/*
 * Galera — single product
 */

.product-page { padding-top: 28px; padding-bottom: 8px; }

.product-main__inner {
    display: flex;
    align-items: flex-start;
    gap: 48px;
    /* The element is also .container — a shorthand padding would wipe its
       horizontal gutter. */
    padding-top: 8px;
    padding-bottom: 56px;
}

/* Positioned: the sale badge inside is absolute and would otherwise anchor
   to the viewport and land in the page corner.
   Sticky while there are two columns: the summary is much taller than the
   gallery (on a tablet by ~900px), so the left side used to end early and
   leave a hole. Now the photo travels with the scroll instead. */
.product-main__media {
    position: sticky;
    top: calc(var(--header-height) + 20px);
    align-self: flex-start;
    flex: 1 1 560px;
    min-width: 0;
}
.product-main__summary { flex: 1 1 480px; min-width: 0; }

/* ── Gallery ────────────────────────────────────────────────────────────── */
/* FlexSlider writes a pixel width inline; cap it so the gallery cannot grow
   past its column. */
.woocommerce-product-gallery {
    position: relative;
    max-width: 100%;
    margin: 0;
}

.woocommerce-product-gallery .flex-viewport { max-width: 100%; }

.woocommerce-product-gallery__wrapper { margin: 0; }

.woocommerce-product-gallery__image,
.woocommerce-product-gallery__image a {
    /* Positioned so overflow actually clips the zoom layer WooCommerce
       injects on hover. */
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--color-bg-alt);
}

.woocommerce-product-gallery__image img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.woocommerce-product-gallery .flex-control-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}

.woocommerce-product-gallery .flex-control-thumbs li {
    flex: 0 0 auto;
    width: calc(20% - 8px);
}

.woocommerce-product-gallery .flex-control-thumbs img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg-alt);
    cursor: pointer;
    opacity: .75;
    mix-blend-mode: multiply;
    transition: border-color var(--transition), opacity var(--transition);
}

.woocommerce-product-gallery .flex-control-thumbs img:hover,
.woocommerce-product-gallery .flex-control-thumbs img.flex-active {
    border-color: var(--color-primary);
    opacity: 1;
}

/* WooCommerce prints a bare 🔍 emoji here — hide it and draw a proper button. */
.woocommerce-product-gallery__trigger {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    background: #FFF no-repeat center;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23662C8D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3Cpath d='M11 8v6M8 11h6'/%3E%3C/svg%3E");
    background-size: 20px 20px;
    box-shadow: var(--shadow-soft);
    font-size: 0;
    text-indent: -9999px;
    transition: border-color var(--transition), transform var(--transition);
}

.woocommerce-product-gallery__trigger:hover {
    border-color: var(--color-primary);
    transform: scale(1.06);
}

.woocommerce-product-gallery__trigger span { display: none; }

.woocommerce-product-gallery__image a { cursor: zoom-in; }

/* Same badge as on the cards, one size up for the product page. */
.product-main__media .onsale {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 2;
    padding: 7px 15px;
    border-radius: var(--radius-pill);
    background: var(--color-sale);
    color: #FFF;
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

/* ── Summary ────────────────────────────────────────────────────────────── */
.product_title {
    margin: 0 0 12px;
    font-size: 30px;
}

.product-main__summary .price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 18px;
    font-family: var(--font-heading);
    font-size: 30px;
    font-weight: 700;
    color: var(--color-navy);
}

.product-main__summary .price del {
    color: var(--color-muted);
    font-size: 20px;
    font-weight: 500;
    text-decoration: line-through;
}

.product-main__summary .price ins {
    color: var(--color-sale);
    text-decoration: none;
}

.woocommerce-product-details__short-description {
    margin-bottom: 20px;
    color: var(--color-muted);
}

.woocommerce-product-details__short-description p:last-child { margin-bottom: 0; }

/* ── Size swatches ──────────────────────────────────────────────────────── */
.variations_form .variations {
    width: 100%;
    margin-bottom: 18px;
    border: 0;
}

.variations_form .variations th,
.variations_form .variations td {
    display: block;
    padding: 0;
    text-align: left;
}

.variations_form .variations .label {
    margin-bottom: 10px;
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    color: var(--color-navy);
}

.swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.swatch {
    min-width: 56px;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: #FFF;
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    transition: border-color var(--transition), background-color var(--transition), color var(--transition);
}

.swatch:hover { border-color: var(--color-primary); color: var(--color-primary); }

.swatch.is-selected {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: #FFF;
    font-weight: 600;
}

.swatch.is-unavailable {
    opacity: .4;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* The select stays for WooCommerce and for people without JavaScript. */
.swatches + .variation-select,
.swatches ~ select { display: none; }

.no-js .swatches { display: none; }
.no-js .swatches ~ select { display: block; }

.reset_variations {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    margin-bottom: 4px;
    color: var(--color-muted);
    font-size: 14px;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ── Add to cart ────────────────────────────────────────────────────────── */
.product-main__summary form.cart {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 0 0 20px;
}

.product-main__summary .variations_form.cart { display: block; }

.woocommerce-variation-add-to-cart {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.quantity {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.quantity__button {
    width: 44px;
    height: 52px;
    border: 0;
    background: none;
    color: var(--color-navy);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: background-color var(--transition);
}

.quantity__button:hover { background: var(--color-primary-soft); }

.quantity input.qty {
    width: 46px;
    height: 52px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--color-text);
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    -moz-appearance: textfield;
}

.quantity input.qty::-webkit-outer-spin-button,
.quantity input.qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.single_add_to_cart_button {
    flex: 1 1 220px;
    min-height: 52px;
    padding: 14px 32px;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--color-primary);
    color: #FFF;
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color var(--transition);
}

.single_add_to_cart_button:hover { background: var(--color-primary-dark); }
.single_add_to_cart_button.disabled { opacity: .5; cursor: not-allowed; }

.woocommerce-variation-price { margin-bottom: 12px; }

.woocommerce-variation-price .price {
    margin: 0;
    font-size: 26px;
}

/* ── Wholesale table from Tiered Price Table ────────────────────────────── */
/* The plugin ships a plain table with a solid highlight row; here it reads as
   a price ladder — the more pairs, the cheaper. */
/* The plugin's cells carry their own white background, so a tinted wrapper
   read as a box inside a box and the highlighted row touched both edges.
   One white card with real padding instead. */
.tpt__tiered-pricing {
    margin: 0 0 20px;
    padding: 6px 14px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: #FFF;
}

.tpt__tiered-pricing table {
    width: 100%;
    border-collapse: collapse;
}

.tpt__tiered-pricing thead th {
    padding: 10px 0 8px;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-muted);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.tpt__tiered-pricing thead th:last-child { text-align: right; }

.tpt__tiered-pricing tbody td {
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 0, 0, .06);
    background: none;
    color: var(--color-navy);
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.tpt__tiered-pricing tbody tr:last-child td { border-bottom: 0; }
.tpt__tiered-pricing tbody td:last-child { text-align: right; }

.tpt__tiered-pricing tbody td:first-child {
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 400;
}

/* Tiered Price Table paints the active row with an inline rule scoped to a
   generated id and marked !important, so its background cannot be overridden.
   It uses the brand colour anyway — instead of fighting it, the row is shaped
   into a proper highlight: rounded ends, white text, tighter line. */
.tpt__tiered-pricing tbody tr.tiered-pricing--active td {
    color: #FFF;
    font-weight: 700;
}

.tpt__tiered-pricing tbody tr.tiered-pricing--active td:first-child {
    padding-left: 14px;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    color: rgba(255, 255, 255, .85);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 500;
}

.tpt__tiered-pricing tbody tr.tiered-pricing--active td:last-child {
    padding-right: 14px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.tpt__tiered-pricing tbody tr.tiered-pricing--active td { border-bottom-color: transparent; }

/* ── Delivery notes ─────────────────────────────────────────────────────── */
.product-delivery {
    margin: 0 0 20px;
    padding: 18px 20px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    list-style: none;
}

.product-delivery__item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-height: 26px;
    margin-bottom: 12px;
    color: var(--color-text);
    font-size: 15px;
}

.product-delivery__item:last-child { margin-bottom: 0; }

.product-delivery__icon {
    flex: 0 0 auto;
    margin-top: 2px;
    color: var(--color-primary);
}

.product-delivery__link {
    color: var(--color-primary);
    font-weight: 600;
}

.product-delivery__link:hover { color: var(--color-primary-dark); }

/* ── Meta ───────────────────────────────────────────────────────────────── */
.product_meta {
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
    color: var(--color-muted);
    font-size: 14px;
}

.product_meta > span { display: block; margin-bottom: 4px; }
.product_meta a { color: var(--color-primary); }

/* ── Tabs ───────────────────────────────────────────────────────────────── */
.product-tabs {
    padding: 8px 0 56px;
    border-top: 1px solid var(--color-border);
}

.product-tabs__list {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0 0 28px;
    padding: 0;
    border-bottom: 1px solid var(--color-border);
    list-style: none;
}

.product-tabs__item { margin: 0; }

.product-tabs__link {
    display: inline-flex;
    align-items: center;
    min-height: 52px;
    padding: 14px 20px;
    border-bottom: 2px solid transparent;
    color: var(--color-muted);
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    transition: color var(--transition), border-color var(--transition);
}

.product-tabs__link:hover { color: var(--color-primary); }

.product-tabs__item.active .product-tabs__link {
    border-bottom-color: var(--color-primary);
    color: var(--color-navy);
}

.product-tabs__panel { padding: 0; }

.product-tabs__panel > h2:first-child { display: none; }

.product-tabs__panel,
.woocommerce-Tabs-panel { max-width: 100%; }

/* ── Specifications ─────────────────────────────────────────────────────── */
.specs {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    margin: 0;
}

.specs__row {
    display: flex;
    align-items: baseline;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border);
}

.specs__row:last-child { border-bottom: 0; }

.specs__term {
    flex: 0 0 240px;
    margin: 0;
    color: var(--color-muted);
    font-size: 15px;
}

.specs__value {
    flex: 1 1 auto;
    margin: 0;
    font-weight: 500;
}

/* ── Reviews (inside the tab) ───────────────────────────────────────────── */
.reviews {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 100%;
}

/* Full width, so the summary reads as one line rather than a tall card. */
.reviews__summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 18px;
    padding: 20px 24px;
    border-radius: var(--radius);
    background: var(--color-bg-alt);
}

