/* AKB catalog · 2026-09-15. Scoped to catalog templates, after Revolution styles.
   !important neutralizes legacy inline heights and stylesheet_change.css overrides. */
#content [data-akb-card] {
    --akb-blue: #2787f5;
    --akb-red: #ef3124;
    --akb-ink: #142b45;
    --akb-muted: #5f6d7e;
    --akb-line: #e5e9ee;
    font-family: Roboto, Helvetica, sans-serif;
    border-radius: 16px !important;
    background: #fff;
    color: var(--akb-ink);
    min-width: 0;
    padding: 20px !important;
    box-shadow: 0 0 0 1px var(--akb-line) !important;
    height: auto !important;
}
#content [data-akb-card]::before { display: none !important; }
#content .product-grid [data-akb-card],
#content .rev_slider [data-akb-card] { display: flex; flex-direction: column; width: 100%; }
#content [data-akb-card] .caption { border-top: 0; padding: 0 !important; min-width: 0; }
#content .product-grid [data-akb-card] .caption,
#content .rev_slider [data-akb-card] .caption { display: flex; flex-direction: column; flex: 1; margin: 0 !important; }
#content .product-grid [data-akb-card] > .image,
#content .rev_slider [data-akb-card] > .image {
    width: 100% !important;
    padding: 10px 0 0;
    margin: 0 0 18px;
    height: 260px !important;
    min-height: 0;
    flex: 0 0 auto;
    aspect-ratio: 1.25;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}
