*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f6f7f2;
    color: #1b1b1b;
    line-height: 1.6;
    min-height: 100vh;
}
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 20px;
}
a { color: #2d6a4f; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Hero */
.hero {
    background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 50%, #40916c 100%);
    color: #fff;
    padding: 40px 0 36px;
    margin-bottom: 8px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: "🍎🍊🍋🍇🥝🍑🍒🍓🥬🥕🌽🫑";
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    font-size: 28px;
    letter-spacing: 12px;
    opacity: 0.12;
    white-space: nowrap;
    overflow: hidden;
    pointer-events: none;
}
.hero-photo {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 21 / 9;
    min-height: 200px;
    max-height: 60vh;
    background: #040404;
}
.hero-photo::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--bg-d, url('/static/hero.jpg')) var(--bg-p-d, center) / var(--bg-s-d, cover) no-repeat;
}
.hero-photo::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.08) 0%, rgba(0,0,0,0.25) 100%);
}

/* Hero contact */
.hero-contact {
    position: absolute;
    bottom: 12px;
    left: 12px;
    z-index: 2;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    background: rgba(27,67,50,0.75);
    padding: 8px 16px;
    border-radius: 10px;
    backdrop-filter: blur(4px);
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
@media (max-width: 768px) {
    .hero-contact {
        font-size: 0.9rem;
        padding: 6px 12px;
        bottom: 8px;
        left: 8px;
    }
}

/* News bar */
.news-bar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 20px;
    max-width: 1100px;
    margin: 0 auto;
}
.news-item {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-radius: 12px;
    padding: 16px 20px;
    color: #1b1b1b;
    box-shadow: 0 2px 8px rgba(245,158,11,0.25);
}
.news-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
    white-space: pre-wrap;
}
.news-content {
    font-size: 1rem;
    font-weight: 500;
    margin-top: 6px;
    opacity: 0.9;
    white-space: pre-wrap;
}
@media (max-width: 768px) {
    .news-bar { padding: 12px 14px; gap: 6px; }
    .news-item { padding: 12px 14px; }
    .news-title { font-size: 1rem; }
    .news-content { font-size: 0.9rem; }
}
@media (max-width: 480px) {
    .news-bar { padding: 10px 10px; }
    .news-item { padding: 10px 12px; }
    .news-title { font-size: 0.9rem; }
    .news-content { font-size: 0.82rem; }
}

.hero h1 {
    font-size: 2rem;
    font-weight: 700;
    position: relative;
}
.hero p {
    font-size: 1rem;
    opacity: 0.85;
    margin-top: 6px;
    position: relative;
}

