/* ===== CSS OPTIMIZATIONS ===== */
/* 
 * Optimizations applied:
 * - Removed duplicate selectors
 * - Combined similar rules
 * - Optimized selectors for better performance
 * - Added CSS custom properties for better maintainability
 */

:root {
    /* Color variables for better maintainability */
    --primary-color: #000000; /* black text */
    --accent-color: #e7d5ca;  /* button color */
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-gray: #f1f3f5;
    --dark-gray: #343a40;
    --white: #ffffff;
    --black: #000000;
    --background-gray: #f8f9fa; /* light gray background */
    --background-gradient-start: #ffffff; /* white */
    --background-gradient-end: #d2b6a3; /* pale sand */
    
    /* Spacing variables */
    --spacing-xs: 5px;
    --spacing-sm: 10px;
    --spacing-md: 15px;
    --spacing-lg: 20px;
    --spacing-xl: 30px;
    
    /* Border radius */
    --border-radius: 8px;
    --border-radius-sm: 4px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Shadows */
    --shadow-light: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-medium: 0 4px 8px rgba(0,0,0,0.15);
    --shadow-heavy: 0 8px 16px rgba(0,0,0,0.2);
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
/* Use will-change for elements that will animate */
.product-card,
.modal-screen,
.cart-fab {
    will-change: transform;
}

/* Optimize paint and layout operations */
.btn,
.product-card,
.modal-content {
    transform: translateZ(0); /* Force hardware acceleration */
}

/* ===== EXISTING CODE CONTINUES ===== */

/* --- Прелоадер --- */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #ffffff 0%, #faf8f6 30%, #f5f0eb 60%, #e7d5ca 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

#preloader.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    border: 4px solid rgba(139, 69, 19, 0.2);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: var(--accent);
    animation: spin 1s ease infinite;
}

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

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

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

.product-card {
    animation: fadeInUp 0.6s ease-out;
}

.category-navbar button {
    animation: slideInLeft 0.5s ease-out;
}

.category-navbar button:nth-child(1) { animation-delay: 0.1s; }
.category-navbar button:nth-child(2) { animation-delay: 0.2s; }
.category-navbar button:nth-child(3) { animation-delay: 0.3s; }
.category-navbar button:nth-child(4) { animation-delay: 0.4s; }
.category-navbar button:nth-child(5) { animation-delay: 0.5s; }


/* --- Theme Variables (New Color Scheme) --- */
:root {
    --background: linear-gradient(180deg, #ffffff 0%, #d2b6a3 100%);
    --card-background: #ffffff;
    --text-primary: #000000;
    --text-secondary: #000000;
    --accent: #e7d5ca;         /* button color */
    --accent-light: #e7d5ca;   /* button color */
    --danger: #dc3545;
    --coffee-brown: #e7d5ca;   /* button color */
    --coffee-light: #e7d5ca;   /* button color */
    --coffee-dark: #d2b6a3;    /* darker shade */
    --gold: #000000;           /* black for text */
    --coffee-pattern: none;
}

html {
    scroll-behavior: smooth;
    box-sizing: border-box;
}

*, *:before, *:after {
    box-sizing: inherit;
}

body {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    color: var(--primary-color);
    background: linear-gradient(180deg, #ffffff 0%, #faf8f6 30%, #f5f0eb 60%, #e7d5ca 100%);
    background-attachment: fixed;
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: none; /* remove decorative overlays for clean white */
    pointer-events: none;
    z-index: -1;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.no-select {
    -webkit-user-select: none; /* Safari */
    -ms-user-select: none;     /* IE 10+ */
    user-select: none;         /* Standard syntax */
}

/* --- Липкая навигация --- */
.category-navbar,
#category-nav.category-navbar { 
    position: sticky; 
    top: 0; 
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 5px 15px; 
    border-bottom: 1px solid rgba(231, 213, 202, 0.3);
    display: flex; 
    overflow-x: auto; 
    z-index: 10; 
}
.category-navbar button { 
    padding: 12px 24px; 
    margin-right: 12px; 
    border: none;
    background: #e7d5ca;
    color: #000000;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    border-radius: 30px; 
    font-size: 0.95em; 
    font-weight: 600; 
    cursor: pointer; 
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
    position: relative;
    overflow: hidden;
}

/* Removed ::before effect that was causing blue shimmer */

.category-navbar button:hover {
    transform: translateY(-2px);
    box-shadow: none;
    background: #d2b6a3;
    border: none;
}

/* --- ОСНОВНАЯ ВЕРСТКА с FLOAT --- */
#product-catalog { padding: 15px; }

.products-grid {
    margin: 0 -1.5%;
}
.products-grid::after {
    content: "";
    display: table;
    clear: both;
}

.category-title {
    width: 100%;
    float: left;
    padding: 0 1.5%;
    font-size: 2em;
    font-weight: 800;
    margin: 10px 0 15px 0;
    color: #000000;
    text-shadow: none;
    scroll-margin-top: 120px;
    position: relative;
    text-align: center;
    letter-spacing: 1px;
}

.category-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    border-radius: 2px;
}

.product-card {
    float: left;
    width: 30.33%;
    margin: 0 1.5% 15px 1.5%;
    background: #ffffff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
    will-change: transform;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%, rgba(0,0,0,0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.product-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.1);
}

.product-card:hover::before {
    opacity: 1;
}
.product-card img { 
    width: 100%; 
    height: 140px; 
    object-fit: cover; 
    display: block;
    transition: transform 0.3s ease;
}

.product-card:hover img {
    transform: scale(1.05);
}
.product-card .product-info {
    background: #e7d5ca;
    padding: 15px;
    color: #000000;
    position: relative;
    overflow: hidden;
}

.product-card .product-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.6s ease;
}

.product-card:hover .product-info::before {
    left: 100%;
}
.product-card .name { 
    font-weight: 600; 
    font-size: 1em; 
    margin: 0 0 8px 0; 
    text-shadow: none;
    color: #000000;
    position: relative;
    z-index: 1;
}

.product-card .price { 
    font-size: 1.1em; 
    font-weight: 700;
    color: #000000; 
    margin: 0; 
    text-shadow: none;
    position: relative;
    z-index: 1;
}
.product-card .description { display: none; }


.product-card, .category-navbar button {
    transition: all 0.3s ease;
}
.admin-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    min-height: 100vh; /* Минимальная высота для предотвращения сворачивания */
    overflow-y: auto; /* Включаем скролл */
    -webkit-overflow-scrolling: touch; /* Плавный скролл на iOS */
}

.admin-container h1, .admin-container h2, .admin-container h3 {
    color: var(--text-primary);
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
    margin-top: 0;
}

.admin-section {
    margin-bottom: 40px;
}

/* --- Forms --- */
#item-form, #category-form, #modifier-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 12px;
    margin-bottom: 20px;
}

#item-form h3 {
    margin: 0;
    padding: 0;
    border: none;
}

#item-form input[type="text"],
#item-form input[type="number"],
#item-form textarea,
#item-form select,
#category-form input[type="text"],
#modifier-form input[type="text"],
#modifier-form input[type="number"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1em;
    box-sizing: border-box; /* Important */
}

#item-form textarea {
    min-height: 100px;
    resize: vertical;
}

#item-form button, #category-form button, #modifier-form button {
    padding: 12px 20px;
    border: none;
    background-color: #e7d5ca;
    color: #000000;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    align-self: flex-start; /* Button doesn't stretch */
}