.reviews__main { width: 100%; }

.reviews__score {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
    color: var(--color-navy);
}

.reviews__stars { margin: 0; }

.reviews__count {
    margin: 0;
    color: var(--color-muted);
    font-size: 15px;
}

.reviews__empty-title,
.reviews__empty-text { flex: 0 1 auto; }

.reviews__empty-title {
    margin: 0 0 8px;
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--color-navy);
}

.reviews__empty-text {
    margin: 0;
    color: var(--color-muted);
    font-size: 15px;
}

/* ── Stars ──────────────────────────────────────────────────────────────── */
.review__star {
    color: var(--color-border);
    font-size: 18px;
    letter-spacing: 2px;
}

.review__star.is-filled { color: #F5A623; }

/* ── Review list ────────────────────────────────────────────────────────── */
.commentlist {
    margin: 0 0 32px;
    padding: 0;
    list-style: none;
}

.review {
    padding: 20px 0;
    border-bottom: 1px solid var(--color-border);
}

.review:first-child { padding-top: 0; }

.review__head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 10px;
}

.review__avatar {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.review__author { flex: 1 1 auto; min-width: 0; }

.review__name {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--color-navy);
}

.review__verified {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    background: rgba(46, 125, 50, .1);
    color: var(--color-success);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
}

.review__date {
    color: var(--color-muted);
    font-size: 14px;
}

.review__rating { margin: 0; }

.review__text {
    color: var(--color-text);
    font-size: 15px;
}

.review__text p:last-child { margin-bottom: 0; }

.review__pending {
    margin: 8px 0 0;
    color: var(--color-muted);
    font-size: 14px;
    font-style: italic;
}

.reviews__pagination ol,
.reviews__pagination ul {
    display: flex;
    gap: 8px;
    margin: 0 0 24px;
    padding: 0;
    list-style: none;
}

/* ── Review form ────────────────────────────────────────────────────────── */
#review_form_wrapper {
    padding: 28px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: #FFF;
}

#review_form_wrapper .comment-reply-title {
    display: block;
    margin-bottom: 18px;
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--color-navy);
}

/* Name and email share a row; the text and the rating take the full width. */
.comment-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0 20px;
}

