:root {
  --red: #c8102e;
  --red-dark: #9e0a22;
  --bg: #fff;
  --fg: #1a1a1a;
  --muted: #666;
  --border: #e6e6e6;
  --soft: #faf7f2;
  --shadow: 0 4px 20px rgba(0,0,0,.08);
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; color: var(--fg); background: var(--bg); line-height: 1.55; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 24px; background: #fff; border-bottom: 1px solid var(--border);
}
.brand { display: flex; flex-direction: column; font-weight: 800; line-height: 1; }
.brand-name { font-size: 22px; color: var(--red); font-style: italic; }
.brand-city { font-size: 11px; color: var(--muted); letter-spacing: 2px; text-transform: uppercase; }
.main-nav { display: flex; gap: 20px; align-items: center; }
.main-nav a { color: var(--fg); font-weight: 600; font-size: 15px; }
.main-nav a:hover { color: var(--red); }
.main-nav .phone { background: var(--red); color: #fff; padding: 8px 14px; border-radius: 999px; }
.main-nav .phone:hover { background: var(--red-dark); text-decoration: none; }
.cart-link { background: #f3f3f3; padding: 8px 12px; border-radius: 999px; }
#cart-count { display: inline-block; min-width: 20px; text-align: center; background: var(--red); color: #fff; border-radius: 999px; padding: 0 6px; font-size: 12px; margin-left: 4px; }

main { min-height: 60vh; }

.hero {
  background: linear-gradient(135deg, #2a0a0a 0%, #4a1010 100%);
  color: #fff; padding: 80px 24px;
}
.hero-inner { max-width: 900px; margin: 0 auto; text-align: center; }
.hero h1 { font-size: clamp(28px, 5vw, 52px); margin: 0 0 16px; line-height: 1.15; }
.hero p { font-size: 18px; opacity: .9; margin: 0 0 28px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.btn { display: inline-block; padding: 12px 24px; border-radius: 999px; font-weight: 700; border: 2px solid transparent; cursor: pointer; font-size: 15px; text-align: center; }
.btn-primary { background: var(--red); color: #fff; border-color: var(--red); }
.btn-primary:hover { background: var(--red-dark); border-color: var(--red-dark); text-decoration: none; }
.btn-ghost { background: transparent; color: #fff; border-color: #fff; }
.btn-ghost:hover { background: #fff; color: var(--red); text-decoration: none; }
.btn-big { font-size: 18px; padding: 16px 32px; width: 100%; }

.section { max-width: 1200px; margin: 0 auto; padding: 60px 24px; }
.section.narrow { max-width: 800px; }
.section-alt { background: var(--soft); }
.section h1, .section h2 { text-align: center; }
.section h2 { font-size: clamp(24px, 3.5vw, 36px); margin-bottom: 40px; }
.center { text-align: center; margin-top: 32px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: transform .15s, box-shadow .15s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.card h3 { margin: 12px 16px 4px; font-size: 18px; color: var(--fg); }
.card .meta, .card .desc { margin: 0 16px; color: var(--muted); font-size: 14px; }
.card .price { font-weight: 800; color: var(--red); font-size: 20px; padding: 8px 16px; }
.card .row { display: flex; justify-content: space-between; align-items: center; padding: 8px 16px 16px; margin-top: auto; gap: 8px; }
.card .row .btn { font-size: 13px; padding: 8px 14px; }

.three-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.three-col div { padding: 24px; background: #fff; border-radius: var(--radius); }
.three-col h3 { margin-top: 0; color: var(--red); }

.cat-nav { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 40px; position: sticky; top: 64px; background: rgba(255,255,255,.97); padding: 12px 0; z-index: 10; }
.cat-nav a { padding: 8px 16px; border: 2px solid var(--border); border-radius: 999px; color: var(--fg); font-weight: 600; font-size: 14px; }
.cat-nav a:hover { border-color: var(--red); color: var(--red); text-decoration: none; }
.category { margin-bottom: 60px; }
.category h2 { text-align: left; border-bottom: 3px solid var(--red); padding-bottom: 8px; display: inline-block; }

/* Cart */
#cart-view table { width: 100%; border-collapse: collapse; }
#cart-view th, #cart-view td { padding: 12px; border-bottom: 1px solid var(--border); text-align: left; }
#cart-view th { background: var(--soft); }
#cart-view .qty { display: inline-flex; align-items: center; gap: 8px; }
#cart-view .qty button { width: 30px; height: 30px; border: 1px solid var(--border); background: #fff; border-radius: 6px; cursor: pointer; font-size: 18px; }
#cart-view .total-row td { font-weight: 800; font-size: 18px; }
.cart-actions { display: flex; justify-content: space-between; margin-top: 24px; gap: 12px; flex-wrap: wrap; }
.empty-cart { text-align: center; padding: 40px; color: var(--muted); }

/* Checkout */
#checkout-form fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
#checkout-form legend { padding: 0 8px; font-weight: 700; }
#checkout-form label { display: block; margin-bottom: 12px; font-size: 14px; }
#checkout-form input[type=text], #checkout-form input:not([type]), #checkout-form input[type=email], #checkout-form input[type=tel], #checkout-form textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 15px; font-family: inherit; }
#checkout-form input[type=radio] { margin-right: 6px; }
#checkout-form fieldset label:has(input[type=radio]) { display: inline-block; margin-right: 20px; }
#checkout-summary { background: var(--soft); padding: 16px; border-radius: var(--radius); margin: 16px 0; font-weight: 600; }
#order-result { margin-top: 20px; padding: 20px; border-radius: var(--radius); }
#order-result.success { background: #e8f5e9; border: 1px solid #4caf50; }
#order-result.error { background: #ffebee; border: 1px solid #f44336; }

/* Text pages */
.text-page { background: #fff; padding: 0; }
.text-page p { margin: 0 0 1em; }

.site-footer {
  background: #1a1a1a; color: #bbb;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 40px; padding: 60px 24px;
}
.site-footer h4 { color: #fff; margin-top: 0; }
.site-footer a { color: var(--red); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); }
.modal-panel { position: relative; background: #fff; width: min(720px, 95vw); max-height: 92vh; overflow-y: auto; border-radius: var(--radius); padding: 28px; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.modal-close { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 999px; border: 0; background: #f3f3f3; cursor: pointer; font-size: 22px; line-height: 1; }
.modal-product { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 16px; }
.modal-product img { width: 140px; height: 140px; object-fit: cover; border-radius: var(--radius); }
.modal-product h2 { margin: 0 0 12px; }
.size-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.size-tab { padding: 10px 16px; border: 2px solid var(--border); background: #fff; border-radius: var(--radius); cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-width: 90px; }
.size-tab.active { border-color: var(--red); background: #fff5f5; }
.size-tab strong { font-size: 14px; }
.size-tab span { font-size: 13px; color: var(--muted); }
.opt-group { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 14px; }
.opt-group legend { font-weight: 700; padding: 0 6px; }
.opt-group .req { color: var(--red); }
.opt-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.opt-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; background: var(--soft); border-radius: 8px; }
.opt-item label { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.opt-label { font-weight: 600; font-size: 14px; }
.opt-price { font-size: 12px; color: var(--red); font-weight: 600; }
.opt-qty { display: flex; align-items: center; gap: 8px; }
.opt-qty button { width: 30px; height: 30px; border: 1px solid var(--border); background: #fff; border-radius: 6px; cursor: pointer; font-size: 18px; font-weight: 700; }
.opt-qty button:disabled { opacity: .4; cursor: not-allowed; }
.opt-qty span { min-width: 20px; text-align: center; font-weight: 700; }
.modal-footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 14px; border-top: 2px solid var(--border); margin-top: 14px; flex-wrap: wrap; }
.modal-total { font-size: 18px; }
.modal-footer .btn-big { width: auto; flex: 1; max-width: 320px; }

/* Responsive */
@media (max-width: 768px) {
  .site-header { padding: 10px 14px; }
  .main-nav { gap: 10px; }
  .main-nav a { font-size: 13px; }
  .main-nav .phone { padding: 6px 10px; font-size: 12px; }
  .hero { padding: 60px 16px; }
  .section { padding: 40px 16px; }
  .cat-nav { top: 56px; }
}
@media (max-width: 480px) {
  .brand-name { font-size: 18px; }
  .main-nav .phone { display: none; }
  .grid { grid-template-columns: 1fr; }
  .modal-product { flex-direction: column; }
  .modal-product img { width: 100%; height: 180px; }
  .modal-panel { padding: 18px; }
  .opt-items { grid-template-columns: 1fr; }
}
