/* ============================================
   TADAA! - MAIN STYLES
   Premium Design + Dark/Light Mode + Animations
   Colors: Yellow (#FFD400), Black (#000000), White (#FFFFFF)
   Font: Inter (Body) + Cormorant Garamond (Headers & Titles)
   ============================================ */

/* ===== Import Google Fonts ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;0,700;1,300;1,400;1,600;1,700&display=swap');

/* ============================================
   CSS VARIABLES (Light Mode Default)
   ============================================ */
:root {
    /* Primary Colors */
    --color-yellow: #FFD400;
    --color-yellow-dark: #E6BF00;
    --color-yellow-light: #FFE44D;
    --color-black: #000000;
    --color-white: #FFFFFF;
    
    /* Neutral Colors */
    --color-gray-50: #FAFAFA;
    --color-gray-100: #F5F5F5;
    --color-gray-200: #EEEEEE;
    --color-gray-300: #E0E0E0;
    --color-gray-400: #BDBDBD;
    --color-gray-500: #9E9E9E;
    --color-gray-600: #757575;
    --color-gray-700: #616161;
    --color-gray-800: #424242;
    --color-gray-900: #212121;
    
    /* Theme Colors */
    --bg-primary: #F8F9FA;
    --bg-secondary: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-input: #F5F5F5;
    --bg-nav: #000000;
    --text-primary: #1A1A1A;
    --text-secondary: #666666;
    --text-muted: #999999;
    --text-inverse: #FFFFFF;
    --border-color: #EEEEEE;
    --shadow-color: rgba(0,0,0,0.06);
    --shadow-hover: rgba(0,0,0,0.10);
    --shadow-lg: rgba(0,0,0,0.12);
    --modal-bg: rgba(0,0,0,0.6);
    --toast-bg: #FFFFFF;
    --toast-text: #1A1A1A;
    
    /* Border Radius (Increased for Luxury Feel) */
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-full: 9999px;
    
    /* Shadows (Softer and more elegant) */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.06);
    --shadow-lg: 0 16px 48px rgba(0,0,0,0.08);
    --shadow-yellow: 0 4px 20px rgba(255, 212, 0, 0.25);
    --shadow-yellow-lg: 0 8px 32px rgba(255, 212, 0, 0.35);
    
    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    
    /* Fonts */
    --font-family-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-family-header: 'Cormorant Garamond', Georgia, serif;
    
    /* Z-Index Scale */
    --z-base: 1;
    --z-nav: 100;
    --z-modal: 1000;
    --z-overlay: 1400;
    --z-sidebar: 1500;
    --z-toast: 2000;
    --z-splash: 99999;
}

/* ============================================
   DARK MODE
   ============================================ */
[data-theme="dark"] {
    --bg-primary: #0A0E14;
    --bg-secondary: #14181F;
    --bg-card: #1A1F2B;
    --bg-input: #252D3F;
    --bg-nav: #0A0E14;
    --text-primary: #F0F4F8;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --text-inverse: #FFFFFF;
    --border-color: #2D3748;
    --shadow-color: rgba(0,0,0,0.5);
    --shadow-hover: rgba(0,0,0,0.7);
    --shadow-lg: rgba(0,0,0,0.6);
    --modal-bg: rgba(0,0,0,0.8);
    --toast-bg: #1A1F2B;
    --toast-text: #F0F4F8;
}

/* ============================================
   RESET & BASE
   ============================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    transition: background var(--transition-normal), color var(--transition-normal);
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   TYPOGRAPHY (LUXURY RULES)
   ============================================ */
/* Apply Serif font to ALL Headers & Titles */
h1, h2, h3, h4, h5, h6,
.section-title, .product-title, .cart-title, .hero-title,
.tadaa-title, .tadaa-brand, .brand-name,
[class*="tadaa-title"], [class*="section-title"] {
    font-family: var(--font-family-header) !important;
    font-weight: 700 !important;
    line-height: 1.15 !important;
    color: var(--text-primary);
    transition: color var(--transition-normal);
    letter-spacing: -0.01em;
}

