:root {
  --blue: #0072ce;
  --blue-dark: #0057a8;
  --blue-deep: #003d7a;
  --navy: #0f1720;
  --ink: #1c2430;
  --muted: #5b6775;
  --line: #e6ebf0;
  --bg: #f4f7fb;
  --white: #fff;
  --whats: #25d366;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(15, 23, 32, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
img { max-width: 100%; }

.topbar {
  background: var(--navy);
  color: #d7e2ee;
  font-size: 13px;
}
.topbar-inner, .header-inner, .cats-nav-inner, .wrap {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
}
.topbar-inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  min-height: 36px;
  flex-wrap: wrap;
}
.topbar a:hover { color: #fff; }
.top-links, .top-contact { display: flex; gap: 16px; flex-wrap: wrap; }

.header {
  background: var(--blue);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 4px 16px rgba(0, 82, 163, 0.28);
}
.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 12px 0;
}
.header-actions .action span { line-height: 1.15; }
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  font-size: 18px;
  white-space: nowrap;
}
.brand img { width: 48px; height: 48px; border-radius: 12px; background: #fff; padding: 2px; }

.search {
  display: flex;
  background: #fff;
  border-radius: 999px;
  overflow: hidden;
}
.search input {
  border: 0;
  padding: 12px 16px;
  width: 100%;
  outline: none;
  color: var(--ink);
}
.search button {
  border: 0;
  background: var(--blue-deep);
  color: #fff;
  padding: 0 18px;
  cursor: pointer;
}

.header-actions { display: flex; gap: 10px; align-items: center; }
.action {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.12);
  border: 0;
  color: #fff;
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
}
.action small { display: block; font-size: 11px; opacity: .85; }
.cart-count {
  background: #fff;
  color: var(--blue);
  border-radius: 999px;
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}