#content .product-grid [data-akb-card] > .image > a,
#content .rev_slider [data-akb-card] > .image > a { display: block; width: 100%; height: 100%; }
#content .product-grid [data-akb-card] > .image > a > img,
#content .rev_slider [data-akb-card] > .image > a > img {
    width: 100% !important; height: 100% !important; object-fit: contain; margin: 0;
}
#content [data-akb-card] .image .owl-carousel { width: 100%; margin: 0; }
#content [data-akb-card] h4 {
    font: 700 19px/1.35 Roboto, Helvetica, sans-serif;
    height: auto !important; min-height: 2.7em; margin: 0 0 9px; padding: 0;
    overflow: visible; text-align: left;
}
#content [data-akb-card] h4 a { color: var(--akb-ink) !important; text-decoration: none; }
#content [data-akb-card] h4 a:hover { color: #176dcc !important; }
#content [data-akb-card] .rating {
    position: static; margin: 0 0 8px; padding: 0; min-width: 0; text-align: left;
    order: 0; background: transparent;
}
#content [data-akb-card] .akb-card-specs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
#content [data-akb-card] .akb-card-spec {
    display: inline-block; padding: 5px 8px; border-radius: 8px;
    background: #f3f5f7; color: #536478; font-size: 14px; line-height: 1.3;
    overflow-wrap: anywhere; max-width: 100%;
}
#content [data-akb-card] .description_options { height: auto !important; min-height: 0 !important; margin-bottom: 10px; }
#content [data-akb-card] .description { color: var(--akb-muted); font-size: 13px; line-height: 1.5; }
/* Keep options and live quantity/weight hooks intact; avoid duplicate spec prose in grid. */
#content .product-grid [data-akb-card] .akb-card-specs:has(.akb-card-spec) + .description_options > .description,
#content .rev_slider [data-akb-card] .akb-card-specs:has(.akb-card-spec) + .description_options > .description { display: none !important; }
#content [data-akb-card] .product_buttons {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(100px, .9fr) !important;
    grid-template-rows: auto auto auto auto auto auto auto !important;
    align-items: center !important; align-content: start;
    column-gap: 12px !important; row-gap: 6px !important;
    position: static !important; padding: 0 !important;
    height: auto !important; min-height: 0 !important;
    margin-top: auto !important; overflow: visible !important;
}
#content [data-akb-card] .product_buttons > * { min-width: 0; }
#content [data-akb-card] .akb-card-stock {
    grid-column: 1 / -1; grid-row: 1;
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; color: var(--akb-muted); font-size: 14px;
    padding: 10px 0 8px; margin: 0 0 5px; border-bottom: 1px solid #f0f2f5;
}
#content [data-akb-card] .akb-card-stock__mark { color: #259646; }
#content [data-akb-card] .product_buttons > .used-price.price {
    grid-column: 1; grid-row: 2;
    display: flex !important; flex-direction: column !important; align-items: flex-start !important;
    gap: 3px !important; width: auto !important; float: none !important;
    margin: 0 !important; line-height: 1.2 !important;
}
#content [data-akb-card] .used-price::before { content: none !important; }
#content [data-akb-card] .product_buttons > .used-price.price > span {
    display: block !important; order: 2 !important; font: 400 11px/1.3 Roboto, Helvetica, sans-serif !important;
    color: var(--akb-muted) !important;
}
#content [data-akb-card] .product_buttons > .used-price.price > .price-new {
    display: block !important; order: 1 !important; margin: 0 !important;
    font: 700 25px/1.1 Roboto, Helvetica, sans-serif !important;
    color: var(--akb-red) !important; white-space: normal;
}
#content [data-akb-card] .product_buttons > .price:not(.used-price) {
    grid-column: 1; grid-row: 3;
    display: flex !important; flex-direction: column !important; gap: 2px !important;
    align-items: flex-start !important; width: auto !important; float: none !important;
    margin: 0 !important; height: auto !important; min-height: 0 !important;
    font: 500 17px/1.3 Roboto, Helvetica, sans-serif !important;
    color: var(--akb-muted) !important;
}
#content [data-akb-card] .product_buttons > .price:not(.used-price) .price-new,
#content [data-akb-card] .product_buttons > .price:not(.used-price) [class^="price_no_format"] {
    display: inline !important; font: inherit !important; color: inherit !important; margin: 0 !important;
}
#content [data-akb-card] .product_buttons > .price .price-old {
    font-size: 13px !important; color: var(--akb-muted) !important; text-decoration: line-through;
}
#content [data-akb-card] [data-akb-exchange="true"] > .price:not(.used-price)::after {
    content: "без обмена"; display: block; font-size: 11px; line-height: 1.3; order: 9;
}
#content [data-akb-card] [data-akb-exchange="false"] > .price:not(.used-price) {
    grid-row: 2 / 4; color: var(--akb-ink) !important; font-size: 25px !important; font-weight: 700 !important;
}
#content [data-akb-card] .product_buttons > .cart {
    grid-column: 2; grid-row: 2 / 4; justify-self: stretch !important; align-self: center !important;
    float: none !important; position: static !important; transform: none !important;
    width: 100% !important; margin: 0 !important; padding: 0 !important;
}
#content [data-akb-card] .product_buttons > .cart a { display: block !important; width: 100% !important; cursor: pointer; text-align: center !important; border-radius: 12px; }
#content [data-akb-card] .product_buttons > .cart .fa.fa-shopping-basket {
    display: flex !important; align-items: center; justify-content: center;
    width: 100% !important; min-width: 0 !important; height: auto !important; min-height: 48px;
    border: 0 !important; border-radius: 12px !important; padding: 12px 10px !important;
    background: var(--akb-blue); color: white;
    font: 700 17px/1.25 Roboto, Helvetica, sans-serif !important;
}
#content [data-akb-card] .product_buttons > .cart .fa-shopping-basket::before { display: none !important; }
#content [data-akb-card] .product_buttons > .cart .prlistb { display: inline !important; font: inherit !important; padding: 0 !important; white-space: normal; }
#content [data-akb-card] .product_buttons > .cart a:hover .fa-shopping-basket { background: #176dcc; }
#content [data-akb-card] .product_buttons > .yandex-split-badge[data-auto-split-badge="true"] {
    grid-column: 1 / -1; grid-row: 4; margin: 6px 0 !important;
    width: 100% !important; min-height: 28px !important; display: flex !important;
}
#content [data-akb-card] .product_buttons > .quick_btn {
    grid-column: 1 / -1; grid-row: 6; float: none !important;
    display: block !important; width: 100% !important; margin: 5px 0 0 !important;
    border: 1px solid #dce3eb !important; border-radius: 12px !important;
    padding: 11px 12px !important; min-height: 44px;
    background: #f7f9fb !important; color: #314a65 !important;
    font: 500 14px/1.4 Roboto, Helvetica, sans-serif; text-align: center; cursor: pointer;
}
#content [data-akb-card] .product_buttons > .quick_btn:hover { background: #edf3fa !important; }
#content [data-akb-card] .product_buttons > .number { grid-column: 1 / -1; grid-row: 5; position: static !important; }
#content [data-akb-card] .product_buttons > .number.bordnone,
#content [data-akb-card] .product_buttons > .clearfix { display: none !important; }
#content [data-akb-card] .product_buttons > .compare,
#content [data-akb-card] .product_buttons > .wishlist { grid-row: 8; }
#content [data-akb-card] .product_buttons > .product-services {
    grid-column: 1 / -1; grid-row: 7; padding-top: 12px; margin-top: 10px;
    border-top: 1px solid var(--akb-line); width: 100%;
}
#content [data-akb-card] .product-services__item { gap: 8px; padding: 5px 0; align-items: baseline; }
#content [data-akb-card] .product-services__main { gap: 7px; flex: 1; }
#content [data-akb-card] .product-services__title-row { gap: 5px; }
#content [data-akb-card] .product-services__title { color: var(--akb-ink); font-size: 13px; line-height: 1.35; }
#content [data-akb-card] .product-services__icon { width: 17px; height: 17px; flex-basis: 17px; font-size: 10px; background: #2cac4d; }
#content [data-akb-card] .product-services__info { width: 20px; height: 20px; flex-basis: 20px; line-height: 20px; font-size: 12px; color: #536478; background: #edf0f4; }
#content [data-akb-card] .product-services__price { padding: 0; flex-wrap: wrap; justify-content: flex-end; gap: 3px 6px; font-size: 13px; }
#content [data-akb-card] .product-services__price::before { display: none; }
#content [data-akb-card] .product-services__price-old { font-size: 12px; }
#content [data-akb-card] .product-services__price-new { font-size: 15px; color: var(--akb-ink); }
#content [data-akb-card] .attribute-sticker__body { border-radius: 9px; }
#content [data-akb-card] a:focus-visible,
#content [data-akb-card] [tabindex]:focus-visible { outline: 3px solid #176dcc; outline-offset: 3px; }
/* Keep Revolution's list and price modes usable; tile geometry applies only to tiles. */
#content .product-list [data-akb-card], #content .product-price [data-akb-card] { flex-direction: row !important; gap: 20px; }
#content .product-list [data-akb-card] > .image { flex: 0 0 24%; width: 24% !important; margin: 0; }
#content .product-list [data-akb-card] .caption,
#content .product-price [data-akb-card] .caption { flex: 1; margin-left: 0 !important; }
#content .product-price [data-akb-card] .akb-card-specs { display: none; }
@media (max-width: 767px) {
    #content .product-layout:has(> [data-akb-card]) { width: 100% !important; }
    #content [data-akb-card] { padding: 18px !important; }
    #content [data-akb-card] h4 { font-size: 18px; min-height: 0; }
    #content .product-grid [data-akb-card] > .image { max-height: 250px; aspect-ratio: 1.4; }
    #content .product-list [data-akb-card] { flex-direction: column !important; }
    #content .product-list [data-akb-card] > .image { width: 100% !important; flex-basis: auto; }
}
@media (prefers-reduced-motion: reduce) {
    #content [data-akb-card], #content [data-akb-card] * { transition: none !important; animation: none !important; }
}

