/*******************************************************

    polo.gr single product page (inc/functions/polo-product.php): photo
    stack + sticky info column, swatches, features, accordions, "See also".
    Loaded after the legacy CSS and polo.category.css (whose cards "See
    also" uses), scoped to .polo-pp-page.

 *******************************************************/



    /* Layout: photos | info */

    .polo-pp {
        display: grid;
        grid-template-columns: minmax( 0, 1.35fr ) minmax( 0, 1fr );
        gap: 0 56px;
        align-items: start;
        max-width: 1360px;
        margin: 16px auto 0;
        font-family: var( --polo-font-roboto );
    }

    /* The legacy overflow:hidden (float clearing) made div.product the scroll container of the
       sticky column: it was pushed down and never stuck. The layout is a grid now. */
    .polo-pp-page div.product {
        overflow: visible;
    }

    .polo-pp-page div.product .summary,
    .polo-pp-page div.product .polo-pp__gallery {
        align-self: start;
        float: none;
        width: auto;
        margin: 0;
    }

    .polo-pp-page div.product .summary {
        position: sticky;
        top: 110px;
        min-width: 0;
        padding-top: 0;
    }

    .polo-pp-page div.product .summary > :first-child {
        margin-top: 0;
    }



    /* Photos: first one large, the rest two per row */

    .polo-pp__track {
        display: grid;
        grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
        gap: 12px;
    }

    .polo-pp__shot {
        margin: 0;
    }

    .polo-pp__shot:first-child,
    .polo-pp__gallery[data-count="2"] .polo-pp__shot,
    .polo-pp__shot:last-child:nth-child( even ) {
        grid-column: 1 / -1;
    }

    .polo-pp__zoom {
        position: relative;
        display: block;
        width: 100%;
        margin: 0;
        padding: 0;
        overflow: hidden;
        aspect-ratio: 1 / 1;
        border: 0;
        border-radius: 6px;
        background-color: var( --polo-cat-soft, #f5f5f4 );
        cursor: zoom-in;
    }

    .polo-pp-page .polo-pp__zoom img {
        position: absolute;
        inset: 0;
        width: 100%;
        max-width: none;
        height: 100%;
        max-height: none;
        margin: 0;
        padding: 6%;
        object-fit: contain;
        mix-blend-mode: multiply;
        border-radius: 0;
        box-shadow: none;
        transition: transform 0.5s var( --polo-ease );
    }

    @media ( hover: hover ) {

        .polo-pp__zoom:hover img {
            transform: scale( 1.03 );
        }

    }

    .polo-pp__zoom:focus-visible {
        outline: 2px solid var( --polo-black );
        outline-offset: 3px;
    }

    .polo-pp__dots {
        display: none;
    }



    /* Info column */

    .polo-pp__crumbs {
        margin-bottom: 14px;
    }

    .polo-pp-page div.product .product_title {
        margin: 0 0 6px;
        color: var( --polo-black );
        font-family: var( --polo-font-zona );
        font-size: clamp( 26px, 2.4vw, 36px );
        font-weight: 800;
        letter-spacing: 0;
        line-height: 1.1;
    }

    .polo-pp__colours {
        margin: 14px 0 16px;
    }

    .polo-pp-page .polo-pp__colour {
        margin: 0 0 10px;
        color: var( --polo-black );
        font-size: 15px;
    }

    .polo-pp__colour span {
        color: var( --polo-grey );
    }

    .polo-pp__swatches {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .polo-pp__swatches li {
        margin: 0;
    }

    .polo-pp__swatch {
        display: block;
        width: 46px;
        height: 46px;
        overflow: hidden;
        padding: 2px;
        border: 1px solid #dcdee0;
        border-radius: 50%;
        background-color: var( --polo-white );
        transition: border-color 0.15s, box-shadow 0.15s;
    }

    .polo-pp__swatch:hover,
    .polo-pp__swatch:focus-visible {
        border-color: var( --polo-black );
    }

    .polo-pp__swatch.is-current {
        border-color: var( --polo-black );
        box-shadow: 0 0 0 1px var( --polo-black );
    }

    .polo-pp-page .polo-pp__swatch img {
        display: block;
        width: 100%;
        max-width: none;
        height: 100%;
        margin: 0;
        border-radius: 50%;
        object-fit: cover;
        transform: scale( 1.55 );
    }

    /* Recommended price, then the product code. */
    .polo-pp-page div.product .summary .polo-pp__price {
        margin: 0 0 6px;
        color: var( --polo-black );
        font-size: 20px;
        font-weight: 400;
        line-height: 1.3;
    }

    .polo-pp-page div.product .summary .polo-pp__price-label {
        margin-left: 4px;
        color: var( --polo-grey );
        font-size: 13px;
        font-weight: 400;
    }

    .polo-pp-page div.product .summary .polo-pp__code {
        display: flex;
        align-items: center;
        gap: 6px;
        margin: 0 0 18px;
        color: var( --polo-grey );
        font-size: 14px;
    }

    .polo-pp-page div.product .summary .polo-pp__code .sku {
        color: #33373d;
        font-variant-numeric: tabular-nums;
    }

    .polo-pp__copy {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 30px;
        height: 30px;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 4px;
        background: none;
        color: var( --polo-grey );
        cursor: pointer;
    }

    .polo-pp__copy:hover,
    .polo-pp__copy:focus-visible {
        background: #f1f2f4;
        color: var( --polo-black );
    }

    .polo-pp__copy.is-done {
        color: #1e7e34;
    }

    .polo-pp-page div.product .woocommerce-product-details__short-description {
        margin: 0 0 20px;
        color: #33373d;
        font-size: 16px;
        line-height: 1.6;
    }

    .polo-pp__badges {
        margin: 0 0 22px;
    }

    .polo-pp-page .polo-pp__badges img {
        width: auto;
        max-width: 220px;
        max-height: 90px;
        margin: 0;
    }

    .polo-pp-page .polo-pp__label {
        margin: 0 0 12px;
        color: var( --polo-black );
        font-family: var( --polo-font-roboto );
        font-size: 13px;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }



    /* Features: icon + its explanation (the old hover tooltip, written out) */

    .polo-pp__features {
        margin: 0 0 24px;
        padding: 20px 0 6px;
        border-top: 1px solid var( --polo-line );
    }

    .polo-pp-page .polo-pp__features .characteristics.tooltip {
        position: static;
        display: flex;
        width: auto; /* the legacy .tooltip is 25% wide */
        align-items: center;
        gap: 14px;
        margin: 0 0 12px;
        padding: 0;
        border: 0;
    }

    .polo-pp-page .polo-pp__features .characteristics img {
        flex: 0 0 auto;
        float: none;
        width: 56px;
        height: auto;
        margin: 0;
        border-radius: 6px;
    }

    .polo-pp-page .polo-pp__features .tooltiptext {
        position: static;
        display: block;
        width: auto;
        margin: 0;
        padding: 0;
        visibility: visible;
        opacity: 1;
        transform: none;
        background: none;
        color: #33373d;
        font-size: 14px;
        line-height: 1.45;
        text-align: left;
    }

    .polo-pp-page .polo-pp__features .tooltiptext::after,
    .polo-pp-page .polo-pp__features .tooltiptext::before {
        display: none;
    }

    .polo-pp__features br {
        display: none;
    }



    /* Dimensions / technical details */

    .polo-pp__spec {
        border-top: 1px solid var( --polo-line );
    }

    .polo-pp__spec:last-of-type {
        border-bottom: 1px solid var( --polo-line );
    }

    .polo-pp__spec summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 0;
        color: var( --polo-black );
        font-size: 13px;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        cursor: pointer;
        list-style: none;
    }

    .polo-pp__spec summary::-webkit-details-marker {
        display: none;
    }

    .polo-pp__spec summary::after {
        content: "+";
        font-size: 20px;
        font-weight: 400;
    }

    .polo-pp__spec[open] summary::after {
        content: "\2212";
    }

    .polo-pp__spec summary:focus-visible {
        outline: 2px solid var( --polo-black );
        outline-offset: 2px;
    }

    .polo-pp__spec-body {
        padding: 0 0 18px;
        color: #33373d;
        font-size: 14px;
        line-height: 1.7;
    }

    .polo-pp__video {
        margin: 24px 0 0;
    }

    .polo-pp__video iframe {
        display: block;
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
        border: 0;
        border-radius: 6px;
    }



    /* See also: the legacy CSS hides card titles on product pages (they were colour swatches). */
    .polo-pp-page .polo-pp__more ul.products li.product .woocommerce-loop-product__title {
        display: block;
    }

    /* See also */

    .polo-pp__more {
        max-width: 1360px;
        margin: 72px auto 40px;
        padding-top: 32px;
        border-top: 1px solid var( --polo-line );
    }

    .polo-pp-page .polo-pp__more-title {
        margin: 0 0 22px;
        color: var( --polo-black );
        font-family: var( --polo-font-zona );
        font-size: clamp( 22px, 2vw, 30px );
        font-weight: 800;
        text-transform: uppercase;
    }



    /* Lightbox */

    .polo-pp__lightbox {
        width: 100vw;
        max-width: none;
        height: 100vh;
        max-height: none;
        margin: 0;
        padding: 0;
        border: 0;
        background: #ffffff;
        opacity: 1;
    }

    .polo-pp__lightbox::backdrop {
        background-color: rgba( 16, 18, 18, 0.4 );
    }

    .polo-pp__lightbox img {
        position: absolute;
        inset: 56px 64px;
        width: calc( 100% - 128px );
        max-width: none;
        height: calc( 100% - 112px );
        margin: 0;
        object-fit: contain;
    }

    .polo-pp__lb-btn {
        position: absolute;
        z-index: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 48px;
        height: 48px;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background-color: var( --polo-white );
        box-shadow: 0 1px 6px rgba( 0, 0, 0, 0.15 );
        color: var( --polo-black );
        font-size: 30px;
        line-height: 1;
        cursor: pointer;
    }

    .polo-pp__lb-close { top: 16px; right: 16px; }
    .polo-pp__lb-prev  { top: 50%; left: 12px; transform: translateY( -50% ); }
    .polo-pp__lb-next  { top: 50%; right: 12px; transform: translateY( -50% ); }

    .polo-pp__lb-count {
        position: absolute;
        bottom: 18px;
        left: 50%;
        margin: 0;
        color: var( --polo-grey );
        font-size: 14px;
        transform: translateX( -50% );
    }



    /* Tablet */

    @media ( max-width: 1199px ) {

        .polo-pp {
            gap: 0 32px;
        }

    }



    /* Phones: swipe gallery with dots, info below */

    @media ( max-width: 900px ) {

        .polo-pp {
            display: block;
            margin-top: 0;
        }

        .polo-pp-page div.product .summary {
            position: static;
            margin-top: 20px;
        }

        .polo-pp__gallery {
            margin: 0 -1em;
        }

        .polo-pp__track {
            display: flex;
            gap: 0;
            overflow-x: auto;
            scroll-snap-type: x mandatory;
            scrollbar-width: none;
            overscroll-behavior-x: contain;
        }

        .polo-pp__track::-webkit-scrollbar {
            display: none;
        }

        .polo-pp__shot {
            flex: 0 0 100%;
            scroll-snap-align: center;
        }

        .polo-pp__zoom {
            border-radius: 0;
        }

        .polo-pp__dots {
            display: flex;
            justify-content: center;
            gap: 6px;
            margin: 12px 0 0;
        }

        .polo-pp__dot {
            width: 7px;
            height: 7px;
            border-radius: 50%;
            background-color: #cfd2d5;
            transition: background-color 0.2s, transform 0.2s;
        }

        .polo-pp__dot.is-on {
            background-color: var( --polo-black );
            transform: scale( 1.15 );
        }

        .polo-pp__more {
            margin-top: 48px;
        }

        .polo-pp__lightbox img {
            inset: 64px 8px;
            width: calc( 100% - 16px );
            height: calc( 100% - 128px );
        }

        .polo-pp__lb-prev,
        .polo-pp__lb-next {
            top: auto;
            bottom: 8px;
            transform: none;
        }

    }

    @media ( prefers-reduced-motion: reduce ) {

        .polo-pp-page .polo-pp__zoom img {
            transition: none;
        }

    }
