@import url("https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

:root {
  --font-display: 'Sora', 'Plus Jakarta Sans', system-ui, sans-serif;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --bg: #F7F7FB;
  --bg-subtle: #FBFBFD;
  --bg-muted: #EDECF7;
  --bg-elevated: #F1F0FA;
  --bg-card: #FFFFFF;
  --thumb-bg: #F1EFFB;

  --text: #14151A;
  --muted: #64657A;
  --muted-2: #8B8CA0;

  --accent: #5B4FE8;
  --accent-hover: #4A3FD6;
  --accent-soft: rgba(91, 79, 232, 0.13);
  --on-accent: #FFFFFF;

  --border: #E4E3F0;
  --border-strong: #CFCDE6;

  --danger: #E0335A;
  --success: #17A673;

  --shadow-sm: 0 2px 10px rgba(20, 21, 26, 0.05);
  --shadow-card: 0 10px 28px rgba(30, 27, 80, 0.07);
  --shadow-card-hover: 0 18px 40px rgba(30, 27, 80, 0.12);
  --shadow-accent: 0 14px 30px rgba(91, 79, 232, 0.24);

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --header-h: 74px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 0.6em;
  color: var(--text);
}

p { color: var(--muted); }

a { color: inherit; }

img { display: block; max-width: 100%; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Buttons & inputs ---------- */

.btn, button, .btn-wa, .btn-primary, .btn-secondary, .btn-outline {
  font-family: var(--font);
  cursor: pointer;
  border: 1px solid transparent;
  padding: 0.85rem 1.35rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
  transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease, border-color .16s ease, filter .16s ease;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  color: var(--on-accent);
  box-shadow: var(--shadow-accent);
}
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.04); }

.btn-outline, .btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--text);
}
.btn-outline:hover, .btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn-wa, .btn-cart { background: var(--bg-card); color: var(--text); }

.btn-icon {
  width: 44px; height: 44px;
  padding: 0;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  position: relative;
}
.btn-icon svg { width: 20px; height: 20px; }
.btn-icon:hover { border-color: var(--accent); color: var(--accent); }

.cart-badge, .badge {
  position: absolute;
  top: -6px; right: -6px;
  min-width: 20px; height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px var(--bg-card);
}

.inp, .input, select.inp, textarea.inp, .input[type="text"], textarea.input {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.inp:focus, .input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--bg-card); }
.inp::placeholder, .input::placeholder { color: var(--muted-2); }

.field { display: block; }
.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

/* ---------- Header ---------- */

.app-header {
  background: rgba(247, 247, 251, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
}
.header-flex { height: 100%; display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; }

.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: inherit; min-width: 0; }
.brand-logo { height: 40px; width: 40px; border-radius: 10px; object-fit: cover; background: var(--bg-elevated); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.b-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.b-tag {
  font-size: 0.72rem;
  color: var(--muted-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.nav { display: flex; align-items: center; gap: 1.75rem; }
.nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
  transition: color .16s ease;
}
.nav a:hover { color: var(--accent); }

.header-actions { display: flex; align-items: center; gap: 0.6rem; flex-shrink: 0; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 4.5rem 0 4rem;
  isolation: isolate;
}
.hero-blob {
  position: absolute;
  top: -180px; right: -140px;
  width: 520px; height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(91, 79, 232, 0.28), rgba(91, 79, 232, 0) 70%);
  filter: blur(10px);
  z-index: -1;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -220px; left: -160px;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle at 60% 60%, rgba(91, 79, 232, 0.14), rgba(91, 79, 232, 0) 70%);
  z-index: -1;
}
.hero-inner { max-width: 720px; }
.hero-kicker {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1.1rem;
}
.hero h1 {
  font-size: clamp(2rem, 4.2vw, 3.1rem);
  margin-bottom: 0.65em;
}
.hero p { font-size: 1.08rem; max-width: 58ch; margin-bottom: 1.75rem; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 0.85rem; }

/* ---------- Filters / categories ---------- */