/* Stable catalog rows without relying on the theme's inline height equalizer. */
#content .row:has(> .product-layout > [data-akb-card]) { display: flex; flex-wrap: wrap; align-items: stretch; }
#content .row:has(> .product-layout > [data-akb-card])::before,
#content .row:has(> .product-layout > [data-akb-card])::after { display: none; }
#content .product-grid:has(> [data-akb-card]) { display: flex; float: none; }
#content [data-akb-card] .description_options:has(.options_buy) { display: block !important; }
#content [data-akb-card] .product_buttons > .price .hidden { display: none !important; }
#content [data-akb-card] .product_buttons > .price .price-new > [class^="price_no_format"] { font: inherit !important; }
@media (max-width: 767px) {
    #content .product-grid [data-akb-card] > .image { height: 220px !important; }
}
#content:has([data-akb-card]) { min-width: 0; max-width: 100%; }
#content .product-layout:has(> [data-akb-card]) { min-width: 0; }
/* Square store thumbnails have white padding; a shallow frame uses their full width. */
#content .product-grid [data-akb-card] > .image,
#content .rev_slider [data-akb-card] > .image { overflow: hidden; }
#content .product-grid [data-akb-card] > .image > a > img,
#content .rev_slider [data-akb-card] > .image > a > img { object-fit: cover; }

