/* ==========================================================================
   Product Single — gallery, info, description, related
   ========================================================================== */

/* ==========================================================================
   27. Product Single — modular sections (spare parts / consumables)
   ========================================================================== */

/* --------------------------------------------------------------------------
   27.1 Hero — gallery + info
   -------------------------------------------------------------------------- */

.product-hero {
    padding: var(--space-xl) 0 var(--space-2xl);
}

.product-hero__layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-l);
    align-items: start;
}

@media (max-width: 960px) {
    .product-hero__layout {
        grid-template-columns: 1fr;
    }
}

/* -- Gallery ------------------------------------------------------------- */

.product-hero__gallery-main {
    position: relative;
    background: #D4E3FF;
    background: linear-gradient(45deg, rgba(212, 227, 255, 1) 0%, rgba(255, 255, 255, 1) 100%);
    border-radius: 20px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    margin-bottom: var(--space-m);
    max-height: 500px;
    width: 100%;
}

/* Single image: no thumbnails below, so drop the reserved gap. */
.product-hero__gallery--single .product-hero__gallery-main {
    margin-bottom: 0;
}

/* Sticky only in the desktop two-column layout; static once the columns
   stack on mobile/tablet. */
@media (min-width: 961px) {
    .product-hero__gallery {
        position: sticky;
        top: 75px;
    }
}

.product-hero__gallery-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    padding: var(--space-xl);
}

.product-hero__gallery-arrows {
    position: absolute;
    bottom: var(--space-m);
    right: var(--space-m);
    display: flex;
    gap: var(--space-xs);
    z-index: 2;
}

.product-hero__gallery-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid transparent;
    background-color: var(--color-white);
    color: var(--color-black);
    cursor: pointer;
    transition: background-color var(--transition), color var(--transition), border-color var(--transition);
}

.product-hero__gallery-arrow--prev {
    background-color: var(--color-white);
    color: var(--color-dark-blue);
    border-color: var(--color-light-grey);
}

.product-hero__gallery-arrow--prev:hover {
    border-color: var(--color-dark-blue);
}

.product-hero__gallery-arrow--next {
    background-color: var(--color-dark-blue);
    color: var(--color-white);
    border-color: var(--color-dark-blue);
}

.product-hero__gallery-arrow--next:hover {
    background-color: var(--color-electric-blue);
    border-color: var(--color-electric-blue);
}

.product-hero__gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-s);
}

.product-hero__gallery-thumb {
    padding: 0;
    background: var(--color-light-blue);
    border: 2px solid transparent;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 1 / 1;
    transition: border-color var(--transition);
}

.product-hero__gallery-thumb.is-active,
.product-hero__gallery-thumb:hover {
    border-color: var(--color-electric-blue);
}

.product-hero__gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Gallery position indicator — desktop uses the thumbnails, so it's hidden
   there and only shown on mobile (see the mobile block). */
.product-hero__gallery-progress {
    display: none;
}

/* -- Info ---------------------------------------------------------------- */

.product-hero__info {
    position: relative;
    /* room for favorite button at top-right */
}

/* Favorite button unified in main.css (.fav-btn / .fav-btn--hero). */

.product-hero__title {
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--color-dark-blue);
    line-height: 1.1;
    margin: 0 0 var(--space-m);
    font-weight: 400;
    width: 90%;
}

.product-hero__title-main,
.product-hero__title-sub {
    display: block;
}

.product-hero__price {
    font-size: var(--text-lg);
    color: var(--color-black);
    margin-bottom: var(--space-l);
}

.product-hero__price .amount,
.product-hero__price ins {
    color: var(--color-black);
    text-decoration: none;
}

.product-hero__price del {
    opacity: 0.4;
    margin-right: var(--space-s);
}

.product-hero__benefits {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-s);
}

.product-hero__benefits li {
    display: flex;
    align-items: center;
    gap: var(--space-s);
    font-size: var(--text-sm);
    color: var(--color-black);
}

.product-hero__benefit-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background-color: var(--color-light-blue);
    border-radius: 50%;
    color: var(--color-dark-blue);
    flex-shrink: 0;
}

.product-hero__divider {
    border-top: 1px solid var(--color-light-grey);
    margin: var(--space-m) 0;
}

.product-hero__shipping {
    font-size: var(--text-sm);
    color: var(--color-black);
    opacity: 0.8;
    margin: 0 0 var(--space-l);
}

/* Stock status — shown under the free-shipping line for out-of-stock,
   backorder or low-stock products. */
.product-hero__stock {
    display: inline-flex;
    align-items: center;
    gap: var(--space-s);
    margin: calc(-1 * var(--space-s)) 0 var(--space-l);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: var(--text-sm);
    font-weight: 600;
    background: var(--color-light-blue);
    color: var(--color-dark-blue);
}