.comment-form > p {
    flex: 1 1 100%;
    margin: 0 0 18px;
}

/* Needs the same specificity as ".comment-form > p" above to win. */
.comment-form > .comment-form-author,
.comment-form > .comment-form-email { flex: 1 1 calc(50% - 10px); }

.comment-form label {
    display: block;
    margin-bottom: 6px;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    color: var(--color-navy);
}

.comment-form .required { color: var(--color-sale); }

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form textarea {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: #FFF;
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 16px;
}

.comment-form textarea { min-height: 130px; resize: vertical; }

.comment-form input::placeholder,
.comment-form textarea::placeholder { color: var(--color-muted); }

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--focus-ring);
}

/* The rating is a row of stars, not a list of sentences. */
.comment-form-rating .stars {
    display: flex;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.comment-form-rating .stars span { display: flex; gap: 2px; }

.comment-form-rating .stars a {
    position: relative;
    width: 40px;
    height: 40px;
    color: transparent;
    font-size: 0;
    text-indent: -9999px;
}

.comment-form-rating .stars a::before {
    content: '★';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-border);
    font-size: 28px;
    text-indent: 0;
    transition: color var(--transition);
}

.comment-form-rating .stars a.active::before,
.comment-form-rating .stars a:hover::before { color: #F5A623; }

.comment-form-rating select { display: none; }

.comment-form-cookies-consent {
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-form-cookies-consent label {
    margin: 0;
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--color-muted);
    font-size: 14px;
}

.comment-form .form-submit { margin-bottom: 0; }

.comment-form input[type="submit"] {
    min-height: 50px;
    padding: 14px 34px;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--color-primary);
    color: #FFF;
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color var(--transition);
}

.comment-form input[type="submit"]:hover { background: var(--color-primary-dark); }

.woocommerce-verification-required {
    margin: 0;
    padding: 20px 24px;
    border-radius: var(--radius);
    background: var(--color-bg-alt);
    color: var(--color-muted);
}

/* ── Related ────────────────────────────────────────────────────────────── */

.related.products,
.up-sells.products { padding: 8px 0 56px; }

.related.products > h2,
.up-sells.products > h2 {
    margin: 0 0 24px;
    font-size: 26px;
}

.related.products,
.up-sells.products {
    width: 100%;
    max-width: var(--container-width);
    padding-left: var(--gutter);
    padding-right: var(--gutter);
    margin: 0 auto;
}

/* ── Adaptive ───────────────────────────────────────────────────────────── */
@media (max-width: 1023px) {
    .product-main__inner { gap: 32px; padding-bottom: 40px; }
    .product-main__media   { flex: 1 1 380px; }
    .product-main__summary { flex: 1 1 340px; }
    .product_title { font-size: 26px; }
    .product-tabs { padding-bottom: 40px; }
    .specs__term { flex: 0 0 180px; }
    .reviews { gap: 20px; }
}

@media (max-width: 767px) {
    .product-main__inner {
        flex-direction: column;
        gap: 24px;
    }

    /* One column — nothing to stick to. */
    .product-main__media {
        position: static;
        flex: 0 1 auto;
        width: 100%;
    }

    .product-main__summary { flex: 0 1 auto; width: 100%; }

    .product_title { font-size: 22px; }
    .product-main__summary .price { font-size: 26px; }

    .single_add_to_cart_button { flex: 1 1 100%; }

    .woocommerce-product-gallery .flex-control-thumbs li { width: calc(25% - 8px); }

    .specs__row { flex-direction: column; gap: 2px; }
    .specs__term { flex: 0 1 auto; }

    .reviews__summary { align-items: flex-start; flex-direction: column; gap: 6px; padding: 18px 20px; }
    .comment-form > .comment-form-author,
    .comment-form > .comment-form-email { flex: 1 1 100%; }
    #review_form_wrapper { padding: 20px; }

    /* Tab titles scroll sideways instead of wrapping onto three lines. */
    .product-tabs__list {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        margin-left: calc(-1 * var(--gutter));
        margin-right: calc(-1 * var(--gutter));
        padding: 0 var(--gutter);
    }

    .product-tabs__item { flex: 0 0 auto; }
    .product-tabs__link { padding: 14px 14px; font-size: 15px; white-space: nowrap; }
}
