/* ============================================================
   VibeTech Store — Shared Stylesheet
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=DM+Mono:wght@400;500&display=swap');

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

:root {
  --t:     #24a19a;
  --td:    #1b7a74;
  --tl:    #e6f7f6;
  --tm:    #b2e4e2;
  --red:   #e53;
  --gold:  #f59e0b;
  --txt:   #1a1a1a;
  --muted: #6b7280;
  --border:#e5e7eb;
  --surf:  #ffffff;
  --bg:    #f5f6f8;
  --shadow: 0 1px 4px rgba(0,0,0,.07);
  --rad-sm:6px;
  --rad-md:8px;
  --rad-lg:12px;
  --rad-xl:16px;
}

body {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--txt);
  background: var(--bg);
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

/* ---- NAV ---- */
.nav {
  background: var(--t);
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(36,161,154,.3);
}
.nav-logo {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-logo img {
  height: 32px;
  width: auto;
  border-radius: 6px;
  object-fit: contain;
}
.nav-logo-text { color: #fff; }
.nav-logo-text strong { display: block; font-size: 16px; font-weight: 600; line-height: 1.1; }
.nav-logo-text small { font-size: 10px; opacity: .7; font-weight: 400; }
.nav-btn {
  background: rgba(255,255,255,.18);
  border: none;
  color: #fff;
  border-radius: var(--rad-md);
  padding: 7px 12px;
  cursor: pointer;
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  display: flex;
  align-items: center;
  gap: 5px;
  position: relative;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s;
}
.nav-btn:hover { background: rgba(255,255,255,.28); }
.cart-badge {
  background: var(--red);
  color: #fff;
  border-radius: 50%;
  width: 16px; height: 16px;
  font-size: 9px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
  position: absolute;
  top: -5px; right: -5px;
  border: 2px solid var(--t);
}

/* ---- BREADCRUMB ---- */
.breadcrumb {
  padding: 9px 16px;
  font-size: 11px;
  color: var(--muted);
  background: var(--surf);
  border-bottom: 1px solid var(--border);
}
.breadcrumb a { color: var(--t); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* ---- FLASH ---- */
.flash {
  margin: 12px 16px 0;
  padding: 10px 14px;
  border-radius: var(--rad-md);
  font-size: 12px;
  font-weight: 500;
}
.flash.ok { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.flash.err { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: var(--rad-md);
  padding: 10px 16px; font-size: 13px; font-weight: 500;
  cursor: pointer; font-family: 'DM Sans', sans-serif;
  text-decoration: none; transition: all .15s; white-space: nowrap;
}
.btn-primary { background: var(--t); color: #fff; width: 100%; padding: 12px; }
.btn-primary:hover { background: var(--td); }
.btn-secondary { background: var(--surf); color: var(--t); border: 1.5px solid var(--t); width: 100%; padding: 11px; }
.btn-secondary:hover { background: var(--tl); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-danger { background: #fee2e2; color: #991b1b; }
.btn-danger:hover { background: #fecaca; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--bg); color: var(--txt); }

/* ---- CARDS ---- */
.card {
  background: var(--surf);
  border: 1px solid var(--border);
  border-radius: var(--rad-lg);
  overflow: hidden;
}
.card-body { padding: 14px; }
.card-title {
  font-size: 12px; font-weight: 600; color: var(--txt);
  padding-bottom: 8px; margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* ---- PRODUCT GRID ---- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 14px;
}
@media (min-width: 600px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .product-grid { grid-template-columns: repeat(4, 1fr); }
}
.prod-thumb-card {
  background: var(--surf);
  border: 1px solid var(--border);
  border-radius: var(--rad-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: box-shadow .15s, transform .15s;
}
.prod-thumb-card:hover { box-shadow: 0 4px 16px rgba(36,161,154,.15); transform: translateY(-2px); }
.prod-thumb-img {
  background: var(--tl);
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
}
.prod-thumb-img img { width: 100%; height: 100%; object-fit: cover; }
.prod-thumb-img .no-img { font-size: 36px; }
.prod-badge {
  position: absolute; top: 8px; left: 8px;
  background: var(--red); color: #fff;
  font-size: 10px; font-weight: 600;
  padding: 2px 6px; border-radius: 4px;
}
.prod-thumb-info { padding: 10px; }
.prod-thumb-name { font-size: 12px; font-weight: 500; line-height: 1.4; margin-bottom: 4px; color: var(--txt); }
.prod-thumb-price { font-size: 14px; font-weight: 600; color: var(--red); }
.prod-thumb-orig { font-size: 11px; color: var(--muted); text-decoration: line-through; margin-left: 4px; }

/* ---- FORM ---- */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 11px; font-weight: 600; color: var(--muted); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .4px; }
.form-control {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: var(--rad-md);
  font-size: 13px; font-family: 'DM Sans', sans-serif; color: var(--txt);
  background: var(--surf); transition: border-color .15s;
  -webkit-appearance: none;
}
.form-control:focus { outline: none; border-color: var(--t); box-shadow: 0 0 0 3px rgba(36,161,154,.1); }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }
.form-hint { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ---- FOOTER ---- */
.footer {
  background: var(--surf);
  border-top: 1px solid var(--border);
  padding: 14px 16px;
  font-size: 11px;
  color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 8px;
  align-items: center; justify-content: space-between;
  margin-top: 24px;
}
.footer a { color: var(--t); text-decoration: none; }

/* ---- SECTION HEADER ---- */
.section-head {
  padding: 12px 16px 8px;
  display: flex; align-items: center; justify-content: space-between;
}
.section-head h2 { font-size: 14px; font-weight: 600; }

/* ---- CATEGORY CHIPS ---- */
.cat-strip {
  display: flex; gap: 8px;
  padding: 8px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cat-strip::-webkit-scrollbar { display: none; }
.cat-chip {
  flex-shrink: 0;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px; font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surf); color: var(--muted);
  cursor: pointer; text-decoration: none;
  transition: all .15s;
}
.cat-chip.active, .cat-chip:hover {
  background: var(--t); color: #fff; border-color: var(--t);
}

/* ---- STAR RATING ---- */
.stars { color: var(--gold); font-size: 12px; }

/* ---- DIVIDER ---- */
.divider { height: 1px; background: var(--border); margin: 12px 0; }

/* ---- SPECS TABLE ---- */
.spec-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 12px; border-bottom: 1px solid var(--border); }
.spec-row:last-child { border-bottom: none; }
.spec-key { color: var(--muted); }
.spec-val { color: var(--txt); font-weight: 500; text-align: right; max-width: 60%; }

/* ---- QUANTITY ---- */
.qty-ctrl {
  display: flex; align-items: center;
  border: 1px solid var(--border); border-radius: var(--rad-md); overflow: hidden;
}
.qty-btn {
  background: var(--bg); border: none; width: 36px; height: 36px;
  cursor: pointer; font-size: 16px; color: var(--txt);
  font-family: 'DM Sans', sans-serif; transition: background .1s;
}
.qty-btn:hover { background: var(--tl); color: var(--td); }
.qty-val {
  width: 44px; text-align: center; font-size: 13px; font-weight: 500;
  border: none; border-left: 1px solid var(--border); border-right: 1px solid var(--border);
  height: 36px; background: var(--surf); color: var(--txt);
  font-family: 'DM Sans', sans-serif;
}
.qty-val:focus { outline: none; }

/* ---- ADMIN TABLE ---- */
.table { width: 100%; border-collapse: collapse; font-size: 12px; }
.table th { padding: 8px 12px; text-align: left; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; border-bottom: 2px solid var(--border); background: var(--bg); }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--tl); }
.table-wrap { overflow-x: auto; }

/* ---- ADMIN SIDEBAR ---- */
.admin-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 200px; flex-shrink: 0;
  background: var(--surf); border-right: 1px solid var(--border);
  padding: 16px 0;
  display: flex; flex-direction: column;
}
.sidebar-logo {
  padding: 0 16px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
  font-size: 13px; font-weight: 600; color: var(--t);
}
.sidebar-logo small { display: block; font-size: 10px; color: var(--muted); font-weight: 400; }
.sidebar a {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; font-size: 13px; font-weight: 500;
  color: var(--muted); text-decoration: none; transition: all .15s;
}
.sidebar a:hover, .sidebar a.active { color: var(--t); background: var(--tl); }
.sidebar a .icon { font-size: 15px; }
.admin-main { flex: 1; min-width: 0; padding: 20px 16px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.admin-head h1 { font-size: 18px; font-weight: 600; }

/* ---- STAT CARDS ---- */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
@media (min-width: 700px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-card { background: var(--surf); border: 1px solid var(--border); border-radius: var(--rad-lg); padding: 14px; }
.stat-label { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px; }
.stat-val { font-size: 22px; font-weight: 600; color: var(--txt); }
.stat-val.green { color: var(--t); }
.stat-val.red { color: var(--red); }
.stat-sub { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* ---- ORDER STATUS BADGES ---- */
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 10px; font-weight: 600; }
.badge-pending   { background: #fef3c7; color: #92400e; }
.badge-confirmed { background: #d1fae5; color: #065f46; }
.badge-shipped   { background: #dbeafe; color: #1e40af; }
.badge-delivered { background: #d1fae5; color: #065f46; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }

/* ---- MOBILE ADMIN TOGGLE ---- */
@media (max-width: 640px) {
  .sidebar { display: none; }
  .sidebar.open { display: flex; position: fixed; left: 0; top: 0; bottom: 0; z-index: 200; box-shadow: 4px 0 20px rgba(0,0,0,.15); }
  .mob-menu-btn { display: flex !important; }
}
.mob-menu-btn { display: none; }

/* ---- PRODUCT PAGE LAYOUT ---- */
.product-page { display: flex; gap: 0; }
@media (min-width: 700px) {
  .product-page { gap: 14px; padding: 14px; }
  .product-page .pp-left { flex: 1; min-width: 0; }
  .product-page .pp-right { width: 220px; flex-shrink: 0; }
}
.pp-left { flex: 1; min-width: 0; padding: 14px; }
.pp-right { display: none; }
@media (min-width: 700px) { .pp-right { display: flex; flex-direction: column; gap: 12px; padding: 14px 14px 14px 0; } }

/* Product image area */
.prod-img-area {
  background: var(--tl);
  aspect-ratio: 1;
  max-height: 280px;
  display: flex; align-items: center; justify-content: center;
  position: relative; border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.prod-img-area img { width: 100%; height: 100%; object-fit: cover; }
.prod-img-area .no-img { font-size: 80px; }
.discount-badge {
  position: absolute; top: 12px; left: 12px;
  background: var(--red); color: #fff;
  font-size: 10px; font-weight: 600; padding: 3px 8px;
  border-radius: var(--rad-md);
}
.prod-thumbs { display: flex; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.thumb {
  width: 48px; height: 48px; flex-shrink: 0;
  background: var(--tl); border-radius: var(--rad-md);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: 1.5px solid transparent;
  overflow: hidden; transition: border-color .15s;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.active, .thumb:hover { border-color: var(--t); }
.prod-info { padding: 14px; }
.prod-name { font-size: 15px; font-weight: 600; line-height: 1.4; margin-bottom: 3px; }
.prod-sku { font-size: 11px; color: var(--muted); margin-bottom: 10px; }
.rating-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.review-count { font-size: 12px; color: var(--t); }
.price-row { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.price-main { font-size: 24px; font-weight: 600; color: var(--red); }
.price-orig { font-size: 13px; color: var(--muted); text-decoration: line-through; }
.price-save { font-size: 11px; color: var(--t); background: var(--tl); padding: 2px 8px; border-radius: 20px; }
.opt-label { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px; }
.variants { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.var-btn {
  padding: 6px 14px; border: 1px solid var(--border);
  border-radius: var(--rad-md); font-size: 12px; font-weight: 500;
  cursor: pointer; background: var(--surf); color: var(--txt);
  font-family: 'DM Sans', sans-serif; transition: all .15s;
}
.var-btn.active { border-color: var(--t); background: var(--tl); color: var(--td); }
.var-btn:hover:not(.active) { border-color: var(--tm); }
.qty-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.stock-info { font-size: 11px; color: var(--muted); }
.stock-ok { color: var(--t); }
.stock-low { color: #f59e0b; }
.stock-out { color: var(--red); }
.shipping-row { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); margin-top: 10px; flex-wrap: wrap; }
.ship-ok { color: var(--t); }

/* Mobile order info (below add to cart) */
.mob-order-info { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 700px) { .mob-order-info { display: none; } }

/* Info rows */
.info-row { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; font-size: 12px; }
.info-row-label { color: var(--muted); }
.info-row-val { color: var(--txt); font-weight: 500; }
.info-row-val.ok { color: var(--t); }

/* Review bars */
.review-summary { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.big-rating { font-size: 28px; font-weight: 600; color: var(--t); }
.rating-bars { flex: 1; }
.bar-row { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--muted); margin-bottom: 4px; }
.bar-track { flex: 1; height: 4px; background: var(--bg); border-radius: 2px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--t); border-radius: 2px; }
.review-item { padding: 8px 0; border-top: 1px solid var(--border); }
.rev-header { display: flex; justify-content: space-between; margin-bottom: 2px; }
.rev-user { font-size: 11px; font-weight: 600; }
.rev-date { font-size: 10px; color: var(--muted); }
.rev-text { font-size: 11px; color: var(--muted); line-height: 1.5; margin-top: 3px; }

/* Cart page */
.cart-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.cart-item-img { width: 60px; height: 60px; background: var(--tl); border-radius: var(--rad-md); overflow: hidden; flex-shrink: 0; }
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 13px; font-weight: 500; line-height: 1.3; margin-bottom: 3px; }
.cart-item-variant { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.cart-item-price { font-size: 14px; font-weight: 600; color: var(--red); }

/* WhatsApp button */
.btn-wa {
  background: #25d366; color: #fff;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--rad-md); padding: 12px;
  font-size: 14px; font-weight: 600;
  text-decoration: none; transition: background .15s;
  width: 100%; border: none; cursor: pointer; font-family: 'DM Sans', sans-serif;
}
.btn-wa:hover { background: #1ebe5d; }

/* Checkout form card */
.checkout-page { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 700px) {
  .checkout-page { flex-direction: row; gap: 14px; padding: 14px; }
  .checkout-page .chk-left { flex: 1; }
  .checkout-page .chk-right { width: 280px; flex-shrink: 0; }
}
