/* ============================================================
   EnergyHouse BG — storefront stylesheet
   Design tokens: 4px spacing scale (4/8/16/24/32/48)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;800&display=swap');
:root {
  --brand: #f7941d;
  --brand-dark: #e07f12;
  --brand-2: #f05a2b;
  --brand-soft: #fff4e4;
  --ink: #1c2b3a;
  --ink-2: #405062;
  --muted: #6b7684;
  --line: #e3e8ee;
  --bg: #f6f7f9;
  --card: #ffffff;
  --green: #1d9a56;
  --red: #d64545;
  --radius: 14px;
  --radius-sm: 10px;
  /* 4px spacing scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 16px;
  --sp-4: 24px;
  --sp-5: 32px;
  --sp-6: 48px;
  --shadow: 0 10px 30px rgba(28, 43, 58, .08);
  --shadow-lg: 0 18px 50px rgba(28, 43, 58, .16);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: Roboto, "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font: inherit; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 20px; }

/* ---------- top bar ---------- */
.topbar { background: var(--ink); color: #cfd9e4; font-size: 13px; }
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; min-height: 38px; gap: 14px; }
.topbar a { color: #fff; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.topbar .links { display: flex; gap: 18px; }

/* ---------- header ---------- */
.header { background: var(--card); position: sticky; top: 0; z-index: 50; box-shadow: 0 1px 0 var(--line), 0 8px 24px rgba(28,43,58,.05); }
.header .wrap { display: flex; align-items: center; gap: var(--sp-3); height: 76px; }
.logo img { height: 46px; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: var(--sp-2); }
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; color: var(--ink-2); transition: .15s; }
.icon-btn:hover { background: var(--brand-soft); color: var(--brand); }
.icon-btn .badge { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.search-box { flex: 1; max-width: 430px; display: flex; }
.search-box input { flex: 1; border: 2px solid var(--line); border-right: none; border-radius: 12px 0 0 12px; padding: 0 16px; height: 46px; outline: none; }
.search-box input:focus { border-color: var(--brand); }
.search-box button { width: 52px; border-radius: 0 12px 12px 0; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; }
.search-box button:hover { background: var(--brand-dark); }

/* ---------- nav ---------- */
.nav { background: var(--card); border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; gap: 4px; overflow-x: auto; }
.nav a { padding: 15px 16px; font-weight: 600; color: var(--ink-2); white-space: nowrap; border-bottom: 3px solid transparent; }
.nav a:hover, .nav a.active { color: var(--brand); border-color: var(--brand); }

/* ---------- hero slider ---------- */
.hero { position: relative; overflow: hidden; }
.hero-track { display: flex; transition: transform .5s ease; }
.hero-slide { min-width: 100%; height: clamp(320px, 42vw, 480px); background-size: cover; background-position: center; display: flex; align-items: center; }
.hero-dots { position: absolute; bottom: 18px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; }
.hero-dots button { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.5); }
.hero-dots button.on { background: #fff; transform: scale(1.2); }
.hero-arrows button { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.85); color: var(--ink); font-size: 22px; box-shadow: var(--shadow); opacity: 0; transition: .2s; }
.hero:hover .hero-arrows button { opacity: 1; }
.hero-arrows .prev { left: 16px; } .hero-arrows .next { right: 16px; }

/* ---------- features strip ---------- */
.features { background: var(--card); border-bottom: 1px solid var(--line); }
.features .wrap { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; padding-top: 18px; padding-bottom: 18px; }
.feature { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 10px 6px; border-radius: 12px; transition: .15s; }
.feature:hover { background: var(--brand-soft); }
.feature svg { width: 34px; height: 34px; stroke: var(--brand); fill: none; stroke-width: 1.7; }
.feature span { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }

/* ---------- sections ---------- */
.section { padding: var(--sp-6) 0; }
.section.alt + .section.alt { padding-top: var(--sp-4); }
.section-head { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.section-head h2 { font-size: clamp(24px, 3vw, 32px); font-weight: 800; letter-spacing: -.5px; }
.section-head .line { flex: 1; height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--brand), transparent); }
.section-head .more { color: var(--brand); font-weight: 700; white-space: nowrap; }
.section.alt { background: var(--card); }

