:root {
    --color-bg: #F7F5F1;
    --color-surface: #FFFFFF;
    --color-text: #241F1A;
    --color-muted: #6E6459;
    --color-primary: #B5651D;
    --color-primary-dark: #8F4E14;
    --color-accent: #2E4034;
    --color-border: #E6E0D6;
    --radius: 12px;
    --shadow: 0 6px 24px rgba(36, 31, 26, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: 'Segoe UI', Roboto, -apple-system, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; margin: 0; padding: 0; }

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 50;
}
.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    gap: 16px;
    flex-wrap: wrap;
}
.logo {
    font-weight: 700;
    font-size: 1.15rem;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}
.logo__img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}
.main-nav {
    display: flex;
    gap: 20px;
    flex: 1;
    justify-content: center;
}
.main-nav a:hover { color: var(--color-primary); }
.header__actions {
    display: flex;
    align-items: center;
    gap: 16px;
}
.phone { font-weight: 600; white-space: nowrap; }
.contact-icons {
    display: flex;
    align-items: center;
    gap: 6px;
}
.contact-icons__link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f2f2f2;
    color: #444;
    transition: background 0.15s, color 0.15s;
}
.contact-icons__link:hover {
    background: var(--color-primary);
    color: #fff;
}
@media (max-width: 860px) {
    .contact-icons { display: none; }
}
.cart-link {
    background: var(--color-accent);
    color: #fff;
    padding: 8px 16px;
    border-radius: 999px;
    font-weight: 600;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background .15s ease, transform .15s ease;
}
.cart-link:hover { background: var(--color-primary); transform: translateY(-1px); }
.cart-count {
    background: rgba(255,255,255,0.25);
    border-radius: 999px;
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    padding: 0 5px;
}
.burger {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 820px) {
    .main-nav {
        display: none;
        flex-direction: column;
        width: 100%;
        order: 3;
        background: var(--color-surface);
        padding: 12px 0;
        gap: 12px;
    }
    .main-nav.is-open { display: flex; }
    .burger { display: block; }
}

/* Hero */
.hero {
    position: relative;
    background:
        radial-gradient(circle at 15% 20%, rgba(181,101,29,0.35) 0%, transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(181,101,29,0.25) 0%, transparent 40%),
        var(--color-accent);
    background-size: cover;
    background-position: center;
    color: #fff;
    padding: 72px 0;
    text-align: center;
    overflow: hidden;
}
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.14) 1.5px, transparent 1.5px);
    background-size: 28px 28px;
    opacity: 0.5;
    pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }
