/* ══════════════════════════════════════════════════
   ALIAS AMAZON v3.0 — Classic Amazon Style
   Navy: #131921  ·  Orange: #FEBD69  ·  Cards: #FFF
   ══════════════════════════════════════════════════ */

:root {
  /* Amazon palette */
  --navy: #131921;
  --navy-light: #232f3e;
  --orange: #febd69;
  --orange-dark: #f3a847;
  --cta: #ffd814;
  --cta-hover: #f7ca00;
  --buy: #ffa41c;
  --buy-hover: #fa8900;
  --red: #cc0c39;
  --red-dark: #b12704;
  --link: #007185;
  --link-hover: #c7510f;
  --bestseller: #c7510f;
  --star: #de7921;
  --green: #067d62;
  --green-soft: #e6f4e6;

  /* Surfaces */
  --bg: #e3e6e6;
  --bg-card: #ffffff;
  --bg-stripe: #f5f5f5;
  --border: #dee0e0;
  --border-light: #e7e7e7;

  /* Text */
  --text: #0f1111;
  --text-secondary: #565959;
  --text-muted: #aaa;

  /* Radii & Shadows */
  --radius: 8px;
  --radius-sm: 4px;
  --radius-lg: 12px;
  --shadow: 0 2px 5px rgba(0,0,0,0.08);
  --shadow-md: 0 0 10px rgba(0,0,0,0.12);
  --shadow-lg: 0 2px 12px rgba(0,0,0,0.14);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.04);

  /* Typography */
  --font: 'Amazon Ember', 'Helvetica Neue', Arial, sans-serif;
  --font-thai: 'Sarabun', 'Noto Sans Thai', 'Helvetica Neue', Arial, sans-serif;
  --transition: 0.15s ease;
}

