:root {
    /* Original Green Branding */
    --primary: #059669;
    /* Original Store Green */
    --primary-dark: #047857;
    --primary-light: #ecfdf5;
    --primary-glow: rgba(5, 150, 105, 0.15);

    --secondary: #10b981;
    --accent: #f59e0b;
    --success: #059669;
    --danger: #ef4444;
    --warning: #f59e0b;

    /* Surfaces */
    --bg: #f8fafc;
    --glass: rgba(255, 255, 255, 0.85);
    --glass-heavy: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-muted: #64748b;

    /* Shadows - Refined */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 12px 24px -6px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 20px 40px -8px rgba(5, 150, 105, 0.1);
    --shadow-premium: 0 32px 64px -12px rgba(5, 150, 105, 0.15);
}

/* Hide global WhatsApp on product page to avoid duplicate CTA */
.product-page-modern .whatsapp-float {
    display: none !important;
}

[data-theme="dark"] {
    --bg: #0b1215;
    --glass: rgba(17, 24, 28, 0.9);
    --glass-heavy: #11181c;
    --border: #232d32;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --shadow-lg: 0 20px 40px -8px rgba(0, 0, 0, 0.6);
}

/* Global Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Spiritual Loading Overlay */
#spiritual-loader {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.loader-text {
    font-size: clamp(1.5rem, 5vw, 2.2rem);
    font-weight: 900;
    color: var(--primary);
    text-align: center;
    animation: pulseFade 2s infinite ease-in-out;
}

