:root {
  --bg: #f0f0f0;
  --surface: #ffffff;
  --surface2: #f3f3f3;
  --border: #ddd;
  --text: #111;
  --text2: #878787;
  --header-bg: #ffffff;
  --header-accent: #febd69;
  --accent: #f23b31;
  --accent-dark: #f5625a;
  --accent-light: #fff0f0;
  --btn-primary: #f23b31;
  --btn-primary-border: #d43028;
  --btn-primary-text: #ffffff;
  --btn-secondary-bg: #fff;
  --green: #2e7d32;
  --star: #f23b31;
  --radius: 8px;
  --radius-sm: 4px;
  --shadow: 0 1px 4px rgba(0,0,0,0.1);
  --shadow-lg: 0 3px 14px rgba(0,0,0,0.13);
  --header-h: 58px;
  --font: system-ui,-apple-system,'Segoe UI',Arial,sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: var(--font); }
img { display: block; max-width: 100%; }

/* ── HEADER ── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--header-bg);
  height: var(--header-h);
  border-bottom: 1px solid #e0e0e0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.site-header-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 12px; height: 100%;
  display: flex; align-items: center; gap: 12px;
}
.header-logo {
  font-weight: 800; font-size: 20px; color: #1c1c1c;
  letter-spacing: -0.3px; flex: 1;
}
.header-logo span { color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  position: relative; padding: 0 12px; height: 34px; border-radius: 4px;
  border: 1px solid #d0d0d0; background: #fff; color: #1c1c1c;
  display: flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 500; white-space: nowrap;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn .icon-label { display: none; }
@media (min-width: 480px) { .icon-btn .icon-label { display: inline; } }
.badge {
  background: var(--header-accent); color: #111;
  font-size: 11px; font-weight: 800;
  padding: 0 5px; border-radius: 10px; min-width: 18px;
  text-align: center; line-height: 18px;
}
.badge:empty { display: none; }

/* ── BANNER ── */
.site-banner {
  background: #232f3e; color: #fff;
  text-align: center; padding: 7px 16px;
  font-size: 13px; font-weight: 500;
}
.site-banner strong { color: var(--header-accent); }

/* ── PAGE ── */
.page { max-width: 1200px; margin: 0 auto; padding: 0 12px 60px; }

/* ── SECTION TITLE ── */
.section-title {
  font-size: 20px; font-weight: 700; color: var(--text);
  margin: 20px 0 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

/* ── PRODUCT GRID ── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

/* ── PRODUCT CARD ── */
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.18s, border-color 0.18s;
  display: flex; flex-direction: column;
}
.product-card:hover { box-shadow: var(--shadow-lg); border-color: #aaa; }

.card-img-wrap {
  aspect-ratio: 1; overflow: hidden;
  background: var(--surface2); position: relative; flex-shrink: 0;
}
.card-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.25s; }
.product-card:hover .card-img-wrap img { transform: scale(1.03); }

.card-price-badge {
  position: absolute; top: 7px; left: 7px;
  background: var(--accent); color: #fff;
  font-weight: 800; font-size: 13px;
  padding: 2px 7px; border-radius: 3px;
}
.card-fav-btn {
  position: absolute; top: 5px; right: 5px;
  width: 26px; height: 26px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.85); font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.card-fav-btn:hover { transform: scale(1.15); }

.card-body {
  padding: 10px; display: flex; flex-direction: column;
  flex: 1;
}
.card-body-bottom {
  margin-top: auto;
}
.card-name {
  font-size: 13px; font-weight: 400; line-height: 1.4;
  margin-bottom: 6px; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-rating { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; margin-top: 0; }
.stars { color: var(--star); font-size: 12px; letter-spacing: -1px; }
.rating-val { font-size: 11px; color: var(--text2); }
.rating-badge {
  display: inline-flex; align-items: center; gap: 3px;
  background: var(--accent); color: #fff;
  font-size: 12px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px;
}
.rating-star { font-size: 11px; }

.card-add-btn {
  width: 100%; padding: 7px 8px;
  background: var(--btn-primary);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--btn-primary-text);
  font-weight: 600; font-size: 12px;
  transition: background 0.15s;
  margin-top: auto;
}
.card-add-btn:hover { background: var(--accent-dark); }