/* ═══════ RESET ═══════ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-thai);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* ═══════ TOP STRIP (Delivery) ═══════ */
.top-strip {
  background: var(--navy-light);
  color: #ccc;
  font-size: 0.82rem;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  overflow-x: auto;
  white-space: nowrap;
}
.top-strip .ts-item {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: color var(--transition);
}
.top-strip .ts-item:hover { color: #fff; }
.top-strip .ts-divider { color: #555; }
.ts-location { color: #fff; font-weight: 600; }

/* ═══════ HEADER ═══════ */
.header {
  background: var(--navy);
  padding: 10px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.header-inner {
  max-width: 1500px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 2px;
  transition: border var(--transition);
  text-decoration: none !important;
}
.logo:hover { border-color: #fff; }
.logo-icon {
  font-size: 1.5rem;
  color: var(--orange);
  margin-right: 4px;
}
.logo-text {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.03em;
}

/* Delivery selector */
.nav-location {
  display: flex;
  flex-direction: column;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  white-space: nowrap;
  transition: border var(--transition);
  line-height: 1.2;
}
.nav-location:hover { border-color: #fff; }
.nav-location .nl-label {
  font-size: 0.68rem;
  color: #ccc;
}
.nav-location .nl-addr {
  font-size: 0.82rem;
  color: #fff;
  font-weight: 700;
}

/* Search - AMAZON STYLE */
.search-box {
  flex: 1;
  min-width: 0;
  display: flex;
  height: 42px;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.search-box select {
  width: 52px;
  min-width: 52px;
  background: #f3f3f3;
  border: none;
  border-right: 1px solid #cdcdcd;
  color: #555;
  font-size: 0.75rem;
  padding: 0 4px;
  cursor: pointer;
  font-family: var(--font-thai);
  border-radius: 6px 0 0 6px;
}
.search-box select:hover { background: #dadada; color: #222; }
.search-box input {
  flex: 1;
  border: none;
  padding: 0 12px;
  font-size: 0.95rem;
  font-family: var(--font-thai);
  outline: none;
}
.search-box input::placeholder { color: #999; }
.search-box button {
  width: 46px;
  min-width: 46px;
  border: none;
  background: var(--orange);
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  border-radius: 0 6px 6px 0;
}
.search-box button:hover { background: var(--orange-dark); }

/* Header actions */
.header-actions { display: flex; align-items: center; gap: 2px; }
.nav-btn {
  display: flex;
  flex-direction: column;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.2;
  transition: border var(--transition);
  background: transparent;
  font-family: var(--font-thai);
  text-align: left;
}
.nav-btn:hover { border-color: #fff; }
.nav-btn .nb-sm {
  font-size: 0.68rem;
  color: #ccc;
}
.nav-btn .nb-lg {
  font-size: 0.84rem;
  color: #fff;
  font-weight: 700;
}

/* Cart button */
.cart-btn {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  transition: border var(--transition);
  position: relative;
  background: transparent;
  border: none;
  color: #fff;
  font-family: var(--font-thai);
}
.cart-btn:hover { border-color: #fff; }
.cart-btn .cart-icon { font-size: 1.8rem; position: relative; }
.cart-count {
  position: absolute;
  top: -4px;
  left: 18px;
  color: var(--orange);
  font-size: 1rem;
  font-weight: 700;
}
.cart-text {
  font-size: 0.84rem;
  color: #fff;
  font-weight: 700;
  margin-bottom: 2px;
}

/* ═══════ MEGA NAV (Category bar) ═══════ */
.mega-nav {
  background: var(--navy-light);
  padding: 0 16px;
  position: sticky;
  top: 72px;
  z-index: 99;
}
.mega-nav-inner {
  max-width: 1500px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 40px;
  overflow-x: auto;
}
.mega-nav a, .mega-nav .mn-item {
  color: #fff;
  font-size: 0.84rem;
  padding: 8px 12px;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: 2px;
  transition: border var(--transition);
  text-decoration: none;
  cursor: pointer;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}
.mega-nav a:hover, .mega-nav .mn-item:hover {
  border-color: #fff;
  text-decoration: none;
}
.mega-nav .mn-all {
  font-weight: 700;
}

/* ═══════ BREADCRUMB ═══════ */
.breadcrumb {
  max-width: 1500px;
  margin: 0 auto;
  padding: 12px 20px 4px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--link-hover); }
.breadcrumb .bc-sep { color: var(--text-muted); }

/* ═══════ DEAL CAROUSEL ═══════ */
.deal-carousel {
  max-width: 1500px;
  margin: 12px auto 20px;
  padding: 0 20px;
  position: relative;
}
.deal-header {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 18px 24px;
  margin-bottom: 0;
  box-shadow: var(--shadow-card);
}
.deal-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
}
.deal-timer {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--red);
  font-weight: 700;
  font-size: 1.05rem;
}
.deal-timer .dt-block {
  background: var(--red);
  color: #fff;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 0.95rem;
  min-width: 36px;
  text-align: center;
}
.deck-scroll {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 16px 0 8px;
  gap: 12px;
}
.deck-scroll::-webkit-scrollbar { height: 4px; }
.deck-scroll::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }
.deal-card {
  min-width: 220px;
  max-width: 220px;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px 16px;
  cursor: pointer;
  transition: box-shadow var(--transition);
  box-shadow: var(--shadow-card);
  text-align: center;
  flex-shrink: 0;
}
.deal-card:hover { box-shadow: var(--shadow-lg); }
.deal-card .dc-img {
  font-size: 3.5rem;
  margin-bottom: 12px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.deal-card .dc-discount {
  background: var(--red);
  color: #fff;
  padding: 4px 10px;
  border-radius: 2px;
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 6px;
}
.deal-card .dc-claim {
  font-size: 0.72rem;
  color: var(--red-dark);
  margin-top: 10px;
  font-weight: 500;
}

/* ═══════ SECTIONS ═══════ */
.section {
  max-width: 1500px;
  margin: 0 auto;
  padding: 20px;
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  background: var(--bg-card);
  padding: 16px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}
.section-link {
  font-size: 0.85rem;
  color: var(--link);
  font-weight: 500;
}

/* ═══════ CATEGORIES ═══════ */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}
.category-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 28px 20px;
  cursor: pointer;
  transition: box-shadow var(--transition);
  box-shadow: var(--shadow-card);
  text-align: center;
}
.category-card:hover {
  box-shadow: var(--shadow-lg);
}
.category-card .cat-icon {
  font-size: 2.6rem;
  margin-bottom: 10px;
  display: inline-block;
}
.category-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}
.category-card .cat-count {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* ═══════ PRODUCT GRID (Amazon tight) ═══════ */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.product-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow var(--transition);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  position: relative;
}
.product-card:hover { box-shadow: var(--shadow-lg); }

.product-img {
  width: 100%;
  height: 200px;
  background: #f7f7f7;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 12px;
}
.product-img .pi-icon {
  font-size: 4rem;
  transition: transform 0.2s ease;
}
.product-card:hover .pi-icon { transform: scale(1.05); }
.product-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

/* Bestseller tag */
.bestseller-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bestseller);
  color: #fff;
  padding: 4px 10px;
  border-radius: 2px;
  font-size: 0.7rem;
  font-weight: 600;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
}

.product-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
}

/* Product info */
.product-info {
  padding: 14px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.product-info h4 {
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text);
}
.product-info h4:hover { color: var(--link-hover); }

/* Rating */
.product-rating {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 0.78rem;
}
.stars { color: var(--star); font-size: 0.85rem; letter-spacing: 1px; }
.rating-count { color: var(--link); font-size: 0.76rem; }
.rating-arrow { color: var(--text-muted); font-size: 0.7rem; }

/* Price */
.price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.price {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}
.price-original {
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-decoration: line-through;
}
.price-save {
  font-size: 0.74rem;
  color: var(--red);
  font-weight: 500;
}

/* Delivery */
.delivery-info {
  font-size: 0.74rem;
  color: var(--text-secondary);
  margin-top: 6px;
}
.delivery-free {
  color: var(--green);
  font-weight: 500;
}

/* Add to Cart */
.product-actions {
  padding: 0 16px 14px;
  margin-top: auto;
}
.product-actions .btn-add {
  width: 100%;
  background: linear-gradient(to bottom, var(--cta), var(--cta-hover));
  border: 1px solid #f0c14b;
  border-radius: 20px;
  padding: 8px 0;
  font-size: 0.84rem;
  cursor: pointer;
  font-family: var(--font-thai);
  transition: background var(--transition);
}
.product-actions .btn-add:hover {
  background: linear-gradient(to bottom, #e6c300, #d4ab00);
}

/* ═══════ BUTTONS ═══════ */
.btn {
  padding: 8px 20px;
  border-radius: 20px;
  border: 1px solid #d5d9d9;
  cursor: pointer;
  font-family: var(--font-thai);
  font-size: 0.84rem;
  font-weight: 500;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #fff;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: linear-gradient(to bottom, var(--cta), var(--cta-hover));
  border-color: #f0c14b;
}
.btn-primary:hover { background: linear-gradient(to bottom, #e6c300, #d4ab00); }
.btn-orange {
  background: linear-gradient(to bottom, var(--buy), var(--buy-hover));
  border-color: #e47911;
  color: #111;
}
.btn-orange:hover { background: linear-gradient(to bottom, #f09a00, #db7d00); }
.btn-outline {
  background: #fff;
  color: var(--text);
  border-color: #d5d9d9;
  box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}
.btn-outline:hover { background: #f7fafa; }
.btn-sm { padding: 4px 14px; font-size: 0.78rem; }
.btn-lg { padding: 10px 28px; font-size: 0.92rem; }
.btn-full { width: 100%; }

/* ═══════ HERO BANNER ═══════ */
.hero {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
}
.hero-slider {
  background: linear-gradient(135deg, #ffe9cf 0%, #ffd8a8 40%, #c8e6d9 100%);
  border-radius: var(--radius);
  padding: 48px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  min-height: 280px;
  box-shadow: var(--shadow-card);
}
.hero-text { flex: 1; max-width: 500px; }
.hero-text h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
  line-height: 1.2;
}
.hero-text p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.6;
}
.hero-badge {
  display: inline-block;
  background: var(--red);
  color: #fff;
  padding: 6px 16px;
  border-radius: 3px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 14px;
}
.hero-img {
  font-size: 8rem;
  opacity: 0.85;
}

/* ═══════ CART v2 ═══════ */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 250;
  animation: fadeIn 0.15s ease;
}
.cart-sidebar {
  position: fixed;
  top: 0; right: 0;
  width: 380px;
  max-width: 100%;
  height: 100%;
  background: #fff;
  z-index: 251;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 20px rgba(0,0,0,0.18);
  animation: slideInRight 0.25s ease;
}
@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.cart-sidebar::-webkit-scrollbar { width: 5px; }
.cart-sidebar::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
.cart-sidebar h2 { font-size: 1.2rem; margin-bottom: 20px; }
.cart-items { flex: 1; overflow-y: auto; }
.cart-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
}
.cart-item .ci-img { font-size: 2.5rem; min-width: 56px; text-align: center; }
.cart-item .ci-info { flex: 1; }
.cart-item .ci-name { font-size: 0.88rem; font-weight: 500; }
.cart-item .ci-price { color: var(--red-dark); font-weight: 600; margin-top: 2px; }
.cart-item .ci-qty {
  display: flex; gap: 8px; align-items: center;
  margin-top: 8px;
}
.cart-item .ci-qty button {
  width: 28px; height: 28px; border-radius: 50%;
  background: #f0f2f2; border: 1px solid #d5d9d9;
  cursor: pointer; font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
}
.cart-item .ci-qty button:hover { background: #e3e6e6; }
.cart-item .ci-remove {
  background: transparent; border: none; color: #888;
  cursor: pointer; font-size: 1rem; padding: 4px;
  transition: color var(--transition);
}
.cart-item .ci-remove:hover { color: var(--red); }
.cart-total {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 2px solid #ddd;
  display: flex;
  justify-content: space-between;
  font-size: 1.15rem;
  font-weight: 700;
}
.cart-empty {
  text-align: center;
  color: #888;
  padding: 60px 20px;
  font-size: 1.05rem;
}
.cart-empty .ce-icon { font-size: 3rem; display: block; margin-bottom: 12px; }

/* ═══════ AUTH MODAL ═══════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}
.modal-card {
  background: #fff;
  border-radius: var(--radius);
  max-width: 400px;
  width: 100%;
  padding: 28px;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.2s ease;
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.modal-card h2 {
  font-size: 1.2rem;
  margin-bottom: 20px;
  font-weight: 600;
}
.modal-close {
  position: absolute;
  top: 12px; right: 14px;
  background: transparent; border: none;
  font-size: 1.3rem; color: #888; cursor: pointer;
  padding: 6px;
}
.modal-close:hover { color: var(--text); }
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.84rem;
  color: var(--text);
  font-weight: 600;
}
.form-group input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #888c8c;
  border-radius: 3px;
  font-size: 0.92rem;
  font-family: var(--font-thai);
  outline: none;
  transition: all var(--transition);
}
.form-group input:focus {
  border-color: var(--orange-dark);
  box-shadow: 0 0 0 3px rgba(254,189,105,0.3);
}
.form-actions {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.form-link {
  margin-top: 14px;
  text-align: center;
  font-size: 0.84rem;
  color: var(--text-secondary);
}
.form-link a { font-weight: 600; }
.form-error { color: var(--red); font-size: 0.8rem; min-height: 18px; margin-top: 4px; }

/* ═══════ PRODUCT DETAIL ═══════ */
.product-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}
.product-detail-card {
  background: #fff;
  border-radius: var(--radius);
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  position: relative;
  box-shadow: var(--shadow-lg);
}
.product-detail-card::-webkit-scrollbar { width: 5px; }
.product-detail-card::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
.product-detail-close {
  position: sticky;
  top: 0;
  float: right;
  background: #fff;
  border: 1px solid #ccc;
  width: 38px; height: 38px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  z-index: 10;
  transition: all var(--transition);
  color: #555;
}
.product-detail-close:hover { background: #f0f0f0; }
.product-detail-card .detail-img {
  text-align: center;
  padding: 30px;
  font-size: 5rem;
  background: #f7f7f7;
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.product-detail-card h2 {
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.product-detail-card .detail-price {
  font-size: 1.5rem;
  color: var(--red-dark);
  font-weight: 600;
  margin: 10px 0;
}
.product-detail-card .detail-desc {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.7;
  margin-bottom: 20px;
}
.specs-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}
.specs-table td {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.88rem;
}
.specs-table td:first-child {
  color: var(--text-secondary);
  width: 140px;
  font-weight: 500;
}

/* ═══════ DASHBOARD ═══════ */
.dashboard-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
}
.dash-sidebar {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px 0;
  box-shadow: var(--shadow-card);
  height: fit-content;
  position: sticky;
  top: 128px;
}
.dash-sidebar a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  color: var(--text);
  font-size: 0.88rem;
  transition: all var(--transition);
  text-decoration: none;
  border-left: 3px solid transparent;
}
.dash-sidebar a:hover, .dash-sidebar a.active {
  background: #f0f2f2;
  border-left-color: var(--orange);
  color: var(--link-hover);
  text-decoration: none;
  font-weight: 600;
}
.dash-main {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-card);
}
.order-row {
  display: flex;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
  align-items: center;
}
.order-row:last-child { border-bottom: none; }
.order-status {
  padding: 4px 12px;
  border-radius: 3px;
  font-size: 0.78rem;
  font-weight: 600;
}
.status-pending { background: #fff3cd; color: #856404; }
.status-paid { background: var(--green-soft); color: var(--green); }
.status-shipped { background: #cce5ff; color: #004085; }
.status-cancelled { background: #f8d7da; color: #721c24; }

/* ═══════ ADMIN ═══════ */
.admin-layout {
  display: grid;
  grid-template-columns: 210px 1fr;
  min-height: calc(100vh - 112px);
}
.admin-sidebar {
  background: var(--navy-light);
  padding: 16px 0;
}
.admin-sidebar a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  color: #ccc;
  font-size: 0.86rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition);
  border-left: 3px solid transparent;
}
.admin-sidebar a:hover, .admin-sidebar a.active {
  background: rgba(255,255,255,0.08);
  color: #fff;
  border-left-color: var(--orange);
  text-decoration: none;
}
.admin-main {
  padding: 24px;
  background: var(--bg);
  overflow-y: auto;
}
.admin-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}
.admin-card h3 { font-weight: 600; margin-bottom: 16px; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.stat-card .stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
}
.stat-card .stat-label { font-size: 0.82rem; color: var(--text-secondary); margin-top: 4px; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
}
.admin-table th {
  text-align: left;
  padding: 10px 14px;
  background: #f0f2f2;
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
}
.admin-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.88rem;
}
.admin-table tr:hover { background: #fafafa; }

/* ═══════ CHAT WIDGET ═══════ */
.chat-widget { position: fixed; bottom: 24px; right: 24px; z-index: 150; }
.chat-toggle {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--navy);
  border: none;
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
  transition: all var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.chat-toggle:hover { background: var(--navy-light); transform: scale(1.05); }
.chat-toggle:active { transform: scale(0.95); }
.chat-panel {
  position: absolute;
  bottom: 68px;
  right: 0;
  width: 360px;
  height: 480px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: scaleIn 0.15s ease;
}
.chat-header {
  background: var(--navy);
  padding: 14px 18px;
  color: #fff;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.chat-header button {
  background: rgba(255,255,255,0.15);
  border: none; color: #fff; cursor: pointer;
  font-size: 0.9rem; width: 28px; height: 28px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.chat-header button:hover { background: rgba(255,255,255,0.3); }
.chat-messages { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.chat-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.85rem;
  line-height: 1.5;
}
.chat-msg.bot {
  align-self: flex-start;
  background: #f0f2f2;
  border-bottom-left-radius: 2px;
}
.chat-msg.user {
  align-self: flex-end;
  background: var(--navy);
  color: #fff;
  border-bottom-right-radius: 2px;
}
.chat-msg.admin-msg {
  align-self: flex-start;
  background: #e8f5e9;
  border-left: 3px solid var(--green);
  border-bottom-left-radius: 2px;
  font-size: 0.82rem;
}
.chat-input-row {
  display: flex;
  padding: 12px;
  gap: 8px;
  border-top: 1px solid var(--border);
}
.chat-input-row input {
  flex: 1;
  padding: 8px 14px;
  border: 1px solid #888c8c;
  border-radius: 20px;
  font-size: 0.88rem;
  font-family: var(--font-thai);
  outline: none;
}
.chat-input-row input:focus { border-color: var(--orange-dark); }
.chat-input-row button {
  background: var(--orange);
  border: none; color: #111;
  width: 38px; height: 38px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  border: 1px solid #f0c14b;
  display: flex; align-items: center; justify-content: center;
}
.chat-input-row button:hover { background: var(--orange-dark); }

/* ═══════ TOAST ═══════ */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.toast {
  background: var(--navy);
  color: #fff;
  padding: 10px 24px;
  border-radius: 4px;
  font-weight: 500;
  font-size: 0.88rem;
  box-shadow: var(--shadow-md);
  animation: toastIn 0.3s ease;
}
.toast.error {
  background: var(--red);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ═══════ SKELETON ═══════ */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 2px;
}
.skeleton-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.skeleton-img { height: 200px; border-radius: 0; }
.skeleton-text { height: 14px; margin: 14px 16px 10px; width: 70%; }
.skeleton-text-sm { height: 12px; margin: 0 16px 14px; width: 50%; }

/* ═══════ FOOTER ═══════ */
.footer {
  background: var(--navy-light);
  margin-top: 28px;
}
.footer-backtop {
  background: #37475a;
  padding: 14px;
  text-align: center;
  color: #fff;
  cursor: pointer;
  font-size: 0.84rem;
  transition: background var(--transition);
}
.footer-backtop:hover { background: #485769; }
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  padding: 40px 20px;
}
.footer-col h4 {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.footer-col a {
  display: block;
  color: #ddd;
  font-size: 0.82rem;
  margin-bottom: 8px;
  text-decoration: none;
}
.footer-col a:hover { color: #fff; text-decoration: underline; }
.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  border-top: 1px solid #3a4553;
  text-align: center;
}
.footer-logo {
  display: inline-block;
  margin-bottom: 8px;
}
.footer-bottom p {
  color: #999;
  font-size: 0.78rem;
}

/* ═══════ MOBILE ═══════ */
@media (max-width: 1024px) {
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 20px; }
}

@media (max-width: 768px) {
  /* Hide desktop nav items */
  .nav-location, .nav-btn.nb-returns, .nav-btn.nb-account { display: none; }

  .header { padding: 8px 10px; }
  .header-inner { gap: 8px; }
  .logo { padding: 4px 6px; }
  .logo-text { font-size: 0.9rem; }
  .logo-icon { font-size: 1.2rem; }

  .search-box { height: 36px; }
  .search-box input { font-size: 0.85rem; }
  .search-box button { width: 40px; min-width: 40px; }
  .search-box select { width: 42px; min-width: 42px; font-size: 0.7rem; }

  .mega-nav-inner { height: 36px; }
  .mega-nav a { font-size: 0.78rem; padding: 6px 10px; }

  .hero-slider { flex-direction: column; padding: 32px 24px; min-height: auto; text-align: center; }
  .hero-text h1 { font-size: 1.4rem; }
  .hero-text { max-width: 100%; }
  .hero-img { font-size: 5rem; margin-top: 16px; }

  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .product-img { height: 160px; }
  .product-info h4 { font-size: 0.82rem; }
  .product-actions .btn-add { font-size: 0.78rem; padding: 6px 0; }
  .price { font-size: 1rem; }
  .breadcrumb { display: none; }

  .cart-sidebar { width: 100%; }
  .chat-panel { width: calc(100vw - 20px); right: 0; }

  .dashboard-grid, .admin-layout { grid-template-columns: 1fr; }
  .dash-sidebar {
    position: static;
    display: flex;
    overflow-x: auto;
    padding: 8px;
    gap: 2px;
  }
  .dash-sidebar a { white-space: nowrap; padding: 8px 14px; border-left: none; border-bottom: 3px solid transparent; }
  .dash-sidebar a.active { border-bottom-color: var(--orange); border-left-color: transparent; }
  .admin-sidebar {
    display: flex;
    overflow-x: auto;
    padding: 8px;
    gap: 2px;
  }
  .admin-sidebar a { white-space: nowrap; padding: 8px 14px; font-size: 0.8rem; }

  .footer-inner { grid-template-columns: 1fr 1fr; gap: 16px; }
}
