:root {
  --primary: #d70018;
  --primary-dark: #b40013;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f5f5f7;
  --gold: #a9752f;
  --gold-dark: #7c5620;
  --champagne-1: #fdf7ec;
  --champagne-2: #f0dfc0;
  --ink: #2b2117;
}
.brand-wordmark { font-family: "Playfair Display", Georgia, serif; letter-spacing: .015em; }
* { box-sizing: border-box; }
body { font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; margin: 0; background: var(--bg); color: var(--text); font-size: 14px; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ---- Hero iPhone Luxury (trang chu) ---- */
.hero-iphone { background: linear-gradient(135deg,#111827,#1f2937); border-radius: 14px; padding: 40px 32px; color: #fff; margin: 20px 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.hero-iphone h1 { font-size: 30px; margin: 0 0 10px; font-weight: 800; }
.hero-iphone p { color: #cbd5e1; margin: 0 0 16px; font-size: 14.5px; }
.hero-iphone .btn-buy { display: inline-block; max-width: 220px; }
.genuine-badge { display: inline-flex; align-items: center; gap: 6px; background: #fff5f5; color: var(--primary); border: 1px solid #fecaca; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; margin-bottom: 14px; }

/* ---- Vong quay may man (thay the hero-iphone lam banner dau trang chu) ---- */
.lucky-wheel-section {
  --wheel-r: 130px;
  background: linear-gradient(135deg, #111827, #1f2937);
  border-radius: 14px;
  padding: 34px 32px;
  margin: 20px 0;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
  overflow: hidden;
}
.lucky-wheel-copy { flex: 1 1 280px; min-width: 240px; }
.lucky-wheel-copy h1 { font-size: 28px; margin: 0 0 10px; font-weight: 800; }
.lucky-wheel-copy p { color: #cbd5e1; margin: 0 0 18px; font-size: 14.5px; }
.lucky-wheel-btn { display: inline-block; width: auto; min-width: 180px; padding: 13px 28px; font-size: 15px; }
.lucky-wheel-result { margin-top: 14px; padding: 12px 14px; border-radius: 8px; font-size: 13.5px; line-height: 1.5; max-width: 380px; }
.lucky-wheel-result.is-hidden { display: none; }
.lucky-wheel-result.is-info { background: rgba(255,255,255,.08); color: #e5e7eb; border: 1px solid rgba(255,255,255,.15); }
.lucky-wheel-result.is-win { background: rgba(217,0,24,.14); color: #fff; border: 1px solid rgba(217,0,24,.4); }
.lucky-wheel-code { display: inline-block; margin-top: 6px; font-family: "Playfair Display", Georgia, serif; font-size: 20px; letter-spacing: .06em; color: var(--gold); background: #fff; padding: 4px 14px; border-radius: 6px; }

.lucky-wheel-wrap { position: relative; flex: 0 0 auto; width: calc(var(--wheel-r) * 2); height: calc(var(--wheel-r) * 2); display: flex; align-items: center; justify-content: center; }
.lucky-wheel {
  width: 100%; height: 100%; border-radius: 50%;
  border: 6px solid var(--gold);
  box-shadow: 0 0 0 3px rgba(255,255,255,.15), 0 14px 34px rgba(0,0,0,.4);
  position: relative;
  transition: transform 4s cubic-bezier(.17,.67,.16,1);
}
.lucky-wheel-label {
  position: absolute; top: 50%; left: 50%; width: 0; height: 0;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  font-size: 10.5px; font-weight: 700; color: var(--ink);
  white-space: nowrap;
}
.lucky-wheel-label.is-coupon { color: #fff; font-size: 11.5px; }
.lucky-wheel-pointer { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); font-size: 22px; color: var(--gold); z-index: 5; filter: drop-shadow(0 2px 3px rgba(0,0,0,.4)); }
.lucky-wheel-hub {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 46px; height: 46px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--champagne-1), var(--gold));
  border: 3px solid #fff; display: flex; align-items: center; justify-content: center;
  font-size: 20px; box-shadow: 0 3px 10px rgba(0,0,0,.35); z-index: 4;
}
@media (max-width: 640px) {
  .lucky-wheel-section { --wheel-r: 100px; padding: 26px 20px; gap: 20px; }
  .lucky-wheel-copy h1 { font-size: 22px; }
  .lucky-wheel-label { font-size: 9px; }
  .lucky-wheel-label.is-coupon { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .lucky-wheel { transition: none; }
}

/* ---- Ghim danh muc dong may len dau trang: moi "chip" la 1 the he iPhone, ----
   ---- lay cam hung tu chinh ten chip xu ly Apple dung cho doi may do (A13...A19). ---- */
.series-nav { position: sticky; top: 0; z-index: 60; background: #fff; border-bottom: 1px solid var(--border); }
.series-nav-inner { display: flex; align-items: center; gap: 12px; padding: 8px 16px; }
.series-nav-eyebrow { flex-shrink: 0; font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); line-height: 1.3; border-right: 1px solid var(--border); padding-right: 12px; }

.series-nav-track-wrap { position: relative; flex: 1; min-width: 0; }
.series-nav-track-wrap::after { content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 26px; background: linear-gradient(to right, rgba(255,255,255,0), #fff); pointer-events: none; }
.series-nav-track { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; padding: 3px 2px 5px; scrollbar-width: none; -ms-overflow-style: none; }
.series-nav-track::-webkit-scrollbar { display: none; }

.series-chip {
  scroll-snap-align: start;
  flex-shrink: 0;
  position: relative;
  width: 70px; height: 54px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 11px;
  background: linear-gradient(160deg, var(--champagne-1), var(--champagne-2));
  border: 1px solid #e2cb9c;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.series-chip-eyebrow { font-size: 8px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--gold); }
.series-chip-num { font-family: "Playfair Display", Georgia, serif; font-size: 20px; font-weight: 700; color: var(--ink); line-height: 1.1; }
.series-chip-caption { font-size: 7px; font-weight: 600; color: var(--gold-dark); margin-top: 1px; }
.series-chip::after {
  content: ''; position: absolute; left: 12px; right: 12px; bottom: 4px; height: 2px;
  background: var(--gold); border-radius: 2px; transform: scaleX(0); transition: transform .16s ease;
}
.series-chip:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(169,117,47,.28); border-color: var(--gold); }
.series-chip:hover::after { transform: scaleX(1); }
.series-chip:hover .series-chip-num { color: var(--gold-dark); }
.series-chip:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.series-chip.is-active { background: linear-gradient(160deg, #fff5f5, #fde0e0); border-color: var(--primary); box-shadow: 0 4px 12px rgba(215,0,24,.18); }
.series-chip.is-active .series-chip-eyebrow { color: var(--primary-dark); }
.series-chip.is-active .series-chip-num { color: var(--primary); }
.series-chip.is-active .series-chip-caption { color: var(--primary-dark); }
.series-chip.is-active::after { background: var(--primary); transform: scaleX(1); }

@media (max-width: 560px) {
  .series-nav-eyebrow { font-size: 8.5px; padding-right: 8px; }
  .series-chip { width: 58px; height: 46px; }
  .series-chip-num { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .series-chip { transition: none; }
  .series-chip:hover { transform: none; }
}

/* ---- Flash Sale khung gio ---- */
.flash-sale { background: linear-gradient(135deg,#ff3d3d,#b40013); border-radius: 14px; padding: 20px 22px; margin: 20px 0; color: #fff; }
.flash-sale-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.flash-sale-head h2 { margin: 0; font-size: 20px; display: flex; align-items: center; gap: 8px; }
.flash-countdown { display: flex; align-items: center; gap: 6px; font-size: 13px; background: rgba(0,0,0,.18); padding: 6px 12px; border-radius: 999px; }
.flash-countdown .box { background: #fff; color: var(--primary); font-weight: 800; border-radius: 5px; padding: 2px 7px; font-variant-numeric: tabular-nums; }
.flash-slots { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.flash-slot { background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.35); border-radius: 999px; padding: 7px 16px; font-size: 13px; font-weight: 600; }
.flash-slot.active { background: #fff; color: var(--primary); }
.flash-slot.done { opacity: .55; text-decoration: line-through; }
.flash-sale .product-grid .product-card { background: #fff; }
.flash-empty { background: rgba(255,255,255,.12); border-radius: 10px; padding: 30px; text-align: center; font-size: 13.5px; }

/* ---- Topbar ---- */
.top-strip { background: #111827; color: #e5e7eb; font-size: 12.5px; }
.top-strip .container { display: flex; justify-content: space-between; padding: 6px 16px; }

.site-header { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.site-header .header-inner { display: flex; align-items: center; gap: 24px; padding: 14px 16px; }
.site-header .logo { font-size: 25px; font-weight: 700; color: var(--primary); flex-shrink: 0; }
.site-header .search-box { flex: 1; display: flex; }
.site-header .search-box input { flex: 1; padding: 10px 14px; border: 2px solid var(--primary); border-right: none; border-radius: 6px 0 0 6px; font-size: 14px; }
.site-header .search-box button { background: var(--primary); color: #fff; border: none; padding: 0 18px; border-radius: 0 6px 6px 0; cursor: pointer; }
.site-header .header-actions { display: flex; align-items: center; gap: 18px; flex-shrink: 0; }
.header-actions .action-item { text-align: center; font-size: 11.5px; color: var(--text); position: relative; }
.header-actions .action-item .ic { font-size: 20px; }
.cart-count { position: absolute; top: -6px; right: -10px; background: var(--primary); color: #fff; font-size: 10px; border-radius: 999px; padding: 1px 6px; }

.main-nav { background: var(--primary); }
.main-nav .container { display: flex; gap: 4px; overflow-x: auto; }
.main-nav a { color: #fff; padding: 11px 16px; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.main-nav a:hover { background: rgba(255,255,255,.15); }

/* ---- Banner ---- */
.hero-banner { display: block; border-radius: 10px; overflow: hidden; margin: 20px 0; }
.hero-banner img { width: 100%; }

/* ---- Section ---- */
.section { margin: 28px 0; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-title h2 { font-size: 19px; margin: 0; border-left: 4px solid var(--primary); padding-left: 10px; }
.section-title a { font-size: 13px; color: var(--primary); font-weight: 600; }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.cat-card { background: #fff; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.cat-card img { height: 110px; object-fit: cover; }
.cat-card .cat-name { padding: 10px 12px; font-weight: 600; font-size: 13.5px; }

/* ---- Product grid ---- */
.product-grid { display: grid; gap: 16px; }
.product-grid.grid4 { grid-template-columns: repeat(4, 1fr); }
.product-grid.grid3 { grid-template-columns: repeat(3, 1fr); }
.product-grid.list { grid-template-columns: 1fr; }

.product-card { background: #fff; border-radius: 10px; border: 1px solid var(--border); overflow: hidden; position: relative; transition: box-shadow .15s, transform .15s; }
.product-card:hover { box-shadow: 0 8px 20px rgba(0,0,0,.08); transform: translateY(-2px); }
.product-card .thumb { aspect-ratio: 1/1; overflow: hidden; background: #f3f4f6; }
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-card .badge-sale { position: absolute; top: 10px; left: 10px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
.product-card .info { padding: 12px; }
.product-card .name { font-size: 13.5px; font-weight: 600; line-height: 1.4; height: 38px; overflow: hidden; margin-bottom: 6px; }
.product-card .price-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.product-card .price { color: var(--primary); font-weight: 700; font-size: 15.5px; }
.product-card .price-old { color: #9ca3af; text-decoration: line-through; font-size: 12.5px; }
.product-card .discount-percent { color: #16a34a; font-size: 11.5px; font-weight: 600; }
.card-swatches { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.card-swatch { width: 15px; height: 15px; border-radius: 50%; background: var(--swatch-color, #ccc); border: 1px solid rgba(0,0,0,.18); cursor: pointer; display: inline-block; }
.card-swatch:hover, .card-swatch.active { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--primary); }
.card-swatch-more { font-size: 11px; color: var(--muted); }

.product-grid.list .product-card { display: flex; }
.product-grid.list .product-card .thumb { width: 160px; flex-shrink: 0; }
.product-grid.list .product-card .info { flex: 1; }
.product-grid.list .product-card .name { height: auto; }

/* ---- Product detail ---- */
.breadcrumb { font-size: 12.5px; color: var(--muted); margin: 14px 0; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }

.product-detail { display: grid; grid-template-columns: 420px 1fr; gap: 30px; background: #fff; border-radius: 12px; padding: 24px; border: 1px solid var(--border); }
.gallery-main { border-radius: 10px; overflow: hidden; border: 1px solid var(--border); margin-bottom: 10px; aspect-ratio: 1/1; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 8px; }
.gallery-thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; border: 2px solid var(--border); cursor: pointer; }
.gallery-thumbs img.active { border-color: var(--primary); }

.product-title { font-size: 21px; font-weight: 700; margin: 0 0 8px; }
.product-meta { font-size: 12.5px; color: var(--muted); margin-bottom: 14px; }
.price-box { background: #fff5f5; border: 1px dashed var(--primary); border-radius: 10px; padding: 14px 16px; margin-bottom: 16px; }
.price-box .current-price { font-size: 26px; font-weight: 800; color: var(--primary); }
.price-box .old-price { text-decoration: line-through; color: #9ca3af; font-size: 14px; margin-left: 10px; }
.price-box .save-tag { display: inline-block; margin-left: 10px; background: #16a34a; color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 6px; }

.option-group { margin-bottom: 16px; }
.option-group label.title { font-weight: 700; font-size: 13.5px; display: block; margin-bottom: 8px; }
.option-btn-group { display: flex; gap: 8px; flex-wrap: wrap; }
.option-btn { border: 1.5px solid var(--border); border-radius: 8px; padding: 8px 16px; font-size: 13px; cursor: pointer; background: #fff; }
.option-btn.active { border-color: var(--primary); color: var(--primary); background: #fff5f5; font-weight: 600; }
.option-btn:disabled { opacity: .4; cursor: not-allowed; text-decoration: line-through; }

.color-swatch-btn { display: inline-flex; align-items: center; gap: 8px; }
.color-swatch-btn .swatch-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--swatch-color, #ccc); border: 1px solid rgba(0,0,0,.18); flex-shrink: 0; }
.color-swatch-btn.active .swatch-dot { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--primary); }

.stock-info { font-size: 13px; margin-bottom: 16px; }
.stock-info.in-stock { color: #16a34a; }
.stock-info.out-stock { color: var(--primary); }

.buy-actions { display: flex; gap: 10px; margin-top: 16px; }
.btn-buy { flex: 1; background: var(--primary); color: #fff; border: none; padding: 14px; border-radius: 8px; font-size: 15px; font-weight: 700; cursor: pointer; text-align: center; }
.btn-buy:hover { background: var(--primary-dark); }
.btn-buy:disabled { background: #d1d5db; cursor: not-allowed; }
.btn-add-cart { flex: 1; background: #fff; color: var(--primary); border: 2px solid var(--primary); padding: 12px; border-radius: 8px; font-size: 15px; font-weight: 700; cursor: pointer; text-align: center; }

.spec-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.spec-table tr td { padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.spec-table tr td:first-child { width: 40%; color: var(--muted); background: #fafafa; }
.spec-group-title { background: #f3f4f6; font-weight: 700; padding: 10px 14px; font-size: 13.5px; border-top: 1px solid var(--border); }

.tab-nav { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin: 30px 0 16px; }
.tab-nav button { background: none; border: none; padding: 12px 20px; font-size: 14.5px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tab-nav button.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; background: #fff; border-radius: 10px; padding: 20px; border: 1px solid var(--border); }
.tab-panel.active { display: block; }

/* ---- Forms (checkout/cart) ---- */
.checkout-grid { display: grid; grid-template-columns: 1fr 380px; gap: 24px; align-items: start; }
.form-block { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 20px; margin-bottom: 16px; }
.form-block label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.form-block input, .form-block textarea, .form-block select { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13.5px; margin-bottom: 14px; }
.cart-line { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); align-items: center; }
.cart-line img { width: 88px; height: 88px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); flex-shrink: 0; }
.cart-line .name { font-weight: 600; font-size: 14.5px; }
.cart-line .variant { font-size: 12.5px; color: var(--muted); }
.qty-input { width: 60px !important; text-align: center; }

/* ---- Bang du lieu dung chung (theo doi don hang, danh sach san pham da dat...) ---- */
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th, .data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.data-table th { background: #fafafa; color: var(--muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.02em; }

/* ---- Footer ---- */
.site-footer { background: #111827; color: #cbd5e1; margin-top: 40px; padding: 40px 0 20px; font-size: 13px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 24px; }
.footer-grid h4 { color: #fff; margin-bottom: 12px; font-size: 14px; }
.footer-bottom { text-align: center; padding-top: 20px; margin-top: 20px; border-top: 1px solid #1f2937; color: #6b7280; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }

@media (max-width: 900px) {
  .product-grid.grid4, .product-grid.grid3 { grid-template-columns: repeat(2, 1fr); }
  .product-detail { grid-template-columns: 1fr; }
  .checkout-grid { grid-template-columns: 1fr; }
  .site-header .search-box { display: none; }
}
