/* --- GOOGLE FONTS IMPORT (Kazakh Alphabet Support - Cyrillic-ext) --- */
@import url('https://fonts.googleapis.com/css2?family=Golos+Text:wght@400;600;700;800&family=Inter:wght@400;600&display=swap');

/* --- FONT SMOOTHING & TEXT RENDERING --- */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* --- PREMIUM SaaS THEME ENGINE (AGGRESSIVE OVERRIDES) --- */
:root {
    /* DEFAULT (LIGHT) */
    --atls-bg: #f8fafc !important;
    --atls-card: #ffffff !important;
    --atls-text-primary: #0f172a !important;
    --atls-text-secondary: #64748b !important;
    --atls-nav: #ffffff !important;
    --atls-border: #e2e8f0 !important;
    --atls-accent: #333333 !important;
    --atls-text-on-accent: #ffffff !important;
    --atls-accent-soft: #f1f5f9 !important;
    --atls-radius: 12px !important;
    --atls-font: 'Inter', sans-serif !important;
    --atls-font-heading: 'Golos Text', sans-serif !important;
}

/* Global Typography & Base */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif !important;
    background-color: var(--atls-bg) !important;
    color: var(--atls-text-primary) !important;
    letter-spacing: -0.01em;
    transition: background-color 0.3s ease, color 0.3s ease;
    word-break: break-word;
}

h1,
h2,
h3,
h4,
.font-black,
.font-extrabold,
.product-name,
.modal-title,
.feature-title,
.restaurant-title-premium {
    font-family: 'Golos Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif !important;
    letter-spacing: -0.02em !important;
}

/* 1. FORCE THEME COLORS OVER TAILWIND HARDCODED CLASSES */
.bg-white,
.bg-gray-50,
.bg-gray-100,
.bg-slate-50,
.bg-slate-100,
.bg-blue-50,
.bg-emerald-50,
.bg-amber-50,
.bg-purple-50,
.bg-red-50,
.bg-green-50,
.atls-card-bg,
.analytics-card {
    background-color: var(--atls-card) !important;
}

/* Force Accent Colors */
.bg-blue-600,
.bg-blue-700,
.bg-blue-500,
.bg-indigo-600,
.bg-emerald-600,
.bg-purple-600,
.atls-btn-primary,
.add-btn-minimal,
.lanzhou-btn.bg-black {
    background-color: var(--atls-accent) !important;
    background-image: none !important;
    color: var(--atls-text-on-accent) !important;
    border: none !important;
}

/* Force Text Colors */
.text-gray-900,
.text-gray-800,
.text-blue-900,
.text-blue-800,
.atls-text-primary {
    color: var(--atls-text-primary) !important;
}

.text-gray-700,
.text-gray-600,
.text-gray-500,
.text-blue-600,
.text-blue-500,
.text-blue-400,
.atls-text-secondary {
    color: var(--atls-text-secondary) !important;
}

.atls-text-accent,
.menu-item-price,
.rec-item-price,
.restaurant-title-premium {
    color: var(--atls-accent) !important;
}

/* Force Border Colors */
.border,
.border-blue-50,
.border-blue-100,
.border-blue-200,
.border-gray-100,
.border-gray-200,
.border-slate-200 {
    border: 1px solid var(--atls-border) !important;
}

/* Layout Padding Fixes to prevent Browser Overlap */
nav {
    background-color: var(--atls-nav) !important;
    border-bottom: 1px solid var(--atls-border) !important;
    box-shadow: none !important;
    position: sticky !important;
    top: 0;
    z-index: 50;
}

/* --- LIGHT THEME SPECIFIC OVERRIDES --- */

/* Checkout Buttons (Method & Address Type) */
.order-method-btn,
.address-type-btn {
    transition: all 0.2s ease;
    border: 1px solid var(--atls-border) !important;
    background-color: var(--atls-accent-soft) !important;
    /* Inactive Background */
    color: var(--atls-text-secondary) !important;
    /* Inactive Text */
    box-shadow: none !important;
}

/* Active State */
.order-method-btn.active,
.address-type-btn.active {
    background-color: #ffffff !important;
    color: var(--atls-text-primary) !important;
    border: 2px solid var(--atls-accent) !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05) !important;
    transform: translateY(-1px);
}

/* Modal Inputs */
.order-modal-input {
    background-color: #F2F2F7 !important;
    /* Light Grey */
    border: 1px solid transparent !important;
    /* Remove dark borders */
    color: var(--atls-text-primary) !important;
    transition: all 0.2s ease;
}

.order-modal-input:focus {
    background-color: #ffffff !important;
    border-color: var(--atls-accent) !important;
    box-shadow: 0 0 0 3px var(--atls-accent-soft) !important;
    outline: none !important;
}

/* Order Send Button */
.order-modal-send-btn {
    background-color: var(--atls-accent) !important;
    color: var(--atls-text-on-accent) !important;
    border: none !important;
}

/* --- THEMES --- */