h1 { font-size: 38px; }
h2 { font-size: 30px; }
h3 { font-size: 24px; }
h4 { font-size: 20px; }
h5 { font-size: 17px; }
h6 { font-size: 15px; }

/* Keep Body/UI text in Sans-Serif */
p, span, a, button, input, select, textarea, .btn, .category-btn, .price-tag, .cart-item-details {
    font-family: var(--font-family-body);
    font-weight: 400;
    line-height: 1.6;
}

p {
    color: var(--text-secondary);
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

/* ============================================
   CONTAINER
   ============================================ */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   BUTTONS (Elegant & Minimal)
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 32px;
    border: none;
    border-radius: var(--radius-full);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 52px;
    letter-spacing: 0.3px;
}

.btn-primary {
    background: var(--color-yellow);
    color: var(--color-black);
    box-shadow: var(--shadow-yellow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-yellow-lg);
}

.btn-primary:active {
    transform: scale(0.97);
}

.btn-secondary {
    background: var(--color-black);
    color: var(--color-white);
}

.btn-secondary:hover {
    background: var(--color-gray-800);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    background: var(--color-gray-50);
    border-color: var(--text-primary);
    transform: translateY(-2px);
}

/* ============================================
   CARDS (Soft, Rounded, Floating)
   ============================================ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.card-glass {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .card-glass {
    background: rgba(255, 255, 255, 0.03);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ============================================
   ANIMATION CLASSES
   ============================================ */
.animate-fade-up { animation: fadeInUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.animate-fade-scale { animation: fadeInScale 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.animate-slide-right { animation: slideInRight 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.animate-float { animation: float 4s ease-in-out infinite; }

/* ============================================
   PRODUCT CARD (Premium Upgrade)
   ============================================ */
.product-card {
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: rgba(255, 212, 0, 0.3);
}

.product-card:active {
    transform: scale(0.98);
}

.product-card .image-wrapper {
    position: relative;
    padding-bottom: 100%;
    background: var(--bg-input);
    overflow: hidden;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.product-card .image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.product-card:hover .image-wrapper img {
    transform: scale(1.05);
}

.product-card .product-info {
    padding: 18px 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    justify-content: space-between;
}

.product-card .product-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.product-card .product-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.product-card .product-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

/* ============================================
   CATEGORY BUTTONS (Elegant Chips)
   ============================================ */
.category-btn {
    padding: 12px 24px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    font-weight: 500;
    font-size: 14px;
    transition: all var(--transition-normal);
    flex-shrink: 0;
}

.category-btn:hover {
    transform: translateY(-2px);
    border-color: var(--color-yellow);
    color: var(--text-primary);
}

.category-btn.active {
    background: var(--color-yellow);
    color: var(--color-black);
    border-color: var(--color-yellow);
    font-weight: 600;
    box-shadow: var(--shadow-yellow);
}

/* ============================================
   CART SIDEBAR (Premium Overlay)
   ============================================ */
#cartSidebar {
    transition: right 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    box-shadow: -12px 0 60px var(--shadow-lg) !important;
    border-left: 1px solid var(--border-color);
}

#cartSidebar .cart-header {
    padding: 24px 28px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#cartSidebar .cart-header h3 {
    font-size: 26px;
    margin: 0;
}

#cartSidebar .close-cart-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-input);
    border: none;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    color: var(--text-primary);
}

#cartSidebar .close-cart-btn:hover {
    background: var(--border-color);
    transform: rotate(90deg);
}

#cartOverlay {
    transition: opacity 0.4s ease;
}

/* ============================================
   QUANTITY CONTROLS (Refined)
   ============================================ */
.qty-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    padding: 4px 6px;
}

