/* ═══════════════════════════════════════════════
   KL Product Page Builder – Frontend Styles
   Mobile-first with min-width breakpoints
   ═══════════════════════════════════════════════ */

/* ── Prevent horizontal overflow on product pages ── */
body.single-product {
    overflow-x: hidden !important;
}

/* ── White background for product & shop pages ── */
body.single-product,
body.post-type-archive-product,
body.tax-product_cat {
    --ast-global-color-5: #ffffff;
    background-color: #ffffff !important;
}
.single-product .ast-separate-container,
.single-product .site-content,
.single-product #primary,
.post-type-archive-product .ast-separate-container,
.post-type-archive-product .site-content,
.post-type-archive-product #primary,
.tax-product_cat .ast-separate-container,
.tax-product_cat .site-content,
.tax-product_cat #primary {
    background-color: #ffffff !important;
}

/* ── Product Layout ── */
.woocommerce div.product,
.woocommerce.single-product div.product {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0 4% !important;
}
.woocommerce div.product div.images,
.woocommerce #content div.product div.images,
.woocommerce.single-product div.product div.images {
    width: 28% !important;
}
.woocommerce div.product div.summary,
.woocommerce #content div.product div.summary,
.woocommerce.single-product div.product div.summary {
    width: 68% !important;
}

/* ── Hide product meta (Category / Tags / Brand) ── */
.woocommerce div.product .product_meta {
    display: none !important;
}
.woocommerce div.product .single-product-category {
    display: none !important;
}

/* ── Hide default WC/Astra sale badge ── */
.woocommerce span.onsale,
.woocommerce div.product span.onsale,
.single-product span.onsale {
    display: none !important;
}

/* ── Custom Sale Badge (upper-right of image) ── */
.woocommerce div.product div.images {
    position: relative;
}
.kl-pp-sale-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 9;
    font-family: 'Outfit', sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #e74c3c;
    color: #fff;
    padding: 4px 14px;
    border-radius: 6px;
    line-height: 1.6;
}

/* ── Hide zoom trigger ── */
.woocommerce div.product div.images .woocommerce-product-gallery__trigger {
    display: none !important;
}

/* ── Hide Astra's breadcrumb (header + summary) ── */
.single-product .ast-breadcrumbs-wrapper {
    display: none !important;
}
.woocommerce div.product .entry-summary .woocommerce-breadcrumb,
.woocommerce div.product .summary .woocommerce-breadcrumb {
    display: none !important;
}

/* ── Reduce space above breadcrumb ── */
.single-product .ast-woocommerce-container,
.single-product .site-content > .ast-container,
.single-product #primary,
.single-product .site-content,
.single-product #content,
.single-product .ast-container,
.single-product .entry-content,
.single-product article.product,
.single-product .site-main {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* ── Recently Viewed: hidden until JS loads content ── */
.single-product .kl-recently-viewed {
    display: none;
    width: 100% !important;
    flex-basis: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    max-width: 100% !important;
    margin-bottom: 24px;
}
.single-product .kl-recently-viewed.kl-rv-visible {
    display: block;
}
.single-product .kl-recently-viewed h2 {
    font-size: 22px;
    font-weight: 700;
    color: #0a0a0a;
    margin: 0 0 16px;
    padding: 0 20px;
}
.single-product .kl-recently-viewed ul.products {
    display: flex !important;
    grid-template-columns: none !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 16px !important;
    padding: 4px 0 8px !important;
    list-style: none !important;
    margin: 0 !important;
    width: 100% !important;
}
.single-product .kl-recently-viewed ul.products::-webkit-scrollbar {
    display: none;
}
.single-product .kl-recently-viewed ul.products > li.product {
    flex: 0 0 70vw !important;
    max-width: 70vw !important;
    scroll-snap-align: start;
    display: flex !important;
    flex-direction: column !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    width: auto !important;
    float: none !important;
}
.single-product .kl-recently-viewed .kl-shop-image {
    display: block;
    overflow: hidden;
}
.single-product .kl-recently-viewed .kl-shop-image img {
    width: 100%;
    height: auto;
    display: block;
}
@media (min-width: 768px) {
    .single-product .kl-recently-viewed ul.products > li.product {
        flex: 0 0 calc(33.333% - 11px) !important;
        max-width: calc(33.333% - 11px) !important;
    }
}
@media (min-width: 1024px) {
    .single-product .kl-recently-viewed ul.products > li.product {
        flex: 0 0 calc(20% - 13px) !important;
        max-width: calc(20% - 13px) !important;
    }
}

/* ── You Might Also Need: horizontal slider on all sizes ── */
.single-product .related.products {
    width: 100% !important;
    flex-basis: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    max-width: 100% !important;
}

/* Scroll wrapper (holds arrows + list) */
.kl-related-scroll-wrap {
    position: relative;
    padding: 0 20px;
}

/* Horizontal scrollable list */
.single-product .related.products ul.products {
    display: flex !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 16px !important;
    padding: 4px 0 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}
.single-product .related.products ul.products::-webkit-scrollbar {
    display: none;
}

/* Card sizing – responsive */
.single-product .related.products ul.products > li.product {
    flex: 0 0 70vw !important;
    max-width: 70vw !important;
    scroll-snap-align: start;
}
@media (min-width: 768px) {
    .single-product .related.products ul.products > li.product {
        flex: 0 0 calc(33.333% - 11px) !important;
        max-width: calc(33.333% - 11px) !important;
    }
}
@media (min-width: 1024px) {
    .single-product .related.products ul.products > li.product {
        flex: 0 0 calc(20% - 13px) !important;
        max-width: calc(20% - 13px) !important;
    }
}

/* Arrow buttons – matches homepage Best Sellers style */
.kl-related-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #eee;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    color: #333;
    font-size: 14px;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s;
}
.kl-related-arrow:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    background: #f8f9fa;
    color: #0a0a0a;
}
.kl-related-arrow.kl-hidden {
    opacity: 0;
    pointer-events: none;
}
.kl-related-prev {
    left: -4px;
}
.kl-related-next {
    right: -4px;
}