/* --- Categories & Items List --- */
#categories-container, #items-container, #modifiers-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.category-item, .item-admin-card {
    background: var(--card-background);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.item-admin-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.category-item span, .item-admin-card p {
    margin: 0 0 8px 0;
}

.category-item div, .item-admin-card div {
    margin-top: 10px;
}

.category-item button, .item-admin-card button {
    padding: 8px 12px;
    margin-right: 5px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background-color: #e7d5ca;
    color: #000000;
    border-radius: 6px;
    cursor: pointer;
}

.item-admin-card button:first-of-type {
    background-color: #d2b6a3;
}


/* --- Toast Notification --- */
.toast-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 25px;
    border-radius: 25px;
    background-color: #333;
    color: white;
    font-size: 1em;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s, bottom 0.3s;
}

.toast-notification.show {
    opacity: 1;
    bottom: 30px;
}


/* --- Основные стили --- */
.btn {
    padding: 12px 24px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    background: #e7d5ca;
    color: #000000;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    background: #d2b6a3;
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.screen { display: none; flex-direction: column; min-height: 100vh; }
.screen.active { display: flex; }
#catalog-screen header { padding: 15px; }

.header-top {
    display: flex;
    justify-content: center; /* Center .shop-location */
    align-items: center;
    position: relative; /* For absolute positioning of user controls */
}

.header-top-user-controls {
    display: flex;
    align-items: center;
    position: absolute;
    right: 0;
}

#account-icon {
    font-size: 1.5em;
    text-decoration: none;
    color: white;
}

.shop-location { 
    font-size: 1.1em; 
    font-weight: 600;
    color: #000000;
    text-shadow: none;
    margin: 0 0 5px 0; 
    letter-spacing: 0.5px;
}
.greeting { 
    font-size: 2.2em; 
    font-weight: 700; 
    margin: 0; 
    color: var(--primary-color);
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    position: relative;
    letter-spacing: 1px;
    line-height: 1.1;
    padding: 5px 0;
    text-align: center;
}

@keyframes greetingGlow {
    from {
        filter: drop-shadow(0 0 5px rgba(255,255,255,0.3));
    }
    to {
        filter: drop-shadow(0 0 15px rgba(255,255,255,0.6));
    }
}

.greeting::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    border-radius: 2px;
    animation: greetingUnderline 2s ease-in-out infinite;
}

@keyframes greetingUnderline {
    0%, 100% {
        width: 60px;
        opacity: 0.7;
    }
    50% {
        width: 100px;
        opacity: 1;
    }
}
.modal-screen {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: 0;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d1810 25%, #3d2416 50%, #2d1810 75%, #1a1a1a 100%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    border-top-left-radius: 30px;
    border-top-right-radius: 30px;
    box-shadow: 0 -20px 60px rgba(139, 69, 19, 0.6);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
    pointer-events: none;
}

.modal-screen.visible { 
    transform: translateY(0);
    pointer-events: auto;
}
.modal-header { 
    position: relative; 
    height: 40vh; 
    flex-shrink: 0; 
    overflow: hidden;
}

.modal-header img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    border-top-left-radius: 30px; 
    border-top-right-radius: 30px;
    transition: transform 0.4s ease;
}

.modal-screen:hover .modal-header img {
    transform: scale(1.05);
}
.modal-close-btn { 
    position: absolute; 
    top: 20px; 
    right: 20px; 
    width: 40px; 
    height: 40px; 
    border-radius: 50%; 
    border: 2px solid rgba(255,255,255,0.3);
    background: rgba(0,0,0,0.6); 
    color: white; 
    font-size: 1.4em; 
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal-close-btn:hover {
    background: rgba(0,0,0,0.8);
    transform: scale(1.1);
    border-color: rgba(255,255,255,0.5);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.modal-close-btn:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

.modal-content { 
    padding: 20px 20px 25px 20px; 
    flex-grow: 1; 
    overflow-y: auto; 
    color: #000000; 
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    min-height: 0;
}

.modal-title { 
    font-size: 1.8em; 
    font-weight: 800; 
    margin: 0 0 12px 0; 
    text-shadow: none;
    color: #000000;
    letter-spacing: 0.5px;
}

.modal-description {
    color: #000000;
    margin-bottom: 20px;
    font-size: 1em;
    line-height: 1.5;
    text-shadow: none;
}

/* Модификаторы */
.modal-modifiers {
    margin-bottom: 20px;
    background: rgba(231, 213, 202, 0.2);
    border-radius: 20px;
    padding: 15px;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(210, 182, 163, 0.3);
}

.modal-modifier-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    padding: 12px;
    background: rgba(231, 213, 202, 0.2);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(210, 182, 163, 0.3);
}

.modal-modifier-tab {
    background: rgba(231, 213, 202, 0.5) !important;
    border: 2px solid rgba(210, 182, 163, 0.5) !important;
    color: #000000 !important;
    font-size: 1em !important;
    font-weight: 700 !important;
    padding: 10px 20px !important;
    border-radius: 30px !important;
    cursor: pointer !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative !important;
    overflow: hidden !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    text-shadow: none !important;
}

.modal-modifier-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

.modal-modifier-tab:hover::before {
    left: 100%;
}

.modal-modifier-tab.active {
    background: #e7d5ca !important;
    color: #000000 !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2) !important;
    border-color: rgba(210, 182, 163, 0.7) !important;
    transform: translateY(-3px) !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
}

.modal-modifier-tab:hover {
    background: #d2b6a3 !important;
    color: #000000;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    border-color: rgba(210, 182, 163, 0.7);
}

.modal-modifier-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding: 12px;
    background: rgba(231, 213, 202, 0.15);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(210, 182, 163, 0.2);
}

.modal-modifier-option {
    background: rgba(231, 213, 202, 0.6) !important;
    border: 2px solid rgba(210, 182, 163, 0.5) !important;
    border-radius: 18px !important;
    padding: 12px 16px !important;
    color: #000000 !important;
    font-size: 0.9em !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    position: relative !important;
    overflow: hidden !important;
    min-width: 120px !important;
    text-align: center !important;
    text-shadow: none !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
    white-space: nowrap !important;
}

.modal-modifier-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.modal-modifier-option:hover::before {
    left: 100%;
}

.modal-modifier-option:hover {
    background: #d2b6a3 !important;
    border-color: rgba(210, 182, 163, 0.7);
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.modal-modifier-option.selected {
    background: #e7d5ca !important;
    border-color: rgba(210, 182, 163, 0.8) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25) !important;
    transform: translateY(-3px) !important;
}

.modal-modifier-option.selected::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 0.8em;
    color: #000000;
    font-weight: bold;
}