.qty-control button {
    background: transparent;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-control button:hover {
    background: var(--color-white);
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .qty-control button:hover {
    background: var(--color-gray-800);
}

.qty-control button:active {
    transform: scale(0.9);
}

.qty-control .qty-value {
    font-weight: 600;
    font-size: 15px;
    min-width: 24px;
    text-align: center;
    color: var(--text-primary);
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */
.toast-notification {
    animation: slideInRight 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    background: var(--toast-bg) !important;
    color: var(--toast-text) !important;
    border-left: 4px solid var(--color-yellow) !important;
    box-shadow: var(--shadow-lg) !important;
    border-radius: var(--radius-md) !important;
    padding: 18px 24px !important;
}

/* ============================================
   DARK MODE SPECIFIC OVERRIDES
   ============================================ */
[data-theme="dark"] .product-card {
    border-color: var(--border-color);
}

[data-theme="dark"] .product-card:hover {
    border-color: var(--color-yellow);
}

[data-theme="dark"] #searchInput {
    background: var(--bg-input) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .category-btn.active {
    background: var(--color-yellow);
    color: var(--color-black);
}

[data-theme="dark"] #cartSidebar .order-item {
    border-bottom-color: var(--border-color) !important;
}

[data-theme="dark"] #productModal > div {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .toast-notification {
    background: var(--toast-bg) !important;
    color: var(--toast-text) !important;
}

/* ============================================
   UTILITIES
   ============================================ */
.text-yellow { color: var(--color-yellow); }
.text-black { color: var(--color-black); }
.text-white { color: var(--color-white); }
.text-gray { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }

.bg-yellow { background: var(--color-yellow); }
.bg-black { background: var(--color-black); }
.bg-white { background: var(--color-white); }
.bg-gray { background: var(--bg-input); }

.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }
.gap-10 { gap: 40px; }

.w-full { width: 100%; }
.h-full { height: 100%; }
.max-w-full { max-width: 100%; }

.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.hidden { display: none !important; }
.block { display: block; }
.inline-block { display: inline-block; }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-y-auto { overflow-y: auto; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .container { padding: 0 16px; }
    
    .card { padding: 20px; border-radius: var(--radius-md); }
    
    .btn { padding: 14px 24px; font-size: 14px; min-height: 48px; }
    
    h1 { font-size: 30px; }
    h2 { font-size: 24px; }
    h3 { font-size: 20px; }
}

@media (max-width: 480px) {
    .container { padding: 0 12px; }
    
    .card { padding: 16px; border-radius: var(--radius-sm); }
    
    .btn { padding: 12px 20px; font-size: 13px; min-height: 44px; width: 100%; justify-content: center; }
    
    h1 { font-size: 26px; }
    h2 { font-size: 22px; }
    h3 { font-size: 18px; }
    
    .category-btn { padding: 10px 18px; font-size: 13px; }
    
    .product-card .product-info { padding: 14px 16px 18px; }
}

/* ============================================
   IPHONE SAFARI & MOBILE FIXES
   ============================================ */
@supports (-webkit-touch-callout: none) {
    body {
        -webkit-text-size-adjust: 100% !important;
        text-size-adjust: 100% !important;
        min-height: -webkit-fill-available !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    .container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 12px !important;
        overflow-x: hidden !important;
    }
    
    #cartSidebar {
        width: 100% !important;
        max-width: 380px !important;
        height: 100% !important;
        height: 100vh !important;
        height: 100dvh !important;
        min-height: -webkit-fill-available !important;
        overflow: hidden !important;
    }
    
    input, textarea, select {
        font-size: 16px !important;
    }
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}
::-webkit-scrollbar-track {
    background: var(--bg-input);
}
::-webkit-scrollbar-thumb {
    background: var(--color-yellow);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-yellow-dark);
}

/* ============================================
   SELECTION COLOR
   ============================================ */
::selection { background: var(--color-yellow); color: var(--color-black); }
::-moz-selection { background: var(--color-yellow); color: var(--color-black); }

/* ============================================
   FOCUS STATES FOR ACCESSIBILITY
   ============================================ */
*:focus-visible {
    outline: 2px solid var(--color-yellow);
    outline-offset: 2px;
}
