/* Preyek Supermarket - Dynamic Red/Blue Theme */
:root {
  --primary: #e53935;
  --primary-dark: #c62828;
  --secondary: #1565c0;
  --secondary-dark: #0d47a1;
  --accent: #ffb300;
  --bg: #f7fbff;
  --card: #ffffff;
  --text: #132238;
  --muted: #5f6c7b;
  --border: #d7e4f3;
  --success: #16a34a;
  --danger: #dc2626;
  --shadow: 0 10px 28px rgba(10, 39, 82, 0.10);
  --card-shadow: 0 4px 16px rgba(10, 39, 82, 0.08);
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; max-width:100%; }
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size:16px;
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  -webkit-text-size-adjust:100%;
  text-rendering:optimizeLegibility;
  overflow-x:hidden;
  background:
    radial-gradient(circle at top left, rgba(229,57,53,.08), transparent 28%),
    radial-gradient(circle at top right, rgba(21,101,192,.08), transparent 24%),
    var(--bg);
  color: var(--text);
}
img { display:block; max-width:100%; }
button, input, select, textarea { font-family:inherit; }
.visually-hidden {
  position:absolute !important; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; margin: 0; }
nav, .site-header {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(135deg, rgba(19,34,56,.98), rgba(13,71,161,.96));
  color: #fff; box-shadow: var(--shadow);
}
.nav-container {
  max-width: 1240px; margin: 0 auto; padding: 14px 18px;
  display: flex; align-items: center; gap: 14px;
}
.logo { font-weight: 800; letter-spacing: .2px; font-size: 1.1rem; display: flex; align-items: center; gap: 8px; }
.logo span { color: #ffecb3; }
.nav-links { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.nav-links a { padding: 9px 12px; border-radius: 999px; color: rgba(255,255,255,.9); }
.nav-links a:hover, .nav-links a.active { background: rgba(255,255,255,.12); }
.search-box {
  border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08); color: #fff;
  border-radius: 999px; padding: 10px 14px; min-width: 220px;
}
.search-box::placeholder { color: rgba(255,255,255,.72); }
.catalog-search {
  flex:1 1 430px;
  max-width:560px;
  display:grid;
  grid-template-columns:minmax(0, 1fr) auto;
  gap:8px;
  align-items:center;
}
.catalog-search-input { position:relative; min-width:0; }
.catalog-search .search-box {
  display:block;
  width:100%;
  min-width:0;
  height:46px;
  padding:10px 42px 10px 42px;
  border:1px solid rgba(255,255,255,.36);
  border-radius:14px;
  background:#fff;
  color:var(--text);
  font-size:16px;
  line-height:1.2;
  outline:none;
}
.catalog-search .search-box::placeholder { color:#748196; opacity:1; }
.catalog-search .search-box:focus {
  border-color:#9fc4ef;
  box-shadow:0 0 0 3px rgba(255,255,255,.18);
}
.search-symbol {
  position:absolute;
  left:14px;
  top:50%;
  z-index:1;
  transform:translateY(-53%);
  color:var(--secondary-dark);
  font-size:1.35rem;
  font-weight:700;
  pointer-events:none;
}
.search-clear {
  position:absolute;
  right:7px;
  top:50%;
  transform:translateY(-50%);
  width:32px;
  height:32px;
  padding:0;
  border:0;
  border-radius:50%;
  background:#eef4fb;
  color:#526176;
  font-size:1.35rem;
  line-height:1;
  cursor:pointer;
}
.catalog-search-button {
  min-height:46px;
  padding:0 18px;
  border:1px solid rgba(255,255,255,.26);
  border-radius:14px;
  background:var(--primary);
  color:#fff;
  font-size:.94rem;
  font-weight:700;
  cursor:pointer;
}
.catalog-search-button:hover { background:var(--primary-dark); }
.cart-icon {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.1);
}
.cart-badge {
  position: absolute; top: -7px; right: -7px; background: var(--accent); color: #111;
  border-radius: 999px; font-size: 11px; font-weight: 800; padding: 2px 6px;
}
.burger {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.18);
  border-radius: 12px; background: rgba(255,255,255,.08); color: #fff; cursor: pointer;
}
.menu-drawer {
  position: fixed; inset: 0 0 0 auto; width: min(360px, 88vw); transform: translateX(100%);
  transition: transform .25s ease; background: #0f1c31; color: #fff; z-index: 80;
  box-shadow: -18px 0 60px rgba(0,0,0,.35); padding: 20px;
}
.menu-drawer.open { transform: translateX(0); }
.menu-drawer h3 { margin: 0 0 16px; }
.menu-drawer a { display: block; padding: 13px 14px; margin-bottom: 10px; border-radius: 14px; background: rgba(255,255,255,.06); }
.menu-drawer a:hover { background: rgba(255,255,255,.11); }
.menu-overlay { position: fixed; inset: 0; background: rgba(8,15,30,.55); z-index: 70; display: none; }
.menu-overlay.show { display: block; }
.hero {
  max-width: 1240px; margin: 24px auto; padding: 42px 20px;
  background: linear-gradient(135deg, rgba(229,57,53,.94), rgba(21,101,192,.95));
  color: #fff; border-radius: 28px; box-shadow: var(--shadow);
}
.hero h1 { font-size: clamp(2rem, 4vw, 4rem); margin: 0 0 10px; }
.hero p { max-width: 780px; color: rgba(255,255,255,.92); line-height: 1.7; }
.cta-btn, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 12px 18px; cursor: pointer;
  font-weight: 700; transition: transform .18s ease, box-shadow .18s ease;
}
.cta-btn, .btn-primary { background: #fff; color: var(--primary); }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-outline { background: transparent; color: inherit; border: 1px solid rgba(255,255,255,.22); }
.cta-btn:hover, .btn:hover { transform: translateY(-1px); }
.categories, .products, .product-detail, .cart, .checkout, .success, .admin-page { max-width: 1240px; margin: 0 auto; padding: 24px 20px 46px; }
.section-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-bottom:18px; }
.section-heading h2 { margin:0 0 6px; font-size:clamp(1.7rem, 4vw, 2.5rem); }
.count-note { margin:0; color:var(--muted); line-height:1.5; }
.product-toolbar { display:grid; grid-template-columns:minmax(220px, 330px) minmax(0,1fr); gap:14px; margin-bottom:18px; align-items:center; }
.search-help { margin:0; color:var(--muted); font-size:.92rem; }
.category-grid, .stats-grid, .admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.product-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); gap:16px; align-items:stretch; }
.category-card, .product-card, .stat-card, .admin-card, .panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.category-card { padding: 18px; text-align: center; cursor: pointer; }
.category-card:hover, .product-card:hover { transform: translateY(-3px); }
.category-emoji { font-size: 42px; margin-bottom: 10px; }
.shop-category-browser {
  display:grid;
  gap:18px;
}
.shop-category-browser-head {
  display:flex;
  align-items:end;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
}
.shop-category-browser-head h2 {
  margin:0 0 6px;
  font-size:clamp(1.65rem, 4vw, 2.45rem);
  line-height:1.12;
}
.shop-category-browser-head p {
  margin:0;
  color:var(--muted);
  line-height:1.5;
}
.shop-category-search {
  flex:0 1 360px;
  min-width:min(100%, 260px);
}
.shop-category-search input {
  min-height:44px;
  border-radius:14px;
  background:#fff;
  box-shadow:0 8px 22px rgba(10,39,82,.07);
}
.shop-department-list {
  display:grid;
  gap:18px;
}
.shop-department {
  border:1px solid var(--border);
  border-radius:18px;
  background:rgba(255,255,255,.82);
  box-shadow:0 18px 42px rgba(10,39,82,.08);
  padding:16px;
}
.shop-department-head {
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:14px;
}
.shop-department-head h3 {
  margin:0 0 2px;
  font-size:1.05rem;
}
.shop-department-head p {
  margin:0;
  color:var(--muted);
  font-size:.84rem;
}
.shop-department-icon,
.shop-category-icon {
  display:inline-grid;
  place-items:center;
  flex:0 0 auto;
  color:var(--secondary-dark);
  background:linear-gradient(145deg, #eef5fd, #fff6f5);
}
.shop-department-icon {
  width:44px;
  height:44px;
  border-radius:14px;
}
.shop-category-icon {
  width:40px;
  height:40px;
  border-radius:13px;
}
.category-icon-svg {
  width:24px;
  height:24px;
}
.shop-category-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(156px, 1fr));
  gap:10px;
}
.shop-category-card {
  min-width:0;
  min-height:76px;
  display:grid;
  grid-template-columns:40px minmax(0, 1fr);
  grid-template-rows:auto auto;
  align-items:center;
  column-gap:10px;
  row-gap:2px;
  padding:10px;
  border:1px solid #e4edf8;
  border-radius:14px;
  background:#fff;
  color:var(--text);
  box-shadow:0 8px 18px rgba(10,39,82,.055);
  transition:transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.shop-category-card:hover,
.shop-category-card:focus-visible {
  transform:translateY(-2px);
  border-color:rgba(21,101,192,.35);
  box-shadow:0 14px 30px rgba(10,39,82,.11);
  outline:0;
}
.shop-category-card.active {
  border-color:rgba(229,57,53,.45);
  background:linear-gradient(180deg, #fff, #fff6f5);
}
.shop-category-card.active .shop-category-icon {
  color:var(--primary-dark);
}
.shop-category-card .shop-category-icon {
  grid-row:1 / 3;
}
.shop-category-name {
  min-width:0;
  color:var(--text);
  font-size:.87rem;
  font-weight:800;
  line-height:1.2;
  overflow:hidden;
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
}
.shop-category-count {
  color:var(--muted);
  font-size:.72rem;
  line-height:1.2;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.shop-category-empty {
  margin:0;
  padding:18px;
  border:1px dashed var(--border);
  border-radius:14px;
  color:var(--muted);
  text-align:center;
}
.products-category-browser {
  margin:12px 0 22px;
}
.products-category-disclosure {
  margin:0 0 22px;
  border:1px solid var(--border);
  border-radius:16px;
  background:rgba(255,255,255,.86);
  box-shadow:0 12px 28px rgba(10,39,82,.07);
  overflow:hidden;
}
.products-category-disclosure > summary {
  min-height:54px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:13px 16px;
  color:var(--secondary-dark);
  cursor:pointer;
  font-weight:800;
  list-style:none;
}
.products-category-disclosure > summary::-webkit-details-marker { display:none; }
.products-category-disclosure > summary::after {
  content:'+';
  width:30px;
  height:30px;
  display:grid;
  place-items:center;
  flex:0 0 auto;
  border-radius:10px;
  background:linear-gradient(145deg, #eef5fd, #fff6f5);
  font-size:1.2rem;
}
.products-category-disclosure[open] > summary::after { content:'−'; }
.products-category-disclosure > summary small {
  margin-left:auto;
  color:var(--muted);
  font-size:.78rem;
  font-weight:600;
}
.products-category-disclosure[open] > summary { border-bottom:1px solid var(--border); }
.products-category-disclosure .products-category-browser { padding:16px; }
.product-card {
  min-width:0;
  padding:0;
  display:flex;
  flex-direction:column;
  border-color:#e5ebf3;
  border-radius:14px;
  box-shadow:var(--card-shadow);
  transition:transform .18s ease, box-shadow .18s ease;
}
.product-card-link { display:flex; flex:1 1 auto; min-width:0; flex-direction:column; color:inherit; }
.product-card-link:focus-visible { outline:3px solid rgba(21,101,192,.32); outline-offset:-3px; }
.product-image {
  width:100%;
  height:auto;
  aspect-ratio:1 / 1;
  border-radius:14px 14px 0 0;
  border-bottom:1px solid #edf1f6;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(145deg, #fff 15%, #f5f9ff 100%);
  font-size:52px;
  position:relative;
  overflow:hidden;
}
.product-card .product-image { margin:0; }
.product-photo-slot {
  width: 100%;
  height: 100%;
  border: 2px dashed rgba(21,101,192,.24);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(229,57,53,.05), rgba(21,101,192,.06)),
    repeating-linear-gradient(45deg, rgba(255,255,255,.45) 0 10px, rgba(255,255,255,.65) 10px 20px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: .3px;
  text-transform: uppercase;
  text-align: center;
  padding: 14px;
}
.product-photo-slot span { font-size:.9rem; color:var(--secondary-dark); }
.product-photo-slot small { font-size:.68rem; line-height:1.35; text-transform:none; letter-spacing:0; font-weight:700; max-width:170px; }
.product-photo {
  width:100%;
  height:100%;
  object-fit:contain;
  padding:4px;
  background:#fff;
  border-radius:inherit;
  filter:saturate(1.05) contrast(1.025);
  transform:scale(1.12);
  transition:transform .2s ease, filter .2s ease;
}
.product-card:hover .product-photo { transform:scale(1.15); filter:saturate(1.08) contrast(1.035); }
.product-image.image-missing::after {
  content:"◇";
  display:grid;
  place-items:center;
  width:72px;
  height:72px;
  border:2px solid rgba(21,101,192,.16);
  border-radius:18px;
  color:rgba(21,101,192,.38);
  font-size:2rem;
}
.representative-photo-badge {
  position:absolute;
  left:10px;
  bottom:10px;
  z-index:2;
  max-width:calc(100% - 20px);
  padding:5px 9px;
  border:1px solid rgba(21,101,192,.2);
  border-radius:999px;
  background:rgba(255,255,255,.94);
  color:var(--secondary-dark);
  box-shadow:0 7px 18px rgba(10,39,82,.12);
  font-size:.68rem;
  font-weight:700;
  line-height:1.2;
  letter-spacing:.02em;
}
.photo-status, .photo-source { position:absolute; left:10px; border-radius:999px; padding:4px 8px; font-size:10px; font-weight:900; background:rgba(255,255,255,.9); color:var(--secondary-dark); box-shadow:0 8px 18px rgba(10,39,82,.12); }
.photo-status { top:10px; }
.photo-source { bottom:10px; right:10px; left:10px; text-align:center; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.margin-badge, .fast-seller-badge { position: absolute; left: 12px; top: 12px; border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 800; }
.margin-badge { background: rgba(21,101,192,.12); color: var(--secondary-dark); }
.fast-seller-badge { right: 12px; left: auto; background: rgba(229,57,53,.12); color: var(--primary-dark); }
.product-card-content { padding:11px 11px 9px; display:grid; gap:8px; flex:1; min-width:0; }
.product-name {
  min-height:3.9em;
  margin:0;
  display:-webkit-box;
  overflow:hidden;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:3;
  font-size:.96rem;
  line-height:1.3;
  font-weight:700;
  letter-spacing:-.008em;
  overflow-wrap:anywhere;
}
.product-card-tags { display:flex; align-items:center; gap:5px; min-width:0; }
.product-category-chip, .product-variant-chip {
  min-width:0;
  padding:3px 7px;
  border-radius:999px;
  font-size:.7rem;
  font-weight:700;
  line-height:1.35;
  white-space:nowrap;
}
.product-category-chip {
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  background:#eef5fd;
  color:var(--secondary-dark);
}
.product-variant-chip { flex:0 0 auto; background:#fff0ef; color:var(--primary-dark); }
.product-card-facts { display:grid; gap:3px; margin-top:auto; font-size:.72rem; line-height:1.35; }
.product-card-code { color:#6b7788; overflow-wrap:anywhere; }
.product-card-stock { font-weight:700; }
.product-card-stock.in-stock { color:var(--success); }
.product-card-stock.out-stock { color:var(--danger); }
.product-code {
  display: inline-flex;
  align-items: center;
  margin: 0 0 8px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(21,101,192,.08);
  color: var(--secondary-dark);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .2px;
}
.product-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .88rem; flex-wrap:wrap; }
.product-price { margin: 10px 0; color: var(--primary); font-size: 1.25rem; font-weight: 800; }
.product-stock { font-weight: 800; margin-bottom: 12px; }
.product-stock.in-stock { color: var(--success); }
.product-stock.out-stock { color: var(--danger); }
.product-info-panel {
  border:1px solid var(--border);
  border-radius:16px;
  background:linear-gradient(180deg, #fff, #f8fbff);
  overflow:hidden;
}
.product-info-row {
  display:grid;
  grid-template-columns:minmax(108px, .4fr) minmax(0, 1fr);
  gap:12px;
  align-items:start;
  padding:12px 14px;
  border-bottom:1px solid var(--border);
}
.product-info-row:last-child { border-bottom:0; }
.product-info-row span {
  color:var(--muted);
  font-size:.74rem;
  font-weight:900;
  letter-spacing:.055em;
  line-height:1.4;
  text-transform:uppercase;
}
.product-info-row strong {
  color:var(--text);
  font-size:.92rem;
  line-height:1.45;
  overflow-wrap:anywhere;
}
.product-description-row strong { font-weight:700; }
.stock-row strong, .product-info-row .in-stock { color:var(--success); }
.product-info-row .out-stock { color:var(--danger); }
.product-card-specs .product-info-row { grid-template-columns:1fr; gap:4px; padding:10px 12px; }
.product-card-specs .product-info-row strong { font-size:.88rem; }
.product-card-footer {
  margin-top:auto;
  border:0;
  border-top:1px solid #edf1f6;
  border-radius:0;
  background:#fff;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:7px;
  padding:9px 10px 10px;
}
.product-card-footer .product-price {
  margin:0;
  min-width:0;
  font-size:clamp(.9rem, 3.8vw, 1.12rem);
  line-height:1.15;
  white-space:nowrap;
  letter-spacing:-.025em;
}
.product-card-footer .product-price::before { display:none; content:none; }
.product-card-footer .add-to-cart {
  width:auto;
  min-width:52px;
  min-height:44px;
  padding:9px 13px;
  border-radius:12px;
  font-size:.86rem;
  box-shadow:none;
}
.add-to-cart {
  width:100%;
  border:0;
  border-radius:14px;
  padding:13px 16px;
  background:var(--primary);
  color:#fff;
  font:inherit;
  font-weight:900;
  cursor:pointer;
  box-shadow:0 12px 26px rgba(229,57,53,.2);
}
.add-to-cart:hover:not(:disabled) { background:var(--primary-dark); transform:translateY(-1px); }
.add-to-cart:disabled, .btn:disabled { opacity:.62; cursor:not-allowed; transform:none; box-shadow:none; }
.product-detail { display:grid; grid-template-columns:minmax(280px, .9fr) minmax(0, 1.1fr); gap:24px; align-items:start; }
.product-detail-images, .product-detail-info { background:#fff; border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow); padding:20px; }
.product-detail-photo { width:100%; height:auto; aspect-ratio:1 / 1; min-height:280px; border-radius:18px; overflow:hidden; background:linear-gradient(135deg, rgba(229,57,53,.08), rgba(21,101,192,.08)); position:relative; display:flex; align-items:center; justify-content:center; }
.product-detail-photo .product-photo-slot { height:100%; }
.product-detail-price-panel { margin-top:20px; padding:18px; text-align:center; border:1px solid var(--border); border-radius:18px; background:#fff; }
.product-price-large { display:block; color:var(--primary); font-size:clamp(1.7rem, 4vw, 2.4rem); font-weight:900; margin-bottom:10px; }
.product-detail-info { display:grid; gap:16px; }
.product-detail-info h1 { margin:0; font-size:clamp(1.8rem, 4vw, 3rem); line-height:1.05; }
.product-detail-info p { color:var(--muted); line-height:1.6; }
.product-action-panel { border:1px solid var(--border); border-radius:18px; background:#fff; padding:14px; display:grid; gap:14px; }
.product-action-panel .quantity-selector { margin-top:0; justify-content:center; justify-self:center; }
.product-action-panel .add-to-cart { padding:14px 18px; }
.quantity-selector { display:inline-flex; align-items:center; gap:14px; border:1px solid var(--border); border-radius:999px; padding:8px 10px; background:#f8fbff; margin-top:10px; }
.quantity-selector #quantity-value { min-width:28px; text-align:center; font-weight:900; }
.cart-items { display: grid; gap: 14px; margin-bottom: 24px; }
.cart-item { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.cart-item-name { font-weight: 800; margin-bottom: 4px; }
.cart-item-code { color: var(--muted); font-size: .86rem; }
.cart-item-price { color: var(--primary); font-weight: 800; margin-top: 6px; }
.cart-quantity { display: inline-flex; align-items: center; gap: 8px; }
.quantity-btn { width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 50%; background: #fff; color: var(--text); font-weight: 900; cursor: pointer; }
.cart-summary { border: 1px solid var(--border); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); padding: 18px; display: grid; gap: 10px; }
.summary-line { display: flex; justify-content: space-between; gap: 14px; }
.summary-line.total { font-size: 1.2rem; font-weight: 900; color: var(--primary); border-top: 1px solid var(--border); padding-top: 10px; }
.product-empty { text-align: center; color: var(--muted); padding: 32px 10px; }
.load-more-wrap { text-align: center; margin-top: 18px; }
.form-group { margin-bottom: 14px; }
.form-control, input, select, textarea { width: 100%; border: 1px solid var(--border); border-radius: 14px; padding: 13px 14px; font: inherit; background: #fff; color: var(--text); }
.input-group { position: relative; display: flex; align-items: center; }
.input-icon { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.input-group .form-control, .input-group input { padding-left: 40px; }
footer { margin-top: 18px; background: linear-gradient(135deg, #0f1c31, #132238); color: #fff; }
.footer-container { max-width: 1240px; margin: 0 auto; padding: 28px 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.footer-col h4 { margin: 0 0 10px; color: #ffd54f; }
.footer-bottom { text-align: center; border-top: 1px solid rgba(255,255,255,.12); padding: 14px 20px; color: rgba(255,255,255,.78); }
.site-credit { display:block; margin-top:7px; font-size:.8rem; line-height:1.45; }
.site-credit a { color:#ffd54f; font-weight:800; text-decoration:underline; text-underline-offset:3px; }
.site-credit a:hover, .site-credit a:focus-visible { color:#fff; }
.wallet-balance, .balance-amount, .info-strip { border-radius: var(--radius); }
.balance-amount { font-size: 2rem; font-weight: 800; }
.alert { padding: 12px 14px; border-radius: 14px; margin: 10px 0; }
.alert-success { background: rgba(22,163,74,.1); color: #166534; }
.alert-error { background: rgba(220,38,38,.1); color: #991b1b; }
.alert-warning, .alert-info { background: rgba(21,101,192,.08); color: var(--secondary-dark); }
.product-stock-bar, .stock-bar { height: 8px; background: #e9eff8; border-radius: 999px; overflow: hidden; }
.product-stock-filled, .stock-bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--secondary)); }
.admin-hero { background: linear-gradient(135deg, #132238, #153e75); color: #fff; padding: 28px; border-radius: 24px; }
.admin-card { padding: 18px; }
.admin-section-title { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin:0 0 14px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.admin-table th, .admin-table td { text-align: left; padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.admin-table th { color: var(--secondary-dark); background: rgba(21,101,192,.06); }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.setting-row { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; }
.admin-msg { margin-top: 10px; color: var(--muted); }
.cart-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
@media (max-width: 1000px) { .nav-links { display:none; } .catalog-search { max-width:none; } }
@media (max-width: 640px) {
  .hero { margin: 14px; border-radius: 22px; }
  .nav-container { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:9px; padding:10px; }
  .burger { grid-column:1; grid-row:1; }
  .logo { grid-column:2; grid-row:1; min-width:0; font-size:.96rem; line-height:1.2; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .cart-icon { grid-column:3; grid-row:1; }
  .catalog-search { grid-column:1 / -1; grid-row:2; width:100%; max-width:none; gap:7px; }
  .catalog-search .search-box { height:46px; border-radius:13px; }
  .catalog-search-button { min-width:76px; min-height:46px; padding:0 13px; border-radius:13px; }
  .categories, .products, .product-detail, .cart, .checkout, .success, .admin-page { padding:18px 10px 38px; }
  .section-heading { align-items:center; margin-bottom:14px; }
  .section-heading h2 { font-size:1.65rem; line-height:1.15; }
  .section-heading .btn { min-height:42px; padding:9px 14px; }
  .product-toolbar { grid-template-columns:1fr; }
  .search-help { font-size:.84rem; line-height:1.4; }
  .products-category-disclosure > summary { align-items:flex-start; padding:12px; }
  .products-category-disclosure > summary small { display:none; }
  .products-category-disclosure .products-category-browser { padding:12px 8px; }
  .shop-category-browser-head { align-items:stretch; gap:12px; }
  .shop-category-search { flex-basis:100%; }
  .shop-department { padding:12px; border-radius:16px; }
  .shop-department-head { margin-bottom:10px; }
  .shop-category-grid { grid-template-columns:repeat(3, minmax(0, 1fr)); gap:8px; }
  .shop-category-card {
    min-height:104px;
    grid-template-columns:1fr;
    grid-template-rows:auto auto auto;
    justify-items:center;
    text-align:center;
    padding:8px 6px;
  }
  .shop-category-card .shop-category-icon { grid-row:auto; }
  .shop-category-icon { width:44px; height:44px; }
  .shop-category-name { font-size:.72rem; line-height:1.15; -webkit-line-clamp:3; }
  .shop-category-count { max-width:100%; font-size:.64rem; }
  .product-grid { grid-template-columns:repeat(2, minmax(0, 1fr)); gap:10px; }
  .product-card { padding: 0; }
  .product-card .product-image { margin:0; }
  .product-card-content { padding:9px 9px 8px; gap:7px; }
  .product-name { min-height:3.9em; font-size:.9rem; }
  .product-category-chip, .product-variant-chip { padding:3px 6px; font-size:.66rem; }
  .product-card-facts { font-size:.69rem; }
  .product-card-footer { gap:5px; padding:8px; }
  .product-card-footer .add-to-cart { min-width:48px; min-height:44px; padding:8px 10px; font-size:.8rem; }
  .product-detail { grid-template-columns:1fr; }
  .product-detail-images, .product-detail-info { padding:12px; border-radius:14px; }
  .product-detail-photo { min-height:0; border-radius:14px; }
  .product-detail-photo .product-photo { padding:4px; transform:scale(1.08); }
  .product-detail-info h1 { font-size:clamp(1.45rem, 7vw, 2rem); line-height:1.12; }
  .product-info-row { grid-template-columns:minmax(96px, .42fr) minmax(0,1fr); gap:10px; padding:11px 12px; }
  .product-info-row span { font-size:.69rem; font-weight:700; }
  .product-info-row strong { font-size:.9rem; }
  .product-detail-price-panel { margin-top:12px; padding:13px; border-radius:14px; }
  .product-price-large { font-size:1.75rem; margin:0; }
  .form-control, input, select, textarea { font-size:16px; }
  .cart-item { grid-template-columns: 1fr; }
  .cart-quantity, .cart-actions { justify-content: flex-start; }
}
@media (max-width: 430px) {
  .product-card-footer { grid-template-columns:1fr; align-items:stretch; }
  .product-card-footer .product-price { text-align:center; }
  .product-card-footer .add-to-cart { width:100%; }
}
@media (max-width: 350px) {
  .products { padding-left:8px; padding-right:8px; }
  .shop-department { padding:10px; }
  .shop-category-grid { gap:6px; }
  .shop-category-card { min-height:100px; padding:7px 4px; }
  .shop-category-icon { width:40px; height:40px; }
  .shop-category-name { font-size:.68rem; }
  .shop-category-count { font-size:.6rem; }
  .product-grid { gap:7px; }
  .catalog-search-button { min-width:68px; padding:0 10px; }
}
