:root {
    --ink: #161d17;
    --muted: #6b6f6c;
    --border: #e7e4dd;
    --bg: #faf9f6;
    --surface: #ffffff;
    --accent: #2f6b3c;
    --accent-dark: #1f4a28;
    --accent-soft: #eaf3ec;
    --gold: #c99a4a;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 3px rgba(22, 29, 23, .06);
    --shadow-md: 0 10px 30px rgba(22, 29, 23, .08);
    --shadow-lift: 0 16px 40px rgba(22, 29, 23, .14);
}

* { box-sizing: border-box; }

body {
    font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { letter-spacing: -0.02em; font-weight: 800; }

a { text-decoration: none; color: inherit; }

.container { max-width: 1180px; }

.btn { border-radius: 999px; font-weight: 600; padding: 10px 20px; transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease; }
.btn:active { transform: scale(.97); }
.btn-dark { background: var(--ink); border-color: var(--ink); }
.btn-dark:hover { background: #000; border-color: #000; box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-lg { padding: 14px 28px; }

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

/* ─── Reveal-on-scroll ─── */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ─── Header ─── */

.site-closed-banner {
    background: #b23b3b; color: #fff; text-align: center; padding: 10px; font-size: .9rem;
}

.site-header {
    background: rgba(255,255,255,.92);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 50;
}

.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 0; gap: 24px;
}

.logo { font-size: 1.45rem; font-weight: 800; letter-spacing: -0.03em; display: flex; align-items: center; gap: 8px; }
.logo .logo-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); display: inline-block; }

.main-nav { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.main-nav a { color: var(--muted); font-size: .95rem; font-weight: 600; position: relative; }
.main-nav a::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px;
    background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .2s ease;
}
.main-nav a:hover { color: var(--ink); }
.main-nav a:hover::after { transform: scaleX(1); }
.quick-order-link { color: var(--accent) !important; }

.header-actions { display: flex; align-items: center; gap: 6px; }

.icon-btn {
    width: 42px; height: 42px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; font-size: 1.2rem; color: var(--ink); position: relative; transition: background-color .15s ease;
}
.icon-btn:hover { background: var(--accent-soft); }

.cart-badge {
    position: absolute; top: 2px; right: 2px; background: var(--accent);
    color: #fff; font-size: .65rem; border-radius: 50%; min-width: 17px; height: 17px;
    display: flex; align-items: center; justify-content: center; padding: 0 3px; font-weight: 700;
}

.menu-toggle {
    display: none; width: 42px; height: 42px; border: none; background: none; font-size: 1.4rem; color: var(--ink);
    border-radius: 50%; align-items: center; justify-content: center;
}
.menu-toggle:hover { background: var(--accent-soft); }

.mobile-nav-drawer {
    display: none; flex-direction: column; padding: 8px 0 16px; border-top: 1px solid var(--border);
}
.mobile-nav-drawer a { padding: 10px 4px; font-weight: 600; color: var(--ink); }
.mobile-nav-drawer.open { display: flex; }

/* ─── Hero ─── */

.hero-strip {
    position: relative; overflow: hidden;
    background: radial-gradient(120% 160% at 15% 0%, #3d8a4e 0%, var(--accent) 45%, var(--accent-dark) 100%);
    color: #fff; padding: 64px 0 56px; margin-bottom: 32px;
}
.hero-strip::before {
    content: ""; position: absolute; inset: 0;
    background-image: radial-gradient(rgba(255,255,255,.14) 1.5px, transparent 1.5px);
    background-size: 22px 22px; opacity: .5; pointer-events: none;
}
.hero-strip::after {
    content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%;
    background: radial-gradient(circle, rgba(201,154,74,.35), transparent 70%);
    right: -120px; top: -160px; pointer-events: none;
}
.hero-strip .container { position: relative; z-index: 1; }
.hero-strip h1 { font-size: clamp(2rem, 4vw, 2.9rem); font-weight: 800; margin-bottom: 10px; max-width: 640px; }
.hero-strip p { opacity: .92; margin: 0; font-size: 1.05rem; max-width: 560px; }

/* ─── Trust badges / quick order banner ─── */

.trust-badges { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; margin-top: 24px; }
.trust-badge {
    display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--ink); font-weight: 600;
    background: #fff; border: 1px solid var(--border); border-radius: 20px; padding: 8px 16px; box-shadow: var(--shadow-sm);
}
.trust-badge i { color: var(--accent); }