.product-hero__stock-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    flex: 0 0 auto;
}

.product-hero__stock--out-of-stock {
    background: #fdecee;
    color: #c0293b;
}

.product-hero__stock--available-on-backorder {
    background: #fff6e6;
    color: #a5680a;
}

.product-hero__stock--in-stock {
    background: #eafbf1;
    color: #1f8a4c;
}

/* SKU sits just under the shipping line — pulled up to read as a pair. */
.product-hero__sku {
    font-size: var(--text-sm);
    color: var(--color-black);
    opacity: 0.8;
    margin: calc(-1 * var(--space-m)) 0 var(--space-l);
}

.product-hero__sku-value {
    font-weight: 600;
}

/* Actions: quantity + add to cart */
.product-hero__actions {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    align-items: center;
    column-gap: clamp(1rem, 2vw, 1.75rem);
    row-gap: var(--space-m);
    margin-bottom: var(--space-l);
}

.product-hero__qty {
    display: inline-flex;
    align-items: center;
    gap: clamp(0.75rem, 1.6vw, 1.25rem);
    flex-shrink: 0;
    min-width: 0;
}

.product-hero__qty-label {
    font-size: 1rem;
    opacity: 1;
    white-space: nowrap;
}

/* Ghost variant of qty-pill (outline, no grey fill) */
.qty-pill--ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.125rem;
    background-color: var(--color-white);
    border: 1px solid rgba(18, 19, 20, 0.28);
    border-radius: 50px;
    padding: 0.875rem 1.2rem;
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
}

.qty-pill--ghost .qty-pill__btn:hover {
    opacity: 0.7;
}

.qty-pill--ghost .qty-pill__btn {
    background: transparent;
    border: 0;
}

.product-hero__qty-symbol {
    font-size: 22px;
    font-weight: 100;
}

.qty-pill--ghost .qty-pill__input,
.qty-pill--ghost.quantity .qty.qty-pill__input {
    font-family: 'Urbanist';
    width: 1.75rem;
    min-width: 1.75rem;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: center;
    font-size: 1.3rem;
    appearance: textfield;
}

.qty-pill--ghost .qty-pill__input::-webkit-outer-spin-button,
.qty-pill--ghost .qty-pill__input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.product-hero__add-to-cart {
    flex: 1;
    min-width: 0;
    width: 100%;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 1.75rem;
    font-size: clamp(1.125rem, 2vw, 1.25rem);
    font-weight: 500;
    background-color: #2970FF;
}

@media (max-width: 760px) {

    /* minmax(0, 1fr) so the column can shrink below its content's min-width
       (plain 1fr = minmax(auto,1fr) would let the wide qty pill push the row
       off-screen). */
    .product-hero__actions {
        grid-template-columns: minmax(0, 1fr);
    }

    .product-hero__qty {
        justify-content: space-between;
        width: 100%;
        min-width: 0;
        flex-wrap: nowrap;
        gap: var(--space-m);
    }

    /* Bigger quantity control — the pill grows to fill the row, with the
       count centred between the − / + buttons. */
    .product-hero__qty .qty-pill--ghost {
        flex: 1 1 0;
        min-width: 0;
        justify-content: space-between;
        padding: 1rem 1.5rem;
    }

    .qty-pill--ghost .qty-pill__input,
    .qty-pill--ghost.quantity .qty.qty-pill__input {
        flex: 1;
        width: auto;
        min-width: 0;
        font-size: 1.6rem;
    }
}

/* Slider progress bar — hidden by default; shown + driven by JS only when the
   related grid becomes a horizontal slider (mobile). */
.product-related__progress {
    display: none;
}


.product-hero__trust-card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 44px;
    padding: 6px;
    background-color: #F3F6FC;
    border-radius: 8px;

    &.blue {
        background-color: #016FD0;
    }
}