/* ---------- product cards ---------- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: var(--sp-4); }
.product-card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: .2s; display: flex; flex-direction: column; }
.product-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); border-color: transparent; }
.card-badges { position: absolute; top: var(--sp-3); left: var(--sp-3); z-index: 2; display: flex; flex-direction: column; gap: var(--sp-2); }
.badge { padding: 4px 10px; border-radius: 8px; font-size: 11.5px; font-weight: 800; letter-spacing: .4px; color: #fff; }
.badge.promo { background: var(--brand); }
.badge.soldout { background: #8b95a1; }
.card-img { display: block; background: #eef1f5; }
.card-img img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.sold-out .card-img img { filter: grayscale(.9) opacity(.75); }
.card-body { padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-body h3 { font-size: 15.5px; line-height: 1.35; min-height: 2.6em; }
.card-meta { font-size: 12.5px; color: var(--muted); }
.card-meta b { color: var(--ink-2); }
.stars { color: #f5a623; font-size: 13px; letter-spacing: 1px; }
.stars small { color: var(--muted); letter-spacing: 0; }
.price-block { margin-top: auto; background: var(--bg); border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; }
.price-ton { font-size: 12.5px; color: var(--muted); }
.price-ton b { color: var(--brand); font-size: 20px; letter-spacing: -.5px; }
.price-pallet { font-size: 15px; font-weight: 700; }
.price-pallet small { color: var(--muted); font-weight: 600; }
.price-old { text-decoration: line-through; color: var(--muted); font-weight: 600; font-size: 13px; margin-right: 6px; }
.card-actions { display: flex; gap: 8px; padding: 0 16px 16px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 12px; font-weight: 700; transition: .15s; border: 2px solid transparent; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(242,101,34,.35); }
.btn-primary:hover { background: var(--brand-dark); transform: translateY(-1px); }
.btn-ghost { border-color: var(--line); color: var(--ink-2); width: 48px; padding: 12px 0; }
.btn-ghost:hover, .btn-ghost.active { color: var(--red); border-color: var(--red); }
.btn-outline { border-color: var(--brand); color: var(--brand); }
.btn-outline:hover { background: var(--brand-soft); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }

/* ---------- story / steps / reasons / faq ---------- */
.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.split h2 { font-size: clamp(24px, 3vw, 34px); margin-bottom: 14px; }
.split p { color: var(--ink-2); margin-bottom: 12px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: step; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; position: relative; }
.step::before { counter-increment: step; content: counter(step); position: absolute; top: -14px; left: 18px; width: 34px; height: 34px; border-radius: 10px; background: var(--brand); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 14px rgba(242,101,34,.35); }
.step h3 { font-size: 16px; margin: 10px 0 6px; }
.step p { font-size: 13.5px; color: var(--muted); }
.reasons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.reason { display: flex; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.reason svg { width: 38px; height: 38px; flex: none; stroke: var(--brand); fill: none; stroke-width: 1.6; }
.reason h3 { font-size: 16px; margin-bottom: 4px; }
.reason p { font-size: 13.5px; color: var(--muted); }
.reviews { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.review { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.review .who { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.review .ava { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), #ffb27a); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.review h4 { font-size: 14px; }
.review .stars { font-size: 12px; }
.review p { font-size: 13.5px; color: var(--ink-2); margin-top: 8px; }

.faq { max-width: 900px; margin: 0 auto; }
.faq-item { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
.faq-item > button { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: left; padding: 16px 20px; font-weight: 700; font-size: 15px; }
.faq-item > button::after { content: '+'; font-size: 22px; color: var(--brand); transition: .2s; }
.faq-item.open > button::after { transform: rotate(45deg); }
.faq-item .answer { max-height: 0; overflow: hidden; transition: max-height .25s ease; color: var(--ink-2); }
.faq-item.open .answer { max-height: 300px; }
.faq-item .answer p { padding: 0 20px 18px; font-size: 14.5px; }

.cta-band { background: linear-gradient(120deg, var(--ink), #2c3e55); color: #fff; border-radius: 20px; padding: 40px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.cta-band h2 { font-size: clamp(20px, 2.6vw, 30px); }

/* ---------- footer ---------- */
.footer { background: var(--ink); color: #b9c4d0; margin-top: 60px; }
.footer .wrap { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1.2fr; gap: 34px; padding-top: 50px; padding-bottom: 30px; }
.footer h4 { color: #fff; font-size: 15px; margin-bottom: 14px; letter-spacing: .3px; }
.footer a { display: block; padding: 4px 0; color: #b9c4d0; }
.footer a:hover { color: var(--brand); }
.footer p { font-size: 13.5px; margin-bottom: 10px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); }
.footer-bottom .wrap { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 16px; padding-bottom: 16px; font-size: 13px; }
.footer img.pay { height: 42px; background: var(--card); border-radius: 8px; padding: 4px; }

/* ---------- cart drawer ---------- */
.overlay { position: fixed; inset: 0; background: rgba(18, 28, 40, .5); opacity: 0; pointer-events: none; transition: .25s; z-index: 90; }
.overlay.show { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(430px, 100%); background: var(--card); z-index: 95; transform: translateX(105%); transition: .3s; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.drawer.show { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h3 { font-size: 18px; }
.drawer-items { flex: 1; overflow: auto; padding: 14px 20px; }
.drawer-foot { border-top: 1px solid var(--line); padding: 18px 20px; display: grid; gap: 10px; }
.cart-line { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.cart-line img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: #eef1f5; }
.cart-line .n { font-size: 13.5px; font-weight: 700; line-height: 1.3; }
.cart-line .qty { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; }
.cart-line .qty button { width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--line); font-weight: 800; color: var(--ink-2); }
.cart-line .qty span { min-width: 20px; text-align: center; font-weight: 700; }
.cart-line .p { margin-left: auto; font-weight: 800; color: var(--brand); white-space: nowrap; }
.cart-empty { text-align: center; color: var(--muted); padding: 60px 20px; }
.cart-empty svg { width: 60px; height: 60px; stroke: #c4cdd6; fill: none; stroke-width: 1.4; margin: 0 auto 12px; }

/* ---------- tables / forms ---------- */
.table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
.table th { background: #f0f3f7; font-size: 12.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-2); }
.table td img { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.page-title { font-size: clamp(24px, 3vw, 34px); font-weight: 800; margin-bottom: 6px; }
.page-sub { color: var(--muted); margin-bottom: 28px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 5px; }
.field label .req { color: var(--brand); }
.input, .field input, .field select, .field textarea {
  width: 100%; border: 2px solid var(--line); border-radius: 10px; padding: 11px 14px; outline: none; background: #fff; transition: .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); }

.summary { position: sticky; top: 90px; }
.summary .row { display: flex; justify-content: space-between; padding: 6px 0; color: var(--ink-2); }
.summary .row.total { border-top: 2px solid var(--ink); margin-top: 10px; padding-top: 12px; font-size: 20px; font-weight: 800; color: var(--ink); }
.pay-methods { display: grid; gap: 10px; }
.pay-methods label { display: flex; gap: 12px; align-items: center; border: 2px solid var(--line); border-radius: 12px; padding: 14px; cursor: pointer; transition: .15s; }
.pay-methods label.sel { border-color: var(--brand); background: var(--brand-soft); }
.pay-methods input { accent-color: var(--brand); }
.pay-methods b { display: block; font-size: 14.5px; }
.pay-methods small { color: var(--muted); }

/* ---------- quick view / modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(18,28,40,.55); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 100; opacity: 0; pointer-events: none; transition: .2s; }
.modal-back.show { opacity: 1; pointer-events: auto; }
.modal { background: var(--card); border-radius: 18px; max-width: 860px; width: 100%; max-height: 90vh; overflow: auto; padding: 30px; display: grid; grid-template-columns: 1fr 1fr; gap: 26px; transform: scale(.96); transition: .2s; }
.modal-back.show .modal { transform: none; }
.modal .close { position: absolute; top: 14px; right: 18px; font-size: 26px; color: var(--muted); }
.modal .close:hover { color: var(--brand); }
.modal img.pv { border-radius: 12px; background: #eef1f5; }

/* ---------- toast ---------- */
#toast-box { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 120; display: grid; gap: 10px; width: min(430px, 92vw); }
.toast { background: var(--ink); color: #fff; padding: 14px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: center; font-size: 14px; animation: pop .25s ease; }
.toast.ok::before { content: '✓'; color: #57d38c; font-weight: 800; }
.toast.err::before { content: '!'; color: #ff9c9c; font-weight: 800; }
@keyframes pop { from { transform: translateY(14px); opacity: 0; } }

/* ---------- cookie bar ---------- */
.cookiebar { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(28,43,58,.97); color: #dbe4ee; padding: 14px 0; z-index: 80; }
.cookiebar .wrap { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.cookiebar button { background: var(--brand); color: #fff; border-radius: 10px; padding: 10px 18px; font-weight: 700; }

/* ---------- misc ---------- */
.breadcrumbs { font-size: 13px; color: var(--muted); margin: 18px 0; }
.breadcrumbs a:hover { color: var(--brand); }
.muted { color: var(--muted); }
.center { text-align: center; }
.tag-cat { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.rating-line { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.qty-pick { display: inline-flex; align-items: center; border: 2px solid var(--line); border-radius: 12px; overflow: hidden; }
.qty-pick button { width: 44px; height: 48px; font-size: 20px; color: var(--ink-2); }
.qty-pick button:hover { background: var(--brand-soft); color: var(--brand); }
.qty-pick input { width: 64px; text-align: center; border: none; outline: none; font-weight: 800; font-size: 16px; }
.stock-line { font-size: 13.5px; margin-bottom: 14px; }
.stock-line.yes { color: var(--green); font-weight: 700; }
.stock-line.no { color: var(--red); font-weight: 700; }
.success-hero { text-align: center; padding: 60px 20px; }
.success-hero .check { width: 84px; height: 84px; margin: 0 auto 20px; border-radius: 50%; background: #e8f8ef; color: var(--green); display: flex; align-items: center; justify-content: center; font-size: 40px; font-weight: 800; }
.info-band { background: #eef4fb; border: 1px solid #d7e4f5; border-radius: 12px; padding: 18px 20px; margin: 16px 0; font-size: 14.5px; }
.info-band b { color: var(--ink); }

/* responsive */
@media (max-width: 1060px) {
  .features .wrap { grid-template-columns: repeat(3, 1fr); }
  .steps, .reviews, .reasons { grid-template-columns: repeat(2, 1fr); }
  .footer .wrap { grid-template-columns: 1fr 1fr; }
  .search-box { display: none; }
}
@media (max-width: 720px) {
  .header .wrap { height: 64px; gap: 10px; }
  .logo img { height: 38px; }
  .features .wrap, .steps, .reviews, .reasons, .form-grid { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .modal { grid-template-columns: 1fr; }
  .footer .wrap { grid-template-columns: 1fr; gap: 20px; }
  .table-responsive { overflow-x: auto; }
}
