/* ============================================
   TADAA! - MAIN STYLES
   Premium Design + Dark/Light Mode + Animations
   Colors: Yellow (#FFD700), Blue (#1A56DB), Black (#000000)
   Font: Cormorant Garamond
   ============================================ */

/* ===== Import Google Font ===== */
@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: #FFD700;
    --color-yellow-dark: #E6C200;
    --color-blue: #1A56DB;
    --color-blue-dark: #1542A8;
    --color-black: #000000;
    --color-white: #FFFFFF;
    
    /* Neutral Colors */
    --color-gray-50: #F9FAFB;
    --color-gray-100: #F3F4F6;
    --color-gray-200: #E5E7EB;
    --color-gray-300: #D1D5DB;
    --color-gray-400: #9CA3AF;
    --color-gray-500: #6B7280;
    --color-gray-600: #4B5563;
    --color-gray-700: #374151;
    --color-gray-800: #1F2937;
    --color-gray-900: #111827;
    
    /* Theme Colors */
    --bg-primary: #f3f4f6;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-input: #F9FAFB;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --border-color: #E5E7EB;
    --shadow-color: rgba(0,0,0,0.06);
    --shadow-hover: rgba(0,0,0,0.12);
    --shadow-lg: rgba(0,0,0,0.15);
    --modal-bg: rgba(0,0,0,0.7);
    --nav-bg: #000000;
    --nav-text: #ffffff;
    --footer-bg: #000000;
    --footer-text: #9CA3AF;
    --toast-bg: #ffffff;
    --toast-text: #1F2937;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --shadow-xl: 0 16px 48px rgba(0,0,0,0.15);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Fonts */
    --font-family: 'Cormorant Garamond', Georgia, serif;
}

/* ============================================
   DARK MODE
   ============================================ */
[data-theme="dark"] {
    --bg-primary: #0f1724;
    --bg-secondary: #1a2332;
    --bg-card: #1a2332;
    --bg-input: #283548;
    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --border-color: #334155;
    --shadow-color: rgba(0,0,0,0.4);
    --shadow-hover: rgba(0,0,0,0.6);
    --shadow-lg: rgba(0,0,0,0.5);
    --modal-bg: rgba(0,0,0,0.85);
    --nav-bg: #0a0f1a;
    --nav-text: #F1F5F9;
    --footer-bg: #0a0f1a;
    --footer-text: #94A3B8;
    --toast-bg: #1a2332;
    --toast-text: #F1F5F9;
}

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

html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

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

a:hover {
    color: var(--color-blue-dark);
}

/* ============================================
   TADAA! TITLE WITH BLACK EXCLAMATION
   ============================================ */
.tadaa-title {
    font-family: var(--font-family);
    font-weight: 700;
}

.tadaa-title .exclamation {
    color: var(--color-black) !important;
}

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

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-full);
    font-family: var(--font-family);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow-hover);
}

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

.btn-primary:hover {
    background: var(--color-yellow-dark);
}

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

.btn-secondary:hover {
    background: var(--color-blue-dark);
}

.btn-outline {
    background: transparent;
    color: var(--color-blue);
    border: 2px solid var(--color-blue);
}

.btn-outline:hover {
    background: var(--color-blue);
    color: var(--color-white);
}

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

.btn-black:hover {
    background: var(--color-gray-800);
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

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

.card-rounded {
    border-radius: var(--radius-lg);
}

/* ============================================
   SECTION DIVIDERS
   ============================================ */
.section-divider {
    position: relative;
    padding: 60px 0;
    overflow: hidden;
}

.section-divider::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-yellow), var(--color-blue), var(--color-black));
    border-radius: 0 0 50% 50%;
}

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

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.4);
    }
    50% {
        box-shadow: 0 0 25px 12px rgba(255, 215, 0, 0);
    }
}

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

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   ANIMATION CLASSES
   ============================================ */
.animate-fade-up {
    animation: fadeInUp 0.6s ease forwards;
}

.animate-fade-scale {
    animation: fadeInScale 0.5s ease forwards;
}

.animate-slide-left {
    animation: slideInLeft 0.5s ease forwards;
}

.animate-slide-right {
    animation: slideInRight 0.5s ease forwards;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-pulse-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}

/* ===== Staggered Children ===== */
.stagger-children > * {
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.10s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.20s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.30s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.40s; }
.stagger-children > *:nth-child(9) { animation-delay: 0.45s; }
.stagger-children > *:nth-child(10) { animation-delay: 0.50s; }

/* ============================================
   LOADING SKELETON
   ============================================ */
