:root {
  --primary: #ff4747;
  --primary-dark: #e6392f;
  --accent: #ff8a00;
  --accent-2: #ffb800;
  --ink: #1a1a2e;
  --ink-soft: #4a4a5e;
  --muted: #8a8aa3;
  --border: #ececf3;
  --bg: #f5f5fa;
  --card: #ffffff;
  --success: #1aa05e;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 2px 10px rgba(26,26,46,0.06);
  --shadow-lg: 0 12px 32px rgba(26,26,46,0.12);
  --header-h: 64px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Poppins", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
ul { list-style: none; margin: 0; padding: 0; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; border: none; font-weight: 600; font-size: 14px;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; box-shadow: 0 6px 16px rgba(255,71,71,0.35); }
.btn-primary:hover { box-shadow: 0 8px 22px rgba(255,71,71,0.45); }
.btn-outline { background: #fff; color: var(--primary); border: 2px solid var(--primary); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-ghost { background: transparent; color: var(--ink-soft); border: 1px solid var(--border); }
.btn-danger { background: #fff0f0; color: #d63031; border: 1px solid #ffd6d6; }

/* ---------- Top utility bar ---------- */
.topbar { background: var(--ink); color: #cfcfe0; font-size: 12px; }
.topbar .container { display: flex; justify-content: space-between; align-items: center; height: 34px; }
.topbar a { color: #cfcfe0; }
.topbar a:hover { color: #fff; }

/* ---------- Header ---------- */
.site-header { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.site-header .container { display: flex; align-items: center; gap: 24px; height: var(--header-h); }
.logo { font-weight: 800; font-size: 24px; background: linear-gradient(135deg, var(--primary), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; flex-shrink: 0; letter-spacing: -0.5px; }
.search-form { flex: 1; display: flex; max-width: 620px; }
.search-form input { flex: 1; border: 2px solid var(--primary); border-right: none; border-radius: 999px 0 0 999px; padding: 10px 18px; font-size: 14px; outline: none; }
.search-form button { border-radius: 0 999px 999px 0; background: var(--primary); color: #fff; border: none; padding: 0 22px; font-weight: 700; }
.header-actions { display: flex; align-items: center; gap: 18px; margin-left: auto; flex-shrink: 0; }
.header-actions a { display: flex; flex-direction: column; align-items: center; font-size: 11px; color: var(--ink-soft); gap: 2px; font-weight: 600; position: relative; }
.header-actions .icon { font-size: 20px; }
.cart-badge { position: absolute; top: -4px; right: -10px; background: var(--primary); color: #fff; font-size: 10px; font-weight: 700; border-radius: 999px; padding: 1px 6px; min-width: 16px; text-align: center; }
.menu-toggle { display: none; background: none; border: none; font-size: 24px; }

/* ---------- Category strip ---------- */
.category-strip { background: #fff; border-bottom: 1px solid var(--border); }
.category-strip .container { display: flex; gap: 28px; overflow-x: auto; padding-top: 10px; padding-bottom: 10px; scrollbar-width: none; }
.category-strip .container::-webkit-scrollbar { display: none; }
.cat-pill { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; flex-shrink: 0; }
.cat-pill .emoji { font-size: 22px; width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; background: var(--bg); border-radius: 50%; }
.cat-pill:hover .emoji { background: #ffe9e2; }

/* ---------- Hero / banners ---------- */
.hero { padding: 20px 0; }
.hero-slider { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); height: 320px; }
.hero-slide { position: absolute; inset: 0; display: flex; align-items: center; opacity: 0; transition: opacity .6s ease; }
.hero-slide.active { opacity: 1; }
.hero-slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-slide-text { position: relative; z-index: 2; padding: 0 60px; color: #fff; max-width: 480px; text-shadow: 0 2px 12px rgba(0,0,0,0.35); }
.hero-slide-text h2 { font-size: 34px; margin: 0 0 10px; font-weight: 800; }
.hero-slide-text p { font-size: 16px; margin: 0 0 20px; opacity: .95; }
.hero-dots { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 3; }
.hero-dots span { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.5); cursor: pointer; }
.hero-dots span.active { background: #fff; width: 22px; border-radius: 4px; }

/* ---------- Sections ---------- */
.section { padding: 34px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; }
.section-head h2 { font-size: 22px; font-weight: 800; margin: 0; display: flex; align-items: center; gap: 8px; }
.section-head .see-all { font-size: 13px; font-weight: 700; color: var(--primary); }

.flash-banner { background: linear-gradient(135deg, var(--primary), var(--accent)); border-radius: var(--radius); padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; color: #fff; margin-bottom: 18px; }
.flash-banner .flash-title { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; }
.countdown { display: flex; gap: 6px; align-items: center; font-weight: 700; }
.countdown span.box { background: rgba(0,0,0,0.25); border-radius: 6px; padding: 4px 8px; min-width: 30px; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- Product grid ---------- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.product-grid.scroll { display: flex; overflow-x: auto; gap: 14px; padding-bottom: 6px; scrollbar-width: none; }
.product-grid.scroll::-webkit-scrollbar { display: none; }
.product-grid.scroll .product-card { min-width: 190px; flex-shrink: 0; }

.product-card { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease; position: relative; display: flex; flex-direction: column; }
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.product-thumb { position: relative; aspect-ratio: 1/1; background: #f0f0f6; overflow: hidden; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.badge { position: absolute; top: 8px; left: 8px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 6px; }
.badge.discount { background: var(--ink); }
.badge-ship { position: absolute; bottom: 8px; left: 8px; background: rgba(26,26,46,0.75); color: #fff; font-size: 10px; padding: 2px 6px; border-radius: 4px; }
.wishlist-btn { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; background: rgba(255,255,255,0.9); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 15px; border: none; }
.product-info { padding: 10px 12px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-name { font-size: 13px; font-weight: 600; line-height: 1.35; color: var(--ink); height: 35px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.product-price-row { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.price-now { color: var(--primary); font-weight: 800; font-size: 16px; }
.price-compare { color: var(--muted); font-size: 12px; text-decoration: line-through; }
.product-meta { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--muted); }
.stars { color: var(--accent-2); }

/* ---------- Trust strip ---------- */
.trust-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.trust-item { display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.trust-item .icon { font-size: 26px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #c8c8dd; margin-top: 40px; padding: 44px 0 20px; }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; margin-bottom: 30px; }
.footer-grid h4 { color: #fff; font-size: 14px; margin: 0 0 14px; }
.footer-grid ul li { margin-bottom: 8px; font-size: 13px; }
.footer-grid ul li a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #33334d; padding-top: 18px; text-align: center; font-size: 12px; color: #8a8aa3; }

/* ---------- Breadcrumb / page head ---------- */
.page-head { padding: 22px 0 6px; }
.breadcrumb { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.breadcrumb a { color: var(--primary); }
.page-title { font-size: 24px; font-weight: 800; }

/* ---------- Shop / filters ---------- */
.shop-layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
.filter-card { background: #fff; border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.filter-card h4 { margin: 0 0 12px; font-size: 14px; }
.filter-card ul li { margin-bottom: 10px; }
.filter-card ul li a { font-size: 13px; color: var(--ink-soft); }
.filter-card ul li a.active, .filter-card ul li a:hover { color: var(--primary); font-weight: 700; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; font-size: 13px; color: var(--ink-soft); }
.toolbar select { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; }
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 28px; }
.pagination a, .pagination span { padding: 8px 14px; border-radius: 8px; background: #fff; box-shadow: var(--shadow); font-size: 13px; font-weight: 600; }
.pagination .active { background: var(--primary); color: #fff; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }

/* ---------- Product detail ---------- */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; background: #fff; border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.pd-gallery-main { aspect-ratio: 1/1; background: #f0f0f6; border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; }
.pd-gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.pd-thumbs { display: flex; gap: 8px; }
.pd-thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 2px solid transparent; }
.pd-thumbs img.active { border-color: var(--primary); }
.pd-title { font-size: 24px; font-weight: 800; margin: 0 0 10px; }
.pd-rating { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.pd-price-box { background: linear-gradient(135deg, #fff5f0, #fff0e6); border-radius: 12px; padding: 16px 18px; margin-bottom: 18px; }
.pd-price-box .price-now { font-size: 30px; }
.pd-desc { font-size: 14px; color: var(--ink-soft); line-height: 1.6; margin-bottom: 20px; }
.qty-selector { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.qty-selector button { width: 36px; height: 36px; background: #fff; border: none; font-size: 16px; }
.qty-selector input { width: 44px; text-align: center; border: none; font-size: 14px; }
.pd-actions { display: flex; gap: 12px; margin-top: 20px; align-items: center; }
.pd-tags { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.pd-tag { background: var(--bg); font-size: 12px; padding: 6px 12px; border-radius: 999px; color: var(--ink-soft); font-weight: 600; }
.review-item { border-bottom: 1px solid var(--border); padding: 16px 0; }
.review-item:last-child { border-bottom: none; }

/* ---------- Cart ---------- */
.cart-layout { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
.cart-item { display: grid; grid-template-columns: 80px 1fr auto; gap: 14px; align-items: center; background: #fff; border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); margin-bottom: 12px; }
.cart-item img { width: 80px; height: 80px; object-fit: cover; border-radius: 10px; }
.cart-item .name { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.summary-card { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); position: sticky; top: 90px; }
.summary-row { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 10px; color: var(--ink-soft); }
.summary-row.total { font-size: 18px; font-weight: 800; color: var(--ink); border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }

/* ---------- Forms ---------- */
.auth-card { max-width: 420px; margin: 40px auto; background: #fff; border-radius: var(--radius); padding: 34px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 22px; margin: 0 0 6px; }
.auth-card p.sub { color: var(--muted); font-size: 13px; margin: 0 0 22px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-control { width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; outline: none; transition: border-color .15s ease; }
.form-control:focus { border-color: var(--primary); }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.alert { padding: 12px 16px; border-radius: 10px; font-size: 13px; margin-bottom: 16px; font-weight: 600; }
.alert-error { background: #fff0f0; color: #d63031; border: 1px solid #ffd6d6; }
.alert-success { background: #eefaf0; color: #1aa05e; border: 1px solid #c9f0d3; }

/* ---------- Account ---------- */
.account-layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
.account-nav { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.account-nav a { display: block; padding: 14px 18px; font-size: 14px; font-weight: 600; color: var(--ink-soft); border-bottom: 1px solid var(--border); }
.account-nav a.active, .account-nav a:hover { color: var(--primary); background: #fff5f0; }
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
table.simple-table { width: 100%; border-collapse: collapse; }
table.simple-table th, table.simple-table td { text-align: left; padding: 12px 10px; font-size: 13px; border-bottom: 1px solid var(--border); }
table.simple-table th { color: var(--muted); font-weight: 700; text-transform: uppercase; font-size: 11px; letter-spacing: .03em; }
.status-pill { padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; display: inline-block; }
.status-pending_payment { background: #fff4e0; color: #b8860b; }
.status-paid, .status-delivered { background: #eafaf0; color: #1aa05e; }
.status-processing, .status-shipped { background: #eaf1ff; color: #2f6fed; }
.status-cancelled, .status-refunded { background: #fff0f0; color: #d63031; }

@media (max-width: 900px) {
  .search-form { display: none; }
  .menu-toggle { display: block; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .shop-layout, .cart-layout, .account-layout { grid-template-columns: 1fr; }
  .product-detail { grid-template-columns: 1fr; }
  .trust-strip { grid-template-columns: repeat(2, 1fr); }
  .hero-slide-text h2 { font-size: 24px; }
  .hero-slider { height: 220px; }
}
