/* ==========================================================================
   Sophie.co.ke Inspired Product Page Styles - Shau Brands
   ========================================================================== */

/* Navbar Clearance & Solid Background for Product Pages */
header.header-transparent {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06) !important;
    z-index: 9999 !important;
}
body.dark-mode header.header-transparent {
    background: #0f172a !important;
    border-bottom: 1px solid #1e293b !important;
}

/* Page container & Breadcrumb with safe top clearance */
.sophie-breadcrumb-bar {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 0;
    font-size: 0.82rem;
    margin-top: 130px; /* Safe clearance for fixed desktop header (top-strip ~35px + nav ~75px + breathing room) */
}

@media (max-width: 991px) {
    .sophie-breadcrumb-bar {
        margin-top: 90px; /* Mobile header is shorter (no top-strip on mobile) */
        padding: 10px 0;
    }
}

@media (max-width: 576px) {
    .sophie-breadcrumb-bar {
        margin-top: 82px;
    }
}
.sophie-breadcrumbs {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.sophie-breadcrumbs li a {
    color: #64748b;
    text-decoration: none;
    transition: color 0.2s;
}
.sophie-breadcrumbs li a:hover {
    color: #0f172a;
}
.sophie-breadcrumbs li i {
    font-size: 0.65rem;
    color: #94a3b8;
}
.sophie-breadcrumbs li.active {
    color: #0f172a;
    font-weight: 600;
}

/* Product Section Spacing */
.sophie-product-area {
    padding: 24px 0 60px;
    background: #ffffff;
}
@media (max-width: 768px) {
    .sophie-product-area {
        padding: 14px 0 85px; /* Leave space for bottom sticky bar */
    }
}

/* Gallery & Media Area */
.sophie-gallery-box {
    position: relative;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.sophie-main-img-holder {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
}
.sophie-main-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}
.sophie-img-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(15, 23, 42, 0.75);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    backdrop-filter: blur(4px);
    z-index: 2;
}

/* Gallery Thumbnails */
.sophie-thumbs-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
}
.sophie-thumb-btn {
    flex: 0 0 64px;
    height: 64px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    padding: 2px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s;
}
.sophie-thumb-btn.active, .sophie-thumb-btn:hover {
    border-color: #0f172a;
}
.sophie-thumb-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

/* Product Info Area */
.sophie-details-box {
    padding-left: 10px;
}
@media (max-width: 991px) {
    .sophie-details-box {
        padding-left: 0;
        margin-top: 15px;
    }
}

/* Title & Navigation Arrows Header */
.sophie-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.sophie-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
    margin: 0;
}
.sophie-nav-arrows {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.sophie-nav-arrow-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    text-decoration: none;
    transition: all 0.2s;
}
.sophie-nav-arrow-btn:hover {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}

/* Price Display */
.sophie-price-wrap {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 12px;
}
.sophie-price-old {
    font-size: 1rem;
    color: #94a3b8;
    text-decoration: line-through;
    font-weight: 500;
}
.sophie-price-current {
    font-size: 1.6rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.5px;
}
.sophie-discount-badge {
    background: #10b981;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 4px;
}

/* Sales Urgency Banner */
.sophie-sold-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #334155;
    margin-bottom: 14px;
    font-weight: 500;
}
.sophie-sold-banner i {
    color: #f97316;
    font-size: 1rem;
}

/* Brand Link */
.sophie-brand-row {
    font-size: 0.88rem;
    color: #64748b;
    margin-bottom: 16px;
}
.sophie-brand-link {
    color: #0284c7;
    text-decoration: none;
    font-weight: 600;
}
.sophie-brand-link:hover {
    text-decoration: underline;
}

/* Flash Sale Countdown Timer */
.sophie-countdown-box {
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}
.sophie-countdown-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 10px;
}
.sophie-countdown-header i {
    color: #f59e0b;
}
.sophie-timer-grid {
    display: flex;
    gap: 8px;
}
.sophie-timer-cell {
    flex: 1;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-align: center;
    padding: 6px 4px;
}
.sophie-timer-num {
    display: block;
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
}
.sophie-timer-lbl {
    display: block;
    font-size: 0.65rem;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 600;
    margin-top: 3px;
    letter-spacing: 0.5px;
}

/* Option Groups (Color & Size) */
.sophie-option-group {
    margin-bottom: 18px;
}
.sophie-option-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.sophie-option-selected {
    font-weight: 400;
    color: #64748b;
}
.sophie-option-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.sophie-pill-btn {
    min-width: 44px;
    padding: 6px 14px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.sophie-pill-btn:hover {
    border-color: #0f172a;
}
.sophie-pill-btn.active {
    border-color: #0f172a;
    background: #0f172a;
    color: #ffffff;
}

/* Wishlist Action */
.sophie-wishlist-action {
    margin-bottom: 16px;
}
.sophie-wishlist-link {
    color: #475569;
    font-size: 0.88rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}
.sophie-wishlist-link:hover {
    color: #ef4444;
}

/* Trust Signals (Delivery & Active Viewers) */
.sophie-trust-box {
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    padding: 12px 0;
    margin-bottom: 18px;
}
.sophie-trust-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.86rem;
    color: #334155;
    margin-bottom: 8px;
}
.sophie-trust-row:last-child {
    margin-bottom: 0;
}
.sophie-trust-row i {
    color: #0284c7;
    font-size: 0.95rem;
    width: 18px;
    text-align: center;
}

