/* ==========================================================================
   VTVshop design system — colours taken from the VTV tricolour logo mark:
   red (#E2231A), green (#12A64B), blue (#0B5CAB).
   ========================================================================== */

:root {
  /* Hues taken straight from the VTVshop logo mark:
     red = first V · green = T and the "Shop" word · blue = last V */
  --red: #e2231a;
  --red-600: #c41911;
  --red-700: #a2110a;
  --red-50: #fdecea;
  --green: #17a94a;
  --green-600: #128a3c;
  --green-50: #e8f8ee;
  --blue: #1657c0;
  --blue-600: #12479f;
  --blue-50: #eaf1fd;
  --tri: linear-gradient(90deg, #e2231a 0 33.33%, #17a94a 33.33% 66.66%, #1657c0 66.66% 100%);
  --navy: #0b1424;
  --ink: #17202f;
  --muted: #5b6675;
  --line: #e7eaf0;
  --bg: #f3f5f8;
  --white: #ffffff;
  --gold: #f5a623;
  --shadow-sm: 0 1px 2px rgba(11, 20, 36, 0.06);
  --shadow: 0 4px 16px rgba(11, 20, 36, 0.08);
  --shadow-lg: 0 20px 48px rgba(11, 20, 36, 0.16);
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 22px;
  --container: 1240px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Roboto, 'Noto Sans', Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; font-size: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; }
ul { margin: 0; padding: 0; list-style: none; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }
.tricolor { background: var(--tri); }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.bold { font-weight: 700; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 8px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: grid; gap: 12px; }
.hide { display: none !important; }

/* ---------------------------------------------------------------- top bar */
.topbar { background: var(--navy); color: rgba(255, 255, 255, 0.82); font-size: 12.5px; }
.topbar .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 36px; }
.topbar-links { display: flex; align-items: center; gap: 18px; min-width: 0; }
.topbar-links a { white-space: nowrap; }
.topbar-links a:hover { color: #fff; }
.topbar-right { display: flex; align-items: center; gap: 16px; white-space: nowrap; }
.topbar-right a:hover { color: #fff; }
.topbar-hot { display: inline-flex; align-items: center; gap: 6px; color: #fff; font-weight: 600; }
.topbar-user { display: inline-flex; align-items: center; gap: 8px; }
.topbar-user .avatar {
  width: 22px; height: 22px; border-radius: 50%; background: var(--red);
  display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff;
}
.topbar-divider { width: 1px; height: 14px; background: rgba(255, 255, 255, 0.25); }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: linear-gradient(135deg, #e2231a 0%, #cb1a12 55%, #a91109 100%);
  color: #fff;
  box-shadow: 0 6px 20px rgba(165, 16, 9, 0.22);
}
/* tricolour hairline under the header — the logo, restated as a rule */
.site-header::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--tri);
}
.header-inner {
  display: grid;
  grid-template-columns: auto minmax(240px, 1fr) auto;
  align-items: center;
  gap: 22px;
  padding: 14px 16px;
  max-width: var(--container);
  margin: 0 auto;
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; }
.brand-logo {
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border-radius: 12px; padding: 7px 12px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s ease;
}
.brand:hover .brand-logo { transform: translateY(-1px); }
.brand-logo img { height: 30px; width: auto; }
.brand-tag {
  font-size: 10px; font-weight: 700; letter-spacing: 0.11em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92); line-height: 1.35;
  border-left: 1px solid rgba(255, 255, 255, 0.35); padding-left: 12px;
}
.brand-tag span { display: block; }