/* Селектор количества */
.modal-quantity {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(231, 213, 202, 0.3);
    border-radius: 25px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid rgba(210, 182, 163, 0.5);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.modal-quantity-btn {
    width: 45px !important;
    height: 45px !important;
    border: none !important;
    border-radius: 50% !important;
    background: #e7d5ca !important;
    color: #000000 !important;
    font-size: 1.5em !important;
    font-weight: bold !important;
    cursor: pointer !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    border: 2px solid rgba(210, 182, 163, 0.6) !important;
    position: relative !important;
    overflow: hidden !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
    text-shadow: none !important;
}

.modal-quantity-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.modal-quantity-btn:hover::before {
    left: 100%;
}

.modal-quantity-btn:hover {
    background: #d2b6a3 !important;
    transform: scale(1.15);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border-color: rgba(210, 182, 163, 0.8);
}

.modal-quantity-btn:active {
    transform: scale(0.95);
}

.modal-quantity-display {
    font-size: 1.8em !important;
    font-weight: 900 !important;
    color: #000000 !important;
    text-shadow: none !important;
    min-width: 60px !important;
    text-align: center !important;
    background: rgba(255, 255, 255, 0.8) !important;
    padding: 12px 20px !important;
    border-radius: 20px !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    border: 2px solid rgba(210, 182, 163, 0.3) !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important;
}

/* Кнопка добавления в корзину */
.modal-add-to-cart {
    width: 100% !important;
    background: #e7d5ca !important;
    border: none !important;
    border-radius: 25px !important;
    padding: 25px 35px !important;
    color: #000000 !important;
    font-size: 1.3em !important;
    font-weight: 800 !important;
    cursor: pointer !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2) !important;
    position: relative !important;
    overflow: hidden !important;
    text-shadow: none !important;
    letter-spacing: 1px !important;
    border: 2px solid rgba(210, 182, 163, 0.3) !important;
    line-height: 1.2 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 60px !important;
}



.modal-add-to-cart::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s ease;
}

.modal-add-to-cart:hover::before {
    left: 100%;
}

.modal-add-to-cart:hover {
    background: #d2b6a3 !important;
    transform: translateY(-5px);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.3);
    border-color: rgba(210, 182, 163, 0.5);
}

.modal-add-to-cart:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.modal-add-to-cart:disabled {
    background: #cccccc !important;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    color: #666666 !important;
}

/* Кнопка "Назад" */
.modal-back-btn {
    width: 100% !important;
    background: rgba(231, 213, 202, 0.5) !important;
    border: 2px solid rgba(210, 182, 163, 0.5) !important;
    border-radius: 20px !important;
    padding: 18px 30px !important;
    color: #000000 !important;
    font-size: 1.1em !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1) !important;
    position: relative !important;
    overflow: hidden !important;
    text-shadow: none !important;
    letter-spacing: 0.5px !important;
    margin-top: 15px !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    line-height: 1.2 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 50px !important;
}

.modal-back-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.modal-back-btn:hover::before {
    left: 100%;
}

.modal-back-btn:hover {
    background: #d2b6a3 !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border-color: rgba(210, 182, 163, 0.7);
}

/* Анимации для модального окна */
@keyframes modalSlideIn {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-screen.visible {
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Контент вкладок модификаторов */
.modal-modifier-tab-content {
    display: none;
}

.modal-modifier-tab-content.active {
    display: block;
}

.modifier-placeholder {
    color: rgba(0, 0, 0, 0.5);
    text-align: center;
    font-style: italic;
    margin: 20px 0;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .modal-screen {
        border-top-left-radius: 25px;
        border-top-right-radius: 25px;
        transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    }
    
    .modal-header {
        height: 35vh;
    }
    
    #cart-fab {
        width: 60px;
        height: 60px;
        bottom: 15px;
        right: 15px;
    }
    
    .cart-fab-badge {
        width: 26px;
        height: 26px;
        min-width: 26px;
        min-height: 26px;
        font-size: 0.8em;
        top: -6px;
        right: -6px;
    }
    
    .cart-fab-icon svg {
        width: 24px;
        height: 24px;
    }
    
    .cart-item {
        gap: 10px;
        padding: 10px;
    }
    
    .cart-item-image {
        width: 55px;
        height: 55px;
    }
    
    .cart-item-name {
        font-size: 0.95em;
        line-height: 1.2;
        margin-bottom: 2px;
    }
    
    .cart-item-mods {
        font-size: 0.8em;
        line-height: 1.1;
    }
    
    .cart-item-controls {
        gap: 6px;
    }
    
    .cart-item-quantity-controls {
        gap: 6px;
    }
    
    .cart-item-quantity-controls button {
        width: 26px;
        height: 26px;
        font-size: 1em;
    }
    
    .cart-item-quantity-display {
        font-size: 0.9em;
        min-width: 18px;
    }
    
    .cart-item-price {
        font-size: 1.1em;
    }
    
    .cart-item-remove {
        width: 26px;
        height: 26px;
        font-size: 1em;
    }
    
    .modal-modifiers {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .modal-modifier-tabs {
        gap: 10px;
        padding: 12px;
    }
    
    .modal-modifier-tab {
        padding: 10px 18px;
        font-size: 1em;
    }
    
    .modal-modifier-options {
        gap: 10px;
        padding: 12px;
    }
    
    .modal-modifier-option {
        min-width: 100px;
        padding: 12px 16px;
        font-size: 0.9em;
    }
    
    .modal-quantity {
        gap: 15px;
        padding: 15px;
    }
    
    .modal-quantity-btn {
        width: 45px;
        height: 45px;
        font-size: 1.5em;
    }
    
    .modal-quantity-display {
        font-size: 1.8em;
        padding: 12px 20px;
        min-width: 60px;
    }
    
    .modal-add-to-cart {
        padding: 20px 25px;
        font-size: 1.2em;
        min-height: 55px;
    }
    
    .modal-back-btn {
        padding: 15px 25px;
        font-size: 1em;
        margin-top: 12px;
        min-height: 45px;
    }
}

@media (max-width: 480px) {
    .modal-screen {
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }
    
    .modal-header {
        height: 30vh;
    }
    
    #cart-fab {
        width: 55px;
        height: 55px;
        bottom: 12px;
        right: 12px;
    }
    
    .cart-fab-badge {
        width: 24px;
        height: 24px;
        min-width: 24px;
        min-height: 24px;
        font-size: 0.75em;
        top: -5px;
        right: -5px;
    }
    
    .cart-fab-icon svg {
        width: 22px;
        height: 22px;
    }
    
    .cart-item {
        gap: 8px;
        padding: 8px;
    }
    
    .cart-item-image {
        width: 50px;
        height: 50px;
    }
    
    .cart-item-name {
        font-size: 0.9em;
        line-height: 1.1;
        margin-bottom: 1px;
    }
    
    .cart-item-mods {
        font-size: 0.7em;
        line-height: 1.0;
    }
    
    .cart-item-controls {
        gap: 4px;
    }
    
    .cart-item-quantity-controls {
        gap: 4px;
    }
    
    .cart-item-quantity-controls button {
        width: 24px;
        height: 24px;
        font-size: 0.9em;
    }
    
    .cart-item-quantity-display {
        font-size: 0.85em;
        min-width: 16px;
    }
    
    .cart-item-price {
        font-size: 1em;
    }
    
    .cart-item-remove {
        width: 24px;
        height: 24px;
        font-size: 0.9em;
    }
    
    .modal-modifiers {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .modal-modifier-tabs {
        gap: 8px;
        padding: 10px;
    }
    
    .modal-modifier-tab {
        padding: 8px 14px;
        font-size: 0.9em;
    }
    
    .modal-modifier-options {
        gap: 8px;
        padding: 10px;
    }
    
    .modal-modifier-option {
        min-width: 90px;
        padding: 10px 14px;
        font-size: 0.85em;
    }
    
    .modal-quantity {
        gap: 12px;
        padding: 12px;
    }
    
    .modal-quantity-btn {
        width: 40px;
        height: 40px;
        font-size: 1.3em;
    }
    
    .modal-quantity-display {
        font-size: 1.5em;
        padding: 10px 18px;
        min-width: 50px;
    }
    
    .modal-add-to-cart {
        padding: 18px 20px;
        font-size: 1.1em;
        min-height: 50px;
    }
    
    .modal-back-btn {
        padding: 12px 20px;
        font-size: 0.9em;
        margin-top: 10px;
        min-height: 40px;
    }
}

/* Старые стили модификаторов удалены - теперь используются новые классы modal-modifier-* */

/* Старые стили удалены - теперь используются новые классы modal-quantity, modal-add-to-cart, modal-back-btn */

/* --- Стили для плавающей кнопки корзины --- */
#cart-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 65px;
    height: 65px;
    background: #e7d5ca;
    color: #000000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 999;
    border: 2px solid rgba(0, 0, 0, 0.1);
    overflow: visible;
    font-weight: 600;
    will-change: transform, bottom;
}

#cart-fab::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%, rgba(0,0,0,0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 50%;
}