/* Category badges */
.category-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Nav */
nav {
    background: #1b4332;
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-front {
    background: transparent;
    position: sticky;
    top: 0;
    padding: 4px 0;
    height: auto;
    left: auto;
    right: auto;
}
.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff !important;
    text-decoration: none !important;
}
.logo-icon { margin-right: 6px; }
.nav-links { display: flex; gap: 20px; align-items: center; }
.nav-links a { color: #a7d4b5; font-weight: 500; font-size: 0.9rem; }
.nav-links a:hover { color: #fff; text-decoration: none; }

.cart-link { position: relative; }
.cart-badge {
    background: #e76f51;
    color: #fff;
    font-size: 0.7rem;
    padding: 1px 7px;
    border-radius: 10px;
    position: absolute;
    top: -8px;
    right: -14px;
    font-weight: 600;
}

/* Floating social & cart buttons */
.float-group {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}
.float-btn {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    transition: transform .2s, box-shadow .2s;
    text-decoration: none !important;
    color: #fff !important;
    position: relative;
}
.float-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(0,0,0,0.3);
}
.float-btn:active {
    transform: scale(0.95);
}
.float-cart {
    background: linear-gradient(135deg, #2d6a4f, #40916c);
    font-size: 1.5rem;
}
.float-tg {
    background: linear-gradient(135deg, #1e96c8, #37aee2);
}
.float-max {
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
}
.float-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #e76f51;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    border-radius: 10px;
    padding: 0 5px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Main */
main { min-height: calc(100vh - 120px); }
.container { padding-bottom: 150px; }

/* Products grid (Ozon style) */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: 12px;
    margin-top: 8px;
}
.product-card {
    background: #fff;
    border: 1px solid #e8ece4;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: transform .2s, box-shadow .2s, border-color .2s;
    color: inherit;
    text-decoration: none;
}
.product-card .card-hint {
    margin-top: auto;
    padding: 10px 12px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #2d6a4f;
    text-align: center;
}
.product-card,
.product-card:hover,
.product-card:active,
.product-card:focus,
.product-card:visited {
    text-decoration: none !important;
    -webkit-tap-highlight-color: transparent;
}
.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0,0,0,0.10);
}
body.dark .product-card .card-hint { color: #f5a524; }

/* ===== Детальная страница товара ===== */
.back-link { display: inline-block; margin: 8px 0; color: #6b7280; font-size: 0.9rem; text-decoration: none; }
.back-link:hover { color: #2d6a4f; }
.product-detail { max-width: 760px; }
.detail-info h1 { font-size: 1.3rem; margin: 0 0 6px; }
.detail-description { color: #6b7280; margin: 8px 0; line-height: 1.45; font-size: 0.9rem; }
.detail-stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.stat-card { background: #f8f9f5; border: 1px solid #e8ece4; border-radius: 10px; padding: 7px 12px; display: flex; flex-direction: column; gap: 1px; }
.stat-label { font-size: 0.7rem; color: #6b7280; }
.stat-value { font-size: 1rem; font-weight: 700; color: #1b4332; }
.detail-info h2 { font-size: 0.95rem; margin: 12px 0 8px; }
.piece-list-detail { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.piece-row {
    display: flex; align-items: center; gap: 12px;
    border: 1px solid #d1d5db; border-radius: 12px; padding: 12px 14px;
    cursor: pointer; transition: border-color .15s, background .15s;
    background: #fff;
}
.piece-row:hover { border-color: #2d6a4f; background: #f0f7f2; }
.piece-row input[type=radio] { width: 20px; height: 20px; accent-color: #2d6a4f; flex-shrink: 0; }
.piece-row-main { display: flex; flex-direction: row; justify-content: space-between; align-items: center; gap: 8px; min-width: 0; width: 100%; }
.piece-row-title { font-weight: 600; color: #1b1b1b; font-size: 0.95rem; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.piece-row-sub { font-size: 0.85rem; color: #6b7280; line-height: 1.2; text-align: right; white-space: nowrap; }
.piece-price { font-weight: 700; color: #2d6a4f; }
.piece-section-title { font-size: 0.85rem; font-weight: 700; margin: 10px 0 6px; color: #1b4332; }
.piece-row-cooking { border-color: #f3d9a4; background: #fffbea; }
.piece-row-cool { border-color: #bae6fd; background: #f0f9ff; }
.piece-row-frozen { border-color: #ddd6fe; background: #f5f3ff; }
body.dark .piece-section-title { color: #f5f0e8; }
body.dark .piece-row-cool { border-color: rgba(56,189,248,0.35); background: rgba(56,189,248,0.07); }
body.dark .piece-row-frozen { border-color: rgba(167,139,250,0.35); background: rgba(167,139,250,0.07); }
.piece-row-occupied { opacity: 0.55; cursor: not-allowed; }
.piece-row-occupied:hover { border-color: #d1d5db; background: #fff; }
body.dark .detail-description, body.dark .piece-row-sub { color: #8b867e; }
body.dark .piece-price { color: #f5a524; }
body.dark .stat-card { background: #141419; border-color: #2a2a33; }
body.dark .stat-value { color: #86efac; }
body.dark .piece-row { background: #141419; border-color: #2a2a33; }
body.dark .piece-row-title { color: #e8e4df; }
body.dark .piece-row:hover { border-color: #f5a524; background: rgba(245,165,36,0.06); }
body.dark .piece-row-cooking { border-color: rgba(245,158,11,0.4); background: rgba(245,158,11,0.08); }
body.dark .piece-row-occupied:hover { border-color: #33333b; background: #141419; }
@media (max-width: 768px) {
    .modal-box { padding: 16px 10px 90px 10px; }
}
.product-photo {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #f0f1ec;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 16px 16px 0 0;
}
.product-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.photo-placeholder {
    font-size: 3rem;
    opacity: 0.4;
}
.card-discount {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #e11d48;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 8px;
    letter-spacing: 0.02em;
}
.product-card h3 {
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.35;
    color: #1b1b1b;
    margin: 10px 12px 0;
    overflow: hidden;
}
.product-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 12px 12px;
    margin-top: auto;
}
.price-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}
.product-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2d6a4f;
    line-height: 1.1;
}
.price-old {
    font-size: 0.78rem;
    color: #9ca3af;
    text-decoration: line-through;
}
.price-discount {
    font-size: 1.2rem;
    font-weight: 700;
    color: #c62828;
    line-height: 1.1;
}
.add-form .add-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}
.add-form .btn {
    flex: 1;
    padding: 8px 10px;
    font-size: 0.85rem;
    white-space: nowrap;
}
.qty-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.qty-wrap .qty-input {
    width: 64px;
    padding: 7px 26px 7px 8px;
    text-align: left;
    border: 1px solid #d4dbd0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
}
.qty-wrap .qty-input:focus {
    outline: none;
    border-color: #2d6a4f;
}
.qty-wrap .qty-input::-webkit-outer-spin-button,
.qty-wrap .qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.qty-wrap .qty-input {
    -moz-appearance: textfield;
    appearance: textfield;
}
.qty-unit {
    position: absolute;
    right: 8px;
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: 500;
    pointer-events: none;
    line-height: 1;
    user-select: none;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    border: 1px solid #d4dbd0;
    background: #fff;
    color: #1b1b1b;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none !important;
}
.btn:hover { background: #f0f7f2; border-color: #b7d8c0; }
.btn-primary {
    background: #2d6a4f;
    color: #fff;
    border-color: #2d6a4f;
}
.btn-primary:hover { background: #1b4332; }
.btn-primary-outline {
    background: transparent;
    color: #2d6a4f;
    border-color: #2d6a4f;
}
.btn-primary-outline:hover { background: #f0f7f2; }
.btn-danger { color: #d97706; border-color: #fde68a; }
.btn-danger:hover { background: #fffbeb; }
.btn-lg { padding: 12px 28px; font-size: 1rem; }
.btn-sm { padding: 5px 12px; font-size: 0.8rem; }

/* Search bar */
.search-bar { margin: 16px 0 4px; }
.search-form { display: flex; align-items: center; position: relative; max-width: 100%; }
.search-input {
    width: 100%;
    padding: 10px 40px 10px 14px;
    border: 1px solid #d4dbd0;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
}
.search-input:focus {
    outline: none;
    border-color: #2d6a4f;
    box-shadow: 0 0 0 3px rgba(45,106,79,0.1);
}
.search-input::placeholder { color: #9ca3af; }
.search-clear {
    position: absolute;
    right: 10px;
    padding: 4px 8px;
    color: #9ca3af;
    font-size: 0.85rem;
    text-decoration: none !important;
    border-radius: 50%;
}
.search-clear:hover { color: #ef4444; background: #fee2e2; }

/* Category tabs */
.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0 20px;
}
.tab {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    background: #fff;
    border: 1px solid #d4dbd0;
    color: #4b5563;
    transition: all .2s;
    text-decoration: none !important;
}
.tab:hover {
    background: #f0f7f2;
    border-color: #2d6a4f;
    color: #2d6a4f;
}
.tab.active {
    background: #2d6a4f;
    border-color: #2d6a4f;
    color: #fff;
}

/* Section title with emoji */
.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.3rem;
    font-weight: 600;
    color: #1b4332;
    margin-bottom: 8px;
}

/* Cart */
.cart-list { margin-top: 16px; }
.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 8px;
    border: 1px solid #e8ece4;
}
.cart-item-info { display: flex; flex-direction: column; gap: 2px; }
.cart-item-info strong { font-size: 1rem; }
.cart-item-info span { font-size: 0.85rem; color: #6b7280; }
.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.cart-item-total { font-weight: 600; font-size: 1rem; min-width: 70px; text-align: right; color: #2d6a4f; }
.qty-form { display: flex; align-items: center; gap: 6px; }
.qty-input {
    width: 50px;
    padding: 5px 8px;
    border: 1px solid #d4dbd0;
    border-radius: 6px;
    text-align: center;
    font-size: 0.9rem;
}
.qty-input:focus {
    outline: none;
    border-color: #2d6a4f;
}
.cart-total {
    text-align: right;
    font-size: 1.3rem;
    margin: 20px 0;
    padding: 16px 20px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e8ece4;
    color: #1b4332;
}

/* Forms */
.form-note {
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 16px;
    padding: 8px 12px;
    background: #f0f7f2;
    border-radius: 6px;
    border-left: 3px solid #2d6a4f;
}
.delivery-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.delivery-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 1px solid #d4dbd0;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .2s, background .2s;
}
.delivery-option:hover {
    border-color: #2d6a4f;
    background: #f0f7f2;
}
.delivery-option.disabled-option { opacity: 0.55; }
.delivery-option.disabled-option:hover { border-color: #ddd; background: #fff; }
.delivery-option input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #2d6a4f;
    flex-shrink: 0;
}
.delivery-option-label {
    font-size: 0.95rem;
    font-weight: 500;
}
.delivery-fee-note {
    font-size: 0.9rem;
    color: #92400e;
    background: #fef3c7;
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 16px;
}
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 6px; font-size: 0.9rem; color: #374151; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d4dbd0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color .2s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none;
    border-color: #2d6a4f;
    box-shadow: 0 0 0 3px rgba(45,106,79,0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Photo preview in form */
.photo-preview { margin-bottom: 8px; }
.photo-preview img {
    width: 90px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #d4dbd0;
    display: block;
}
.photo-hint { font-size: 0.75rem; color: #9ca3af; }
.photo-rotate { margin-bottom: 8px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.photo-rotate-label { font-size: 0.8rem; color: #6b7280; }
.photo-rotate .btn-sm { font-size: 0.78rem; }
.photo-delete { margin-bottom: 8px; }
.photo-delete .btn-sm { font-size: 0.78rem; }

/* Admin table thumb */
.admin-thumb {
    width: 75px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e8ece4;
    display: block;
}
.admin-thumb-empty { color: #d1d5db; font-size: 0.9rem; }

.checkout-form {
    max-width: 500px;
    background: #fff;
    padding: 28px;
    border-radius: 14px;
    border: 1px solid #e8ece4;
    margin-top: 20px;
}
.form-actions { display: flex; gap: 10px; margin-top: 20px; }

/* Success */
.success-block {
    text-align: center;
    padding: 60px 20px;
}
.success-block .success-emoji { font-size: 3rem; display: block; margin-bottom: 12px; }
.success-block h1 { color: #2d6a4f; margin-bottom: 12px; }
.success-block p { font-size: 1.1rem; color: #6b7280; margin-bottom: 24px; }

/* Order number block */
.order-number-box {
    background: #fef9c3;
    border: 2px solid #eab308;
    border-radius: 14px;
    padding: 24px 20px;
    margin: 20px auto;
    max-width: 400px;
}
.order-number-label {
    font-size: 1rem;
    color: #92400e;
    font-weight: 500;
    margin-bottom: 8px;
}
.order-number-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: #1b4332;
    letter-spacing: 2px;
}
.order-number-warning {
    font-size: 1rem;
    font-weight: 700;
    color: #dc2626;
    margin-top: 12px;
    margin-bottom: 0 !important;
}

/* Order total on success */
.order-total-box {
    background: #d1fae5;
    border: 2px solid #16a34a;
    border-radius: 14px;
    padding: 20px;
    margin: 16px auto;
    max-width: 400px;
}
.order-total-label {
    font-size: 1rem;
    color: #166534;
    font-weight: 500;
    margin-bottom: 4px;
}
.order-total-value {
    font-size: 2rem;
    font-weight: 800;
    color: #1b4332;
}
.order-total-detail {
    font-size: 0.85rem;
    color: #166534;
    margin-top: 4px;
}

/* Form error */
.form-error {
    color: #dc2626;
    font-size: 0.85rem;
    margin-top: 4px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}
.empty-state .empty-emoji { font-size: 3rem; display: block; margin-bottom: 12px; }
.empty-state p { font-size: 1.1rem; margin-bottom: 16px; }

/* Admin */
.admin-nav { background: #1e293b; border-bottom: none; position: sticky; top: 0; }
.admin-nav .nav-links a { color: #94a3b8; font-size: 0.85rem; }
.admin-nav .nav-links a:hover { color: #fff; }
.admin-nav .logo { color: #fff !important; font-size: 1rem; }
.hamburger {
    display: none;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
}
.hamburger:hover { color: #fff; background: rgba(255,255,255,0.08); }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 16px; margin: 24px 0; }
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.stat-number { display: block; font-size: 2rem; font-weight: 700; color: #1e293b; }
.stat-label { font-size: 0.9rem; color: #64748b; }
.stat-card.accent .stat-number { color: #2d6a4f; }

.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-top: 16px;
}
.table th, .table td {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.9rem;
}
.table th { background: #f8fafc; font-weight: 600; color: #475569; }
.table td { border-top: 1px solid #f1f5f9; }
.actions { display: flex; gap: 6px; }

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.admin-search { margin-bottom: 12px; }
.admin-search .search-form { max-width: 400px; }
.admin-search .search-input { font-size: 0.85rem; padding: 8px 36px 8px 12px; }

.status-badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}
.status-новый { background: #dbeafe; color: #1d4ed8; }
.status-подтверждён { background: #fef3c7; color: #b45309; }
.status-доставка { background: #e0e7ff; color: #4338ca; }
.status-выполнен { background: #d1fae5; color: #16a34a; }
.status-отменён { background: #fee2e2; color: #dc2626; }

.contact-note {
    font-size: 0.8rem;
    color: #64748b;
    font-style: italic;
}
.contact-data { display: flex; flex-direction: column; gap: 2px; font-size: 0.82rem; }
.contact-data span { white-space: nowrap; }
.pieces-hint { background: #fff8e1; border: 1px solid #f3d9a4; border-radius: 8px; padding: 8px 12px; font-size: 0.9rem; color: #92400e; }
.phase-select { font-size: 0.8rem; padding: 4px 6px; border-radius: 8px; border: 1px solid #d1d5db; }
.phase-select.phase-cool { background: #e0f2fe; color: #0369a1; font-weight: 600; }
.phase-select.phase-frozen { background: #ede9fe; color: #6d28d9; font-weight: 600; }
.status-form select {
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    font-size: 0.85rem;
    cursor: pointer;
}

.order-items-list { list-style: none; font-size: 0.85rem; }
.order-items-list li { padding: 1px 0; }

.admin-login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f6f7f2;
}
.login-box {
    background: #fff;
    padding: 36px;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    width: 360px;
    margin-top: 80px;
}
.login-box h1 { font-size: 1.4rem; margin-bottom: 20px; text-align: center; }
.back-link { display: block; text-align: center; margin-top: 16px; color: #6b7280; font-size: 0.9rem; }

.alert {
    padding: 10px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}
.alert-error { background: #fee2e2; color: #dc2626; }

footer {
    text-align: center;
    padding: 20px 0;
    color: #9ca3af;
    font-size: 0.85rem;
    border-top: 1px solid #e5e7eb;
}

/* ===== Mobile First ===== */
/* ===== Модальные окна (весь экран) ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 1000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.modal-box {
    min-height: 100%;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 20px 16px 110px 16px;
    box-sizing: border-box;
}
.detail-form { margin-right: 84px; }
.detail-form .btn {
    margin-right: 0;
    padding: 12px 28px;
    font-size: 1rem;
    min-height: 48px;
}
@media (max-width: 768px) {
    .detail-form { margin-right: 64px; }
}
.card-timer {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
    padding: 3px 9px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.modal-close {
    position: fixed;
    top: 12px;
    right: 14px;
    z-index: 1001;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid #33333b;
    background: #141419;
    color: #e8e4df;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-close:hover { border-color: #f5a524; color: #f5a524; }

html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }

/* Shared mobile patterns */
@media (max-width: 768px) {
    body { overflow-x: hidden; }
    .container { padding: 20px 14px 150px; }
    .hero-photo { aspect-ratio: 16 / 9; min-height: 160px; max-height: 40vh; }
    .hero-photo::before { background: var(--bg-m, var(--bg-d, url('/static/hero.jpg'))) var(--bg-p-m, var(--bg-p-d, center)) / var(--bg-s-m, var(--bg-s-d, cover)) no-repeat; }
    main { padding: 20px 0; }
    nav { padding: 10px 0; }
    .nav-inner { flex-direction: row; gap: 6px; flex-wrap: nowrap; }
    .logo { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .logo-icon { margin-right: 4px; }
    .nav-links { gap: 10px; flex-shrink: 0; }
    .nav-links a { font-size: 0.82rem; white-space: nowrap; }

    .hero { padding: 28px 0 24px; }
    .hero h1 { font-size: 1.4rem; }
    .hero p { font-size: 0.85rem; }
    .hero::before { font-size: 16px; letter-spacing: 4px; top: -6px; }

    .category-tabs { flex-wrap: nowrap; overflow-x: auto; gap: 6px; margin: 12px 0 16px; padding-bottom: 4px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    .category-tabs::-webkit-scrollbar { display: none; }
    .tab { flex-shrink: 0; padding: 6px 12px; font-size: 0.8rem; }

    .section-title { font-size: 1.1rem; }

    .products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .product-card { border-radius: 12px; }
    .photo-placeholder { font-size: 2.2rem; }
    .card-discount { top: 6px; left: 6px; font-size: 0.66rem; padding: 1px 6px; }
    .product-card h3 {
        font-size: 0.8rem;
        line-height: 1.35;
        margin: 6px 8px 0;
    }
    .product-footer { padding: 6px 8px 8px; gap: 8px; }
    .product-price, .price-discount { font-size: 1rem; }
    .price-old { font-size: 0.7rem; }
    .add-form .add-controls { gap: 4px; }
    .qty-wrap .qty-input { width: 52px; padding: 6px 20px 6px 6px; font-size: 0.8rem; }
    .qty-unit { font-size: 0.68rem; right: 6px; }
    .add-form .btn { padding: 7px 6px; font-size: 0.72rem; }
    .btn { padding: 7px 12px; font-size: 0.82rem; }

    .cart-item { padding: 12px 14px; }
    .cart-item-actions { flex-wrap: wrap; gap: 8px; }
    .cart-item-total { min-width: auto; }
    .cart-total { font-size: 1.1rem; padding: 12px 14px; }

    .float-group { bottom: 16px; right: 16px; gap: 10px; }
    .float-btn { width: 48px; height: 48px; }
    .float-btn svg { width: 24px; height: 24px; }
    .float-cart { font-size: 1.3rem; }

    .checkout-form { padding: 20px; }
    .form-row { grid-template-columns: 1fr; gap: 0; }
    .form-group input, .form-group textarea, .form-group select { padding: 10px 12px; font-size: 16px; }
    .form-note { font-size: 0.75rem; }

    .success-block { padding: 40px 14px; }
    .success-emoji { font-size: 2.2rem; }
    .success-block h1 { font-size: 1.2rem; }

    .empty-state { padding: 40px 14px; }
    .empty-state .empty-emoji { font-size: 2.2rem; }
    .empty-state p { font-size: 0.95rem; }

    .hamburger { display: block; }
    .admin-nav .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #1e293b;
        flex-direction: column;
        padding: 8px 14px 14px;
        gap: 2px;
        border-top: 1px solid #334155;
        box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    }
    .admin-nav .nav-links.open { display: flex; }
    .admin-nav .nav-links a { padding: 10px 12px; border-radius: 8px; font-size: 0.9rem; }
    .admin-nav .nav-links a:hover { background: rgba(255,255,255,0.06); }

    .stats-grid { grid-template-columns: 1fr; gap: 10px; }
    .stat-card { padding: 16px; }
    .stat-number { font-size: 1.5rem; }

    .table th, .table td { font-size: 0.82rem; vertical-align: top; }
    .table .col-photo { display: table-cell; }
    .admin-thumb { width: 50px; height: 67px; }

    h1 { font-size: 1.2rem; }
    h2 { font-size: 1rem; }

    footer { font-size: 0.75rem; padding: 14px 0; }
}

@media (max-width: 480px) {
    body { overflow-x: hidden; }
    .container { padding: 16px 10px 150px; }
    nav { padding: 8px 0; }
    .logo { font-size: 0.9rem; }
    .nav-links a { font-size: 0.75rem; }

    .hero { padding: 22px 0 18px; }
    .hero-photo { aspect-ratio: 4 / 3; min-height: 120px; max-height: 35vh; }
    .hero h1 { font-size: 1.2rem; }
    .hero p { font-size: 0.78rem; }

    .product-card h3 { font-size: 0.76rem; line-height: 1.3; margin: 5px 6px 0; }
    .product-price, .price-discount { font-size: 0.95rem; }
    .qty-wrap .qty-input { width: 46px; padding: 5px 18px 5px 4px; font-size: 0.75rem; }
    .qty-unit { font-size: 0.62rem; right: 4px; }
    .add-form .btn { padding: 6px 4px; font-size: 0.68rem; }
    .add-form .add-controls .btn { padding: 6px 4px; font-size: 0.68rem; }

    .cart-item { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 12px; }
    .cart-item-actions { justify-content: space-between; }
    .qty-input { width: 44px; }

    .login-box { width: auto; margin: 20px 10px; padding: 20px; }

    .table thead { display: none; }
    .table { display: block; }
    .table tbody, .table tr { display: block; }
    .table tr {
        background: #fff;
        margin-bottom: 10px;
        padding: 10px 12px;
        border-radius: 10px;
        border: 1px solid #e2e8f0;
    }
    .table td {
        display: flex;
        padding: 3px 0;
        font-size: 0.82rem;
        border: none;
        white-space: normal;
        vertical-align: top;
        gap: 6px;
    }
    .table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #64748b;
        flex-shrink: 0;
        min-width: 70px;
        font-size: 0.78rem;
    }
    .table td[data-label=""]::before { content: none; display: none; }
    .table td.actions { display: flex; gap: 6px; margin-top: 4px; }
    .table td.actions::before { content: none; display: none; }
    .table .col-photo { display: block; }
    .table .col-photo .admin-thumb { width: 50px; height: 67px; }
    .table .col-items { font-size: 0.8rem; }
    .status-form select { max-width: 100%; font-size: 0.8rem; }
    .order-items-list { padding-left: 0; }
    .status-form select { max-width: 100px; font-size: 0.72rem; }
    .admin-header { flex-direction: column; gap: 10px; align-items: stretch; }
    .admin-header .btn { width: 100%; text-align: center; }
    .admin-search .search-form { max-width: 100%; }

    .admin-nav .nav-links a { padding: 8px 10px; font-size: 0.85rem; }

    .status-form select { font-size: 0.75rem; padding: 3px 6px; }
    .order-items-list { font-size: 0.75rem; }
    .order-items-list li { padding: 0; }

    .actions { gap: 4px; }
    .actions .btn-sm { padding: 4px 8px; font-size: 0.7rem; }
}

/* ===== Desktop: сетка карточек как на Ozon ===== */
@media (min-width: 769px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
        gap: 16px;
    }
    .add-form .btn {
        padding: 8px 14px;
    }
    .product-card .badge-hot,
    .product-card .badge-discount {
        font-size: 0.9rem;
        margin-left: 4px;
    }
}

/* Journal */
.journal-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.journal-entry {
    background: #fff;
    border: 1px solid #e8ece4;
    border-radius: 12px;
    padding: 14px 18px;
    transition: box-shadow .2s;
}
.journal-entry:hover {
    box-shadow: 0 2px 8px rgba(45,106,79,0.08);
}
.journal-entry-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}
.journal-entry-date {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6b7280;
    background: #f3f4f6;
    padding: 2px 10px;
    border-radius: 6px;
}
.journal-entry-amount {
    font-size: 0.9rem;
    font-weight: 700;
    color: #2d6a4f;
}
.journal-entry-content {
    font-size: 1rem;
    line-height: 1.5;
    color: #1b1b1b;
    white-space: pre-wrap;
}

/* Touch optimization */
@media (hover: none) and (pointer: coarse) {
    .btn, .tab, .cart-item { cursor: default; }
    .btn:active { opacity: 0.8; }
    .product-card:active { transform: none; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
    .product-card:hover { transform: none; box-shadow: 0 1px 4px rgba(0,0,0,0.06); border-color: #e8ece4; }
    .admin-nav .nav-links a { padding: 12px; }
    .add-controls .btn { padding-top: 10px; padding-bottom: 10px; }
    .qty-input { min-height: 36px; }
    .form-group input, .form-group textarea, .form-group select { min-height: 44px; }
    .btn-lg { padding-top: 14px; padding-bottom: 14px; }
}

/* Order edit */
.order-edit-card {
    background: #fff;
    border: 1px solid #e8ece4;
    border-radius: 12px;
    padding: 16px 20px;
}
.order-edit-info {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 0.9rem;
    color: #4b5563;
}
@media (max-width: 480px) {
    .order-edit-info { flex-direction: column; gap: 4px; }
}

/* ===== Тёмная тема "Smoke & Fire" (смокер-меню) ===== */
body.dark {
    background: #000;
    color: #e8e4df;
}
body.dark ::selection { background: #f5a524; color: #0b0b0d; }
body.dark a { color: #f5a524; }
body.dark .hero-photo { background: #040404; }
body.dark .hero-photo::after {
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.55) 100%);
}
body.dark .hero-contact { background: rgba(15,12,8,0.82); }

body.dark .news-item {
    background: linear-gradient(135deg, #f5a524, #d97706);
    color: #14100a;
    box-shadow: 0 2px 14px rgba(245,165,36,0.28);
}
body.dark .news-title { color: #14100a; }
body.dark .news-content { color: #2b1c06; }

body.dark .section-title {
    color: #f5f0e8;
    font-family: 'Oswald', 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

body.dark .search-input {
    background: #16161b;
    border-color: #2a2a33;
    color: #e8e4df;
}
body.dark .search-input:focus {
    border-color: #f5a524;
    box-shadow: 0 0 0 3px rgba(245,165,36,0.15);
}
body.dark .search-input::placeholder { color: #6e6a63; }
body.dark .search-clear { color: #6e6a63; }

body.dark .tab {
    background: #16161b;
    border-color: #2a2a33;
    color: #c9c4bc;
}
body.dark .tab:hover { background: #1e1e25; border-color: #f5a524; color: #f5a524; }
body.dark .tab.active {
    background: linear-gradient(135deg, #f5a524, #ea580c);
    border-color: #f5a524;
    color: #14100a;
    font-weight: 700;
}

body.dark .product-card {
    background: #141419;
    border-color: #232329;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
body.dark .product-card:hover {
    border-color: rgba(245,165,36,0.55);
    box-shadow: 0 8px 28px rgba(245,165,36,0.10);
}
body.dark .product-card h3 {
    color: #f5f0e8;
}
body.dark .product-photo { background: #1d1d24; }
body.dark .photo-placeholder { opacity: 0.5; }
body.dark .product-price { color: #f5a524; }
body.dark .price-old { color: #6e6a63; }
body.dark .price-discount { color: #fb7185; }

body.dark .qty-input,
body.dark .add-form .qty-input {
    background: #0e0e12;
    border-color: #2a2a33;
    color: #e8e4df;
}
body.dark .qty-input:focus { border-color: #f5a524; }
body.dark .qty-unit { color: #6e6a63; }

body.dark .btn {
    background: #1a1a20;
    border-color: #2e2e37;
    color: #e8e4df;
}
body.dark .btn:hover { background: #23232b; border-color: #f5a524; }
body.dark .btn-primary {
    background: linear-gradient(135deg, #f5a524, #ea580c);
    border-color: #f5a524;
    color: #14100a;
    font-weight: 600;
}
body.dark .btn-primary:hover {
    background: linear-gradient(135deg, #ffb845, #f97316);
    border-color: #ffb845;
}
body.dark .btn-danger { color: #fb7185; border-color: #4c1d28; }
body.dark .btn-danger:hover { background: rgba(251,113,133,0.1); }

body.dark .cart-item,
body.dark .cart-total,
body.dark .checkout-form {
    background: #141419;
    border-color: #2a2a33;
}
body.dark .cart-item-total,
body.dark .cart-total { color: #f5a524; }
body.dark .cart-item-info span { color: #8b867e; }

body.dark .form-group label { color: #c9c4bc; }
body.dark .form-group input,
body.dark .form-group textarea,
body.dark .form-group select {
    background: #0e0e12;
    border-color: #2a2a33;
    color: #e8e4df;
}
body.dark .form-group input:focus,
body.dark .form-group textarea:focus,
body.dark .form-group select:focus {
    border-color: #f5a524;
    box-shadow: 0 0 0 3px rgba(245,165,36,0.12);
}
body.dark .form-note {
    background: rgba(245,165,36,0.08);
    border-left-color: #f5a524;
    color: #c9c4bc;
}
body.dark .delivery-option { border-color: #2a2a33; }
body.dark .delivery-option:hover {
    border-color: #f5a524;
    background: rgba(245,165,36,0.06);
}
body.dark .delivery-fee-note {
    background: rgba(245,165,36,0.12);
    color: #f5a524;
}

body.dark .success-block h1 { color: #f5a524; }
body.dark .success-block p { color: #8b867e; }
body.dark .order-number-box {
    background: rgba(245,165,36,0.1);
    border-color: #f5a524;
}
body.dark .order-number-label { color: #f5a524; }
body.dark .order-number-value { color: #f5f0e8; }
body.dark .order-total-box {
    background: rgba(245,165,36,0.08);
    border-color: #f5a524;
}
body.dark .order-total-label { color: #f5a524; }
body.dark .order-total-value { color: #f5f0e8; }
body.dark .order-total-detail { color: #f5a524; }

.payment-qr-block {
    margin: 20px 0;
    padding: 20px;
    background: #fff;
    border: 2px dashed #f5a524;
    border-radius: 14px;
    text-align: center;
}
.payment-qr-title {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 12px;
    color: #92400e;
}
.payment-qr-img {
    width: 220px;
    height: 220px;
    border-radius: 8px;
    background: #fff;
    padding: 6px;
}
.payment-qr-hint {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 10px;
}
.payment-phone-line {
    font-size: 0.95rem;
    font-weight: 500;
    color: #1b4332;
    margin-top: 10px;
}
.cart-error {
    background: #fdeeee;
    border: 1px solid #f0c4c4;
    color: #b91c1c;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 0.9rem;
}
body.dark .cart-error { background: rgba(220,38,38,0.12); border-color: rgba(220,38,38,0.4); color: #f87171; }

.pickup-note {
    font-size: 0.85rem;
    color: #6b7280;
    margin: -12px 0 16px;
    text-align: center;
}
body.dark .payment-phone-line { color: #86efac; }
body.dark .pickup-note { color: #8b867e; }
body.dark .payment-qr-block { background: #141419; border-color: rgba(245,165,36,0.5); }
body.dark .payment-qr-title { color: #f5a524; }
body.dark .payment-qr-hint { color: #8b867e; }

body.dark .empty-state { color: #8b867e; }

body.dark .float-cart { background: linear-gradient(135deg, #f5a524, #ea580c); }
body.dark .float-tg { background: linear-gradient(135deg, #0f2c3d, #1e96c8); }
body.dark .float-max { background: linear-gradient(135deg, #1d1d25, #7c3aed); }
body.dark .float-badge { background: #ea580c; }

body.dark footer { border-top-color: #1c1c22; color: #6e6a63; }

body.dark .tab-hot { background: rgba(245,165,36,0.12) !important; color: #f5a524 !important; }
body.dark .tab-discount { background: rgba(251,113,133,0.12) !important; color: #fb7185 !important; }
body.dark .tab-prep { background: rgba(245,158,11,0.14) !important; color: #fbbf24 !important; }
body.dark .prep-label { color: #fbbf24; }
body.dark .prep-time { color: #f5a524; }
body.dark .prep-timer.is-ready .prep-label,
body.dark .prep-timer.is-ready .prep-time { color: #4ade80; }

/* ===== Банер: высота = пропорции загруженного фото, с ограничением ===== */
.hero-photo.has-ratio {
    aspect-ratio: var(--br-d, 21 / 9);
    min-height: 0;
    max-height: 55vh;
}
.hero-photo.has-ratio::before {
    background-size: contain;
}
@media (max-width: 768px) {
    .hero-photo.has-ratio {
        aspect-ratio: var(--br-m, var(--br-d, 16 / 9));
        max-height: 40vh;
    }
}
