/* ============================================================
   SRINIVASA PEARLS — Master Stylesheet
   ============================================================ */

:root {
    --logo-teal: #09637E;
    --logo-silver: #9FA3A7;
    --gold: #D4AF37;
    --gold-dark: #B8941F;
    --gold-light: rgba(212,175,55,0.08);
    --deep-bg: #FAF8F4; /* Luxurious Alabaster/Cream */
    --card-bg: #FFFFFF; /* High-contrast white cards */
    --charcoal: #1B1B1B; /* Elegant black for light mode */
    --charcoal-light: #555555;
    --white: #ffffff;
    --shadow-soft: 0 10px 40px rgba(0,0,0,0.05);
    --shadow-hover: 0 20px 60px rgba(0,0,0,0.1);
    --radius-card: 1.5rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    background-color: var(--deep-bg);
    color: var(--charcoal);
    font-family: 'Poppins', sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--pearl); }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 3px; }

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn-gold {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: #0A1111 !important; /* Contrasting dark text on gold button */
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.04em;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(212,175,55,0.2);
    text-decoration: none;
    white-space: nowrap;
}
.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212,175,55,0.3);
    background: linear-gradient(135deg, #f0d060 0%, var(--gold) 100%);
    color: #1B1B1B !important;
}
.btn-gold:active { transform: translateY(0); }

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--logo-teal);
    color: var(--logo-teal);
    background: transparent;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 0.875rem;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
}
.btn-outline:hover {
    background: var(--logo-teal);
    color: var(--deep-bg);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,201,201,0.2);
}

/* ── PRODUCT CARDS ───────────────────────────────────────── */
.product-card {
    background: var(--card-bg);
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: transform 0.4s cubic-bezier(0.25,0.46,0.45,0.94), box-shadow 0.4s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0,201,201,0.05);
}
.product-card:hover {
    transform: translateY(-7px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(0,201,201,0.15);
}

/* Image wrapper — square aspect ratio, no broken heights */
.product-img {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: var(--deep-bg);
    flex-shrink: 0;
}
.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.6s cubic-bezier(0.25,0.46,0.45,0.94);
}
.product-card:hover .product-img img {
    transform: scale(1.07);
}

/* Quick-add hover button */
.product-img .quick-view {
    position: absolute;
    bottom: -54px;
    left: 50%;
    transform: translateX(-50%);
    transition: bottom 0.35s cubic-bezier(0.34,1.56,0.64,1);
    white-space: nowrap;
    z-index: 5;
}
.product-card:hover .product-img .quick-view {
    bottom: 12px;
}

/* ── CATEGORY CARDS ──────────────────────────────────────── */
.category-card {
    border-radius: 1rem;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    display: block;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 38px rgba(44,44,44,0.18);
}
.category-card .cat-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: var(--beige);
}
.category-card .cat-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    transition: transform 0.55s ease;
}
.category-card:hover .cat-img-wrap img {
    transform: scale(1.1);
}
.category-card .cat-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(30,24,18,0.75) 0%, transparent 100%);
    padding: 2rem 0.9rem 0.9rem;
}

/* ── HORIZONTAL SCROLL ───────────────────────────────────── */
.scroll-container {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 4px;
}
.scroll-container::-webkit-scrollbar { display: none; }
.scroll-container > * { scroll-snap-align: start; }

/* ── SCROLL REVEAL ───────────────────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.25s; }
.reveal-delay-4 { transition-delay: 0.34s; }

/* ── TYPOGRAPHY HELPERS ──────────────────────────────────── */
.section-heading {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    color: var(--charcoal);
    letter-spacing: 0.15em;
    line-height: 1.2;
    text-transform: uppercase;
}
.section-subheading {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    color: var(--charcoal-light);
}
.gold-divider {
    width: 60px;
    height: 1.5px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 0 auto;
    border: none;
    display: block;
}

/* ── BADGES ──────────────────────────────────────────────── */
.badge-new {
    display: inline-block;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 3px 8px;
    border-radius: 99px;
    text-transform: uppercase;
    line-height: 1.5;
}
.badge-sale {
    display: inline-block;
    background: #E74C3C;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 3px 8px;
    border-radius: 99px;
    text-transform: uppercase;
    line-height: 1.5;
}

/* ── STARS ───────────────────────────────────────────────── */
.stars { color: var(--gold); letter-spacing: 0.08em; }

