/* modern.css - Premium Vanilla CSS Design System for KeraKart */

/* ==========================================================================
   1. CSS Reset & Variables
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Brand Colors */
    --brand-blue: #6366f1;
    --brand-blue-hover: #4f46e5;
    --brand-blue-light: rgba(99, 102, 241, 0.1);
    --brand-blue-glow: rgba(99, 102, 241, 0.3);
    
    --brand-50: #eef2ff;
    --brand-100: #e0e7ff;
    --brand-dark: #1e1b4b;
    --brand-yellow: #fbbf24;
    --brand-accent: #ec4899;
    
    /* Semantic Colors */
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #0ea5e9;

    /* Backgrounds */
    --bg-main: #f8fafc;
    --bg-surface: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.85);
    
    /* Text */
    --text-main: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --text-on-dark: #ffffff;
    
    /* Borders & UI Elements */
    --border-light: #f1f5f9;
    --border-color: #e2e8f0;
    --border-glass: rgba(255, 255, 255, 0.2);
    
    /* Radii */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 32px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    
    /* 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);
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-main);
    background-color: var(--bg-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

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

ul, ol {
    list-style: none;
}

button, input, select, textarea {
    font-family: inherit;
    outline: none;
    border: none;
    background: none;
}

button {
    cursor: pointer;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   2. Layout & Grid System
   ========================================================================== */
.container {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 80px 0;
}

.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; }

.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

@media (max-width: 1024px) {
    .lg-grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
    .md-grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
    .md-grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    /* FIX: md-hidden should be visible on mobile, hidden on desktop */
    /* This is overridden by the inline <style> in header.php for correct behavior */
}

/* ==========================================================================
   3. Typography
   ========================================================================== */
.text-h1 { font-size: 4rem; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
.text-h2 { font-size: 2.5rem; font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; }
.text-h3 { font-size: 1.75rem; font-weight: 700; line-height: 1.3; }
.text-lg { font-size: 1.125rem; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }

.text-primary { color: var(--brand-blue); }
.text-white { color: var(--text-on-dark); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }
.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.05em; }
.tracking-widest { letter-spacing: 0.1em; }

/* ==========================================================================
   4. Components - Glassmorphism & Cards
   ========================================================================== */
.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
}

.glass-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--brand-blue-light);
}

/* ==========================================================================
   5. Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    text-decoration: none;
    cursor: pointer;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-hover));
    color: var(--text-on-dark);
    box-shadow: 0 4px 15px var(--brand-blue-glow);
}

.btn-primary:hover {
    box-shadow: 0 8px 25px var(--brand-blue-glow);
    filter: brightness(1.1);
    transform: translateY(-2px);
    color: var(--text-on-dark);
}

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

.btn-outline:hover {
    border-color: var(--brand-blue);
    color: var(--brand-blue);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--brand-blue-light);
    color: var(--brand-blue);
}

/* Premium CTA Button - shimmer gradient */
.btn-premium {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--brand-blue) 0%, #8b5cf6 50%, var(--brand-blue-hover) 100%);
    background-size: 200% 200%;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    text-decoration: none;
    letter-spacing: 0.01em;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-premium::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.15) 50%, transparent 100%);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.btn-premium:hover::before {
    transform: translateX(100%);
}

.btn-premium:hover {
    background-position: right center;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5);
    color: #ffffff;
}

.btn-premium:active {
    transform: scale(0.97) translateY(0);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-full);
    background: var(--bg-surface);
    color: var(--text-muted);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    color: var(--brand-blue);
    background: var(--brand-blue-light);
}

/* ==========================================================================
   6. Header & Navigation
   ========================================================================== */
.header-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 76px;
    z-index: 50;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    transition: all var(--transition-normal);
}

.header-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-hover));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px var(--brand-blue-glow);
    transition: transform var(--transition-normal);
}

.brand-logo:hover .brand-icon {
    transform: rotate(8deg) scale(1.05);
}

.brand-text-container {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.brand-title {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--brand-dark);
    letter-spacing: -0.02em;
}

.brand-title span {
    color: var(--brand-blue);
}

.brand-subtitle {
    font-size: 0.6rem;
    font-weight: 800;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-top: 2px;
}

.search-bar-container {
    flex: 1;
    max-width: 500px;
    position: relative;
    display: none;
}

@media (min-width: 768px) {
    .search-bar-container {
        display: block;
    }
}

.search-input {
    width: 100%;
    background: #f1f5f9;
    border: 1px solid transparent;
    padding: 12px 16px 12px 48px;
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    color: var(--text-main);
    transition: all var(--transition-fast);
}

.search-input:focus {
    background: var(--bg-surface);
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 4px var(--brand-blue-light);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    transition: color var(--transition-fast);
}

.search-input:focus + .search-icon {
    color: var(--brand-blue);
}