#cart-fab:hover::before {
    opacity: 1;
}

#cart-fab:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    background: #d2b6a3;
}

#cart-fab.cart-fab-hidden {
    transform: scale(0);
    opacity: 0;
}

.cart-fab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 2;
    color: #000000;
}

.cart-fab-icon svg {
    width: 28px;
    height: 28px;
    stroke-width: 2;
}

.cart-fab-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #d2b6a3;
    color: #000000;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 800;
    font-size: 0.85em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(0, 0, 0, 0.1);
    animation: pulse 2s infinite;
    z-index: 3;
    min-width: 28px;
    min-height: 28px;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* --- Стили для экрана корзины --- */
.screen-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 15px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
    background: #ffffff;
    backdrop-filter: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.screen-header h2 {
    margin: 0;
    color: white;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.6);
    font-size: 1.5em;
    font-weight: 600;
}

#back-to-catalog-btn {
    position: absolute;
    left: 15px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 10px 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

#back-to-catalog-btn:hover {
    transform: translateY(-2px);
    border-color: var(--gold);
    box-shadow: 0 4px 15px rgba(218, 165, 32, 0.4);
}

#cart-items-container {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    backdrop-filter: blur(10px);
    padding: 12px;
    border-radius: 16px;
    border: 2px solid rgba(255,255,255,0.1);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.cart-item:hover {
    transform: translateY(-2px);
    border-color: rgba(218, 165, 32, 0.3);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.cart-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 12px;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.2);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.cart-item-details {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cart-item-name {
    font-weight: 600;
    font-size: 1.1em;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
    white-space: normal;
    line-height: 1.3;
    margin-bottom: 3px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.cart-item-mods {
    font-size: 0.85em;
    color: rgba(255,255,255,0.8);
    list-style: none;
    padding: 0;
    margin: 0;
    white-space: normal;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.cart-item-quantity {
    font-weight: 500;
    color: var(--gold);
}

.cart-item-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
    min-width: 0;
}

.cart-item-price {
    font-weight: 700;
    font-size: 1.2em;
    color: var(--white);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
    flex-shrink: 0;
    text-align: right;
}

.cart-item-quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.cart-item-quantity-controls button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    color: white;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.cart-item-quantity-controls button:hover {
    transform: scale(1.1);
    border-color: var(--gold);
    box-shadow: 0 4px 15px rgba(218, 165, 32, 0.4);
}

.cart-item-quantity-display {
    font-weight: 600;
    font-size: 1.1em;
    min-width: 25px;
    text-align: center;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
}

.cart-item-remove {
    background: linear-gradient(135deg, #ff4757 0%, #ff3742 100%);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    color: white;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.cart-item-remove:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.4);
}

/* --- Cart Screen Enhancements --- */
#cart-screen {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.1) 0%, rgba(218, 165, 32, 0.1) 100%);
    backdrop-filter: blur(10px);
}

.order-comment-section {
    margin-bottom: 15px;
    padding: 0 15px;
}

.order-comment-section label {
    display: block;
    font-size: 1em;
    font-weight: 500;
    margin-bottom: 8px;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
}

#order-comment {
    width: 100%;
    min-height: 80px;
    padding: 15px;
    border-radius: 12px;
    border: 2px solid rgba(255,255,255,0.2);
    font-family: 'Montserrat', sans-serif;
    font-size: 1em;
    resize: vertical;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    color: white;
    transition: all 0.3s ease;
}

#order-comment:focus {
    outline: none;
    border-color: var(--gold);
    background: rgba(255,255,255,0.15);
    box-shadow: 0 0 20px rgba(218, 165, 32, 0.3);
}

#order-comment::placeholder {
    color: rgba(255,255,255,0.7);
}

#cart-screen footer {
    padding: 20px 15px;
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
    backdrop-filter: none;
    margin-top: auto;
    flex-shrink: 0;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.04);
}

.cart-total-section {
    display: flex;
    justify-content: space-between;
    font-size: 1.3em;
    font-weight: 700;
    margin-bottom: 20px;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
}

.checkout-button {
    width: 100%;
    background: linear-gradient(135deg, var(--gold) 0%, #FFA500 100%);
    color: #333;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 12px;
    padding: 15px 20px;
    font-size: 1.2em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    text-shadow: 1px 1px 2px rgba(255,255,255,0.3);
}

.checkout-button:hover {
    transform: translateY(-2px);
    border-color: rgba(255,255,255,0.5);
    box-shadow: 0 8px 25px rgba(218, 165, 32, 0.4);
}

.checkout-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(218, 165, 32, 0.3);
}

.confirmation-screen {
    justify-content: center;
    align-items: center;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
}

.confirmation-screen h2 {
    font-size: 2em;
    margin-bottom: 10px;
}

.confirmation-screen p {
    font-size: 1.2em;
    margin-bottom: 30px;
}

#toast-container {
    position: fixed;
    bottom: 90px; /* Выше плавающей кнопки корзины */
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}





/* ===== UNIFIED ADMIN PANEL DESIGN SYSTEM ===== */
/* 
 * Consistent styling for all admin panel elements
 * - Unified color scheme
 * - Consistent spacing and typography
 * - Standardized component styles
 */

/* Base admin container */
.admin-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.15) 0%, rgba(218, 165, 32, 0.15) 100%);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Unified header styles */
.admin-header,
.admin-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.25) 0%, rgba(218, 165, 32, 0.25) 100%);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.admin-header h1,
.admin-settings-header h2 {
    margin: 0;
    font-size: 2em;
    font-weight: 700;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.admin-settings-header h2 {
    font-size: 1.8em;
}

/* Unified button styles for admin panel */
.admin-actions .btn,
#back-to-menu-btn,
.modal-actions .btn,
.item-actions .btn,
#add-category-btn,
#add-modifier-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    margin-left: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    color: white;
}

.admin-actions .btn:hover,
#back-to-menu-btn:hover,
.modal-actions .btn:hover,
.item-actions .btn:hover,
#add-category-btn:hover,
#add-modifier-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