/* ── Our breadcrumb above image ── */
.woocommerce div.product > .woocommerce-breadcrumb {
    width: 100%;
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    color: #999;
    margin: 0 0 10px;
    padding: 0;
}
.woocommerce div.product > .woocommerce-breadcrumb a {
    color: #6c757d;
    text-decoration: none;
    transition: color 0.2s;
}
.woocommerce div.product > .woocommerce-breadcrumb a:hover {
    color: var(--kl-accent, #00d4aa);
}

/* ── Star Rating (always visible) ── */
.kl-pp-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.kl-pp-rating .star-rating {
    color: #FFD700;
    font-size: 14px;
}
.kl-pp-rating-count {
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    color: #999;
}

/* ── Scroll Animations ── */
.kl-pp-animate {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.kl-pp-animate.kl-pp-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ═══════════════════════════════════════
   Product Details
   ═══════════════════════════════════════ */
.kl-pp-details {
    margin-top: 16px;
    margin-bottom: 8px;
    border: 1px solid #eee;
    border-radius: 10px;
    overflow: hidden;
}
.kl-pp-detail-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
}
.kl-pp-detail-row:last-child {
    border-bottom: none;
}
.kl-pp-detail-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;
    flex-shrink: 0;
}
.kl-pp-detail-icon i {
    font-size: 15px;
    color: #6c757d;
}
.kl-pp-detail-content {
    display: flex;
    flex-direction: column;
}
.kl-pp-detail-label {
    font-family: 'Outfit', sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.kl-pp-detail-value {
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #0a0a0a;
}

/* ═══════════════════════════════════════
   Highlights Bar
   ═══════════════════════════════════════ */
.kl-pp-highlights {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 20px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #eee;
}
.kl-pp-highlight-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #0a0a0a;
}
.kl-pp-highlight-item i {
    color: var(--kl-accent, #00d4aa);
    font-size: 14px;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════
   Custom Tabs – Override WooCommerce
   ═══════════════════════════════════════ */
.woocommerce div.product .woocommerce-tabs {
    margin-top: 10px !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
}

.woocommerce div.product .woocommerce-tabs ul.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e0e0e0;
    margin: 0 0 24px;
    padding: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    list-style: none;
}
.woocommerce div.product .woocommerce-tabs ul.tabs::before {
    display: none;
}
.woocommerce div.product .woocommerce-tabs ul.tabs li {
    border: none;
    background: none;
    border-radius: 0;
    margin: 0;
    padding: 0;
}
.woocommerce div.product .woocommerce-tabs ul.tabs li::before,
.woocommerce div.product .woocommerce-tabs ul.tabs li::after {
    display: none;
}
.woocommerce div.product .woocommerce-tabs ul.tabs li a {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: #6c757d;
    padding: 12px 20px;
    display: block;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s;
}
.woocommerce div.product .woocommerce-tabs ul.tabs li a:hover {
    color: #0a0a0a;
}
.woocommerce div.product .woocommerce-tabs ul.tabs li.active a {
    color: #0a0a0a;
    border-bottom-color: var(--kl-accent, #00d4aa);
}

/* Tab content panel */
.kl-pp-tab-content {
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    line-height: 1.7;
    color: #555;
}
.kl-pp-tab-content ul,
.kl-pp-tab-content ol {
    padding-left: 20px;
    margin-bottom: 16px;
}
.kl-pp-tab-content li {
    margin-bottom: 8px;
}
.kl-pp-tab-content strong {
    color: #0a0a0a;
}

/* WooCommerce tab panel general */
.woocommerce-Tabs-panel {
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    line-height: 1.7;
    color: #555;
}
.woocommerce-Tabs-panel h2 {
    display: none;
}
.woocommerce-Tabs-panel ul,
.woocommerce-Tabs-panel ol {
    padding-left: 20px;
    margin-bottom: 16px;
}
.woocommerce-Tabs-panel li {
    margin-bottom: 8px;
}
.woocommerce-Tabs-panel strong {
    color: #0a0a0a;
}

/* ═══════════════════════════════════════
   FAQ Accordion
   ═══════════════════════════════════════ */
.kl-pp-faq {
    padding: 12px 20px;
    max-width: 800px;
    margin: 0 auto;
}
.kl-pp-faq-title {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin: 0 0 24px;
    color: #0a0a0a;
}
.kl-pp-faq-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.kl-pp-faq-item {
    border: 1px solid #eee;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.2s;
}
.kl-pp-faq-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.kl-pp-faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    background: none;
    border: none;
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #0a0a0a;
    cursor: pointer;
    text-align: left;
    gap: 12px;
}
.kl-pp-faq-icon {
    font-size: 14px;
    color: #6c757d;
    transition: transform 0.3s;
    flex-shrink: 0;
}
.kl-pp-faq-item.kl-open .kl-pp-faq-icon {
    transform: rotate(180deg);
}
.kl-pp-faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}
.kl-pp-faq-answer p {
    padding: 0 20px 18px;
    margin: 0;
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    color: #555;
    line-height: 1.7;
}
.kl-pp-faq-item.kl-open .kl-pp-faq-answer {
    max-height: 500px;
}