.product-hero__trust-card img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* -- Mobile phone tweaks ------------------------------------------------- */
@media (max-width: 600px) {

    .product-hero__trust-card {
        width: 65px;
    }

    .m-accessories__intro {
        min-height: 250px;
    }

    .m-accessory-card__image {
        padding: .5rem;
        border-radius: 45px;
    }

    .m-accessory-card__footer {
        padding: .5rem;
        padding-top: 0;
    }

    .m-accessory-card__arrow {
        width: 25px;
        position: absolute;
        right: 10px;
        bottom: 0;
    }

    .m-accessory-card__name {
        font-size: .9rem;
    }

    .m-accessory-card__price {
        font-size: .8rem;
        max-width: 80%;
    }

    /* Tighter side padding across the whole product page (content only —
       header/footer keep their own). */
    .product-single .container {
        padding-left: 0;
        padding-right: 0;
    }

    /* Smaller product title. */
    .product-hero__title {
        font-size: 1.5rem;
        width: 100%;
    }

    /* Gallery: drop the thumbnails and show the blue position bar instead
       (navigation stays on the arrows). */
    .product-hero__gallery-thumbs {
        display: none;
    }

    .product-hero__gallery-progress {
        display: block;
        position: relative;
        height: 4px;
        border-radius: 999px;
        background: var(--color-light-blue-dark);
        overflow: hidden;
    }

    .product-hero__gallery-progress-bar {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        width: 33%;
        border-radius: 999px;
        background: var(--color-electric-blue);
        transition: left 0.2s ease;
    }

    /* "Spare parts you may like" → swipeable horizontal slider (cards peek to
       the screen edge). Only on the product page (.product-related). */
    .product-related .m-accessories__grid {
        display: flex;
        grid-template-columns: none;
        gap: var(--space-m);
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        margin: 0 calc(-1 * var(--space-m));
        padding: 0 var(--space-m) var(--space-s);
    }

    .product-related .m-accessories__grid::-webkit-scrollbar {
        display: none;
    }

    .product-related .m-accessory-card {
        flex: 0 0 46%;
        scroll-snap-align: start;
    }

    /* Scroll progress track + thumb under the slider. */
    .product-related__progress {
        display: block;
        position: relative;
        height: 4px;
        margin-top: var(--space-m);
        border-radius: 999px;
        background: var(--color-light-blue-dark);
        overflow: hidden;
    }

    .product-related__progress-bar {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        width: 30%;
        border-radius: 999px;
        background: var(--color-electric-blue);
        transition: left 0.05s linear;
    }
}

/* Trust / Safe checkout box */
.product-hero__trust {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-m);
    padding: var(--space-m);
    background-color: var(--color-white);
    border: 1px solid #E6ECF5;
    border-radius: 16px;
    flex-wrap: wrap;
}

.product-hero__trust-label {
    font-size: 1.1rem;
    color: var(--color-dark-grey);
}

.product-hero__trust-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.product-desc--inline {
    padding-top: var(--space-l);
}

.product-desc--inline .product-desc__inner {
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
}

.product-desc--inline .product-desc__tab {
    margin-bottom: var(--space-m);
}

.product-desc--inline .product-desc__text {
    margin-bottom: var(--space-l);
}

/* --------------------------------------------------------------------------
   27.2 Description + Specs Table
   -------------------------------------------------------------------------- */

.product-desc {
    padding: var(--space-xl) 0 var(--space-2xl);
}

.product-desc__inner {
    max-width: 760px;
    margin-left: auto;
    margin-right: 0;
    padding-right: var(--container-padding);
}

/* Account for outer container + push content to right column */
@media (min-width: 961px) {
    .product-desc__inner {
        width: calc(50% - var(--space-m));
        max-width: none;
        margin-left: auto;
        margin-right: calc((100vw - var(--container-width)) / 2 + var(--container-padding));
    }
}

@media (max-width: 1260px) and (min-width: 961px) {
    .product-desc__inner {
        margin-right: var(--container-padding);
    }
}

.product-desc__tab {
    display: block;
    padding: 16px 32px;
    border-radius: 999px;
    /* Pill that fades out to the (white) page on the right. */
    background: linear-gradient(90deg, var(--color-light-blue) 0%, #ffffff 65%);
    margin-bottom: var(--space-l);
}

.product-desc__tab-label {
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--color-dark-blue);
    font-family: var(--font-heading);
}

.product-desc__text {
    font-size: var(--text-sm);
    line-height: 1.7;
    color: var(--color-black);
    opacity: 0.85;
    margin-bottom: var(--space-xl);
}

.product-desc__text p {
    margin-bottom: var(--space-s);
}

.product-desc__specs {
    display: flex;
    flex-direction: column;
    gap: var(--space-m);
}

.product-desc__spec-row {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: var(--space-m);
    align-items: center;
}

@media (max-width: 500px) {
    .product-desc__spec-row {
        grid-template-columns: 120px 1fr;
    }
}

.product-desc__spec-label {
    display: inline-block;
    padding: 8px 16px;
    background-color: var(--color-light-blue);
    border-radius: 50px;
    font-size: var(--text-sm);
    color: var(--color-dark-blue);
    width: fit-content;
}

.product-desc__spec-value {
    font-size: var(--text-sm);
    color: var(--color-black);
    border-bottom: 1px solid #a3b3bd55;
    padding: 10px 0 10px 10px;
}

/* --------------------------------------------------------------------------
   27.3 Related products ("Spare parts you may like")
   Reuses the single-machine accessories section markup + classes
   (.m-accessories / .m-accessory-card in machine-single.css), so there are no
   product-specific styles here — see template-parts/product/related.php.
   -------------------------------------------------------------------------- */