/* Unified button color variants */
.btn-primary { 
    background: linear-gradient(135deg, #007aff 0%, #5856d6 100%);
}

.btn-success { 
    background: linear-gradient(135deg, #34c759 0%, #30d158 100%);
}

.btn-secondary { 
    background: linear-gradient(135deg, #8e8e93 0%, #636366 100%);
}

.btn-danger { 
    background: linear-gradient(135deg, #ff3b30 0%, #ff453a 100%);
}

.btn-info { 
    background: linear-gradient(135deg, #5ac8fa 0%, #64d2ff 100%);
}

.btn-warning { 
    background: linear-gradient(135deg, #ff9500 0%, #ff9f0a 100%);
}

/* Back button specific styling */
#back-to-menu-btn {
    flex-shrink: 0;
    font-size: 0.9em;
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
}

.admin-grid {
    margin: 0 -1.5%;
}
.admin-grid::after {
    content: "";
    display: table;
    clear: both;
}

.item-card {
    float: left;
    width: 30.33%;
    margin: 0 1.5% 15px 1.5%;
    background: var(--card-background);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    cursor: grab;
    border: none;
    position: relative; /* For actions overlay */
    will-change: transform;
    transition: none;
}

.item-card:active {
    cursor: grabbing;
}

.item-card .item-card-actions {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    padding: 5px;
    display: flex;
    gap: 5px;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.btn-icon img {
    width: 20px;
    height: 20px;
}

/* SortableJS helper classes - оптимизированные для производительности */
.sortable-ghost {
    opacity: 0.3;
    background: rgba(218, 165, 32, 0.2);
    transform: rotate(2deg);
    transition: none;
    will-change: transform;
}

.sortable-chosen {
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: none;
    will-change: transform;
}

/* Отключаем тяжелые анимации при перетаскивании */
.sortable-ghost *,
.sortable-chosen * {
    transition: none !important;
    animation: none !important;
}

/* Оптимизация для мобильных устройств */
@media (max-width: 768px) {
    .sortable-ghost {
        opacity: 0.2;
        transform: rotate(1deg);
    }
    
    .sortable-chosen {
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    }
    
    /* Дополнительные оптимизации для перетаскивания на мобильных */
    .item-card {
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
    }
    
    .product-card {
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
    }
    
    /* Отключаем тяжелые эффекты при перетаскивании */
    .sortable-ghost .product-card::before,
    .sortable-chosen .product-card::before {
        display: none;
    }
    
    .sortable-ghost .product-card .product-info::before,
    .sortable-chosen .product-card .product-info::before {
        display: none;
    }
}

/* --- Modal Styles --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
}

/* Unified modal content styling */
.modal-overlay .modal-content {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.15) 0%, rgba(218, 165, 32, 0.15) 100%);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Unified modal headings */
.modal-content h2,
.modal-content h3,
.modal-content h4 {
    margin-top: 0;
    margin-bottom: 20px;
    flex-shrink: 0;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    font-weight: 600;
}

.modal-content h2 {
    font-size: 1.8em;
}

.modal-content h3 {
    font-size: 1.5em;
}

.modal-content h4 {
    font-size: 1.2em;
}

#item-form, .tab-content {
    overflow-y: auto; /* Включаем прокрутку для контента */
    padding-right: 15px; /* Отступ для полосы прокрутки */
}

#item-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Unified form input styling */
#item-form input, #item-form textarea, #item-form select,
#category-form input, #category-form textarea, #category-form select,
#modifier-form input, #modifier-form textarea, #modifier-form select {
    width: 100%;
    padding: 12px;
    border: 2px solid rgba(139, 69, 19, 0.3);
    border-radius: 8px;
    font-size: 1em;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.9);
    color: #2c2c2c;
    transition: all 0.3s ease;
}

#item-form input:focus, #item-form textarea:focus, #item-form select:focus,
#category-form input:focus, #category-form textarea:focus, #category-form select:focus,
#modifier-form input:focus, #modifier-form textarea:focus, #modifier-form select:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.2);
}

#item-form textarea {
    min-height: 120px;
    resize: vertical;
}

/* Unified modal actions */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 20px;
    flex-shrink: 0;
}

.modal-actions .btn {
    min-width: 120px;
}

/* --- Styles for NEW Settings Modal --- */

/* Unified list container styling */
.list-container {
    max-height: 450px;
    overflow-y: auto;
    border: 2px solid rgba(139, 69, 19, 0.2);
    border-radius: 12px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

/* Unified list item styling */
.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 5px;
    transition: all 0.3s ease;
}

.list-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.list-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.list-item span {
    font-weight: 500;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Unified item actions button styling */
.item-actions .btn {
    margin-left: 8px;
    padding: 8px 16px;
    font-size: 0.9em;
    border-radius: 8px;
}

/* Unified checkbox list styling */
.checkbox-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

.checkbox-list label {
    display: block;
    margin-bottom: 10px;
    cursor: pointer;
    padding: 8px;
    color: white;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.checkbox-list label:hover {
    background: rgba(255, 255, 255, 0.1);
}

.checkbox-list input[type="checkbox"] {
    margin-right: 8px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.form-group input[type="text"],
.form-group input[type="number"] {
    width: 100%;
    padding: 12px;
    border: 2px solid rgba(139, 69, 19, 0.3);
    border-radius: 8px;
    font-size: 1em;
    background: rgba(255, 255, 255, 0.9);
    color: #2c2c2c;
    transition: all 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.2);
}

/* --- Стили для вкладки Администрирование --- */

.modal-content.wide {
    max-width: 800px;
}

.modal-header-tabs {
    display: flex;
    gap: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 20px;
    flex-shrink: 0;
    padding-bottom: 5px;
}

.modal-header-tabs .tab-link {
    padding: 12px 16px;
    margin-bottom: -1px;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 1.1em;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: none;
    transition: all 0.3s ease;
    border-radius: 8px 8px 0 0;
    background: rgba(255, 255, 255, 0.05);
}

.modal-header-tabs .tab-link:hover {
    color: rgba(255, 255, 255, 0.95);
    background: rgba(255, 255, 255, 0.1);
    text-shadow: none;
}

.modal-header-tabs .tab-link.active {
    color: white;
    border-bottom-color: rgba(218, 165, 32, 0.6);
    background: rgba(255, 255, 255, 0.15);
    text-shadow: none;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

#add-category-btn {
    font-size: 14px;
    width: auto;
    height: auto;
    line-height: 1.2;
    text-align: center;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    padding: 12px 20px;
    color: white;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    border: 2px solid rgba(218, 165, 32, 0.3);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

#add-category-btn::before {
    content: '+';
    font-size: 18px;
    font-weight: bold;
    color: var(--gold);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

#add-category-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

#add-category-btn:hover::after {
    left: 100%;
}

#add-category-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent) 100%);
    border-color: rgba(218, 165, 32, 0.6);
}

#add-category-btn:active {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.btn-small { 
    padding: 5px 10px;
    font-size: 0.9em;
}

.form-actions-split {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}

.inline-form {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.inline-form input {
    flex-grow: 1;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-radius: 8px;
    background-color: #f9f9f9;
    margin-bottom: 10px;
}

.category-list-item {
    cursor: pointer;
    background: var(--background-gray);
    color: var(--primary-color);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 8px;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-shadow: none;
}

.category-list-item:hover {
    background: var(--background-gray);
    transform: translateX(3px);
    box-shadow: none;
}

.category-list-item.active {
    background: var(--background-gray);
    font-weight: 700;
    color: var(--primary-color);
    border: none;
    box-shadow: none;
    transform: translateX(5px);
}

#modifiers-list .list-item {
    cursor: grab;
}

#modifiers-list .list-item > span {
    flex-basis: 70%;
}

#modifier-form {
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 12px;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#modifier-form h4 {
    margin: 0;
}

