/* ── RESET & BASE ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #25D366;
  --primary-dark: #128C7E;
  --bg: #f4f4f4;
  --white: #ffffff;
  --text: #1a1a1a;
  --text-muted: #6b7280;
  --border: #e8e8e8;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(0,0,0,.07);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.14);
  --cart-width: 380px;
  --header-h: 68px;
}
body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }
.container { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.hidden { display: none !important; }
img { display: block; }

/* ── ANNOUNCE BAR ─────────────────────────────────────── */
.announce-bar {
  background: var(--primary-dark);
  color: #fff;
  text-align: center;
  font-size: .82rem;
  font-weight: 600;
  padding: 9px 16px;
  letter-spacing: .2px;
}

/* ── HEADER ───────────────────────────────────────────── */
.header {
  position: sticky; top: 0; z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.header-inner {
  max-width: 1240px; margin: 0 auto;
  padding: 0 16px;
  height: var(--header-h);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
}
.header-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.header-logo { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; }
.header-brand-text { min-width: 0; }
.header-name { font-size: 1.05rem; font-weight: 800; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-subtitle { color: var(--text-muted); font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.header-search {
  position: relative; display: flex; align-items: center;
  background: #f5f5f5; border: 1.5px solid #e0e0e0;
  border-radius: 999px; padding: 0 16px 0 42px;
  height: 44px; transition: border-color .2s, box-shadow .2s;
}
.header-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,211,102,.1); background: #fff; }
.header-search svg {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: #aaa; pointer-events: none;
}
.header-search input {
  border: none; background: transparent; outline: none;
  font-size: .9rem; font-family: inherit; color: var(--text);
  width: 100%; min-width: 0;
}
.header-search input::placeholder { color: #aaa; }

.cart-btn {
  position: relative; background: none; border: 2px solid var(--border);
  color: var(--text); border-radius: 50%; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: all .2s; flex-shrink: 0;
}
.cart-btn:hover { border-color: var(--primary); color: var(--primary); }
.cart-count {
  position: absolute; top: -5px; right: -5px;
  background: #ef4444; color: #fff;
  font-size: .68rem; font-weight: 700;
  min-width: 19px; height: 19px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
  border: 2px solid #fff;
}

/* ── BANNER ───────────────────────────────────────────── */
.banner {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  padding: 48px 16px;
  text-align: center;
  min-height: 160px;
  display: flex; align-items: center; justify-content: center;
  background-size: cover; background-position: center;
  position: relative;
}
.banner::after { content:''; position:absolute; inset:0; background:rgba(0,0,0,.25); pointer-events:none; }
.banner-content { position: relative; z-index: 1; }
.banner-title { color: #fff; font-size: clamp(1.5rem, 4vw, 2.4rem); font-weight: 900; text-shadow: 0 2px 12px rgba(0,0,0,.3); }
.banner-subtitle { color: rgba(255,255,255,.92); font-size: 1rem; margin-top: 8px; text-shadow: 0 1px 6px rgba(0,0,0,.3); font-weight: 500; }

/* ── TRUST STRIP ──────────────────────────────────────── */
.trust-strip {
  background: var(--white);
  border-bottom: 1px solid var(--border);
}
.trust-inner {
  max-width: 1240px; margin: 0 auto;
  padding: 16px;
  display: flex; align-items: center; justify-content: center;
  gap: 0; flex-wrap: wrap;
}
.trust-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 20px;
  flex: 1; min-width: 180px;
}
.trust-icon {
  color: var(--primary);
  display: flex; align-items: center; flex-shrink: 0;
}
.trust-text { display: flex; flex-direction: column; }
.trust-text strong { font-size: .82rem; font-weight: 700; color: var(--text); }
.trust-text span { font-size: .73rem; color: var(--text-muted); margin-top: 1px; }
.trust-divider { width: 1px; height: 36px; background: var(--border); flex-shrink: 0; }

/* ── CATEGORY CIRCLES ─────────────────────────────────── */
.cat-circles-section {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 16px 0 20px;
}
.section-label {
  font-size: .78rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .8px;
  margin-bottom: 14px;
}
.cat-circles-scroll {
  display: flex; gap: 16px;
  overflow-x: auto; padding-bottom: 4px;
  scrollbar-width: none;
}
.cat-circles-scroll::-webkit-scrollbar { display: none; }
.cat-circle {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  cursor: pointer; flex-shrink: 0; min-width: 72px;
  transition: transform .2s;
}
.cat-circle:hover { transform: translateY(-2px); }
.cat-circle-img {
  width: 68px; height: 68px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 800; color: #fff;
  border: 3px solid transparent;
  transition: border-color .2s, box-shadow .2s;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.cat-circle.active .cat-circle-img {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,211,102,.2), 0 2px 8px rgba(0,0,0,.12);
}
.cat-circle-name {
  font-size: .72rem; font-weight: 600; color: var(--text); text-align: center;
  max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cat-circle.active .cat-circle-name { color: var(--primary); }

/* ── PRODUCTS WRAPPER & SECTIONS ──────────────────────── */
.main-content { padding: 24px 0 100px; }

.products-section { margin-bottom: 36px; }
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.section-title {
  font-size: 1.2rem; font-weight: 800; color: var(--text);
  position: relative; padding-left: 14px;
}
.section-title::before {
  content: '';
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 4px; height: 1.2em; border-radius: 2px;
  background: var(--primary);
}

/* ── PRODUCTS GRID ────────────────────────────────────── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
@media (max-width: 480px) {
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

/* ── PRODUCT CARD ─────────────────────────────────────── */
.product-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  display: flex; flex-direction: column;
  border: 1px solid var(--border);
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.product-img-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #fafafa;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.product-img {
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 10px;
  transition: transform .3s;
}
.product-card:hover .product-img { transform: scale(1.05); }
.product-img-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: #f5f5f5; color: #ccc; font-size: 3rem;
}
.product-badge {
  position: absolute; top: 8px; left: 8px;
  background: #ef4444; color: #fff;
  font-size: .66rem; font-weight: 700;
  padding: 3px 8px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: .4px;
  z-index: 1;
}

.product-body { padding: 10px 12px 6px; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.product-brand { font-size: .68rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .6px; }
.product-name { font-size: .88rem; font-weight: 700; line-height: 1.35; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.product-footer { padding: 8px 12px 12px; margin-top: auto; }
.product-original-price { font-size: .75rem; color: #aaa; text-decoration: line-through; margin-bottom: 1px; }
.product-price-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.product-price { font-size: 1.05rem; font-weight: 800; color: var(--text); }
.product-discount-pct {
  font-size: .68rem; font-weight: 700;
  background: #fef2f2; color: #ef4444;
  padding: 2px 6px; border-radius: 4px;
}
.add-btn {
  background: var(--primary); color: #fff;
  border: none; border-radius: 8px;
  padding: 10px 12px; font-size: .82rem; font-weight: 700;
  cursor: pointer; transition: background .18s;
  width: 100%; text-align: center;
  display: flex; align-items: center; justify-content: center; gap: 5px;
}
.add-btn:hover { background: var(--primary-dark); }

/* ── LOADING / EMPTY ──────────────────────────────────── */
.loading-state {
  text-align: center; padding: 64px 16px; color: var(--text-muted);
}
.empty-state {
  text-align: center; padding: 64px 16px; color: var(--text-muted);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.spinner {
  width: 42px; height: 42px; border: 4px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin .8s linear infinite; margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── BOTTOM CART BAR ──────────────────────────────────── */
.bottom-cart-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 150;
  background: var(--primary);
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  cursor: pointer;
  transform: translateY(110%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 -4px 20px rgba(0,0,0,.2);
}
.bottom-cart-bar.visible { transform: translateY(0); }
.bottom-cart-bar-left { display: flex; align-items: center; gap: 10px; color: #fff; font-size: .9rem; font-weight: 700; }
.bottom-cart-bar-right { display: flex; align-items: center; gap: 16px; }
.bottom-cart-bar-right strong { color: #fff; font-size: 1.05rem; font-weight: 800; }
.bottom-cart-bar-action {
  background: rgba(255,255,255,.2); color: #fff;
  font-size: .8rem; font-weight: 700;
  padding: 6px 14px; border-radius: 999px;
}

/* ── CART SIDEBAR ─────────────────────────────────────── */
.cart-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 200;
}
.cart-overlay.open { display: block; }
.cart-sidebar {
  position: fixed; top: 0; right: -100%; bottom: 0; width: var(--cart-width); max-width: 100%;
  background: var(--white); z-index: 201; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; transition: right .3s cubic-bezier(.4,0,.2,1);
}
.cart-sidebar.open { right: 0; }
.cart-header {
  padding: 18px 20px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.cart-header h2 { font-size: 1.05rem; font-weight: 800; }
.close-btn { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--text-muted); padding: 4px; line-height: 1; }
.cart-items { flex: 1; overflow-y: auto; padding: 12px; }
.cart-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px 0; color: var(--text-muted); }
.cart-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px; border-radius: 10px; margin-bottom: 8px;
  background: var(--bg); border: 1px solid var(--border);
}
.cart-item-img { width: 54px; height: 54px; border-radius: 8px; object-fit: contain; background: #fff; padding: 2px; flex-shrink: 0; }
.cart-item-placeholder { width: 54px; height: 54px; border-radius: 8px; background: #f0f0f0; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: .86rem; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cart-item-price { font-size: .82rem; color: var(--primary); font-weight: 700; margin-top: 4px; }
.cart-item-qty { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.cart-item-qty button {
  width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--border);
  background: var(--white); cursor: pointer; font-size: 1rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; transition: all .18s;
}
.cart-item-qty button:hover { border-color: var(--primary); color: var(--primary); }
.cart-item-qty span { font-weight: 700; min-width: 20px; text-align: center; font-size: .9rem; }
.cart-footer { padding: 16px; border-top: 1px solid var(--border); flex-shrink: 0; background: var(--white); }
.cart-total { display: flex; justify-content: space-between; font-size: 1.05rem; font-weight: 800; margin-bottom: 14px; }

/* ── WHATSAPP BTN ─────────────────────────────────────── */
.whatsapp-btn {
  width: 100%; padding: 14px; border: none; border-radius: 10px;
  background: #25D366; color: #fff;
  font-size: .95rem; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .18s; text-decoration: none;
}
.whatsapp-btn:hover { background: #128C7E; }

/* ── PRODUCT MODAL ────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  z-index: 300; display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-overlay.hidden { display: none; }

.product-modal {
  background: var(--white); border-radius: 16px; overflow: hidden;
  width: 100%; max-width: 500px; position: relative;
  max-height: 92vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-close {
  position: absolute; top: 10px; right: 10px; z-index: 5;
  background: rgba(0,0,0,.5); color: #fff;
  border: none; border-radius: 50%; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: .9rem; line-height: 1;
}
.modal-close:hover { background: rgba(0,0,0,.7); }

.modal-gallery {
  position: relative; width: 100%; aspect-ratio: 1 / 1;
  overflow: hidden; background: #fafafa;
}
.carousel-track-wrap { width: 100%; height: 100%; overflow: hidden; }
.carousel-track { display: flex; height: 100%; transition: transform .3s ease; }
.carousel-img { flex-shrink: 0; width: 100%; height: 100%; object-fit: contain; padding: 16px; }
.carousel-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,.35); color: #fff;
  border: none; width: 34px; height: 34px; border-radius: 50%;
  font-size: 1.4rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; z-index: 2;
  transition: background .2s;
}
.carousel-btn:hover { background: rgba(0,0,0,.65); }
.carousel-prev { left: 8px; }
.carousel-next { right: 8px; }
.carousel-dots {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px; z-index: 2;
}
.carousel-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(0,0,0,.2); cursor: pointer; transition: background .2s;
}
.carousel-dot.active { background: var(--primary); }

.modal-body { padding: 20px 22px 26px; }
.modal-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.modal-badge {
  background: #ef4444; color: #fff;
  font-size: .68rem; font-weight: 700;
  padding: 3px 8px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: .4px;
}
.modal-brand { font-size: .72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.modal-body h2 { font-size: 1.25rem; font-weight: 800; line-height: 1.3; }
.modal-desc { color: var(--text-muted); font-size: .88rem; line-height: 1.65; margin-top: 10px; }

.modal-price-block { margin-top: 16px; }
.modal-original-price { font-size: .85rem; color: #aaa; text-decoration: line-through; margin-bottom: 2px; }
.modal-price-row { display: flex; align-items: center; gap: 10px; }
.modal-price { font-size: 1.65rem; font-weight: 900; color: var(--text); }
.modal-discount-pct {
  font-size: .8rem; font-weight: 700;
  background: #fef2f2; color: #ef4444;
  padding: 4px 10px; border-radius: 6px;
}

.modal-actions-row {
  display: flex; align-items: center; gap: 12px; margin-top: 20px;
}
.qty-control { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.qty-control button {
  width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--border);
  background: var(--white); font-size: 1.2rem; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all .18s;
}
.qty-control button:hover { border-color: var(--primary); color: var(--primary); }
.qty-control span { font-size: 1.05rem; font-weight: 700; min-width: 24px; text-align: center; }
.add-to-cart-btn {
  flex: 1; padding: 14px;
  background: var(--primary); color: #fff;
  border: none; border-radius: 10px; font-size: .95rem; font-weight: 700; cursor: pointer;
  transition: background .18s; white-space: nowrap;
}
.add-to-cart-btn:hover { background: var(--primary-dark); }

/* ── CHECKOUT MODAL ───────────────────────────────────── */
.checkout-modal {
  background: var(--white); border-radius: 16px; padding: 26px;
  width: 100%; max-width: 480px; position: relative;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.checkout-modal h2 { font-size: 1.2rem; font-weight: 800; margin-bottom: 18px; }
.checkout-modal .modal-close { top: 14px; right: 14px; }
.checkout-summary { margin-bottom: 4px; }
.checkout-item-row { display: flex; justify-content: space-between; font-size: .88rem; padding: 7px 0; border-bottom: 1px solid var(--border); }
.checkout-total-row { display: flex; justify-content: space-between; font-size: 1.05rem; font-weight: 800; padding: 14px 0 18px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: .82rem; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.form-group input, .form-group textarea {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--border);
  border-radius: 8px; font-size: .9rem; font-family: inherit;
  transition: border-color .18s; outline: none; resize: vertical;
  background: var(--white); color: var(--text);
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--primary); }

/* ── FOOTER ───────────────────────────────────────────── */
.footer {
  background: var(--white); border-top: 1px solid var(--border);
  padding: 20px 16px; text-align: center;
  color: var(--text-muted); font-size: .83rem;
}

/* ── TOAST ────────────────────────────────────────────── */
#toast {
  position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: #1a1a1a; color: #fff; padding: 11px 22px; border-radius: 999px;
  font-size: .85rem; font-weight: 600; z-index: 999;
  transition: transform .3s cubic-bezier(.4,0,.2,1); white-space: nowrap;
  box-shadow: var(--shadow-lg); pointer-events: none;
}
#toast.show { transform: translateX(-50%) translateY(0); }

/* ── RESPONSIVE ───────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --header-h: 60px; }
  .header-subtitle { display: none; }
  .trust-inner { gap: 0; }
  .trust-item { min-width: 140px; padding: 8px 12px; }
  .trust-divider { display: none; }
}

@media (max-width: 500px) {
  .header-name { font-size: .9rem; }
  .header-search input { font-size: .82rem; }
  .trust-strip { overflow-x: auto; }
  .trust-inner { flex-wrap: nowrap; justify-content: flex-start; padding: 12px 16px; }
  .trust-item { min-width: 160px; flex-shrink: 0; }

  .modal-overlay { padding: 0; align-items: flex-end; }
  .product-modal { border-radius: 20px 20px 0 0; max-height: 92vh; max-width: 100%; }
  .checkout-modal { border-radius: 20px 20px 0 0; max-height: 92vh; max-width: 100%; padding: 20px 18px; }
  .modal-body { padding: 16px 16px 26px; }
  .checkout-modal h2 { font-size: 1rem; }
}