/* ── ITEM PAGE ── */
.item-page { max-width: 1000px; margin: 0 auto; padding: 14px 12px 60px; }

/* Compact top strip */
.compact-strip { overflow-x: auto; margin-bottom: 16px; }
.compact-strip::-webkit-scrollbar { display: none; }
.compact-row { display: flex; gap: 8px; width: max-content; }
.compact-card {
  width: 80px; flex-shrink: 0; cursor: pointer;
  border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--border); background: var(--surface);
  transition: border-color 0.15s;
}
.compact-card:hover { border-color: var(--accent); }
.compact-card img {
  width: 80px; height: 80px; object-fit: cover;
  display: block; background: var(--surface2);
}
.compact-card-name {
  font-size: 10px; padding: 4px 5px; line-height: 1.3; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* Main product layout */
.item-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-bottom: 36px;
}

/* Gallery: vertical thumbs left, big image right */
.item-gallery { display: flex; gap: 8px; }
.gallery-thumbs-v {
  display: flex; flex-direction: column; gap: 6px; flex-shrink: 0;
}
.gallery-thumb {
  width: 52px; height: 52px; border-radius: var(--radius-sm);
  overflow: hidden; border: 2px solid transparent; cursor: pointer;
  background: var(--surface2); flex-shrink: 0; transition: border-color 0.15s;
}
.gallery-thumb.active { border-color: var(--accent); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-main {
  flex: 1; aspect-ratio: 1; background: var(--surface2);
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border);
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }

/* Item info */
.item-name { font-size: 19px; font-weight: 700; line-height: 1.3; margin-bottom: 8px; }
.item-mini-desc { color: var(--text2); font-size: 13px; margin-bottom: 10px; line-height: 1.5; }
.item-rating-row { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.item-rating-row .stars { font-size: 15px; }
.item-rating-row .rating-val { font-size: 13px; color: var(--text2); }

.item-price-row { margin-bottom: 12px; }
.item-price { font-size: 28px; font-weight: 800; color: #b12704; }
.item-price-note { font-size: 12px; color: var(--green); margin-top: 2px; font-weight: 500; }

.item-stock-wrap { margin-bottom: 14px; }
.item-stock-label { font-size: 12px; color: var(--text2); margin-bottom: 4px; }
.item-stock-label strong { color: #b12704; }
.item-stock-bar { height: 5px; background: #eee; border-radius: 3px; overflow: hidden; }
.item-stock-fill { height: 100%; background: linear-gradient(90deg,#4caf50,#ff9800,#f44336); border-radius: 3px; }

.item-actions { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.btn-primary {
  width: 100%; padding: 11px 16px;
  background: var(--btn-primary); border: none;
  border-radius: var(--radius-sm); color: var(--btn-primary-text);
  font-weight: 700; font-size: 14px; transition: background 0.15s;
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary {
  width: 100%; padding: 11px 16px;
  background: #fff; border: 1px solid #adb1b8;
  border-radius: 24px; color: var(--text);
  font-weight: 700; font-size: 14px; transition: background 0.15s;
}
.btn-secondary:hover { background: var(--surface2); }
.btn-secondary.added { background: #fff; color: #1c1c1c; border-color: #adb1b8; }

.item-fav-row {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--accent); cursor: pointer; margin-bottom: 12px;
}
.item-fav-row:hover { text-decoration: underline; }

.shipping-row {
  padding: 10px 12px; background: #f0fff8;
  border: 1px solid #c8e6c9; border-radius: var(--radius-sm);
  font-size: 13px; color: var(--green); line-height: 1.5;
}

/* Specs */
.specs-section, .desc-section { margin-bottom: 24px; }
.specs-title, .desc-title { font-size: 16px; font-weight: 700; margin-bottom: 10px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.specs-table { width: 100%; border-collapse: collapse; }
.specs-table tr:nth-child(even) td { background: var(--surface2); }
.specs-table td { padding: 8px 12px; font-size: 13px; border-bottom: 1px solid var(--border); }
.specs-table td:first-child { color: var(--text2); width: 38%; }

.desc-short {
  font-size: 14px; line-height: 1.7; padding: 12px 14px;
  background: var(--surface2); border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent); margin-bottom: 14px;
}
.desc-full h4 { font-size: 13px; font-weight: 700; margin: 14px 0 5px; }
.desc-full ul { padding-left: 18px; }
.desc-full li { font-size: 13px; line-height: 1.6; color: var(--text2); margin-bottom: 3px; }

/* ── CART PAGE ── */
.cart-page { max-width: 660px; margin: 0 auto; padding: 20px 12px 60px; }
.cart-title { font-size: 22px; font-weight: 700; margin-bottom: 18px; }
.cart-empty { text-align: center; padding: 60px 20px; color: var(--text2); }
.cart-empty-icon { font-size: 44px; margin-bottom: 12px; }
.cart-empty p { font-size: 14px; margin-bottom: 16px; }
.btn-back {
  display: inline-block; padding: 10px 20px;
  background: var(--btn-primary); border: none;
  border-radius: 3px; font-weight: 700; font-size: 13px; color: var(--btn-primary-text);
}
.cart-items { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.cart-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px;
}
.cart-item-img { width: 66px; height: 66px; border-radius: var(--radius-sm); object-fit: cover; background: var(--surface2); flex-shrink: 0; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 13px; font-weight: 400; margin-bottom: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cart-item-price { font-size: 14px; color: #b12704; font-weight: 700; }
.qty-control { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.qty-btn {
  width: 26px; height: 26px; border-radius: 3px;
  border: 1px solid var(--border); background: var(--surface2);
  font-size: 15px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.qty-btn:hover { background: var(--border); }
.qty-val { font-weight: 700; font-size: 14px; min-width: 20px; text-align: center; }
.cart-remove { background: none; border: none; font-size: 16px; color: var(--text2); padding: 4px; flex-shrink: 0; }
.cart-remove:hover { color: #b12704; }
.cart-summary { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.cart-summary-row { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 7px; color: var(--text2); }
.cart-summary-total { display: flex; justify-content: space-between; font-weight: 700; font-size: 18px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.cart-checkout-btn {
  width: 100%; margin-top: 12px; padding: 12px;
  background: var(--btn-primary); border: none;
  border-radius: 3px; font-weight: 700; font-size: 15px; color: var(--btn-primary-text);
}
.cart-checkout-btn:hover { background: var(--accent-dark); }

/* ── DELIVERY ── */
.delivery-page { max-width: 500px; margin: 0 auto; padding: 20px 12px 60px; }
.delivery-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.delivery-subtitle { font-size: 13px; color: var(--text2); margin-bottom: 22px; }
.form-group { margin-bottom: 13px; }
.form-label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.form-input {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 14px; color: var(--text);
  background: var(--surface); outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus { border-color: #e77600; box-shadow: 0 0 0 3px rgba(231,118,0,0.15); }
.form-input::placeholder { color: #bbb; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-save-row { display: flex; align-items: center; gap: 8px; margin: 14px 0; cursor: pointer; }
.form-checkbox { width: 16px; height: 16px; accent-color: var(--accent); }
.form-save-label { font-size: 13px; color: var(--text2); }
.form-submit-btn {
  width: 100%; padding: 12px;
  background: var(--btn-primary); border: none;
  border-radius: 3px; font-weight: 700; font-size: 15px;
  color: var(--btn-primary-text); margin-top: 6px;
}
.form-submit-btn:hover { background: #ddb347; }
.order-summary-mini { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; margin-bottom: 18px; font-size: 13px; }
.order-summary-mini-title { font-weight: 700; margin-bottom: 8px; }
.order-item-row { display: flex; justify-content: space-between; margin-bottom: 5px; color: var(--text2); }
.order-total-row { display: flex; justify-content: space-between; font-weight: 700; font-size: 14px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }

/* ── FAVORITES ── */
.favs-page { max-width: 1200px; margin: 0 auto; padding: 20px 12px 60px; }
.favs-title { font-size: 22px; font-weight: 700; margin-bottom: 18px; }
.favs-empty { text-align: center; padding: 60px 20px; color: var(--text2); }
.favs-empty-icon { font-size: 44px; margin-bottom: 12px; }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 18px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #333; color: #fff; padding: 9px 20px;
  border-radius: 20px; font-size: 13px; z-index: 999;
  transition: transform 0.28s; white-space: nowrap; pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ── BREADCRUMB ── */
.breadcrumb { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text2); margin-bottom: 14px; }
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }

/* ── CONFIRM / THANKS ── */
.confirm-page { max-width: 520px; margin: 0 auto; padding: 20px 12px 60px; }
.confirm-title { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.confirm-subtitle { font-size: 13px; color: var(--text2); margin-bottom: 22px; }
.confirm-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.confirm-block-title { font-size: 13px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.edit-link { font-size: 13px; color: var(--accent); font-weight: 400; text-transform: none; letter-spacing: 0; }
.edit-link:hover { text-decoration: underline; }
.confirm-row { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 7px; }
.confirm-row span:first-child { color: var(--text2); }
.confirm-total { display: flex; justify-content: space-between; font-weight: 700; font-size: 18px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.confirm-total span:last-child { color: #b12704; }

/* Payment options */
.payment-section { margin-bottom: 14px; }
.payment-title { font-size: 15px; font-weight: 700; margin-bottom: 10px; }
.payment-options { display: flex; flex-direction: column; gap: 8px; }
.payment-option {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius); cursor: pointer; transition: border-color 0.15s;
}
.payment-option:hover { border-color: var(--accent); }
.payment-option.selected { border-color: var(--accent); background: #fff8f0; }
.payment-option input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; flex-shrink: 0; }
.payment-option-name { font-weight: 600; font-size: 14px; }
.payment-option-desc { font-size: 12px; color: var(--text2); margin-top: 1px; }
.payment-logo { font-size: 20px; }
.pay-btn {
  width: 100%; padding: 14px;
  background: var(--btn-primary); border: none;
  border-radius: 3px; font-weight: 700; font-size: 16px; color: var(--btn-primary-text);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background 0.15s;
}
.pay-btn:hover { background: #ddb347; }
.secure-note { text-align: center; font-size: 12px; color: var(--text2); margin-top: 10px; }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .item-layout { grid-template-columns: 1fr; gap: 16px; }
  .item-name { font-size: 16px; }
  .item-price { font-size: 22px; }
  .form-row { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: repeat(2,1fr); gap: 8px; }
  .gallery-thumbs-v { flex-direction: row; }
  .gallery-main { min-height: 240px; }
}

/* ── BADGE BOUNCE ── */
@keyframes badgeBounce {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.5); }
  65%  { transform: scale(0.85); }
  100% { transform: scale(1); }
}
.badge.bounce { animation: badgeBounce 0.4s ease; }

/* ── FOOTER ── */
.site-footer {
  background: #1c1c1c;
  color: rgba(255,255,255,0.7);
  padding: 40px 0 24px;
  font-size: 13px;
  margin-top: 60px;
}
.site-footer a { color: rgba(255,255,255,0.6); text-decoration: none; }
.site-footer a:hover { color: #fff; }
.footer-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 12px;
}
.footer-top {
  display: flex; flex-wrap: wrap; gap: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 20px;
}
.footer-brand { flex: 1; min-width: 180px; }
.footer-brand .header-logo { color: #fff; font-size: 20px; display: inline-block; margin-bottom: 8px; }
.footer-brand .header-logo span { color: var(--accent); }
.footer-brand p { font-size: 12px; line-height: 1.6; max-width: 220px; }
.footer-col { min-width: 140px; }
.footer-col h4 { color: #fff; font-size: 13px; font-weight: 700; margin-bottom: 12px; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-col ul li a { font-size: 12px; }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between;
  align-items: center; gap: 8px; font-size: 12px;
  color: rgba(255,255,255,0.4);
}
@media (max-width: 600px) {
  .footer-top { gap: 20px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}