/* ═══════════════════════════════════════
   Guarantee Banner
   ═══════════════════════════════════════ */
.kl-pp-guarantee {
    padding: 0 20px 48px;
    max-width: 900px;
    margin: 0 auto;
}
.kl-pp-guarantee-inner {
    padding: 36px 28px;
    border-radius: 14px;
    text-align: center;
}

/* Background variants */
.kl-pp-guarantee-inner--gradient {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
    color: #fff;
}
.kl-pp-guarantee-inner--solid {
    background: #f8f9fa;
    color: #0a0a0a;
    border: 1px solid #eee;
}
.kl-pp-guarantee-inner--accent {
    background: linear-gradient(135deg, var(--kl-accent, #00d4aa) 0%, #00b894 100%);
    color: #0a0a0a;
}

.kl-pp-guarantee-icon {
    font-size: 40px;
    margin-bottom: 16px;
}
.kl-pp-guarantee-inner--gradient .kl-pp-guarantee-icon {
    color: var(--kl-accent, #00d4aa);
}
.kl-pp-guarantee-inner--solid .kl-pp-guarantee-icon {
    color: var(--kl-accent, #00d4aa);
}
.kl-pp-guarantee-inner--accent .kl-pp-guarantee-icon {
    color: #0a0a0a;
}

.kl-pp-guarantee-headline {
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 12px;
}
.kl-pp-guarantee-text {
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
    opacity: 0.85;
}

/* ═══════════════════════════════════════
   Reviews – Style Override
   ═══════════════════════════════════════ */
.woocommerce #reviews h2 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}
.woocommerce #reviews #comments ol.commentlist li .comment-text {
    border-radius: 10px;
    border-color: #eee;
    font-family: 'Outfit', sans-serif;
}
.woocommerce #reviews .star-rating {
    color: #FFD700;
}
.woocommerce #review_form #respond .comment-form-rating .stars a {
    color: #FFD700;
}

/* ═══════════════════════════════════════
   RESPONSIVE – Tablet (768px+)
   ═══════════════════════════════════════ */
@media (min-width: 768px) {
    .kl-pp-highlights {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }
    .kl-pp-highlight-item {
        font-size: 14px;
    }
    .kl-pp-faq-title {
        font-size: 28px;
    }
    .kl-pp-guarantee-inner {
        padding: 48px 40px;
    }
    .kl-pp-guarantee-headline {
        font-size: 26px;
    }
    .woocommerce div.product .woocommerce-tabs ul.tabs li a {
        font-size: 15px;
    }
}

/* ═══════════════════════════════════════
   RESPONSIVE – Desktop (1024px+)
   ═══════════════════════════════════════ */
@media (min-width: 1024px) {
    .kl-pp-highlights {
        padding: 20px 24px;
    }
    .kl-pp-highlight-item {
        gap: 10px;
    }
}

/* ═══════════════════════════════════════
   RESPONSIVE – Mobile (max-width: 767px)
   ═══════════════════════════════════════ */
@media (max-width: 767px) {
    /* Stack image and summary vertically */
    .woocommerce div.product,
    .woocommerce.single-product div.product {
        flex-direction: column !important;
        gap: 16px !important;
    }
    .woocommerce div.product div.images,
    .woocommerce #content div.product div.images,
    .woocommerce.single-product div.product div.images {
        width: 100% !important;
        max-width: 320px;
        margin: 0 auto;
    }
    .woocommerce div.product div.summary,
    .woocommerce #content div.product div.summary,
    .woocommerce.single-product div.product div.summary {
        width: 100% !important;
    }

    /* Breadcrumb */
    .woocommerce div.product > .woocommerce-breadcrumb {
        font-size: 12px;
    }

    /* Sale badge */
    .kl-pp-sale-badge {
        top: 8px;
        right: 8px;
        font-size: 11px;
        padding: 3px 10px;
    }

    /* Details rows */
    .kl-pp-detail-row {
        padding: 10px 12px;
        gap: 10px;
    }
    .kl-pp-detail-icon {
        width: 30px;
        height: 30px;
    }
    .kl-pp-detail-icon i {
        font-size: 13px;
    }
    .kl-pp-detail-value {
        font-size: 13px;
    }

    /* Highlights */
    .kl-pp-highlights {
        grid-template-columns: 1fr 1fr;
        padding: 12px;
        margin-top: 16px;
    }
    .kl-pp-highlight-item {
        font-size: 12px;
        gap: 6px;
    }

    /* Tabs */
    .woocommerce div.product .woocommerce-tabs {
        margin-top: 8px !important;
        padding-top: 0 !important;
    }
    .woocommerce div.product .woocommerce-tabs ul.tabs li a {
        font-size: 13px;
        padding: 10px 14px;
    }

    /* FAQ */
    .kl-pp-faq {
        padding: 32px 16px;
    }
    .kl-pp-faq-title {
        font-size: 20px;
        margin-bottom: 16px;
    }
    .kl-pp-faq-question {
        padding: 14px 16px;
        font-size: 15px;
        gap: 10px;
    }
    .kl-pp-faq-answer p {
        padding: 0 16px 14px;
        font-size: 14px;
    }

    /* Guarantee */
    .kl-pp-guarantee {
        padding: 0 16px 32px;
    }
    .kl-pp-guarantee-inner {
        padding: 28px 20px;
    }
    .kl-pp-guarantee-icon {
        font-size: 32px;
        margin-bottom: 12px;
    }
    .kl-pp-guarantee-headline {
        font-size: 20px;
    }
    .kl-pp-guarantee-text {
        font-size: 14px;
    }

    /* Recently viewed / related section titles */
    .single-product .kl-recently-viewed h2,
    .single-product .related.products > h2 {
        font-size: 18px;
        padding: 0 12px;
    }

    /* Slider arrows */
    .kl-related-arrow {
        width: 34px;
        height: 34px;
        font-size: 12px;
    }
    .kl-related-prev {
        left: 2px;
    }
    .kl-related-next {
        right: 2px;
    }
    .kl-related-scroll-wrap {
        padding: 0 12px;
    }

    /* Microsoft badge */
    .kl-ms-name {
        font-size: 12px;
    }
    .kl-ms-label {
        font-size: 10px;
    }
}

/* ═══════════════════════════════════════
   RESPONSIVE – Small phones (max-width: 479px)
   ═══════════════════════════════════════ */
@media (max-width: 479px) {
    .kl-pp-highlights {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .kl-pp-faq {
        padding: 24px 12px;
    }
    .kl-pp-faq-title {
        font-size: 18px;
    }
    .kl-pp-faq-question {
        padding: 12px;
        font-size: 14px;
    }
    .kl-pp-faq-answer p {
        padding: 0 12px 12px;
        font-size: 13px;
    }

    .kl-pp-guarantee {
        padding: 0 12px 24px;
    }
    .kl-pp-guarantee-inner {
        padding: 24px 16px;
    }
    .kl-pp-guarantee-headline {
        font-size: 18px;
    }
    .kl-pp-guarantee-text {
        font-size: 13px;
    }
}