.search-wrap { position: relative; }
.search-form { display: flex; background: #fff; border-radius: 10px; padding: 4px; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12); }
.search-form input {
  flex: 1; border: 0; outline: none; padding: 0 12px; font-size: 14.5px; color: var(--ink); background: transparent; min-width: 0;
}
.search-form button {
  border: 0; background: var(--red); color: #fff; border-radius: 8px;
  width: 46px; height: 38px; display: grid; place-items: center; transition: background 0.15s;
}
.search-form button:hover { background: var(--red-700); }
.search-hints { display: flex; gap: 14px; margin-top: 7px; font-size: 12px; color: rgba(255, 255, 255, 0.85); overflow: hidden; }
.search-hints a { white-space: nowrap; }
.search-hints a:hover { color: #fff; text-decoration: underline; }
.search-suggest {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff;
  border-radius: 12px; box-shadow: var(--shadow-lg); overflow: hidden; z-index: 70; display: none;
}
.search-suggest.open { display: block; }
.search-suggest button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  border: 0; background: #fff; padding: 10px 12px; color: var(--ink); font-size: 14px;
}
.search-suggest button:hover { background: var(--red-50); }
.search-suggest img { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; background: var(--bg); }
.search-suggest .ss-price { margin-left: auto; color: var(--red); font-weight: 700; font-size: 13px; white-space: nowrap; }

.header-actions { display: flex; align-items: center; gap: 10px; }
.cart-btn {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff; border-radius: 10px; padding: 8px 14px; font-weight: 600; font-size: 14px;
}
.cart-btn:hover { background: rgba(255, 255, 255, 0.24); }
.cart-count {
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: #fff; color: var(--red);
  font-size: 11.5px; font-weight: 800; display: grid; place-items: center;
}
.icon-btn {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.14); color: #fff; display: grid; place-items: center;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.24); }

/* ------------------------------------------------------------- category nav */
.catnav { background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow-sm); position: relative; z-index: 55; }
.catnav-scroll { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; max-width: var(--container); margin: 0 auto; padding: 0 12px; }
.catnav-scroll::-webkit-scrollbar { display: none; }
.catnav a {
  padding: 11px 12px; font-size: 13.5px; font-weight: 500; color: var(--ink); white-space: nowrap;
  border-bottom: 2px solid transparent; display: inline-flex; align-items: center; gap: 6px;
}
.catnav a:hover { color: var(--red); }
.catnav a.active { color: var(--red); border-bottom-color: var(--red); font-weight: 700; }
.catnav a.hot { color: var(--red); font-weight: 700; }

/* ------------------------------------------------------------------ layout */
main { min-height: 60vh; padding-bottom: 56px; }
.page { padding-top: 20px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { font-size: 22px; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin-bottom: 14px; flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--red); }

.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.pad { padding: 18px; }
.section { margin-top: 26px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { font-size: 19px; display: flex; align-items: center; gap: 8px; }
.section-head .link { font-size: 13.5px; color: var(--blue); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.section-head .link:hover { color: var(--red); }

/* ----------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; background: var(--red); color: #fff;
  padding: 11px 20px; border-radius: 10px; font-weight: 700; font-size: 14.5px;
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--red-600); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-outline { background: #fff; border-color: var(--red); color: var(--red); }
.btn-outline:hover { background: var(--red-50); }
.btn-dark { background: var(--navy); }
.btn-dark:hover { background: #16223a; }
.btn-blue { background: var(--blue); }
.btn-blue:hover { background: #094a8b; }
.btn-green { background: var(--green); }
.btn-green:hover { background: #0d8c3e; }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--bg); }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 14px 26px; font-size: 16px; border-radius: 12px; }
.btn-block { width: 100%; }
.link-btn { border: 0; background: none; color: var(--blue); font-weight: 600; padding: 0; }
.link-btn:hover { color: var(--red); }

/* ------------------------------------------------------------------ forms */
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink); }
.field .hint { font-size: 12px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 10px;
  padding: 11px 13px; outline: none; color: var(--ink); transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(226, 35, 26, 0.12); }