/* Compact catalog: verified against the live four-column Revolution layout. */
#content [data-akb-card] {
    padding: 12px !important;
    container: akb-card / inline-size;
}
#content .product-grid [data-akb-card] > .image,
#content .rev_slider [data-akb-card] > .image {
    height: 170px !important;
    max-height: none;
    padding: 0;
    margin-bottom: 10px;
    aspect-ratio: auto;
}
#content [data-akb-card] h4 {
    font-size: 16px;
    line-height: 1.3;
    min-height: 2.6em;
    margin-bottom: 6px;
}
#content [data-akb-card] .rating { margin-bottom: 6px; }
#content [data-akb-card] .akb-card-specs { gap: 4px; margin-bottom: 6px; }
#content [data-akb-card] .akb-card-spec { padding: 4px 6px; font-size: 12px; border-radius: 7px; }
#content [data-akb-card] .description_options { margin-bottom: 0; }
#content [data-akb-card] .product_buttons {
    grid-template-columns: minmax(0, 1fr) minmax(76px, .85fr) !important;
    column-gap: 8px !important;
    row-gap: 3px !important;
    margin-top: 6px !important;
}
#content [data-akb-card] .akb-card-stock {
    padding: 4px 0 6px;
    margin: 0 0 4px;
    font-size: 12px;
}
#content [data-akb-card] .product_buttons > .used-price.price {
    height: auto !important;
    min-height: 0 !important;
    gap: 2px !important;
}
#content [data-akb-card] .product_buttons > .used-price.price > .price-new {
    font-size: clamp(18px, 10cqw, 23px) !important;
    white-space: nowrap !important;
    text-align: left !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
}
#content [data-akb-card] .product_buttons > .used-price.price > span { font-size: 10px !important; }
#content [data-akb-card] .product_buttons > .price:not(.used-price) {
    font-size: 15px !important;
    white-space: nowrap;
    text-align: left !important;
}
#content [data-akb-card] [data-akb-exchange="false"] > .price:not(.used-price) {
    font-size: clamp(18px, 10cqw, 23px) !important;
}
#content [data-akb-card] [data-akb-exchange="true"] > .price:not(.used-price)::after { font-size: 10px; }
#content [data-akb-card] .product_buttons > .cart .fa.fa-shopping-basket {
    min-height: 44px;
    padding: 10px 6px !important;
    font-size: 14px !important;
}
#content [data-akb-card] .product_buttons > .yandex-split-badge[data-auto-split-badge="true"] {
    min-height: 24px !important;
    margin: 2px 0 !important;
}
#content [data-akb-card] .product_buttons > .yandex-split-badge[data-auto-split-badge="true"] yandex-pay-badge {
    min-height: 24px !important;
}
#content [data-akb-card] .product_buttons > .quick_btn {
    margin-top: 2px !important;
    padding: 10px 8px !important;
    font-size: 12px;
    min-height: 40px;
}
#content [data-akb-card] .product_buttons > .product-services { padding-top: 6px; margin-top: 5px; }
#content [data-akb-card] .product-services__item { gap: 5px; padding: 3px 0; }
#content [data-akb-card] .product-services__main { gap: 5px; }
#content [data-akb-card] .product-services__title-row { gap: 3px; }
#content [data-akb-card] .product-services__title { font-size: 11px; line-height: 1.25; }
#content [data-akb-card] .product-services__icon { width: 15px; height: 15px; flex-basis: 15px; font-size: 9px; }
#content [data-akb-card] .product-services__info { width: 16px; height: 16px; flex-basis: 16px; line-height: 16px; font-size: 10px; }
#content [data-akb-card] .product-services__price { gap: 2px 4px; }
#content [data-akb-card] .product-services__price-old { font-size: 10px; }
#content [data-akb-card] .product-services__price-new { font-size: 12px; }
@media (max-width: 767px) {
    #content [data-akb-card] { padding: 14px !important; }
    #content .product-grid [data-akb-card] > .image { height: 180px !important; }
    #content [data-akb-card] h4 { font-size: 17px; min-height: 0; }
    #content [data-akb-card] .akb-card-spec { font-size: 13px; }
    #content [data-akb-card] .product-services__title { font-size: 12px; }
    #content [data-akb-card] .product_buttons > .quick_btn { min-height: 44px; font-size: 13px; }
}
@container akb-card (max-width: 175px) {
    #content [data-akb-card] .product_buttons { grid-template-columns: minmax(0, 1fr) !important; }
    #content [data-akb-card] .product_buttons > .cart { grid-column: 1; grid-row: 4; }
    #content [data-akb-card] .product_buttons > .yandex-split-badge[data-auto-split-badge="true"] { grid-row: 5; }
    #content [data-akb-card] .product_buttons > .number { grid-row: 6; }
    #content [data-akb-card] .product_buttons > .quick_btn { grid-row: 7; }
    #content [data-akb-card] .product_buttons > .product-services { grid-row: 8; }
    #content [data-akb-card] .product_buttons > .compare,
    #content [data-akb-card] .product_buttons > .wishlist { grid-row: 9; }
}