.nav-desktop {
    display: none;
    align-items: center;
    gap: 8px;
}

@media (min-width: 768px) {
    .nav-desktop {
        display: flex;
    }
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-right: 16px;
    margin-right: 16px;
    border-right: 1px solid var(--border-color);
}

.nav-link {
    padding: 8px 16px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: var(--brand-blue);
    background: var(--brand-blue-light);
}

/* User Menu Dropdown */
.user-menu-wrapper {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    border-radius: var(--radius-full);
    background: transparent;
    transition: background var(--transition-fast);
}

.user-menu-btn:hover {
    background: #f1f5f9;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    background: var(--brand-blue-light);
    color: var(--brand-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
}

.user-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-main);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 240px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    padding: 8px;
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: all var(--transition-fast);
}

.dropdown-menu.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.dropdown-item:hover {
    background: var(--brand-blue-light);
    color: var(--brand-blue);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

.cart-icon-btn {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.cart-icon-btn:hover {
    background: var(--brand-blue-light);
    color: var(--brand-blue);
}

.cart-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--brand-accent);
    color: white;
    font-size: 0.65rem;
    font-weight: 900;
    height: 18px;
    min-width: 18px;
    padding: 0 4px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-surface);
}

/* Category Strip */
.category-strip {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    margin-top: 76px;
    display: none;
}

@media (min-width: 768px) {
    .category-strip {
        display: block;
    }
}

.category-strip-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cat-strip-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.cat-strip-item:hover {
    background: #f8fafc;
}

.cat-strip-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-fast);
}

.cat-strip-item:hover .cat-strip-icon-box {
    transform: scale(1.1);
}

.cat-strip-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
}

/* Mobile Spacer */
.header-spacer { height: 76px; }
@media (min-width: 768px) {
    .header-spacer { height: 164px; } /* 76 + strip */
}

/* ==========================================================================
   7. Footer
   ========================================================================== */
.footer-wrapper {
    background: var(--brand-dark);
    color: white;
    padding: 80px 0 40px;
    margin-top: 80px;
    position: relative;
    overflow: hidden;
}

.footer-glow {
    position: absolute;
    top: 0;
    left: 20%;
    width: 400px;
    height: 400px;
    background: rgba(99, 102, 241, 0.15);
    border-radius: 50%;
    filter: blur(100px);
    transform: translateY(-50%);
    pointer-events: none;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 48px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 48px;
}

@media (min-width: 768px) {
    .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}

.footer-brand p {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.7;
    margin-top: 20px;
    max-width: 320px;
}

.footer-socials {
    display: flex;
    gap: 16px;
    margin-top: 24px;
}

.social-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    transition: all var(--transition-fast);
}

.social-btn:hover {
    background: var(--brand-blue);
    color: white;
    transform: translateY(-3px);
}

.footer-col-title {
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 24px;
    color: white;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.footer-link {
    color: var(--text-light);
    font-size: 0.95rem;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.footer-link:hover {
    color: var(--brand-blue);
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding-top: 32px;
    gap: 24px;
}

@media (min-width: 768px) {
    .footer-bottom { flex-direction: row; }
}

.footer-copyright {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==========================================================================
   8. Inputs and Forms
   ========================================================================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    font-size: 0.95rem;
    color: var(--text-main);
    transition: all var(--transition-fast);
}

.form-input:focus {
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 4px var(--brand-blue-light);
}

/* ==========================================================================
   9. Badges & Tags
   ========================================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-primary { background: var(--brand-blue-light); color: var(--brand-blue); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

/* ==========================================================================
   10. Animations
   ========================================================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

.animate-fade-in {
    animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* animate-fade used on hero banner */
.animate-fade {
    animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* animate-ping for notification dot */
@keyframes ping {
    75%, 100% { transform: scale(2); opacity: 0; }
}
.animate-ping { animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite; }

/* animate-spin for loading states */
@keyframes spin {
    to { transform: rotate(360deg); }
}
.animate-spin { animation: spin 1s linear infinite; }

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }

/* Micro-interactions */
.hover-lift {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.hover-lift:hover {
    transform: translateY(-5px);
}
.hover-scale {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.hover-scale:hover {
    transform: scale(1.05);
}

/* ==========================================================================
   11. Utility Classes (Spacing, Colors, Display)
   ========================================================================== */
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; }
.mb-2 { margin-bottom: 8px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; } .mb-8 { margin-bottom: 32px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; } .py-4 { padding-top: 16px; padding-bottom: 16px; }
.px-4 { padding-left: 16px; padding-right: 16px; } .px-6 { padding-left: 24px; padding-right: 24px; }

.w-full { width: 100%; }
.h-full { height: 100%; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }

.relative { position: relative; }
.absolute { position: absolute; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.overflow-hidden { overflow: hidden; }

.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); }

.object-cover { object-fit: cover; }