.category-section {
    background-color: transparent;
    border-radius: 0;
    padding: 0;
    margin-bottom: 20px;
    box-shadow: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-section:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.category-section > div[id^="category-"] {
    scroll-margin-top: 80px; /* Отступ для скролла */
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
    cursor: default;
    pointer-events: none;
}

.category-header:hover {
    background-color: transparent;
}

.category-ghost {
    opacity: 0.5;
    background: #e0e0e0;
    transform: rotate(2deg);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.category-rename-input {
    flex-grow: 1;
    border: none;
    background: transparent;
    font-size: 1em;
    padding: 5px;
}
.category-rename-input:focus {
    outline: none;
    background: #eef;
    border-radius: 4px;
}

.filters-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.btn-filter {
    padding: 8px 16px;
    border: 1px solid #e0e0e0;
    background: #f9f9f9;
    color: #333;
    border-radius: 20px;
    cursor: pointer;
}

.btn-filter.active {
    background-color: var(--accent);
    color: white;
    border-color: var(--accent);
}

.categories-settings-layout {
    display: flex;
    gap: 20px;
}

.categories-column {
    flex: 1;
    border-right: 1px solid #e0e0e0;
    padding-right: 20px;
}

.category-editor-column {
    flex: 2;
}

#category-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#category-modifiers-list {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    padding: 10px;
    border-radius: 8px;
}

#category-modifiers-list label {
    display: block;
    margin-bottom: 8px;
}

/* --- Стили для вкладки Администрирование --- */
#broadcast-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#broadcast-form textarea {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    border: 2px solid rgba(139, 69, 19, 0.2);
    border-radius: 12px;
    resize: vertical;
    background: rgba(255, 255, 255, 0.9);
    color: #2c2c2c;
    font-size: 1em;
    font-family: inherit;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#broadcast-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.2);
    background: rgba(255, 255, 255, 1);
}

#users-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.user-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    border-color: rgba(218, 165, 32, 0.3);
}

.user-info {
    font-size: 1em;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.user-info span {
    display: block;
    margin-bottom: 2px;
}

.user-info .username {
    font-weight: 600;
    font-size: 1.1em;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.user-actions .btn {
    padding: 10px 20px;
    font-size: 0.9em;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.user-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* --- Admin Section Headers --- */
.admin-section-header {
    margin: 30px 0 20px 0;
    padding: 15px 20px;
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.25) 0%, rgba(218, 165, 32, 0.25) 100%);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.admin-section-header h2 {
    margin: 0;
    font-size: 1.6em;
    font-weight: 600;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.admin-section-header h3 {
    margin: 5px 0 0 0;
    font-size: 1.1em;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* --- Стили для личного кабинета и истории заказов --- */

.container {
    max-width: 800px;
    margin: 0 auto;
    background-color: rgba(28, 28, 30, 0.8); /* Полупрозрачный фон */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    min-height: 100vh;
}

#no-orders-message {
    text-align: center;
    padding: 50px 20px;
    color: #fff;
}

#no-orders-message p {
    font-size: 1.2em;
    margin-bottom: 25px;
}

#no-orders-message .btn {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    color: white;
    padding: 12px 25px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(139, 69, 19, 0.3);
}

#no-orders-message .btn:hover {
    background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(139, 69, 19, 0.5);
}

.header {
    display: flex;
    align-items: center;
    padding: 15px;
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.2) 0%, rgba(210, 105, 30, 0.1) 100%);
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid rgba(139, 69, 19, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.back-button {
    margin-right: 15px;
}

.header h1 {
    margin: 0;
    font-size: 1.2em;
    color: white;
    flex-grow: 1;
    text-align: center;
    transform: translateX(-24px); /* Смещаем для центрирования, компенсируя кнопку */
}


#user-info {
    padding: 20px 15px;
    text-align: center;
}

#user-photo {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 3px solid var(--accent);
    margin-bottom: 15px;
    box-shadow: 0 0 15px rgba(0, 122, 255, 0.5);
}

#username {
    font-size: 1.6em;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

#order-history {
    padding: 20px 15px;
}

#order-history-list {
    display: grid;
    gap: 20px;
}

.order-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid rgba(210, 182, 163, 0.4);
}

.order-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    border-color: rgba(210, 182, 163, 0.6);
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(210, 182, 163, 0.4);
}

.order-card-id {
    font-size: 1.1em;
    font-weight: bold;
    color: #000000 !important;
}

.order-card-date {
    font-size: 0.9em;
    color: #555555;
}

.order-card-items {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.order-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid rgba(210, 182, 163, 0.3);
}
.order-item:last-child {
    border-bottom: none;
}

.order-item-image {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    margin-right: 15px;
    object-fit: cover;
}

.order-item-details {
    flex-grow: 1;
    min-width: 0; /* Позволяет flex-элементу сжиматься */
    overflow: hidden; /* Скрывает переполнение */
}

.order-item-name {
    font-weight: 600;
    color: #000000 !important;
    margin: 0 0 5px 0;
    font-size: 1em;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.order-item-mods {
    font-size: 0.85em;
    color: #555555;
    list-style: none;
    padding: 0;
    margin: 0;
}

.order-item-price {
    font-size: 1.1em;
    font-weight: bold;
    color: #000000 !important;
    text-align: right;
}

.order-card-footer {
    padding-top: 15px;
    margin-top: 15px;
    border-top: 1px solid rgba(210, 182, 163, 0.4);
}

.order-card-total {
    color: #000000 !important;
    text-align: right;
    font-size: 1.2em;
    font-weight: bold;
}




.error-message {
    text-align: center;
    padding: 20px;
    color: var(--danger);
}

/* --- АДАПТИВНЫЕ СТИЛИ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ --- */
@media (max-width: 768px) {

    /* --- Общие изменения --- */
    body {
        -webkit-text-size-adjust: 100%; /* Предотвращает авто-увеличение шрифта в Safari */
        overflow-x: hidden; /* Предотвращаем горизонтальный скролл */
        position: relative; /* Для правильного позиционирования */
    }

    .admin-container, #product-catalog {
        padding: 10px; /* Уменьшаем отступы на мобильных */
    }

    /* --- Админ-панель --- */
    .admin-header {
        position: relative; /* Добавляем для z-index */
        z-index: 10; /* Поднимаем шапку над остальным контентом */
        flex-direction: column; /* Складываем шапку в столбик */
        align-items: flex-start;
        gap: 15px;
    }

    .admin-header h1 {
        font-size: 1.5em;
    }

    .admin-actions {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .admin-actions .btn {
        width: 100%; /* Кнопки на всю ширину */
        margin-left: 0; /* Убираем отступ */
        padding: 12px;
        box-sizing: border-box;
    }

    /* Убедимся, что основная сетка админ-панели всегда в одну колонку на мобильных */
    #categories-container.admin-categories-grid {
        grid-template-columns: 1fr; 
        gap: 15px;
        align-items: start;
    }

    /* --- Клиентская часть --- */
    .greeting { 
        font-size: 1.8em; 
        padding: 3px 0;
    }
    .greeting::before {
        width: 40px;
        height: 2px;
    }

    .product-card {
        width: 31%; /* Три колонки на мобильных */
        margin: 0 1% 15px 1%;
        float: left;
    }

    /* --- Адаптивные стили для истории заказов --- */
    .order-item-name {
        font-size: 0.9em;
        -webkit-line-clamp: 2;
    }

    .order-item {
        padding: 12px 0;
    }

    .order-item-image {
        width: 50px;
        height: 50px;
        margin-right: 12px;
    }

    .modal-header { height: 30vh; }
    .modal-title { font-size: 1.5em; }
    /* Старые стили modal-footer удалены */
}