.filters-section { padding: 0 0 2.25rem; }
.filters-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}
.search-field {
  position: relative;
  flex: 1 1 320px;
  max-width: 440px;
  color: var(--muted-2);
}
.search-field svg {
  position: absolute;
  left: 0.9rem; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  pointer-events: none;
}
.search-field .inp-search { padding-left: 2.6rem; }
.filters-stats {
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
}
.filters-stats strong { color: var(--text); }

.cat-chips { display: flex; gap: 0.65rem; overflow-x: auto; padding: 0.2rem 0.1rem 0.6rem; scrollbar-width: thin; }
.chip {
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  white-space: nowrap;
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.88rem;
  transition: all .16s ease;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.is-active {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-accent);
}

/* ---------- Products ---------- */

.products-section { padding: 0.5rem 0 3.5rem; }
.sec-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1.4rem;
  gap: 1rem;
}
.sec-head h2 { margin-bottom: 0; font-size: 1.5rem; }
.badge-count { font-size: 0.85rem; color: var(--muted); font-weight: 600; }

.products-grouped, .products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border-strong);
}
.card-thumb-wrap { position: relative; aspect-ratio: 1; background: var(--thumb-bg); }
.card-thumb { width: 100%; height: 100%; object-fit: cover; }
.card-badge {
  position: absolute;
  top: 0.7rem; left: 0.7rem;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.32rem 0.6rem;
  border-radius: 999px;
  box-shadow: var(--shadow-accent);
  z-index: 1;
}
.card-body { padding: 1.15rem; display: flex; flex-direction: column; flex: 1; gap: 0.2rem; }
.card-cat {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}
.card-body h3 {
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.15rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  margin-top: 0.15rem;
}
.card-price small { font-size: 0.72rem; font-weight: 600; color: var(--muted-2); }
.card-var { font-size: 0.78rem; color: var(--muted-2); margin-bottom: 0.5rem; }
.card-actions { display: flex; gap: 0.55rem; margin-top: auto; }
.card-actions .btn { flex: 1; padding: 0.7rem 0.6rem; font-size: 0.86rem; }
.btn-add-modal { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%); color: #fff; border: none; }

/* ---------- Benefits ---------- */

.benefits-section { padding: 0.5rem 0 3.5rem; }
.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}
.benefit-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  box-shadow: var(--shadow-sm);
}
.benefit-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 1rem;
}
.benefit-icon svg { width: 20px; height: 20px; }
.benefit-card h3 { font-size: 1.02rem; margin-bottom: 0.35em; }
.benefit-card p { font-size: 0.9rem; margin-bottom: 0; }

/* ---------- Footer ---------- */

.app-footer {
  background: var(--bg-muted);
  border-top: 1px solid var(--border);
  padding: 3rem 0 0;
  margin-top: 1rem;
}
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 2.5rem;
}
.footer-brand-col { max-width: 460px; }
.footer-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 0.4rem;
}
.footer-quote { color: var(--muted); font-size: 0.94rem; }
.footer-cta-col { text-align: right; }
.footer-cta-text { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.6rem; }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
  padding: 1.25rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted-2);
}

/* ---------- Cart drawer ---------- */

.cart-backdrop, .modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(20, 21, 26, 0.45);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.cart-backdrop.is-open, .modal-backdrop.is-open { opacity: 1; pointer-events: auto; }