.textarea { min-height: 90px; resize: vertical; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.form-error { color: var(--red-700); background: var(--red-50); border: 1px solid #f6c9c5; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; }
.form-note { font-size: 12.5px; color: var(--muted); }

/* ------------------------------------------------------------------ chips */
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.01em;
}
.chip-red { background: var(--red-50); color: var(--red-700); }
.chip-green { background: var(--green-50); color: #0c7a37; }
.chip-blue { background: var(--blue-50); color: var(--blue); }
.chip-grey { background: #eef1f5; color: var(--muted); }
.chip-dark { background: var(--navy); color: #fff; }

/* ------------------------------------------------------------ product card */
.pcard {
  position: relative; display: flex; flex-direction: column; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.pcard:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #d9dee7; }
.pcard-media { position: relative; aspect-ratio: 1 / 1; background: #f7f8fa; overflow: hidden; display: block; }
.pcard-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.pcard:hover .pcard-media img { transform: scale(1.04); }
.pcard-flag { position: absolute; top: 8px; left: 8px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.pcard-off {
  background: var(--red); color: #fff; font-size: 11.5px; font-weight: 800;
  padding: 2px 7px; border-radius: 6px; box-shadow: 0 2px 6px rgba(226, 35, 26, 0.35);
}
.pcard-tag { background: rgba(11, 20, 36, 0.82); color: #fff; font-size: 10.5px; font-weight: 700; padding: 2px 6px; border-radius: 5px; letter-spacing: 0.02em; }
.pcard-body { padding: 10px 11px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pcard-name {
  font-size: 13.5px; font-weight: 500; color: var(--ink); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 38px;
}
.pcard:hover .pcard-name { color: var(--red-700); }
.pcard-vouchers { display: flex; gap: 4px; flex-wrap: wrap; }
.pcard-vouchers span { font-size: 10px; border: 1px solid #f3c9c5; color: var(--red-700); border-radius: 4px; padding: 0 4px; }
.pcard-price { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.price { color: var(--red); font-weight: 800; font-size: 16.5px; letter-spacing: -0.02em; }
.price-old { color: #98a1ad; font-size: 12.5px; text-decoration: line-through; }
.pcard-meta { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); margin-top: auto; }
.stars { color: var(--gold); letter-spacing: 0.5px; font-size: 11.5px; }
.pcard-add {
  position: absolute; right: 8px; bottom: 8px; width: 34px; height: 34px; border-radius: 10px;
  border: 1px solid #f3c9c5; background: #fff; color: var(--red); display: grid; place-items: center;
  box-shadow: var(--shadow-sm); transition: background 0.15s, transform 0.15s;
}
.pcard-add:hover { background: var(--red); color: #fff; transform: scale(1.06); }
.pcard-soldout { position: absolute; inset: 0; background: rgba(255, 255, 255, 0.72); display: grid; place-items: center; font-weight: 700; color: var(--muted); }

.grid-products { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.grid-products.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

/* ----------------------------------------------------------------- footer */
.site-footer { background: var(--navy); color: rgba(255, 255, 255, 0.72); margin-top: 40px; font-size: 13.5px; }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr 1.2fr; gap: 26px; padding: 44px 0 32px; }
.footer-col h4 { color: #fff; font-size: 13.5px; margin-bottom: 12px; letter-spacing: 0.02em; text-transform: uppercase; }
.footer-col ul { display: grid; gap: 9px; }
.footer-col a:hover { color: #fff; }
.footer-brand { display: grid; gap: 12px; }
.footer-brand .brand-logo { box-shadow: none; padding: 6px 11px; }
.footer-brand .brand-logo img { height: 24px; }
.footer-brand p { line-height: 1.65; font-size: 13px; }
.footer-pay { display: flex; gap: 6px; flex-wrap: wrap; }
.footer-pay span { background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 6px; padding: 4px 8px; font-size: 11.5px; color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, 0.12); padding: 16px 0 22px; font-size: 12px; display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.footer-bottom .bct { display: flex; align-items: center; gap: 10px; }

/* ------------------------------------------------------------------ toast */
.toast-wrap { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: grid; gap: 8px; justify-items: end; }
.toast {
  background: var(--navy); color: #fff; padding: 11px 16px; border-radius: 10px;
  font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow-lg); animation: toastIn 0.2s ease;
  display: flex; align-items: center; gap: 8px; max-width: 340px;
}
.toast.ok { background: #0c7a37; }
.toast.err { background: var(--red-700); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------- utilities */
.skeleton { background: linear-gradient(90deg, #eef1f5 25%, #f7f9fb 37%, #eef1f5 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: var(--radius); }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.empty-state { text-align: center; padding: 54px 20px; color: var(--muted); display: grid; gap: 10px; justify-items: center; }
.empty-state i { color: #c3cbd6; }
.empty-state h3 { color: var(--ink); font-size: 17px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid rgba(0, 0, 0, 0.12); border-top-color: var(--red); animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-row { display: grid; justify-items: center; gap: 10px; padding: 40px; color: var(--muted); font-size: 13.5px; }

.stars-static { color: var(--gold); font-size: 13px; letter-spacing: 1px; }
.badge-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); display: inline-block; }

/* ------------------------------------------------------------- responsive */
@media (min-width: 640px) { .container { padding: 0 20px; } }

@media (max-width: 1023px) {
  .grid-products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-top { grid-template-columns: 1fr 1fr 1fr; }
}

@media (max-width: 860px) {
  .header-inner { grid-template-columns: auto 1fr; gap: 12px; }
  .search-wrap { grid-column: 1 / -1; grid-row: 2; }
  .search-hints { display: none; }
  .catnav { position: relative; }
  .brand-tag { display: none; }
  .brand-logo { padding: 6px 10px; }
  .brand-logo img { height: 24px; }
  .cart-btn span.label { display: none; }
}

@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .container { padding: 0 12px; }
  .topbar .container { height: 32px; font-size: 11.5px; gap: 8px; }
  .topbar-links { gap: 12px; }
  .topbar-links li:nth-child(2) { display: none; }
  .topbar-right { gap: 10px; }
  .topbar-hot span.text { display: none; }
  .grid-products, .grid-products.cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; padding: 28px 0 20px; gap: 20px; }
  .footer-brand { grid-column: 1 / -1; }
  .section-head h2 { font-size: 17px; }
  .price { font-size: 15px; }
  .footer-bottom { flex-direction: column; }
}
