/* ═══════════════════════════════════════════
   WOOCOMMERCE - FLAVOR THEME
   ═══════════════════════════════════════════ */
.flavor-woo-main { padding: 15px 0 50px; }

/* Breadcrumb */
.sp-breadcrumb { font-size: 13px; color: #888; padding: 8px 0 20px; }
.sp-breadcrumb a { color: #555; }
.sp-breadcrumb a:hover { color: #000; }
.sp-breadcrumb span { margin: 0 6px; }

/* ═══ PRODUCT LAYOUT ═══ */
.sp-row {
    display: grid;
    grid-template-columns: 55% 45%;
    gap: 40px;
    margin-bottom: 50px;
    align-items: start;
}

/* ═══ PRODUCT GALLERY — Swiper Thumbnails + Main Image ═══ */
.sp-gallery-wrap {
    display: flex;
    flex-direction: row;
    gap: 10px;
    position: sticky;
    top: 80px;
    align-items: flex-start;
    overflow: hidden;
}

/* ── Vertical thumbs strip (left on desktop) ── */
.sp-gallery-thumbs-wrap {
    width: 78px;
    flex-shrink: 0;
    position: relative;
    max-height: 560px;
}
.sp-thumbs-swiper {
    width: 78px;
    height: 100%;
    max-height: 520px;
    overflow: hidden;
}
.sp-thumbs-swiper .swiper-wrapper {
    flex-direction: column;
}
.sp-thumbs-swiper .swiper-slide {
    width: 72px !important;
    height: 72px !important;
    flex-shrink: 0;
}

/* Thumb nav arrows (vertical) */
.sp-thumbs-nav-prev,
.sp-thumbs-nav-next {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    width: 26px;
    height: 18px;
    background: rgba(255,255,255,0.95);
    border: 1px solid #ddd;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}
.sp-thumbs-nav-prev { top: -2px; }
.sp-thumbs-nav-prev svg { transform: rotate(90deg); }
.sp-thumbs-nav-next { bottom: -2px; }
.sp-thumbs-nav-next svg { transform: rotate(90deg); }
.sp-thumbs-nav-prev:hover,
.sp-thumbs-nav-next:hover {
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.sp-thumbs-nav-prev.swiper-button-disabled,
.sp-thumbs-nav-next.swiper-button-disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* Thumb items */
.sp-thumb-item {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    cursor: pointer;
    border: 2px solid #e5e5e5;
    overflow: hidden;
    background: #f9f9f9;
    transition: border-color 0.18s;
    box-sizing: border-box;
}
.sp-thumb-item img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
}
.sp-thumb-item:hover  { border-color: #888; }
.sp-thumb-item.active { border-color: #000; }

/* ── Main image area (right on desktop) ── */
.sp-gallery-main-wrap {
    flex: 1;
    min-width: 0;
    position: relative;
    background: #f5f5f5;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    max-height: 560px;
}

#sp-main-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: opacity 0.2s ease, transform 0.35s ease;
    cursor: zoom-in;
    background: #f5f5f5;
}
#sp-main-image:hover { transform: scale(1.04); }
#sp-main-image.fading { opacity: 0; }

/* Prev / Next arrows on main image */
.sp-gallery-prev,
.sp-gallery-next {
    position: absolute;
    top: 50%; transform: translateY(-50%);
    z-index: 10; cursor: pointer;
    width: 34px; height: 34px;
    background: rgba(255,255,255,0.93);
    border: 1px solid #ddd;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    transition: background 0.2s, box-shadow 0.2s;
    user-select: none;
}
.sp-gallery-prev { left: 8px; }
.sp-gallery-next { right: 8px; }
.sp-gallery-prev:hover,
.sp-gallery-next:hover {
    background: #fff;
    box-shadow: 0 3px 10px rgba(0,0,0,0.18);
}

/* Product Info */
.sp-info { padding-top: 0; }

.sp-title {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 12px;
    color: #000;
}

.sp-price { font-size: 24px; font-weight: 700; margin-bottom: 12px; }
.sp-price del { color: #999; font-weight: 400; font-size: 18px; margin-right: 8px; }
.sp-price ins { text-decoration: none; color: #e53935; }

.sp-social-proof { font-size: 13px; margin-bottom: 14px; }
.sp-desc { font-size: 14px; color: #555; line-height: 1.7; margin-bottom: 16px; }

/* Swatches */
.swatch-group { margin-bottom: 18px; }
.swatch-label { font-size: 13px; font-weight: 600; margin-bottom: 10px; display: block; }
.swatch-selected { font-weight: 400; color: #555; }
.swatch-options { display: flex; gap: 8px; flex-wrap: wrap; }

/* Base swatch item */
.swatch-item {
    border: 2px solid #e5e5e5;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; overflow: hidden;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    background: #fff;
    color: #333;
}

/* IMAGE swatches — square fixed size */
.swatch-item.swatch-image {
    width: 52px; height: 52px;
    flex-shrink: 0;
}
.swatch-item.swatch-image img { width: 100%; height: 100%; object-fit: cover; }

/* TEXT swatches — auto width, single line, no shrinking */
.swatch-item.swatch-text {
    height: 40px;
    padding: 0 14px;
    font-size: 12px;
    font-weight: 600;
    line-height: 40px;          /* vertically centers text */
    text-align: center;
    white-space: nowrap;        /* NEVER wrap — always single line */
    word-break: keep-all;
    min-width: 0;
    width: auto;
}

/* Hover state — black bg white text (same as active) */
.swatch-item:hover {
    border-color: #000;
    background: #000;
    color: #fff;
}

/* SELECTED state — black background, white text */
.swatch-item.active {
    border-color: #000;
    background: #000;
    color: #fff;
}
.swatch-item.swatch-image.active {
    border-color: #000;
    box-shadow: 0 0 0 2px #000, 0 0 0 4px #fff, 0 0 0 6px #000;
    background: transparent;
}

/* Stock */
.sp-stock { font-size: 13px; font-weight: 600; margin-bottom: 18px; padding: 6px 0; }
.sp-stock.in { color: #43a047; }
.sp-stock.out { color: #e53935; }

/* QTY + ATC */
.sp-atc-row { display: flex; gap: 10px; margin-bottom: 10px; }

.sp-qty-wrap {
    display: flex; align-items: center;
    border: 1px solid #e5e5e5;
}
.sp-qty-btn {
    width: 40px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; color: #555; cursor: pointer;
    background: none; border: none;
}
.sp-qty-btn:hover { background: #f5f5f5; }
.product-qty-input {
    width: 50px; height: 48px;
    text-align: center; font-size: 14px; font-weight: 600;
    border: none; border-left: 1px solid #e5e5e5; border-right: 1px solid #e5e5e5;
    -moz-appearance: textfield; outline: none; background: #fff;
}
.product-qty-input::-webkit-outer-spin-button,
.product-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.sp-btn-atc {
    flex: 1; padding: 14px 20px;
    background: #000; color: #fff;
    font-size: 13px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 2px;
    cursor: pointer; border: 2px solid #000;
    transition: background 0.2s;
}
.sp-btn-atc:hover { background: #222; }

.sp-btn-buy {
    display: block; width: 100%; padding: 14px;
    border: 2px solid #000; color: #000;
    text-align: center; font-size: 13px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 2px;
    margin-bottom: 10px; transition: all 0.2s;
}
.sp-btn-buy:hover { background: #000; color: #fff; }

.sp-btn-ask {
    display: block; width: 100%; padding: 14px;
    background: #f5f5f5; color: #222;
    text-align: center; font-size: 13px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 2px;
    margin-bottom: 20px; cursor: pointer;
    border: 1px solid #e5e5e5; transition: border-color 0.2s;
}
.sp-btn-ask:hover { border-color: #000; }

/* Shipping info lines */
.sp-meta-lines { border-top: 1px solid #e5e5e5; padding-top: 14px; }

/* Extra actions row (wishlist + ask question) */
.sp-extra-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}
.sp-wishlist-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #e5e5e5;
    color: #222;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.sp-wishlist-btn:hover {
    border-color: #000;
}
.sp-wishlist-btn svg {
    flex-shrink: 0;
}
.sp-wishlist-btn.in-wishlist {
    border-color: #e53935;
    color: #e53935;
}
.sp-wishlist-btn.in-wishlist svg {
    fill: #e53935;
    stroke: #e53935;
}
.sp-extra-actions .sp-btn-ask {
    flex: 1;
    margin-bottom: 0;
}
.sp-meta-line {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 0; font-size: 13px; color: #555;
    border-bottom: 1px solid #e5e5e5;
}
.sp-meta-line svg { flex-shrink: 0; }

/* ═══ PRODUCT TABS ═══ */
.product-tabs-section { margin-bottom: 50px; }
.sp-tabs-nav {
    display: flex; border-bottom: 2px solid #e5e5e5; margin-bottom: 24px;
}
.tab-btn {
    padding: 12px 24px; font-size: 13px; font-weight: 600;
    color: #888; border-bottom: 2px solid transparent;
    margin-bottom: -2px; cursor: pointer;
    background: none; border-top: none; border-left: none; border-right: none;
    white-space: nowrap; transition: color 0.2s;
}
.tab-btn:hover { color: #000; }
.tab-btn.active { color: #000; border-bottom-color: #000; }
.tab-panel { display: none; font-size: 14px; line-height: 1.8; color: #555; }
.tab-panel.active { display: block; }

/* Section below product */
.sp-section {
    padding: 40px 0;
    border-top: 1px solid #e5e5e5;
}

/* Archive styles in main.css */

/* ═══ RESPONSIVE ═══ */
@media (max-width: 900px) {
    .sp-row {
        grid-template-columns: 1fr;
        gap: 24px;
        overflow: hidden;
    }

    /* Gallery: stack vertically, main first, thumbs below */
    .sp-gallery-wrap {
        flex-direction: column;
        position: static;
        overflow: hidden;
        width: 100%;
        max-width: 100%;
    }
    /* Main image first on mobile */
    .sp-gallery-main-wrap {
        order: 1;
        width: 100%;
        aspect-ratio: 1 / 1;
        max-height: 420px;
    }
    /* Thumbnails below on mobile — horizontal Swiper */
    .sp-gallery-thumbs-wrap {
        order: 2;
        width: 100%;
        max-height: none;
        overflow: hidden;
    }
    .sp-thumbs-swiper {
        width: 100% !important;
        max-height: none;
        overflow: hidden;
    }
    .sp-thumbs-swiper .swiper-wrapper {
        flex-direction: row !important;
    }
    .sp-thumbs-swiper .swiper-slide {
        width: 66px !important;
        height: 66px !important;
    }
    .sp-thumb-item {
        width: 66px !important;
        height: 66px !important;
    }
    /* Hide vertical nav arrows on mobile, Swiper handles swipe */
    .sp-thumbs-nav-prev,
    .sp-thumbs-nav-next {
        display: none;
    }

    /* Prevent product info overflow */
    .sp-info {
        overflow: hidden;
        word-wrap: break-word;
    }
    .sp-atc-row {
        flex-wrap: wrap;
    }
    .sp-btn-atc {
        min-width: 0;
    }
    .sp-btn-buy,
    .sp-btn-ask {
        word-wrap: break-word;
    }

    .sp-tabs-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .tab-btn { padding: 10px 16px; font-size: 12px; }

    .sp-extra-actions {
        flex-direction: column;
        gap: 8px;
    }
}
@media (max-width: 768px) {
    .woocommerce ul.products { grid-template-columns: repeat(2, 1fr); }
    .swatch-item.swatch-text { padding: 0 8px; font-size: 11px; height: 36px; line-height: 36px; }
    .swatch-options { gap: 6px; }

    /* Prevent any horizontal overflow on product page */
    .flavor-woo-main {
        overflow-x: hidden;
    }
    .flavor-woo-main .container {
        overflow: hidden;
    }
}
@media (max-width: 480px) {
    .sp-gallery-main-wrap {
        max-height: 320px;
    }
    .sp-thumbs-swiper .swiper-slide {
        width: 56px !important;
        height: 56px !important;
    }
    .sp-thumb-item {
        width: 56px !important;
        height: 56px !important;
    }
}