.skeleton {
    background: linear-gradient(90deg, var(--bg-input) 25%, var(--border-color) 50%, var(--bg-input) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

/* ============================================
   PRODUCT CARD HOVER
   ============================================ */
.product-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.product-card img {
    transition: transform 0.5s ease;
}

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

/* ============================================
   CATEGORY BUTTONS
   ============================================ */
.category-btn {
    transition: all 0.3s ease;
}

.category-btn:hover {
    transform: scale(1.05);
}

/* ============================================
   THEME TOGGLE
   ============================================ */
.theme-toggle {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.theme-toggle:hover {
    transform: rotate(20deg);
    background: var(--border-color);
}

/* ============================================
   CART SIDEBAR
   ============================================ */
#cartSidebar {
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
}

#cartOverlay {
    transition: opacity 0.3s ease;
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */
.toast-notification {
    animation: slideInRight 0.4s ease forwards;
    background: var(--toast-bg) !important;
    color: var(--toast-text) !important;
    border-left: 4px solid var(--color-yellow) !important;
}

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

[data-theme="dark"] .product-card:hover {
    box-shadow: 0 8px 30px var(--shadow-hover) !important;
}

[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 {
    background: transparent !important;
    color: var(--text-secondary) !important;
}

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

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

[data-theme="dark"] footer {
    background: var(--footer-bg) !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-blue { color: var(--color-blue); }
.text-black { color: var(--color-black); }
.text-white { color: var(--color-white); }
.text-gray { color: var(--text-secondary); }

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

.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; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }

.w-full { width: 100%; }
.h-full { height: 100%; }
.relative { position: relative; }
.absolute { position: absolute; }
.hidden { display: none; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .container {
        padding: 0 12px;
    }
    
    .card {
        padding: 16px;
    }
    
    .btn {
        padding: 10px 18px;
        font-size: 14px;
    }
    
    .section-divider {
        padding: 40px 0;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .card {
        padding: 12px;
        border-radius: var(--radius-sm);
    }
    
    .btn {
        padding: 8px 14px;
        font-size: 13px;
        width: 100%;
        justify-content: center;
    }
    
    h1 {
        font-size: 28px;
    }
    
    h2 {
        font-size: 22px;
    }
}
/* ============================================
   CHECKOUT PAGE - Prevent Mobile Zoom
   ============================================ */

/* Force input font size to prevent iOS/Android zoom */
input,
textarea,
select {
    font-size: 16px !important;
}

/* Better mobile padding */
@media (max-width: 768px) {
    body {
        padding: 12px;
    }
    
    .card {
        padding: 16px !important;
    }
    
    .grid {
        gap: 12px !important;
    }
    
    h1 {
        font-size: 24px !important;
    }
}
/* ============================================
   IPHONE SAFARI FIXES
   ============================================ */

/* Target iPhone Safari specifically */
@supports (-webkit-touch-callout: none) {
    
    /* Fix body scaling on iPhone */
    body {
        -webkit-text-size-adjust: 100% !important;
        text-size-adjust: 100% !important;
        min-height: -webkit-fill-available !important;
        padding: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    /* Fix container on iPhone */
    .container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 6px !important;
        overflow-x: hidden !important;
    }
    
    /* Fix grid on iPhone */
    .grid {
        gap: 14px !important;
    }
    
    /* Fix cards on iPhone */
    .card {
        padding: 14px !important;
        border-radius: 14px !important;
        overflow: hidden !important;
    }
    
    /* Fix order items on iPhone */
    .order-item {
        gap: 10px !important;
        padding: 10px 0 !important;
    }
    
    .order-item img {
        width: 45px !important;
        height: 45px !important;
        flex-shrink: 0 !important;
    }
    
    .order-item .info .item-name {
        font-size: 13px !important;
        word-break: break-word !important;
    }
    
    .order-item .price {
        font-size: 13px !important;
        flex-shrink: 0 !important;
    }
    
    /* Fix buttons on iPhone */
    .btn-primary {
        font-size: 16px !important;
        padding: 14px !important;
    }
    
    /* Fix headings on iPhone */
    h1, .page-title {
        font-size: 24px !important;
    }
    
    h3 {
        font-size: 18px !important;
    }
    
    /* Fix form inputs on iPhone */
    input, textarea, select {
        font-size: 16px !important;
        padding: 12px !important;
    }
    
    /* Fix totals on iPhone */
    .summary-row {
        font-size: 14px !important;
    }
    
    .total-row {
        font-size: 18px !important;
    }
}

/* ============================================
   IPHONE NOTCH SAFE AREA
   ============================================ */
@supports (padding: max(0px)) {
    body {
        padding-left: max(12px, env(safe-area-inset-left)) !important;
        padding-right: max(12px, env(safe-area-inset-right)) !important;
        padding-top: max(12px, env(safe-area-inset-top)) !important;
        padding-bottom: max(12px, env(safe-area-inset-bottom)) !important;
    }
}

/* ============================================
   PREVENT TEXT OVERFLOW ON ALL DEVICES
   ============================================ */
.order-item .info {
    overflow: hidden !important;
    word-break: break-word !important;
}

.order-item .info .item-name {
    word-break: break-word !important;
}

/* ============================================
   CHECKOUT PAGE SPECIFIC
   ============================================ */
.checkout-page body,
body.checkout-page {
    padding: 12px;
    min-height: 100vh;
    min-height: 100dvh;
}

/* Improve card padding on mobile */
@media (max-width: 768px) {
    .checkout-page .card,
    body.checkout-page .card {
        padding: 16px !important;
    }
    
    .checkout-page .grid,
    body.checkout-page .grid {
        gap: 12px !important;
    }
    
    .checkout-page h1,
    body.checkout-page h1 {
        font-size: 24px !important;
    }
    
    .checkout-page .container,
    body.checkout-page .container {
        padding: 0 4px;
    }
}