/* ── FORMS ───────────────────────────────────────────────── */
.form-input {
    width: 100%;
    padding: 11px 16px;
    border: 1.5px solid rgba(0,201,201,0.1);
    border-radius: 12px;
    background: var(--card-bg);
    font-family: 'Poppins', sans-serif;
    font-size: 0.875rem;
    color: var(--charcoal);
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    -webkit-appearance: none;
    appearance: none;
}
.form-input:focus {
    border-color: var(--logo-teal);
    box-shadow: 0 0 0 3px rgba(0,201,201,0.1);
}
textarea.form-input { resize: vertical; }
select.form-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235C5C5C' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
    cursor: pointer;
}

/* ── QUANTITY BUTTONS ────────────────────────────────────── */
.qty-btn {
    width: 32px;
    height: 32px;
    border: 1.5px solid var(--beige);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: var(--white);
    transition: all 0.2s ease;
    font-size: 1rem;
    color: var(--charcoal);
    user-select: none;
    flex-shrink: 0;
}
.qty-btn:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-light); }

/* Custom Radio Styling for Filters */
.filter-section input[type="radio"] {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--beige);
    border-radius: 50%;
    margin: 0;
    cursor: pointer;
    position: relative;
    transition: border-color 0.2s, background 0.2s;
}
.filter-section input[type="radio"]:checked {
    border-color: var(--gold);
    background: var(--white);
}
.filter-section input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 10px; height: 10px;
    background: var(--gold);
    border-radius: 50%;
}
.filter-section label:hover input[type="radio"] {
    border-color: var(--gold);
}

/* ── TOAST ───────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    background: var(--charcoal);
    color: #fff;
    padding: 13px 20px;
    border-radius: 14px;
    font-size: 0.875rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0,0,0,0.22);
    transform: translateY(80px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s ease;
    max-width: 320px;
    border-left: 3px solid var(--gold);
    pointer-events: none;
}
.toast.show { transform: translateY(0); opacity: 1; pointer-events: auto; }
.toast.success { border-left-color: #27AE60; }
.toast.error   { border-left-color: #E74C3C; }

/* ── PAGE FADE IN ────────────────────────────────────────── */
.page-transition { animation: pageFade 0.45s ease forwards; }
@keyframes pageFade {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── SHIMMER ─────────────────────────────────────────────── */
.shimmer {
    background: linear-gradient(90deg, var(--beige) 0%, #f5f1ea 50%, var(--beige) 100%);
    background-size: 200% 100%;
    animation: shimmerAnim 1.5s infinite;
    border-radius: 12px;
}
@keyframes shimmerAnim {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ── RANGE SLIDER ────────────────────────────────────────── */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: var(--beige);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px; height: 18px;
    background: var(--gold);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(212,175,55,0.4);
}

/* ── TESTIMONIALS ────────────────────────────────────────── */
.testimonial-card {
    background: var(--white);
    border-radius: var(--radius-card);
    padding: 2rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--beige);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

/* ── PROMO BANNER ────────────────────────────────────────── */
.promo-banner {
    background: linear-gradient(135deg, #1e1e1e 0%, #3a3a3a 100%);
    border-radius: 1.5rem;
    overflow: hidden;
    position: relative;
}
.promo-banner::before {
    content: '';
    position: absolute;
    top: -80px; right: -60px;
    width: 380px; height: 380px;
    background: radial-gradient(circle, rgba(212,175,55,0.18) 0%, transparent 70%);
    pointer-events: none;
}

/* ── CART ITEMS ──────────────────────────────────────────── */
.cart-item {
    background: var(--white);
    border-radius: var(--radius-card);
    padding: 1.25rem;
    border: 1.5px solid var(--beige);
    transition: border-color 0.2s ease;
}
.cart-item:hover { border-color: rgba(212,175,55,0.35); }

/* ── PRODUCT IMAGE GALLERY ───────────────────────────────── */
.gallery-thumb {
    border: 2px solid transparent;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s ease;
    flex-shrink: 0;
    width: 72px;
    height: 72px;
}
.gallery-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.gallery-thumb.active,
.gallery-thumb:hover { border-color: var(--gold); }

/* Horizontal thumbnails on mobile */
@media (max-width: 768px) {
    .product-thumbnails {
        display: flex;
        flex-wrap: nowrap !important;
        overflow-x: auto;
        gap: 0.75rem;
        padding-bottom: 0.5rem;
        scrollbar-width: none;
    }
    .product-thumbnails::-webkit-scrollbar { display: none; }
    .gallery-thumb { flex-shrink: 0; width: 68px; height: 68px; }
}

.main-product-img-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 1.5rem;
    overflow: hidden;
    background: var(--beige);
}
.main-product-img-wrap img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.25s ease;
}

/* ── FILTER SIDEBAR ──────────────────────────────────────── */
.filter-section {
    border-bottom: 1px solid var(--beige);
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
}
.filter-section:last-child { border-bottom: none; }

/* ── ORDER STATUS BADGES ─────────────────────────────────── */
.status-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 99px;
    font-size: 0.72rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: capitalize;
}
.status-pending   { background: rgba(254, 243, 199, 0.1); color: #FBBF24; border: 1px solid rgba(251, 191, 36, 0.2); }
.status-confirmed { background: rgba(219, 234, 254, 0.1); color: #60A5FA; border: 1px solid rgba(96, 165, 250, 0.2); }
.status-shipped   { background: rgba(224, 231, 255, 0.1); color: #818CF8; border: 1px solid rgba(129, 140, 248, 0.2); }
.status-delivered { background: rgba(209, 250, 229, 0.1); color: #34D399; border: 1px solid rgba(52, 211, 153, 0.2); }
.status-cancelled { background: rgba(254, 226, 226, 0.1); color: #F87171; border: 1px solid rgba(248, 113, 113, 0.2); }

/* ── ADMIN NAV ───────────────────────────────────────────── */
.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.825rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    color: var(--charcoal-light);
    transition: all 0.2s ease;
    text-decoration: none;
    cursor: pointer;
}
.admin-nav-link:hover,
.admin-nav-link.active {
    background: rgba(212,175,55,0.15);
    color: var(--gold);
}

/* ── HERO IMAGE ──────────────────────────────────────────── */
.hero-img-wrap {
    position: relative;
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
}
.hero-img-wrap .hero-main-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 2rem;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(44,44,44,0.18);
}
.hero-img-wrap .hero-main-img img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}

/* ── LAZY IMG FADE ───────────────────────────────────────── */
img[data-src] { opacity: 0; transition: opacity 0.4s ease; }
img.img-loaded { opacity: 1 !important; }

/* ── LINE CLAMP ──────────────────────────────────────────── */
.line-clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; line-clamp: 1; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-clamp: 2; }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 1024px) {
    .promo-banner { padding: 4rem 2rem; }
}