/* Share Icons Row */
.sophie-share-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    font-size: 0.85rem;
    color: #64748b;
}
.sophie-share-icons {
    display: flex;
    gap: 8px;
}
.sophie-share-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    text-decoration: none;
    transition: all 0.2s;
}
.sophie-share-btn:hover {
    background: #0f172a;
    color: #ffffff;
}

/* Desktop Main Actions (Hidden on tiny screens if preferred, or prominent) */
.sophie-desktop-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}
.sophie-btn-desktop-cart {
    flex: 1;
    background: #18181b;
    color: #ffffff;
    border: 1px solid rgba(212, 175, 55, 0.45);
    border-radius: 8px;
    padding: 14px 20px;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.sophie-btn-desktop-cart i {
    color: #D4AF37;
}
.sophie-btn-desktop-cart:hover {
    background: #27272a;
    border-color: #D4AF37;
    color: #ffffff;
}
.sophie-btn-desktop-buy {
    flex: 1;
    background: linear-gradient(135deg, #e5c158 0%, #D4AF37 60%, #c5a028 100%);
    color: #111111;
    border: 1px solid #c5a028;
    border-radius: 8px;
    padding: 14px 20px;
    font-size: 0.95rem;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.35);
}
.sophie-btn-desktop-buy i {
    color: #111111;
}
.sophie-btn-desktop-buy:hover {
    background: #c5a028;
    color: #111111;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(212, 175, 55, 0.45);
}

/* WhatsApp Business Order Action */
.sophie-whatsapp-action {
    margin-bottom: 20px;
}
.sophie-whatsapp-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #25D366;
    color: #ffffff !important;
    padding: 12px 18px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background 0.2s;
}
.sophie-whatsapp-btn:hover {
    background: #1eb857;
}

/* ==========================================================================
   PRODUCT PAGE FLOATING ACTION BUTTONS STACK (NO OVERLAPPING)
   Stack order from bottom to top:
   - Desktop (>991px): Chat (24px) -> WhatsApp (84px) -> Return to Top (144px)
   - Mobile (<=991px): Sticky bar (0) -> WhatsApp (64px) -> Chat (120px) -> Return to Top (176px)
   ========================================================================== */

/* 1. Floating WhatsApp Button (Desktop default) */
.sophie-floating-whatsapp {
    position: fixed;
    bottom: 84px;
    right: 24px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #25D366;
    color: #ffffff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.45);
    z-index: 99980;
    transition: transform 0.2s ease, box-shadow 0.2s ease, bottom 0.25s ease, right 0.25s ease;
    text-decoration: none;
}
.sophie-floating-whatsapp:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.65);
    color: #ffffff !important;
}

/* 2. Live Chat on Product Page (Desktop default) */
.chat-widget {
    bottom: 24px !important;
    right: 24px !important;
    z-index: 99980 !important;
}
.chat-widget .chat-toggle {
    width: 50px !important;
    height: 50px !important;
}

/* 3. Return to Top on Product Page (Desktop default) */
#scrollUp {
    bottom: 144px !important;
    right: 26px !important;
    width: 46px !important;
    height: 46px !important;
    line-height: 44px !important;
    z-index: 99970 !important;
}

/* Mobile & Tablet Stacking (<= 991px) */
@media (max-width: 991px) {
    /* WhatsApp sits just above the sticky bar */
    .sophie-floating-whatsapp {
        bottom: calc(52px + env(safe-area-inset-bottom, 0px) + 12px) !important;
        right: 16px !important;
        width: 46px !important;
        height: 46px !important;
        font-size: 23px !important;
        box-shadow: 0 4px 14px rgba(37, 211, 102, 0.4) !important;
    }

    /* Live Chat sits cleanly above WhatsApp */
    .chat-widget {
        bottom: calc(52px + env(safe-area-inset-bottom, 0px) + 12px + 46px + 10px) !important;
        right: 16px !important;
    }
    .chat-widget .chat-toggle {
        width: 46px !important;
        height: 46px !important;
    }

    /* Return to top sits cleanly above Live Chat */
    #scrollUp {
        bottom: calc(52px + env(safe-area-inset-bottom, 0px) + 12px + 46px + 10px + 46px + 10px) !important;
        right: 18px !important;
        width: 42px !important;
        height: 42px !important;
        line-height: 40px !important;
        font-size: 14px !important;
    }

    /* When Chat Panel is opened on mobile, position nicely above sticky bar */
    .chat-panel {
        position: fixed !important;
        bottom: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
        right: 12px !important;
        left: 12px !important;
        width: auto !important;
        max-width: 400px !important;
        margin-left: auto !important;
        height: min(480px, calc(100vh - 85px)) !important;
        max-height: calc(100vh - 85px) !important;
        z-index: 100005 !important;
    }
}