/* Стили для контейнера с категориями в админ панели */
#mainContainer {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 200px;
}

/* Стили для модального окна сортировки категорий */
.category-sort-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #f9f9f9;
}

.category-sort-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
    cursor: grab;
    transition: background-color 0.2s ease;
}

.category-sort-item:last-child {
    border-bottom: none;
}

.category-sort-item:hover {
    background-color: #e0e0e0;;
}

.category-sort-item:active {
    cursor: grabbing;
}

.category-sort-handle {
    font-size: 1.2em;
    color: #999;
    margin-right: 15px;
    cursor: grab;
    user-select: none;
}

.category-sort-name {
    flex: 1;
    font-weight: 600;
    font-size: 1.1em;
    color: #333;
}

.category-sort-count {
    color: #666;
    font-size: 0.9em;
    background: #e8e8e8;
    padding: 4px 8px;
    border-radius: 12px;
    margin-left: 10px;
}

.category-sort-ghost {
    opacity: 0.5;
    background: #e0e0e0;
    transform: rotate(2deg);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Стили для кнопки сортировки категорий */
.category-sort-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
}

    .category-sort-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    }

    /* Адаптивные стили для мобильных устройств */
    @media (max-width: 768px) {
        .category-sort-list {
            max-height: 300px;
        }
        
        .category-sort-item {
            padding: 12px;
        }
        
        .category-sort-name {
            font-size: 1em;
        }
        
        .category-sort-count {
            font-size: 0.8em;
            padding: 3px 6px;
        }
        
        .category-sort-btn {
            font-size: 0.9em;
            padding: 12px 16px;
        }
    }



/* Dropdown Menu */
.user-profile {
    position: relative;
    cursor: pointer;
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 50px;
    right: 0;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
    z-index: 1000;
    width: 180px;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    font-size: 16px;
}

.dropdown-menu a:hover {
    background-color: #e0e0e0;;
}

.dropdown-menu .logout-btn {
    color: var(--danger);
}

.dropdown-menu .logout-btn:hover {
    background-color: #ffebee;
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -5px;
    right: 15px;
    width: 10px;
    height: 10px;
    background-color: white;
    transform: rotate(45deg);
    z-index: -1;
}

/* --- Адаптивные стили для очень маленьких экранов --- */
@media (max-width: 480px) {
    .product-card {
        width: 48%; /* Две колонки на очень маленьких экранах */
        margin: 0 1% 15px 1%;
    }

    /* --- Стили для очень маленьких экранов --- */
    .order-item-name {
        font-size: 0.85em;
        -webkit-line-clamp: 2;
    }

    .order-item {
        padding: 10px 0;
    }

    .order-item-image {
        width: 45px;
        height: 45px;
        margin-right: 10px;
    }

    .order-item-details {
        min-width: 0;
        flex: 1;
    }

    .order-item-name {
        word-break: break-word;
        hyphens: auto;
    }

    .order-card {
        padding: 15px;
    }

    .order-card-header {
        margin-bottom: 12px;
        padding-bottom: 12px;
    }
    
    /* --- Дополнительная адаптация панели администрирования для очень маленьких экранов --- */
    .admin-settings-header {
        padding: 10px;
        gap: 10px;
    }
    
    .admin-settings-header h2 {
        font-size: 1.2em;
        line-height: 1.1;
    }
    
    #back-to-menu-btn {
        padding: 8px 16px;
        font-size: 0.8em;
    }
}

/* --- Адаптация админ-панели и модальных окон --- */
@media (max-width: 768px) {
    /* --- Общие изменения --- */
    body {
        -webkit-text-size-adjust: 100%;
    }

    .admin-container, #product-catalog {
        padding: 10px;
    }

    /* --- Админ-панель --- */
    .admin-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .admin-header h1 {
        font-size: 1.5em;
        text-align: center;
        border-bottom: none;
        padding-bottom: 0;
    }

    .admin-actions {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .admin-actions .btn {
        width: 100%;
        margin-left: 0;
        padding: 12px;
        box-sizing: border-box;
    }

    #categories-container.admin-categories-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    /* --- Адаптация модального окна настроек --- */
    .modal-overlay.wide .modal-content {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
        padding: 15px;
    }

    .modal-header-tabs {
        gap: 8px;
        margin-bottom: 15px;
    }

    .modal-header-tabs .tab-link {
        font-size: 1em;
        padding: 10px 12px;
        border-radius: 6px;
    }

    .categories-settings-layout {
        flex-direction: column;
        gap: 20px;
    }

    .categories-column {
        border-right: none;
        padding-right: 0;
    }

    .filters-container {
        flex-wrap: wrap;
        gap: 8px;
    }

    .btn-filter {
        padding: 8px 12px;
        font-size: 0.9em;
    }

    #modifier-form {
        flex-direction: column;
        gap: 10px;
    }

    #modifier-form input {
        width: 100%;
    }

    /* --- Клиентская часть --- */
    .greeting { 
        font-size: 1.6em; 
        padding: 2px 0;
    }
    .greeting::before {
        width: 35px;
        height: 2px;
    }

    .product-card {
        width: 48%;
        margin: 0 1% 15px 1%;
    }

    .modal-header { height: 30vh; }
    .modal-title { font-size: 1.5em; }
    /* Старые стили modal-footer удалены */
    
    /* --- Адаптация панели администрирования --- */
    .admin-settings-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        padding: 15px;
    }
    
    .admin-settings-header h2 {
        font-size: 1.4em;
        word-wrap: break-word;
        hyphens: auto;
        line-height: 1.2;
        max-width: 100%;
    }
    
    #back-to-menu-btn {
        align-self: flex-start;
        padding: 10px 20px;
        font-size: 0.85em;
    }
}

/* === СИСТЕМА УВЕДОМЛЕНИЙ СИНХРОНИЗАЦИИ === */

#sync-notifications-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
    pointer-events: none;
}

/* === ИСПРАВЛЕНИЯ ДЛЯ АДМИН ПАНЕЛИ === */

/* Улучшенные стили модальных окон в админ панели */
.modal-overlay .modal-content {
    background: linear-gradient(135deg, rgba(45, 24, 16, 0.98) 0%, rgba(139, 69, 19, 0.95) 50%, rgba(218, 165, 32, 0.92) 100%);
    backdrop-filter: blur(15px);
    color: white;
    border: 2px solid rgba(218, 165, 32, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(218, 165, 32, 0.1);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

.modal-overlay .modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold) 0%, var(--accent-light) 50%, var(--gold) 100%);
    border-radius: 20px 20px 0 0;
}

/* Исправляем стили для всех модальных окон в админ панели */
.modal-overlay {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-overlay .modal-content {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.95) 0%, rgba(218, 165, 32, 0.95) 100%);
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border-radius: 15px;
}

/* Улучшенные стили заголовков в модальных окнах */
.modal-content h2, .modal-content h3, .modal-content h4 {
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    font-weight: 700;
    position: relative;
    margin-bottom: 25px;
    filter: none;
}

.modal-content h2 {
    font-size: 2.2em;
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(218, 165, 32, 0.4);
}

.modal-content h3 {
    font-size: 1.6em;
    color: var(--gold);
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.6);
}