.cart-panel {
  position: fixed; right: 0; top: 0; bottom: 0;
  width: min(400px, 100%);
  background: var(--bg-card);
  z-index: 1001;
  transform: translateX(100%);
  transition: transform .3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -18px 0 40px rgba(20, 21, 26, 0.12);
}
.cart-panel.is-open { transform: translateX(0); }
.cart-head {
  padding: 1.4rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cart-head h2 { margin-bottom: 0; font-size: 1.1rem; }
.cart-coupon-form { display: flex; gap: 0.5rem; padding: 0 1.5rem; margin-top: 1rem; }
.cart-coupon-form .inp, .cart-coupon-form .input { flex: 1; }
.cart-body { padding: 1rem 1.5rem; flex: 1; overflow-y: auto; }
.cart-line {
  display: flex;
  gap: 0.85rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.cart-line img {
  width: 64px; height: 64px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--thumb-bg);
  flex-shrink: 0;
}
.cart-line > div { flex: 1; min-width: 0; }
.line-title { font-weight: 700; font-size: 0.92rem; margin-bottom: 0.15rem; }
.line-meta { font-size: 0.8rem; color: var(--muted-2); }
.line-price { font-weight: 800; font-size: 0.92rem; margin: 0.3rem 0; }
.qty-row { display: flex; align-items: center; gap: 0.6rem; margin: 0.3rem 0; }
.qty-btn {
  width: 28px; height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.qty-btn:hover { border-color: var(--accent); color: var(--accent); }
.qty-val { font-weight: 700; min-width: 1.4rem; text-align: center; }
.line-remove {
  background: none; border: none;
  color: var(--danger);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.cart-coupon-section { padding-bottom: 1rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border); }
.cart-coupon-title { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); margin-bottom: 0.6rem; }
.cart-coupon-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.6rem; }
.cart-coupon-chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--accent-soft);
  color: var(--accent-hover);
  border: none;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.cart-coupon-feedback { font-size: 0.82rem; margin-top: 0.5rem; color: var(--muted); }
.cart-coupon-feedback.is-error { color: var(--danger); }
.cart-coupon-feedback.is-success { color: var(--success); }
.cart-discount-box { margin-top: 0.6rem; display: flex; flex-direction: column; gap: 0.25rem; }
.cart-discount-row { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--success); }

.cart-foot { padding: 1.25rem 1.5rem 1.5rem; border-top: 1px solid var(--border); }
.cart-total-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.95rem; margin-bottom: 0.5rem; }
.cart-total-row-discount { color: var(--success); }
.cart-actions { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.9rem; }
.cart-actions .btn { width: 100%; }
.cart-foot-empty { padding: 2rem 1.5rem; text-align: center; }
.cart-empty { color: var(--muted-2); font-size: 0.9rem; }

/* ---------- Modals ---------- */

.modal {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-card);
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  width: 92%;
  max-width: 440px;
  z-index: 1001;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-card-hover);
}
.btn-close, .modal-close {
  position: absolute;
  top: 0.9rem; right: 0.9rem;
  width: 32px; height: 32px;
  background: var(--bg-elevated);
  border: none;
  border-radius: 999px;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
}
.btn-close:hover, .modal-close:hover { color: var(--accent); }
.modal h3 { font-size: 1.2rem; padding-right: 2rem; }
.modal .desc { color: var(--muted); font-size: 0.9rem; margin-bottom: 1rem; }
.modal-product-img, .modal-product-img#modal-product-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  background: var(--thumb-bg);
}
.price-big, .modal-price { font-size: 1.55rem; font-weight: 800; color: var(--accent-hover); margin: 0.6rem 0; }
#modal-product-desc { color: var(--muted); font-size: 0.9rem; margin-bottom: 0.4rem; }
.var-grid { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 0.5rem; }
.var-opt {
  padding: 0.55rem 0.95rem;
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  color: var(--text);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 600;
}
.var-opt.is-selected { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-hover); }
.var-opt.is-disabled, .var-opt[disabled] { opacity: 0.45; cursor: not-allowed; }
#modal-var-label, .var-label { font-size: 0.85rem; font-weight: 700; color: var(--muted); margin: 0.9rem 0 0.3rem; }
.modal-actions { display: flex; gap: 0.6rem; margin-top: 1.1rem; }
.modal-actions .btn, .modal button.btn-primary, .modal button.btn-secondary { flex: 1; }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .nav { display: none; }
  .footer-grid { flex-direction: column; align-items: flex-start; text-align: left; }
  .footer-cta-col { text-align: left; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero { padding: 3rem 0 2.5rem; }
  .filters-head { flex-direction: column; align-items: stretch; }
  .filters-stats { order: 2; }
  .search-field { max-width: none; }
  .cart-panel { width: 100%; }
}