/* ==========================================================================
   PERSISTENT MOBILE STICKY ACTION BAR (SHAU BRANDS BLACK & GOLD)
   ========================================================================== */
.sophie-bottom-sticky-bar {
    display: none; /* hidden on wide desktop by default */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 99999;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.25);
    padding-bottom: env(safe-area-inset-bottom, 0);
    background: #111111;
    border-top: 1px solid rgba(212, 175, 55, 0.3);
}

@media (max-width: 991px) {
    .sophie-bottom-sticky-bar {
        display: flex !important;
    }
    body {
        padding-bottom: 65px; /* Ensures footer content isn't obstructed */
    }
}

.sophie-sticky-split-btn {
    flex: 1;
    height: 52px;
    border: none;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    transition: filter 0.2s, background-color 0.2s;
    outline: none;
}
.sophie-sticky-cart-btn {
    background-color: #18181b;
    color: #ffffff;
    border-right: 1px solid rgba(255,255,255,0.12);
}
.sophie-sticky-cart-btn i {
    color: #D4AF37;
}
.sophie-sticky-cart-btn:hover, .sophie-sticky-cart-btn:active {
    background-color: #27272a;
}

.sophie-sticky-buy-btn {
    background: linear-gradient(135deg, #e5c158 0%, #D4AF37 60%, #c5a028 100%);
    color: #111111;
    font-weight: 800;
}
.sophie-sticky-buy-btn i {
    color: #111111;
}
.sophie-sticky-buy-btn:hover, .sophie-sticky-buy-btn:active {
    background: #c5a028;
}

/* ==========================================================================
   RELATED PRODUCTS - COMPACT GRID STYLE (SHAU BRANDS)
   ========================================================================== */
.sophie-related-section {
    padding: 24px 0 50px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}
@media (max-width: 991px) {
    .sophie-related-section {
        padding: 20px 0 95px; /* Extra bottom clearance for mobile sticky bar */
    }
}

.sophie-related-header {
    margin-bottom: 16px;
}
.sophie-related-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 2px;
}
.sophie-related-subtitle {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0;
}

.sophie-related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}
@media (max-width: 991px) {
    .sophie-related-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

.sophie-related-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none !important;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    position: relative;
}
.sophie-related-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.06);
    border-color: #cbd5e1;
}

.sophie-related-img-holder {
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: 140px;
    background: #ffffff;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
@media (min-width: 768px) {
    .sophie-related-img-holder {
        max-height: 190px;
    }
}
.sophie-related-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
    transition: transform 0.3s;
}
.sophie-related-card:hover .sophie-related-img {
    transform: scale(1.04);
}

.sophie-related-wishlist-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255,255,255,0.92);
    border: 1px solid #e2e8f0;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    cursor: pointer;
    z-index: 2;
    transition: all 0.2s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.sophie-related-wishlist-btn:hover {
    color: #ef4444;
    background: #ffffff;
}

.sophie-related-body {
    padding: 8px 10px 10px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.sophie-related-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.1em;
    text-decoration: none !important;
}
.sophie-related-card:hover .sophie-related-name {
    color: #D4AF37;
}

.sophie-related-price-box {
    margin-top: auto;
}
.sophie-related-current-price {
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
    display: block;
}
.sophie-related-price-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}
.sophie-related-old-price {
    font-size: 0.74rem;
    color: #94a3b8;
    text-decoration: line-through;
    font-weight: 500;
}
.sophie-related-discount-badge {
    background: #10b981;
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 3px;
}

/* Dark mode adjustments */
body.dark-mode .sophie-related-section {
    background: #141416;
    border-top-color: rgba(255,255,255,0.08);
}
body.dark-mode .sophie-related-title {
    color: #f3f4f6;
}
body.dark-mode .sophie-related-subtitle {
    color: #9ca3af;
}
body.dark-mode .sophie-related-card {
    background: #1c1c1f;
    border-color: rgba(255,255,255,0.08);
}
body.dark-mode .sophie-related-img-holder {
    background: #18181b;
}
body.dark-mode .sophie-related-name {
    color: #e5e7eb;
}
body.dark-mode .sophie-related-current-price {
    color: #f3f4f6;
}
body.dark-mode .sophie-related-wishlist-btn {
    background: rgba(30,30,35,0.9);
    border-color: rgba(255,255,255,0.12);
    color: #9ca3af;
}


/* ==========================================================================
   DESCRIPTION TAB - CENTERED IMAGE TEXT OVERLAY
   ========================================================================== */
.desc-img-wrapper .desc-img h4 {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    right: auto;
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 800;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0,0,0,0.55);
    width: 80%;
    line-height: 1.3;
}

/* ==========================================================================
   BOTTOM CLEARANCE FOR STICKY BAR ON ALL SECTIONS
   ========================================================================== */
@media (max-width: 991px) {
    .sophie-product-area ~ .pro-desc-area {
        padding-bottom: 80px;
    }
    .sophie-product-area ~ .product-h-two .product-wrapper {
        margin-bottom: 20px;
    }
}