/* Shared rows across catalogue and homepage modules. Empty rating reserves space,
   never displays invented stars. JS measures natural heights within each row. */
#content [data-akb-card] h4 { min-height: var(--akb-title-h, 2.6em) !important; }
#content [data-akb-card] .rating { min-height: var(--akb-rating-h, 0px) !important; }
#content [data-akb-card] .akb-card-specs { min-height: var(--akb-specs-h, 0px) !important; align-content: flex-start; }
#content [data-akb-card] .product_buttons {
    grid-template-rows: auto minmax(var(--akb-main-h, 0px), auto) minmax(var(--akb-base-h, 0px), auto) minmax(var(--akb-split-h, 0px), auto) auto minmax(var(--akb-quick-h, 0px), auto) auto !important;
}
#content [data-akb-card] .product-services__item {
    display: grid;
    grid-template-columns: 15px minmax(0, 1fr) 16px 68px;
    align-items: center;
    min-height: var(--akb-service-h, 0px);
    column-gap: 5px;
}
#content [data-akb-card] .product-services__main,
#content [data-akb-card] .product-services__title-row { display: contents; }
#content [data-akb-card] .product-services__icon { grid-column: 1; grid-row: 1; }
#content [data-akb-card] .product-services__title { grid-column: 2; grid-row: 1; }
#content [data-akb-card] .product-services__info { grid-column: 3; grid-row: 1; }
#content [data-akb-card] .product-services__price { grid-column: 4; grid-row: 1; width: 68px; }
#content .rev_slider [data-akb-card] { margin: 0 !important; }
#content .rev_slider .owl-wrapper:has([data-akb-card]) { display: flex !important; align-items: stretch; }
#content .rev_slider .owl-item:has([data-akb-card]) { display: flex; float: none; flex-shrink: 0; }
#content .rev_slider .owl-item:has([data-akb-card]) > .product-layout { display: flex; width: 100%; }
/* Keep carousel navigation and image galleries controlled by Owl. */
#content [data-akb-card] .owlproduct .owl-wrapper { display: block !important; }
#content [data-akb-card] .owlproduct .owl-item { display: block; float: left; }

#content [data-akb-card] .description_options { min-height: var(--akb-desc-h, 0px) !important; }

#content .rev_slider .owl-carousel:has([data-akb-card]) > .owl-wrapper-outer { overflow: hidden !important; }

/* One photograph per listing card; product detail galleries are unaffected. */
#content [data-akb-card] .image:has(> .akb-card-photo) > .owlproduct,
#content [data-akb-card] .akb-card-mobile-photo { display: none !important; }
#content [data-akb-card] .image > .akb-card-photo { display: block; width: 100%; height: 100%; }
#content [data-akb-card] .image > .akb-card-photo img { display: block; width: 100%; height: 100%; max-width: 100%; object-fit: contain !important; }