/* 1. DARK THEME (Black Edition/Slate 950 - Softened) */
body.theme-dark {
    --atls-bg: #121212 !important;
    --atls-card: #1e1e1e !important;
    --atls-accent: #ffffff !important;
    --atls-text-primary: #e0e0e0 !important;
    --atls-text-secondary: #9e9e9e !important;
    --atls-nav: #121212 !important;
    --atls-border: #2c2c2c !important;
    --atls-text-on-accent: #000000 !important;
    --atls-accent-soft: rgba(255, 255, 255, 0.05) !important;
}

body.theme-dark .cart-checkout-btn {
    background: #252525 !important;
    color: #ffffff !important;
    border: 1px solid #333 !important;
}

body.theme-dark .upsell-shipping-box {
    background: #1e1e1e !important;
    color: #ffffff !important;
}

body.theme-dark .upsell-shipping-box span {
    color: #ffffff !important;
}

/* Floating Cart Dark Theme Override */
body.theme-dark #floating-cart button {
    background-color: #121212 !important;
    border: 1px solid #333 !important;
}

body.theme-dark #floating-cart i {
    color: #ffffff !important;
}

/* Specific Dark Theme Overrides - Inputs & Forms */
body.theme-dark input,
body.theme-dark textarea,
body.theme-dark .order-modal-input {
    background-color: #181818 !important;
    border-color: #2c2c2c !important;
    color: #e0e0e0 !important;
}

body.theme-dark .order-modal-input:focus {
    border-color: #555 !important;
    outline: none !important;
    box-shadow: 0 0 0 1px #555 !important;
}

/* Make prices white/visible in dark mode */
body.theme-dark .menu-item-price,
body.theme-dark .rec-item-price,
body.theme-dark .tsqr-price {
    color: #ffffff !important;
}

/* Adjust buttons if they use accent white - ensure border logic holds */
body.theme-dark .add-btn-minimal,
body.theme-dark .add-btn-circle,
body.theme-dark .lanzhou-btn.bg-black {
    background-color: var(--atls-accent) !important;
    color: var(--atls-text-on-accent) !important;
    border: 1px solid #3d3d3d !important;
}

/* 2. GOLD THEME (Charcoal & Champagne) */
body.theme-gold {
    --atls-bg: #0f0f0f !important;
    --atls-card: #1a1a1a !important;
    --atls-text-primary: #f5f5f9 !important;
    --atls-text-secondary: #a3a3a3 !important;
    --atls-nav: #050505 !important;
    --atls-border: #262626 !important;
    --atls-accent: #d4af37 !important;
    --atls-text-on-accent: #000000 !important;
    --atls-accent-soft: rgba(212, 175, 55, 0.1) !important;
}

/* 3. GLASS THEME (Modern Frosted) */
body.theme-glass {
    --atls-bg: #f1f5f9 !important;
    --atls-card: rgba(255, 255, 255, 0.4) !important;
    --atls-text-primary: #0f172a !important;
    --atls-text-secondary: #475569 !important;
    --atls-nav: rgba(255, 255, 255, 0.6) !important;
    --atls-border: rgba(255, 255, 255, 0.5) !important;
    --atls-accent: #333333 !important;
    --atls-text-on-accent: #ffffff !important;
    --atls-accent-soft: rgba(37, 99, 235, 0.1) !important;
}

body.theme-glass .bg-white,
body.theme-glass .analytics-card {
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
}

/* 4. PREMIUM PASTRY THEME (Boutique Bakery) */
body.theme-pastry {
    --atls-bg: #fdfaf6 !important;
    --atls-card: #ffffff !important;
    --atls-text-primary: #4e342e !important;
    --atls-text-secondary: #8d6e63 !important;
    --atls-nav: #ffffff !important;
    --atls-border: #f8bbd0 !important;

    /* Pink Accent */
    --atls-accent: #d81b60 !important;
    --atls-text-on-accent: #ffffff !important;

    --atls-accent-soft: #fce4ec !important;
    --atls-radius: 20px !important;
}

body.theme-pastry .analytics-icon-bg,
body.theme-pastry .fa-comment-dots,
body.theme-pastry .fa-instagram {
    color: #d81b60 !important;
}

/* Global Component Fixes */
.analytics-icon-bg {
    background-color: var(--atls-accent-soft) !important;
    color: var(--atls-accent) !important;
}

.category-wrapper {
    background-color: var(--atls-bg) !important;
    border-color: var(--atls-border) !important;
}

.bottom-sheet {
    background-color: var(--atls-card) !important;
}

/* Utils */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.line-clamp-1 {
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Category input placeholder (Мәзірді Басқару → Категория қосу) --- */
.atls-category-input::placeholder {
    color: rgba(0, 0, 0, 0.5) !important; /* более контрастный, но не чисто черный */
}

body.theme-dark .atls-category-input::placeholder {
    color: #666666 !important; /* в тёмной теме тоже читаемо */
}


/* themes.css файлының ең соңына қой: */
body.theme-dark .group:hover,
body.theme-dark .menu-item-container:hover,
body.theme-dark .product-card:hover {
    background-color: transparent !important;
    background: none !important;
}

/* Тек кестелерге ғана жұмсақ сұр түс қалдырамыз */
body.theme-dark .client-row:hover,
body.theme-dark .order-row:hover {
    background: rgba(255, 255, 255, 0.03) !important;
}