@media (max-width: 768px) {
    .section-heading { font-size: 1.75rem; }
    .hero-img-wrap .hero-main-img { border-radius: 1.25rem; }
    .promo-banner { border-radius: 1rem; padding: 3rem 1.5rem; }
    .gallery-thumb { width: 62px; height: 62px; }
    
    /* Product card height normalization */
    .product-card h3 { min-height: 2.5rem; }
    
    /* Better touch targets */
    .qty-btn { width: 36px; height: 36px; }
    .btn-gold, .btn-outline { padding-top: 0.85rem; padding-bottom: 0.85rem; }
    
    /* Filter Sidebar Mobile (Refined Drawer) */
    .filter-mobile-active { overflow: hidden; }
    
    @media (max-width: 1023px) {
        aside {
            display: block !important;
            position: fixed;
            top: 0; left: 0; 
            width: 85%; max-width: 320px; 
            height: 100vh;
            background: var(--white);
            z-index: 110;
            padding: 1.5rem;
            overflow-y: auto !important;
            box-shadow: 20px 0 50px rgba(0,0,0,0.15);
            transform: translateX(-100%);
            transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
            visibility: hidden;
            pointer-events: none;
        }
        .filter-mobile-active aside {
            transform: translateX(0);
            visibility: visible;
            pointer-events: auto;
        }
    }
    
    /* Overlay for mobile filter */
    .filter-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(44,44,44,0.3);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 100;
        opacity: 0;
        transition: opacity 0.3s ease;
        cursor: pointer;
    }
    .filter-mobile-active .filter-overlay {
        display: block;
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .section-heading { font-size: 1.5rem; }
    .header-logo-img { height: 1.8rem !important; }
    .header-icons-gap { gap: 0.75rem !important; }
    
    /* Announcement text size */
    .announcement-bar { font-size: 0.65rem; letter-spacing: 0.1em; }
    
    /* Product Cards in 2 columns */
    .product-card .p-4 { padding: 0.75rem; }
    .product-card h3 { font-size: 0.75rem; min-height: 2.25rem; }
    .product-card .font-cinzel { font-size: 0.8rem; }
    
    /* Cart items stacking */
    .cart-item { flex-direction: row; align-items: flex-start; gap: 0.75rem; }
    .cart-item-info { flex: 1; min-width: 0; }
    .cart-item-price { text-align: left !important; margin-top: 0.25rem; }
}