.hero h1 {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    margin: 0 0 20px;
}
.hero__lead {
    max-width: 640px;
    margin: 0 auto 12px;
    opacity: 0.92;
}
.hero__actions {
    margin-top: 28px;
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 22px;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary {
    background: var(--color-primary);
    color: #fff;
}
.btn--primary:hover { background: var(--color-primary-dark); }
.btn--outline {
    background: transparent;
    color: #fff;
    border-color: rgba(255,255,255,0.6);
}
.section .btn--outline {
    color: var(--color-accent);
    border-color: var(--color-accent);
}
.btn--small { padding: 8px 16px; font-size: 0.9rem; }
.btn--big { padding: 16px 28px; font-size: 1.05rem; }

/* Trust strip */
.trust-strip {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 22px 0;
}
.trust-strip__inner {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
@media (max-width: 900px) { .trust-strip__inner { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .trust-strip__inner { grid-template-columns: 1fr; } }
.trust-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--color-primary);
}
.trust-item div { display: flex; flex-direction: column; color: var(--color-text); }
.trust-item strong { font-size: 0.92rem; }
.trust-item span { font-size: 0.8rem; color: var(--color-muted); }

.section-head__icon { vertical-align: -4px; color: var(--color-primary); margin-right: 4px; }

/* Sections */
.section { padding: 56px 0; }
.section--alt { background: #EFEAE1; }
.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 8px;
}
.section-lead {
    color: var(--color-muted);
    max-width: 780px;
    margin-bottom: 28px;
}
.section-head__link { font-weight: 600; color: var(--color-primary); }

/* Product grid & card */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
@media (max-width: 980px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .product-grid { grid-template-columns: 1fr; } }

.product-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    transition: transform .2s ease, box-shadow .2s ease;
}
.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 32px rgba(36, 31, 26, 0.14);
}
.product-card__img { position: relative; display: block; overflow: hidden; background: #fff; }
.product-card__img img { width: 100%; aspect-ratio: 3/4; object-fit: contain; transition: transform .3s ease; }
.product-card:hover .product-card__img img { transform: scale(1.05); }
.product-card__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--color-primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    box-shadow: 0 3px 8px rgba(181, 101, 29, 0.4);
}
.product-card__body { padding: 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-card__title { font-weight: 600; }
.product-card__rating {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--color-primary);
    font-size: 0.82rem;
    font-weight: 600;
}
.product-card__desc { color: var(--color-muted); font-size: 0.9rem; flex: 1; }
.product-card__bottom { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.product-card__price-block { display: flex; flex-direction: column; }
.product-card__price { font-weight: 700; font-size: 1.05rem; }
.product-card__old-price { color: var(--color-muted); font-size: 0.82rem; text-decoration: line-through; }

/* Catalog tabs */
.catalog-tabs { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.catalog-tab {
    padding: 10px 18px;
    border-radius: 999px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    font-weight: 600;
}
.catalog-tab.is-active { background: var(--color-accent); color: #fff; }

/* Breadcrumbs */
.breadcrumbs { color: var(--color-muted); margin-bottom: 20px; font-size: 0.9rem; }

/* Product detail */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 48px;
}
@media (max-width: 820px) { .product-detail { grid-template-columns: 1fr; } }
.product-detail__main-img { border-radius: var(--radius); width: 100%; aspect-ratio: 3/4; object-fit: contain; background: #fff; box-shadow: var(--shadow); }
.product-detail__thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; max-height: 296px; overflow-y: auto; }
.thumb { width: 64px; height: 64px; object-fit: contain; background: #fff; border-radius: 8px; cursor: pointer; border: 2px solid var(--color-border); }
.thumb:hover { border-color: var(--color-primary); }
.product-detail__price { font-size: 1.6rem; font-weight: 700; margin: 12px 0 20px; }
.add-to-cart-form { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.qty-input { width: 70px; padding: 8px; border-radius: 8px; border: 1px solid var(--color-border); margin-left: 8px; }
.product-detail__desc { color: var(--color-muted); white-space: pre-line; }
.characteristics { margin-top: 12px; }
.characteristics li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--color-border); }
.characteristics li span:first-child { color: var(--color-muted); }

/* Reviews */
.reviews { margin: 40px 0; }
.review { background: var(--color-surface); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 14px; box-shadow: var(--shadow); }
.review__head { display: flex; justify-content: space-between; margin-bottom: 6px; }
.review__stars { color: var(--color-primary); }

/* Cart */
.cart-row {
    display: grid;
    grid-template-columns: 70px 1fr 90px 100px 30px;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--color-border);
}
.cart-row__img { width: 60px; height: 60px; object-fit: contain; background: #fff; border: 1px solid var(--color-border); border-radius: 8px; }
.cart-row__price { color: var(--color-muted); font-size: 0.9rem; }
.cart-row__sum { font-weight: 600; }
.cart-row__remove { color: var(--color-muted); font-size: 1.2rem; text-align: center; }
.cart-row__remove:hover { color: #B3261E; }
@media (max-width: 640px) {
    .cart-row { grid-template-columns: 50px 1fr auto; grid-template-areas: "img title remove" "img qty sum"; }
}
.cart-summary { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; }
.cart-summary__total { font-size: 1.2rem; }

/* Checkout */
.checkout-layout { display: grid; grid-template-columns: 1.6fr 1fr; gap: 40px; align-items: start; }
@media (max-width: 900px) { .checkout-layout { grid-template-columns: 1fr; } }
.checkout-form { display: flex; flex-direction: column; gap: 16px; background: var(--color-surface); padding: 24px; border-radius: var(--radius); box-shadow: var(--shadow); }
.checkout-form label, .admin-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 0.9rem; }
.checkout-form input, .checkout-form textarea, .admin-form input, .admin-form textarea, .admin-form select {
    font: inherit;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
}
.delivery-methods { border: 1px solid var(--color-border); border-radius: var(--radius); padding: 16px; }
.delivery-methods legend { font-weight: 700; padding: 0 6px; }
.delivery-method { display: flex; align-items: center; gap: 10px; font-weight: 400; padding: 8px 0; flex-direction: row; }
.delivery-method__price { margin-left: auto; color: var(--color-muted); }
.delivery-note { color: var(--color-muted); font-size: 0.85rem; margin-top: 8px; }
.order-summary { background: var(--color-surface); padding: 24px; border-radius: var(--radius); box-shadow: var(--shadow); }
.order-summary__row { display: flex; justify-content: space-between; padding: 8px 0; }
.order-summary__total { font-weight: 700; border-top: 1px solid var(--color-border); margin-top: 8px; }
.order-summary__note { color: var(--color-muted); font-size: 0.85rem; margin-top: 12px; }
.order-success { text-align: center; padding: 40px 0; }
.order-success h1 { margin-bottom: 20px; }

.alert { padding: 14px 18px; border-radius: 8px; margin-bottom: 16px; }
.alert--error { background: #FCEBEA; color: #B3261E; }

/* Footer */
.site-footer { background: var(--color-accent); color: #fff; padding: 48px 0 20px; margin-top: 40px; }
.footer__inner { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
@media (max-width: 700px) { .footer__inner { grid-template-columns: 1fr; } }
.footer__title { font-weight: 700; margin-bottom: 10px; }
.footer__socials {
    display: flex;
    gap: 16px;
    margin-top: 10px;
}
.footer__socials a {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}
.site-footer a:hover { text-decoration: underline; }
.footer__copy { margin-top: 30px; opacity: 0.7; font-size: 0.85rem; }