.modal-content h4 {
    font-size: 1.3em;
    color: #f0f0f0;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

/* Улучшенные стили форм - комфортная темная тема */
#item-form input, #item-form textarea, #item-form select,
.modal-content input, .modal-content textarea, .modal-content select {
    border: 2px solid rgba(218, 165, 32, 0.3);
    background: linear-gradient(135deg, rgba(45, 24, 16, 0.9) 0%, rgba(139, 69, 19, 0.8) 100%);
    color: #f0f0f0;
    transition: all 0.3s ease;
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 15px;
    backdrop-filter: blur(5px);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

#item-form input:focus, #item-form textarea:focus, #item-form select:focus,
.modal-content input:focus, .modal-content textarea:focus, .modal-content select:focus {
    border-color: var(--gold);
    background: linear-gradient(135deg, rgba(45, 24, 16, 0.95) 0%, rgba(139, 69, 19, 0.9) 100%);
    box-shadow: 0 0 0 3px rgba(218, 165, 32, 0.3), inset 0 2px 4px rgba(0, 0, 0, 0.3);
    outline: none;
    transform: translateY(-1px);
    backdrop-filter: blur(2px);
}

#item-form input::placeholder, #item-form textarea::placeholder,
.modal-content input::placeholder, .modal-content textarea::placeholder {
    color: rgba(240, 240, 240, 0.6);
    font-style: italic;
}

/* Улучшенные стили списков */
.list-container {
    border: 2px solid rgba(218, 165, 32, 0.2);
    border-radius: 16px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(45, 24, 16, 0.4) 0%, rgba(139, 69, 19, 0.3) 100%);
    backdrop-filter: blur(15px);
    margin-bottom: 20px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
}

.list-item {
    border: 1px solid rgba(218, 165, 32, 0.2);
    border-radius: 12px;
    margin-bottom: 10px;
    padding: 16px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, rgba(45, 24, 16, 0.6) 0%, rgba(139, 69, 19, 0.4) 100%);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.list-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(218, 165, 32, 0.1), transparent);
    transition: left 0.6s ease;
}

.list-item:hover::before {
    left: 100%;
}

.list-item:last-child {
    margin-bottom: 0;
}

.list-item:hover {
    background: linear-gradient(135deg, rgba(45, 24, 16, 0.8) 0%, rgba(139, 69, 19, 0.6) 100%);
    transform: translateX(8px) translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(218, 165, 32, 0.3);
    border-color: rgba(218, 165, 32, 0.4);
}

.list-item span {
    color: #f0f0f0;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    font-weight: 600;
    font-size: 15px;
    position: relative;
    z-index: 1;
}

/* Улучшенные стили кнопок в списках */
.item-actions .btn {
    border-radius: 10px;
    border: 2px solid rgba(218, 165, 32, 0.3);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.8) 0%, rgba(218, 165, 32, 0.6) 100%);
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.item-actions .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.item-actions .btn:hover::before {
    left: 100%;
}

.item-actions .btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, rgba(218, 165, 32, 0.8) 0%, rgba(139, 69, 19, 0.6) 100%);
    border-color: rgba(218, 165, 32, 0.6);
}

.item-actions .btn:active {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Мягкие стили табов (заменяют контрастные) */

/* Улучшенные стили лейблов */
.form-group label {
    color: var(--gold);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    font-weight: 700;
    margin-bottom: 12px;
    display: block;
    font-size: 16px;
    letter-spacing: 0.3px;
    position: relative;
    padding-left: 20px;
    filter: none;
}

.form-group label::before {
    content: '✦';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gold);
    font-size: 14px;
    text-shadow: 0 0 8px rgba(218, 165, 32, 0.5);
}

/* Исправляем стили полей ввода в формах */
.form-group input[type="text"], .form-group input[type="number"] {
    border: 2px solid rgba(139, 69, 19, 0.3);
    background: rgba(255, 255, 255, 0.9);
    color: #2c2c2c;
    transition: all 0.3s ease;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

.form-group input[type="text"]:focus, .form-group input[type="number"]:focus {
    border-color: var(--gold);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 3px rgba(218, 165, 32, 0.2);
    outline: none;
}

/* Исправляем стили кнопок в модальных окнах */
.modal-content .btn, .modal-actions .btn {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.modal-content .btn:hover, .modal-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent) 100%);
}

.modal-content .btn:active, .modal-actions .btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Улучшенные стили для чекбоксов */
.checkbox-list {
    background: linear-gradient(135deg, rgba(45, 24, 16, 0.4) 0%, rgba(139, 69, 19, 0.3) 100%);
    border: 2px solid rgba(218, 165, 32, 0.2);
    border-radius: 12px;
    padding: 16px;
    backdrop-filter: blur(10px);
}

.checkbox-list label {
    color: #f0f0f0;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, rgba(45, 24, 16, 0.3) 0%, rgba(139, 69, 19, 0.2) 100%);
    border: 1px solid rgba(218, 165, 32, 0.1);
    margin-bottom: 8px;
    position: relative;
    overflow: hidden;
}

.checkbox-list label::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(218, 165, 32, 0.1), transparent);
    transition: left 0.5s ease;
}

.checkbox-list label:hover::before {
    left: 100%;
}

.checkbox-list label:hover {
    background: linear-gradient(135deg, rgba(45, 24, 16, 0.6) 0%, rgba(139, 69, 19, 0.4) 100%);
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border-color: rgba(218, 165, 32, 0.3);
}

.checkbox-list input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--gold);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkbox-list input[type="checkbox"]:checked {
    transform: scale(1.1);
}

.sync-notification {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.95) 0%, rgba(218, 165, 32, 0.95) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
    overflow: hidden;
}

.sync-notification.show {
    transform: translateX(0);
}

.sync-notification-content {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    gap: 12px;
}

.sync-notification-icon {
    font-size: 1.5em;
    flex-shrink: 0;
    margin-top: 2px;
}

.sync-notification-message {
    flex: 1;
    color: white;
    font-size: 0.9em;
    line-height: 1.4;
}

.sync-notification-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2em;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.sync-notification-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Типы уведомлений */
.sync-notification-success {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.95) 0%, rgba(48, 209, 88, 0.95) 100%);
}

.sync-notification-warning {
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.95) 0%, rgba(255, 159, 10, 0.95) 100%);
}

.sync-notification-error {
    background: linear-gradient(135deg, rgba(255, 59, 48, 0.95) 0%, rgba(255, 69, 58, 0.95) 100%);
}

.sync-notification-info {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.95) 0%, rgba(88, 86, 214, 0.95) 100%);
}

/* Специальные стили для оффлайн предупреждений */
.offline-warning h4 {
    margin: 0 0 8px 0;
    font-size: 1em;
    font-weight: 600;
}

.offline-warning p {
    margin: 0 0 8px 0;
    font-size: 0.85em;
}

.offline-limits {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.offline-limits small {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8em;
}

/* Стили для подтверждения заказа */
.order-confirmation h4 {
    margin: 0 0 8px 0;
    font-size: 1em;
    font-weight: 600;
}

.order-confirmation p {
    margin: 0 0 6px 0;
    font-size: 0.85em;
}

.order-confirmation strong {
    color: #fff;
    font-weight: 600;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    #sync-notifications-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .sync-notification {
        margin-bottom: 8px;
    }
    
    .sync-notification-content {
        padding: 12px;
        gap: 10px;
    }
    
    .sync-notification-message {
        font-size: 0.85em;
    }
    
    .sync-notification-icon {
        font-size: 1.3em;
    }
}

/* ================= NEW COLOR SCHEME APPLIED ================= */
/* All theme overrides have been integrated into the main styles above */