.quick-order-banner {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    background: var(--accent-soft); border: 1px solid #d7e6d9; border-radius: var(--radius-md); padding: 16px 20px; margin-bottom: 24px;
}
.quick-order-banner strong { display: block; }
.quick-order-banner .text-muted { font-size: .85rem; }

.stock-filter-toggle {
    font-size: .85rem; color: var(--muted); border: 1px solid var(--border); border-radius: 20px;
    padding: 7px 16px; white-space: nowrap; font-weight: 600; transition: all .15s ease;
}
.stock-filter-toggle.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.stock-filter-toggle:hover { border-color: var(--ink); }

/* ─── Category filter ─── */

.category-filter { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.category-filter a {
    padding: 9px 18px; border: 1px solid var(--border); border-radius: 20px;
    font-size: .9rem; font-weight: 600; color: var(--muted); transition: all .15s ease;
}
.category-filter a.active, .category-filter a:hover { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ─── Product grid/card ─── */

.product-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 22px; margin-bottom: 48px;
}

.product-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden;
    display: flex; flex-direction: column; transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
}
.product-card:hover { box-shadow: var(--shadow-lift); transform: translateY(-4px); border-color: transparent; }

.product-card-img-wrap { position: relative; display: block; aspect-ratio: 1/1; background: #f0efe9; overflow: hidden; }
.product-card-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.product-card:hover .product-card-img-wrap img { transform: scale(1.06); }
.product-card-noimg { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; color: #cdc9c0; }

.stock-badge { position: absolute; top: 10px; left: 10px; font-weight: 600; border-radius: 20px; }

.product-card-body { padding: 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.product-card-title { font-weight: 700; font-size: .95rem; line-height: 1.3; }
.product-card-unit { font-size: .8rem; color: var(--muted); }
.product-card-bottom { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 10px; }
.product-card-price { font-weight: 800; font-size: 1.1rem; }
.product-card-price small { font-weight: 400; color: var(--muted); }
.product-card-bottom .add-to-cart {
    border-radius: 50%; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
    padding: 0; transition: transform .15s ease, box-shadow .15s ease;
}
.product-card-bottom .add-to-cart:hover { transform: scale(1.1); box-shadow: var(--shadow-md); }

/* ─── Product page ─── */

.product-page { padding: 32px 0 64px; }
.product-gallery-main { aspect-ratio: 1/1; background: #f0efe9; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.product-gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.product-gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.product-gallery-thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 2px solid transparent; transition: border-color .15s ease; }
.product-gallery-thumbs img.active, .product-gallery-thumbs img:hover { border-color: var(--accent); }

.product-title { font-size: 1.8rem; font-weight: 800; margin-bottom: 6px; }
.product-unit { color: var(--muted); margin-bottom: 12px; }
.product-price { font-size: 2rem; font-weight: 800; margin-bottom: 16px; }
.product-price small { font-size: 1rem; font-weight: 400; color: var(--muted); }
.product-description { color: #444; margin-bottom: 20px; }

.messenger-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.messenger-buttons .btn { border-radius: var(--radius-sm); }

/* ─── Cart / checkout ─── */

.cart-page { padding: 32px 0 64px; }
.cart-item {
    display: grid; grid-template-columns: 64px 1fr auto auto auto; align-items: center; gap: 14px;
    padding: 14px 0; border-bottom: 1px solid var(--border);
}
.cart-item-img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-sm); background: #f0efe9; }
.cart-item-noimg { display: flex; align-items: center; justify-content: center; font-size: 1.4rem; color: #cdc9c0; }
.cart-item-info h6 { margin: 0 0 4px; font-size: .95rem; font-weight: 700; }
.cart-item-price { color: var(--muted); font-size: .85rem; }
.cart-item-qty { display: flex; align-items: center; gap: 8px; }
.cart-item-qty button { width: 30px; height: 30px; border: 1px solid var(--border); background: #fff; border-radius: 8px; }
.cart-item-qty button:hover { border-color: var(--ink); }
.cart-item-qty .qty-input { width: 56px; text-align: center; border: 1px solid var(--border); border-radius: 8px; padding: 4px; }
.cart-item-total { font-weight: 700; }
.cart-remove { border: none; background: none; color: var(--muted); }
.cart-remove:hover { color: #b23b3b; }

.checkout-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-sm); position: sticky; top: 90px; }

.empty-cart, .order-success { text-align: center; padding: 64px 0; }
.order-success i { font-size: 3rem; color: var(--accent); }

/* ─── Floating cart bar ─── */

.floating-cart-bar {
    position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 120%);
    display: flex; align-items: center; gap: 14px; background: var(--ink); color: #fff;
    border-radius: 999px; padding: 12px 20px; box-shadow: var(--shadow-lift); z-index: 60;
    transition: transform .3s ease; opacity: .98;
}
.floating-cart-bar.visible { transform: translate(-50%, 0); }
.floating-cart-bar .fc-total { font-weight: 700; }
.floating-cart-bar a.btn { padding: 6px 16px; font-size: .85rem; }

/* ─── Quick order ─── */

.quick-order-page { padding: 32px 0 64px; }

/* ─── Auth / account ─── */

.auth-page, .account-page { max-width: 480px; padding: 48px 0; }
.account-page { max-width: 720px; }
.auth-form input { margin-bottom: 4px; }

.order-history-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 18px; margin-bottom: 12px; box-shadow: var(--shadow-sm); }

/* ─── Payment result ─── */

.payment-result { padding: 80px 0; }
.payment-result i { font-size: 3.5rem; margin-bottom: 16px; display: block; }

/* ─── Footer ─── */

.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 44px 0 22px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.footer-brand { font-weight: 800; font-size: 1.15rem; margin-bottom: 8px; }
.footer-text { color: var(--muted); font-size: .9rem; margin-bottom: 6px; }
.footer-social { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.site-footer h6 { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 12px; font-weight: 700; }
.site-footer a { display: block; margin-bottom: 6px; font-size: .9rem; }
.site-footer a:hover { color: var(--accent); }
.footer-bottom { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: .8rem; color: var(--muted); }

/* ─── Toast ─── */

.toast-notification {
    position: fixed; bottom: 24px; right: 24px; background: var(--ink); color: #fff;
    padding: 12px 18px; border-radius: var(--radius-sm); z-index: 999; font-size: .9rem; box-shadow: var(--shadow-lift);
}

/* ─── Admin ─── */

.admin-sidebar { width: 220px; background: #fff; border-right: 1px solid var(--border); min-height: calc(100vh - 56px); }
.admin-sidebar .nav-link { color: var(--ink); padding: 10px 20px; border-radius: 0 20px 20px 0; }
.admin-sidebar .nav-link.active, .admin-sidebar .nav-link:hover { background: var(--accent-soft); font-weight: 700; color: var(--accent-dark); }
.admin-content { flex: 1; padding: 24px; }

.admin-login-body { background: var(--bg); display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.admin-login-box { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px; width: 360px; box-shadow: var(--shadow-md); }

/* Шапка ломается (перенос логотипа/меню на новую строку) уже на планшетных
   ширинах ~768-900px, поэтому бургер-меню включается раньше брейкпоинта
   основного мобильного layout'а (767px). */
@media (max-width: 899px) {
    .main-nav { display: none; }
    .menu-toggle { display: flex; }
    .trust-badges { margin-top: 0; }
}

@media (max-width: 767px) {
    .admin-sidebar { width: 100%; min-height: auto; }
    .footer-grid { grid-template-columns: 1fr; }
    .checkout-box { position: static; }
}
