/* AV365 single product page: aligned with the homepage and shared product cards. */
body.av365-product-page {
    color: var(--av365-ink, #171a1f);
    background: var(--av365-product-surface, #f3f6f7);
}

body.av365-product-page #main-container {
    background:
        radial-gradient(circle at 8% 4%, rgb(255 255 255 / 92%) 0, transparent 27%),
        linear-gradient(90deg, rgb(21 40 63 / 3%) 1px, transparent 1px),
        var(--av365-product-surface, #f3f6f7);
    background-size: auto, 80px 100%, auto;
}

body.av365-product-page #main > .ct-container-full {
    padding-top: 20px;
}

/* Slim breadcrumb bar: Blocksy's hero adds a 40px gap below it by default. */
body.av365-product-page #main .hero-section {
    margin-bottom: 20px;
}

body.av365-product-page .ct-breadcrumbs,
body.av365-product-page .woocommerce-breadcrumb {
    padding-block: 12px 14px;
    color: #687789;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.6;
    letter-spacing: .055em;
}

body.av365-product-page .ct-breadcrumbs a,
body.av365-product-page .woocommerce-breadcrumb a {
    color: #315d7a;
}

body.av365-product-page .ct-breadcrumbs a:is(:hover, :focus-visible),
body.av365-product-page .woocommerce-breadcrumb a:is(:hover, :focus-visible) {
    color: var(--av365-product-accent, #d90012);
}

body.av365-product-page.av365-product-hide-breadcrumbs :is(.ct-breadcrumbs, .woocommerce-breadcrumb) {
    display: none;
}

body.av365-product-page .product-entry-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 1.04fr) minmax(380px, .96fr);
    gap: clamp(34px, 5vw, 72px);
    align-items: start;
    padding-bottom: clamp(66px, 7vw, 100px);
}