@keyframes pulseFade {

    0%,
    100% {
        opacity: 0.5;
        transform: scale(0.98);
    }

    50% {
        opacity: 1;
        transform: scale(1.02);
    }
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid var(--primary-glow);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-top: 30px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Base */
body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Tajawal', sans-serif;
    line-height: 1.6;
    margin: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Glassmorphism Classes */
.glass-nav {
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.glass-morphism {
    background: rgba(255, 255, 255, 0.72) !important;
    backdrop-filter: saturate(180%) blur(20px) !important;
    -webkit-backdrop-filter: saturate(180%) blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

[data-theme="dark"] .glass-morphism {
    background: rgba(15, 23, 42, 0.72) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

/* Sticky Components */
.sticky-cta-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1050;
    transform: translateY(110%);
    transition: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.sticky-cta-bar.active {
    transform: translateY(0);
}

.sticky-product-header {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    z-index: 999;
}

.btn-primary {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
}

.btn-primary:hover {
    background: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
}

/* Modern Product Page Styles */
.shadow-premium-soft {
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.05);
}

.shadow-hover:hover {
    box-shadow: 0 15px 35px -5px rgba(5, 150, 105, 0.12) !important;
}

.hover-translate-y:hover {
    transform: translateY(-8px);
}

.transition-all {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-primary:hover {
    color: var(--primary) !important;
}

.hover-white:hover {
    background: #fff !important;
}

.rounded-lg-5 {
    border-radius: 2.5rem !important;
}

.prod-gallery-main img {
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.prod-gallery-main:hover img {
    transform: scale(1.05);
}

.thumb-card {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: 0.3s;
    flex-shrink: 0;
    background: #fff;
    padding: 4px;
}

.thumb-card.active {
    border-color: var(--primary);
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.thumb-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.feature-item .icon-circle {
    width: 45px;
    height: 45px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.qty-control {
    display: flex;
    align-items: center;
    width: fit-content;
}

.qty-control .qty-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: 0.3s;
}

.qty-control .qty-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.modern-review-card {
    transition: 0.3s;
}

.modern-review-card:hover {
    transform: translateX(-5px);
    border-color: var(--primary) !important;
}

.xx-small {
    font-size: 0.65rem;
}

.fw-black {
    font-weight: 950 !important;
}

/* Desktop Specifics */
@media (min-width: 992px) {
    .product-info-column {
        padding-right: 2rem;
        border-right: 1px solid var(--border);
    }

    [dir="rtl"] .product-info-column {
        padding-right: 0;
        padding-left: 2rem;
        border-right: 0;
        border-left: 1px solid var(--border);
    }
}

/* Section Typography */
.section-title {
    font-size: clamp(1.4rem, 4vw, 2rem);
    font-weight: 950 !important;
    position: relative;
    padding-bottom: 5px;
}

.section-title span {
    color: var(--primary);
    position: relative;
}

.section-title span::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 0;
    width: 100%;
    height: 8px;
    background: var(--primary-glow);
    z-index: -1;
    border-radius: 4px;
}

/* Card Improvements */
.modern-product-card {
    background: var(--glass-heavy);
    border-radius: 28px;
    border: 1px solid var(--border);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-img-box {
    padding: 8px;
    position: relative;
    aspect-ratio: 1/1;
    overflow: hidden;
}

.card-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 22px;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-body-premium {
    padding: 0 18px 18px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-body-premium h3 {
    font-size: 0.95rem;
    font-weight: 800;
    margin-bottom: 5px;
    line-height: 1.4;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.add-to-cart-abs {
    position: absolute;
    bottom: 15px;
    left: 15px;
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(5, 150, 105, 0.3);
    transition: 0.3s;
    z-index: 10;
}

/* Mobile Responsive Grids & Layout Toggles */
@media (max-width: 767px) {
    .row-cols-2>.col {
        padding: 0 6px;
    }

    /* One Column Mode Implementation (RTL Optimized) */
    body.one-column-mode .row-cols-2 {
        --bs-rows-cols: 1;
    }

    /* Support for Tailwind Grids in One Column Mode */
    body.one-column-mode .products-grid-tailwind {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    }

    body.one-column-mode .row-cols-2>.col {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
        margin-bottom: 12px;
    }

    body.one-column-mode .modern-product-card {
        flex-direction: row;
        height: 130px;
        align-items: center;
        padding: 5px;
    }

    body.one-column-mode .card-img-box {
        width: 120px;
        height: 120px;
        flex-shrink: 0;
        padding: 4px;
    }

    body.one-column-mode .card-body-premium {
        padding: 10px 15px;
        justify-content: center;
        text-align: right;
    }

    body.one-column-mode .card-body-premium h3 {
        font-size: 0.95rem;
        -webkit-line-clamp: 2;
        margin-bottom: 8px;
    }

    body.one-column-mode .card-price {
        font-size: 1.1rem;
    }

    body.one-column-mode .add-to-cart-abs {
        right: auto !important;
        left: 15px !important;
        bottom: 15px !important;
        width: 36px;
        height: 36px;
    }

    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* Scroll Hide Utility */
.hide-scrollbar-mobile::-webkit-scrollbar {
    display: none;
}

@media (max-width: 991px) {
    .hide-scrollbar-mobile {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
}

/* Mobile Specifics */
@media (max-width: 991px) {
    .product-page-modern .container {
        padding-left: 0;
        padding-right: 0;
    }

    .gallery-wrapper {
        margin-bottom: 2rem;
    }

    .prod-gallery-main {
        border-radius: 0 !important;
    }

    .product-info-column {
        padding: 0 20px;
    }

    .thumb-strip {
        padding: 0 15px;
        margin-bottom: 10px;
    }

    .thumb-card {
        width: 65px;
        height: 65px;
        border-radius: 12px;
    }

    .thumb-card img {
        border-radius: 8px;
    }

    .sticky-product-header {
        height: 65px;
        top: 0;
        transform: translateY(-100%);
        transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .sticky-product-header.active {
        transform: translateY(0);
    }

    .price-container {
        border-radius: 25px !important;
        margin: 0 20px;
    }

    .info-card-group {
        padding: 0 20px;
    }

    .product-description,
    .tab-header,
    .reviews-list,
    .related-slider {
        padding: 0 20px;
    }
}

@media (max-width: 576px) {
    .display-5 {
        font-size: 1.75rem;
        line-height: 1.3;
    }

    .sticky-cta-bar {
        border-radius: 24px 24px 0 0;
        padding-bottom: calc(18px + env(safe-area-inset-bottom)) !important;
        display: flex !important;
    }

    .sticky-cta-bar .btn-primary {
        font-size: 1.1rem;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
    }
}

.related-slider::-webkit-scrollbar {
    height: 4px;
}

.related-slider::-webkit-scrollbar-thumb {
    background: var(--primary-glow);
    border-radius: 10px;
}