.cats-nav { background: #fff; border-bottom: 1px solid var(--line); }
.cats-nav-inner {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 0;
}
.cats-nav button, .chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  white-space: nowrap;
  cursor: pointer;
  color: var(--ink);
}
.cats-nav button.active, .chip.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.hero {
  width: min(1240px, calc(100% - 32px));
  margin: 20px auto 0;
  border-radius: 18px;
  overflow: hidden;
  min-height: 280px;
  background:
    radial-gradient(circle at 80% 20%, rgba(255,255,255,.18), transparent 30%),
    linear-gradient(110deg, #003d7a 0%, #0072ce 55%, #4aa3e8 100%);
  color: #fff;
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  align-items: center;
  padding: 36px;
  box-shadow: var(--shadow);
}
.hero h1 { font-size: clamp(32px, 5vw, 56px); margin: 8px 0 12px; line-height: .95; }
.hero p { max-width: 520px; font-size: 18px; opacity: .95; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  border: 0;
  cursor: pointer;
}
.btn-white { background: #fff; color: var(--blue-dark); }
.btn-ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.45); }
.btn-whats { background: var(--whats); color: #fff; }
.btn-block { width: 100%; margin-top: 16px; }
.btn-muted { width: 100%; margin-top: 8px; background: #eef2f6; color: var(--ink); }
.hero-card {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 16px;
  padding: 18px;
  backdrop-filter: blur(6px);
}
.hero-card strong { font-size: 22px; display: block; }

.section { width: min(1240px, calc(100% - 32px)); margin: 28px auto; }
.section h2 { margin: 0 0 14px; font-size: 26px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 14px; }

.cat-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}
.cat-card {
  background: #fff;
  border-radius: 16px;
  padding: 10px 10px 14px;
  text-align: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.cat-card:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(15, 23, 32, 0.12);
}
.icon {
  width: 100%;
  height: 110px;
  margin: 0 auto 10px;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.icon img, .thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}
.cat-card span { font-size: 13px; font-weight: 700; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.product {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.thumb {
  position: relative;
  height: 168px;
  background: #fff;
  overflow: hidden;
}
.badge-new {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  background: #e11d48;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
}
.product-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.tag { color: var(--blue); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.product h3 { margin: 0; font-size: 15px; line-height: 1.3; min-height: 40px; }
.price-old {
  display: inline-block;
  margin-right: 6px;
  color: #7a8794;
  font-weight: 600;
  text-decoration: line-through;
  font-size: 13px;
}
.price small { font-weight: 700; color: #be123c; }
.badge-promo {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  background: #0b63ce;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
}
.badge-out {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 1;
  background: #13202e;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 999px;
}
.product.is-out .buy, .product.is-out .add { opacity: .45; pointer-events: none; }
.product-actions { display: flex; gap: 8px; margin-top: auto; }
.product-actions button, .product-actions a {
  flex: 1;
  text-align: center;
  border-radius: 10px;
  padding: 9px 8px;
  font-size: 13px;
  font-weight: 700;
  border: 0;
  cursor: pointer;
}
.add { background: #e8f3fc; color: var(--blue-dark); }
.buy { background: var(--blue); color: #fff; }

.about, .contact-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 16px;
}
.panel {
  background: #fff;
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.panel h2 { margin-top: 0; }
.hours { color: var(--muted); }

footer {
  background: var(--navy);
  color: #c9d6e4;
  margin-top: 40px;
  padding: 32px 0 18px;
}
.footer-grid {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 20px;
}
.footer-brand { display: flex; gap: 10px; align-items: center; color: #fff; font-weight: 800; }
.copy { text-align: center; font-size: 13px; opacity: .7; margin-top: 18px; }

.drawer {
  position: fixed;
  inset: 0;
  background: rgba(15,23,32,.45);
  display: none;
  z-index: 40;
}
.drawer.open { display: block; }
.drawer-panel {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: min(380px, 100%);
  background: #fff;
  padding: 20px;
  overflow: auto;
}
.cart-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: var(--whats);
  color: #fff;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 28px;
  box-shadow: 0 10px 24px rgba(37, 211, 102, .4);
  z-index: 15;
}

.ai-fab {
  position: fixed;
  right: 18px;
  bottom: 86px;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 114, 206, .35);
  z-index: 16;
}
.ai-panel {
  position: fixed;
  right: 18px;
  bottom: 88px;
  width: min(360px, calc(100vw - 24px));
  height: min(440px, calc(100vh - 110px));
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(15, 23, 32, .2);
  display: flex;
  flex-direction: column;
  z-index: 30;
  overflow: hidden;
}
.ai-panel[hidden] { display: none; }
.ai-panel header {
  background: var(--blue-deep);
  color: #fff;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ai-panel header small { display: block; opacity: .8; font-size: 12px; font-weight: 400; }
.ai-panel header button {
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}
.ai-messages {
  flex: 1;
  overflow: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f4f7fb;
}
.ai-msg {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}
.ai-msg.bot { background: #fff; align-self: flex-start; }
.ai-msg.user { background: #d7ebfb; align-self: flex-end; }
.ai-suggest {
  display: flex;
  gap: 6px;
  padding: 8px 12px 0;
  flex-wrap: wrap;
}
.ai-suggest button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}
.ai-panel form {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
}
.ai-panel input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
}
.ai-panel form button {
  background: var(--blue);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 0 14px;
  font-weight: 700;
  cursor: pointer;
}
.ai-whats {
  display: block;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--whats);
  padding: 0 12px 8px;
}
.ai-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 12px 12px;
}
.ai-actions a {
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  border-radius: 10px;
  padding: 8px 6px;
  background: #e8f1fb;
  color: var(--blue);
}

@media (max-width: 980px) {
  .header-inner, .hero, .cat-grid, .product-grid, .about, .contact-grid, .footer-grid {
    grid-template-columns: 1fr;
  }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .header-inner { grid-template-columns: 1fr auto; }
  .search { grid-column: 1 / -1; }
  .brand { font-size: 15px; }
  .brand img { width: 40px; height: 40px; }
  .header-actions .action span { display: none; }
  .action { padding: 8px 10px; }
  .hero-card { display: none; }
}