body.av365-product-page .woocommerce-product-gallery {
    position: sticky;
    top: calc(var(--admin-bar, 0px) + var(--av365-header-offset, 0px) + 28px);
    min-width: 0;
    padding: clamp(18px, 2.2vw, 30px);
    border: 1px solid #dfe5e8;
    border-top: 4px solid var(--av365-product-accent, #d90012);
    border-radius: var(--av365-product-radius, 6px);
    background: var(--av365-product-image-bg, #fff);
    box-shadow: 18px 18px 0 rgb(21 40 63 / 4%);
}

body.av365-product-page .woocommerce-product-gallery .woocommerce-product-gallery__wrapper {
    margin: 0;
}

body.av365-product-page .woocommerce-product-gallery .woocommerce-product-gallery__image {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: clamp(330px, 38vw, 520px);
    overflow: hidden;
}

body.av365-product-page .woocommerce-product-gallery .woocommerce-product-gallery__image img:not(.zoomImg, .av365-product-zoom-layer),
body.av365-product-page .woocommerce-product-gallery .flexy-item .ct-media-container > img:not(.zoomImg, .av365-product-zoom-layer) {
    width: 100%;
    height: 100%;
    max-height: 500px;
    object-fit: contain;
    mix-blend-mode: multiply;
}

body.av365-product-page .woocommerce-product-gallery :is(.flex-control-thumbs, .flexy-pills[data-type="thumbs"] ol) {
    gap: 12px;
    margin-top: 18px;
}

body.av365-product-page .woocommerce-product-gallery :is(.flex-control-thumbs, .flexy-pills[data-type="thumbs"] ol) li {
    display: flex;
    align-items: stretch;
    overflow: hidden;
    padding: 0 !important;
    border: 1px solid #dfe5e8;
    border-radius: max(2px, calc(var(--av365-product-radius, 6px) - 2px));
    background: #fff;
}

body.av365-product-page .woocommerce-product-gallery .flexy-pills[data-type="thumbs"] li .ct-media-container,
body.av365-product-page .woocommerce-product-gallery .flexy-pills[data-type="thumbs"] li img {
    width: 100%;
    height: 100%;
}

body.av365-product-page .woocommerce-product-gallery .flexy-pills[data-type="thumbs"] li img {
    object-fit: contain;
}

body.av365-product-page .woocommerce-product-gallery .flexy-pills[data-type="thumbs"] .ct-media-container::after {
    display: none;
}

body.av365-product-page .woocommerce-product-gallery .flex-control-thumbs li:has(img.flex-active),
body.av365-product-page .woocommerce-product-gallery .flexy-pills[data-type="thumbs"] li.active {
    border-color: var(--av365-product-accent, #d90012);
    box-shadow: inset 0 0 0 1px var(--av365-product-accent, #d90012);
}

/* One row of thumbnails; the last one opens the rest (product-page.js). */
body.av365-product-page .woocommerce-product-gallery .flexy-pills[data-type="thumbs"] li.av365-thumb-hidden {
    display: none !important;
}

body.av365-product-page .woocommerce-product-gallery .flexy-pills[data-type="thumbs"] li.av365-thumb-has-more {
    position: relative;
}

body.av365-product-page .woocommerce-product-gallery .av365-thumb-more {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgb(23 26 31 / 58%);
    box-shadow: none;
    color: #fff;
    font-size: 20px;
    font-weight: 750;
    letter-spacing: -.02em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    transition: background-color .2s ease;
}

body.av365-product-page .woocommerce-product-gallery .av365-thumb-more:hover {
    background: rgb(23 26 31 / 72%);
}

body.av365-product-page .woocommerce-product-gallery .av365-thumb-more:focus-visible {
    outline: 2px solid var(--av365-product-accent, #d90012);
    outline-offset: -2px;
}

body.av365-product-page .woocommerce-product-gallery__trigger {
    border-radius: 50%;
    color: var(--av365-ink, #171a1f);
    background: #fff;
    box-shadow: 0 6px 18px rgb(21 40 63 / 10%);
}

@media (hover: hover) and (pointer: fine) {
    body.av365-product-page .woocommerce-product-gallery :is(.flexy-view .ct-media-container, .ct-product-gallery-container > .ct-media-container) {
        --av365-zoom-x: 50%;
        --av365-zoom-y: 50%;
        overflow: hidden;
    }

    /* WooCommerce's own zoom enlarges to the full original size; single images used it before. */
    body.av365-product-page .woocommerce-product-gallery :is(.flexy-view, .ct-product-gallery-container) .zoomImg {
        display: none !important;
    }

    body.av365-product-page .woocommerce-product-gallery .av365-product-zoom-layer {
        position: absolute;
        inset: 0;
        z-index: 2;
        display: block;
        width: 100% !important;
        height: 100% !important;
        max-width: none;
        max-height: none;
        margin: 0;
        object-fit: contain;
        opacity: 0;
        pointer-events: none;
        transform: scale(2.2);
        transform-origin: var(--av365-zoom-x) var(--av365-zoom-y);
        transition: opacity 90ms ease;
        will-change: transform;
    }

    body.av365-product-page .woocommerce-product-gallery .ct-media-container.is-av365-zooming > img:not(.zoomImg, .av365-product-zoom-layer) {
        opacity: 0;
    }

    body.av365-product-page .woocommerce-product-gallery .ct-media-container.is-av365-zooming > .av365-product-zoom-layer {
        opacity: 1;
    }
}

body.av365-product-page .summary.entry-summary {
    min-width: 0;
    margin: 0 !important;
    padding: clamp(28px, 3.2vw, 46px);
    border: 1px solid #dfe5e8;
    border-radius: var(--av365-product-radius, 6px);
    background: #fff;
    box-shadow: 0 16px 42px rgb(21 40 63 / 7%);
}

body.av365-product-page .summary .product_title {
    margin: 0;
    color: var(--av365-ink, #171a1f);
    font-size: clamp(28px, 2.35vw, 36px);
    font-weight: 750;
    line-height: 1.1;
    letter-spacing: -.042em;
    overflow-wrap: anywhere;
}

body.av365-product-page .summary.entry-summary > .price {
    margin: 27px 0 8px;
    color: var(--av365-ink, #171a1f);
    font-size: clamp(24px, 2vw, 30px);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -.025em;
    font-variant-numeric: tabular-nums;
}

/* Outlet products: the partner discount does not apply (Partner_Pricing::render_outlet_price_note). */
body.av365-product-page .summary .av365-outlet-price-note {
    margin: 0 0 14px;
    color: var(--av365-slate, #56616d);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
}

/* Guests get no price at all; the empty slot should not leave a gap. */
body.av365-product-page .summary.entry-summary > .price:empty {
    display: none;
}

/* Without the price row the short description would stick to the title. */
body.av365-product-page .summary.entry-summary > .price:empty + .woocommerce-product-details__short-description {
    margin-top: 22px;
}

body.av365-product-page .summary .price ins {
    color: inherit;
    background: none;
}

body.av365-product-page .summary .price del {
    display: block;
    margin-bottom: 3px;
    color: #7d8994;
    font-size: 14px;
    font-weight: 500;
}

body.av365-product-page .summary .price :is(.woocommerce-price-suffix, .av365-restricted-price) {
    display: block;
    margin-top: 4px;
    color: #687789;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0;
}

body.av365-product-page .product-entry-wrapper .entry-summary-items > .av365-product-stock-slot {
    margin: 20px 0 26px;
}

body.av365-product-page .summary .stock.av365-stock-status {
    padding: 9px 13px;
    border: 1px solid currentColor;
    border-left-width: 3px;
    border-radius: max(2px, calc(var(--av365-product-radius, 6px) - 2px));
    box-shadow: none;
    font-size: 12px;
    letter-spacing: .01em;
}

body.av365-product-page .summary .woocommerce-product-details__short-description {
    margin-top: 0;
    color: var(--av365-slate, #56616d);
    font-size: 15px;
    line-height: 1.75;
}

body.av365-product-page .summary .woocommerce-product-details__short-description > :last-child {
    margin-bottom: 0;
}

body.av365-product-page.av365-product-hide-description .woocommerce-product-details__short-description,
body.av365-product-page.av365-product-hide-stock .av365-product-stock-slot,
body.av365-product-page.av365-product-hide-meta .product_meta {
    display: none;
}

body.av365-product-page .summary .ct-product-divider {
    margin-block: 26px;
    border-color: #e2e7eb;
}

body.av365-product-page .summary .ct-product-add-to-cart {
    padding: 20px;
    border: 1px solid #e0e6ea;
    border-left: 4px solid var(--av365-product-accent, #d90012);
    border-radius: var(--av365-product-radius, 6px);
    background: #f6f8f9;
}

body.av365-product-page .summary .ct-cart-actions {
    display: grid;
    grid-template-columns: auto minmax(170px, 1fr);
    gap: 12px;
    width: 100%;
}

body.av365-product-page .summary .quantity {
    --quantity-height: 50px;
    min-width: 126px;
    height: 50px;
    min-height: 50px;
    border-color: #ccd6dd;
    border-radius: max(2px, calc(var(--av365-product-radius, 6px) - 2px));
    background: #fff;
}

body.av365-product-page .summary .quantity input.qty {
    color: var(--av365-ink, #171a1f);
    font-weight: 700;
}

body.av365-product-page .summary .single_add_to_cart_button {
    min-height: 50px;
    border-radius: max(2px, calc(var(--av365-product-radius, 6px) - 2px));
    background: var(--av365-product-accent, #d90012);
    box-shadow: 0 9px 24px color-mix(in srgb, var(--av365-product-accent, #d90012) 22%, transparent);
    font-size: 14px;
    font-weight: 700;
    transition: transform 180ms ease, filter 180ms ease, box-shadow 180ms ease;
}

body.av365-product-page .summary .single_add_to_cart_button:is(:hover, :focus-visible) {
    filter: brightness(.86);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px color-mix(in srgb, var(--av365-product-accent, #d90012) 28%, transparent);
}

/* After adding to the cart: the button confirms briefly, the cart link becomes a line below the row (product-page.js). */
body.av365-product-page .summary .single_add_to_cart_button.is-av365-added {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

body.av365-product-page .summary .ct-cart-actions .added_to_cart {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 4px 8px;
    min-height: 0;
    margin: 2px 0 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    color: var(--av365-slate, #56616d);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
    text-decoration: none;
}

/* Cart quantity line of simple products (product-page.js, setupCartSync). */
body.av365-product-page .summary .ct-cart-actions .av365-cart-status {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    margin: 2px 0 0;
    color: var(--av365-slate, #56616d);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
}

body.av365-product-page .summary .ct-cart-actions .av365-cart-status[hidden] {
    display: none;
}

body.av365-product-page .summary .av365-cart-status strong {
    color: var(--av365-ink, #171a1f);
}

body.av365-product-page .summary .av365-cart-status.is-error {
    color: var(--av365-product-accent, #d90012);
}

body.av365-product-page .summary form.cart.is-av365-saving .quantity {
    opacity: .6;
    transition: opacity .15s ease;
}

body.av365-product-page .summary .av365-added-to-cart__icon {
    display: inline-flex;
    color: #067647;
}

body.av365-product-page .summary .av365-added-to-cart__go {
    color: var(--av365-product-accent, #d90012);
    text-decoration: underline;
    text-underline-offset: 3px;
}

body.av365-product-page .summary .ct-cart-actions .added_to_cart:is(:hover, :focus-visible) .av365-added-to-cart__go {
    color: var(--av365-accent-hover, #b00012);
}

body.av365-product-page .summary .product_meta {
    display: grid;
    gap: 0;
    margin-top: 2px;
    color: #687789;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.55;
    letter-spacing: .055em;
    text-transform: uppercase;
}

body.av365-product-page .summary .product_meta > span {
    display: block;
    padding-block: 12px;
    border-top: 1px solid #e4e8eb;
}

body.av365-product-page .summary .product_meta > span:first-child {
    border-top: 0;
}

body.av365-product-page .summary .product_meta :is(.sku, a) {
    color: var(--av365-ink, #171a1f);
    font-weight: 650;
    letter-spacing: 0;
    text-transform: none;
}

body.av365-product-page .summary .product_meta a {
    display: inline-flex;
    margin: 2px 3px 2px 0;
    padding: 4px 8px;
    border: 1px solid #dce3e8;
    border-radius: 999px;
    background: #f7f9fa;
}

body.av365-product-page .summary .product_meta a:is(:hover, :focus-visible) {
    border-color: var(--av365-product-accent, #d90012);
    color: var(--av365-accent-hover, #b00012);
    background: var(--av365-accent-soft, #fff1f2);
}

body.av365-product-page .related.products {
    display: block !important;
    margin-top: 0;
    padding-block: clamp(58px, 7vw, 92px);
    border-top: 1px solid #dce3e8;
}

body.av365-product-page.av365-product-hide-related .related.products {
    display: none !important;
}

body.av365-product-page .related.products > .ct-module-title {
    margin: 0 0 30px;
    color: var(--av365-ink, #171a1f);
    font-size: clamp(27px, 3vw, 40px);
    font-weight: 750;
    line-height: 1.15;
    letter-spacing: -.04em;
}

body.av365-product-page .related.products > .ct-module-title::before {
    content: "";
    display: block;
    width: 42px;
    margin-bottom: 15px;
    border-top: 3px solid var(--av365-product-accent, #d90012);
}

body.av365-product-page.av365-product-cards .related.products > ul.products {
    align-items: stretch;
    gap: 20px;
}

body.av365-product-page.av365-product-cards .related.products li.product {
    height: 100%;
}

@media (max-width: 999.98px) {
    body.av365-product-page .product-entry-wrapper {
        grid-template-columns: minmax(0, 1fr) minmax(330px, .9fr);
        gap: 26px;
    }

    body.av365-product-page .woocommerce-product-gallery {
        position: static;
        padding: 18px;
    }

    body.av365-product-page .woocommerce-product-gallery .woocommerce-product-gallery__image {
        min-height: 300px;
    }

    body.av365-product-page .summary.entry-summary {
        padding: 27px;
    }

    body.av365-product-page .summary .product_title {
        font-size: clamp(27px, 3.3vw, 33px);
    }
}

@media (max-width: 689.98px) {
    body.av365-product-page #main > .ct-container-full {
        padding-top: 12px;
    }

    body.av365-product-page #main .hero-section {
        margin-bottom: 0;
    }

    body.av365-product-page #main-container {
        background-size: auto, 56px 100%, auto;
    }

    body.av365-product-page :is(.ct-breadcrumbs, .woocommerce-breadcrumb) {
        display: none !important;
    }

    body.av365-product-page .product-entry-wrapper {
        display: flex;
        flex-direction: column;
        gap: 0;
        padding-bottom: 54px;
    }

    body.av365-product-page .woocommerce-product-gallery,
    body.av365-product-page .summary.entry-summary {
        width: 100%;
        box-shadow: none;
    }

    body.av365-product-page .woocommerce-product-gallery {
        padding: 10px 12px 8px;
        border-bottom: 0;
        border-radius: var(--av365-product-radius, 6px) var(--av365-product-radius, 6px) 0 0;
        margin-bottom: 0;
    }

    body.av365-product-page .woocommerce-product-gallery :is(.ct-product-gallery-container, .flexy-container),
    body.av365-product-page .woocommerce-product-gallery .flexy-view {
        height: min(66vw, 270px);
    }

    body.av365-product-page .woocommerce-product-gallery :is(.flexy-items, .flexy-item, .flexy-item .ct-media-container) {
        height: 100% !important;
        min-height: 0;
    }

    body.av365-product-page .woocommerce-product-gallery .flexy-item .ct-media-container {
        width: 100%;
    }

    body.av365-product-page .woocommerce-product-gallery .flexy-item .ct-media-container img:not(.zoomImg, .av365-product-zoom-layer) {
        width: 100%;
        height: 100% !important;
        max-height: none;
        aspect-ratio: auto !important;
        object-fit: contain;
    }

    body.av365-product-page .woocommerce-product-gallery :is(.flex-control-thumbs, .flexy-pills[data-type="thumbs"]) {
        display: none !important;
    }

    body.av365-product-page .summary.entry-summary {
        padding: 22px 20px 24px;
        border-top: 0;
        border-radius: 0 0 var(--av365-product-radius, 6px) var(--av365-product-radius, 6px);
        box-shadow: 8px 8px 0 rgb(21 40 63 / 4%);
    }

    body.av365-product-page .summary .product_title {
        font-size: clamp(23px, 6.2vw, 27px);
        line-height: 1.12;
    }

    body.av365-product-page .summary.entry-summary > .price {
        margin-top: 20px;
        font-size: 24px;
    }

    body.av365-product-page .summary.entry-summary > .price:empty + .woocommerce-product-details__short-description {
        margin-top: 16px;
    }

    body.av365-product-page .summary .ct-product-add-to-cart {
        padding: 15px;
    }

    body.av365-product-page .summary .ct-cart-actions {
        grid-template-columns: 112px minmax(0, 1fr);
        gap: 9px;
    }

    body.av365-product-page .summary .quantity {
        width: 100%;
        min-width: 112px;
    }

    body.av365-product-page .summary .single_add_to_cart_button {
        padding-inline: 12px;
        font-size: 13px;
    }

    body.av365-product-page .related.products {
        width: 100%;
        padding: 50px 0 58px;
        overflow: hidden;
    }

    body.av365-product-page .related.products > .ct-module-title {
        padding-inline: 15px;
        font-size: 29px;
    }

    body.av365-product-page.av365-product-cards .related.products > ul.products {
        --av365-related-card-width: min(82vw, 310px);
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: var(--av365-related-card-width);
        grid-template-columns: none;
        gap: 14px;
        width: auto;
        margin: 0;
        padding: 0 max(15px, calc((100% - var(--av365-related-card-width)) / 2)) 12px;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scroll-padding-inline: max(15px, calc((100% - var(--av365-related-card-width)) / 2));
        scroll-snap-type: x mandatory;
        scrollbar-width: thin;
    }

    body.av365-product-page.av365-product-cards .related.products li.product {
        scroll-snap-align: center;
    }
}

@media (max-width: 389.98px) {
    body.av365-product-page .summary .ct-cart-actions {
        grid-template-columns: 1fr;
    }

    body.av365-product-page .summary .quantity {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.av365-product-page .summary .single_add_to_cart_button,
    body.av365-product-page .summary .single_add_to_cart_button:is(:hover, :focus-visible) {
        transform: none;
        transition: none;
    }
}
