:root{
  --bg1:#090c14; --bg2:#0e1220; --fg:#e6f1ff; --muted:#99a3b3;
  --neon1:#00e5ff; --neon2:#7c4dff; --neon3:#18ffb2; --danger:#ff3b6b; --ok:#25d366; --warn:#ffd166;
  --card: rgba(255,255,255,0.06); --glass: rgba(255,255,255,0.08); --border: rgba(255,255,255,0.15);
}

*{box-sizing:border-box}
html { -webkit-text-size-adjust: 100%; }
html,body{margin:0;padding:0;background: radial-gradient(1200px 800px at 80% -10%,rgba(124,77,255,.25),transparent 70%),
linear-gradient(180deg,var(--bg1),var(--bg2)); color:var(--fg); font-family:System-UI,Segoe UI,Inter,Roboto,Arial,sans-serif;}
img, svg { max-width:100%; height:auto; }

/* Background sheen: only on home */
.home::before{
  content:""; position:fixed; inset:0; pointer-events:none; z-index:0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.08) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: bg-sheen 8s ease-in-out infinite;
  mix-blend-mode: screen; opacity:.18;
  will-change: background-position, opacity;
}
@keyframes bg-sheen{
  0%{background-position: 200% 0; opacity:.10}
  20%{background-position: 90% 0; opacity:.22}
  40%{background-position: 0% 0; opacity:.16}
  100%{background-position: -200% 0; opacity:.10}
}

a{color:var(--neon1); text-decoration:none}
a:hover{opacity:.9}
.container{max-width:1100px;margin:0 auto;padding:24px}
.header{display:flex;align-items:center;gap:16px;padding:16px 24px;position:sticky;top:0;background:linear-gradient(180deg,rgba(9,12,20,.85),transparent);
backdrop-filter: blur(8px); z-index:8; border-bottom:1px solid var(--border)}
.header .brand{display:flex; align-items:center; gap:10px}
.brand-name{font-weight:700; letter-spacing:.3px}

/* Text logo with sheen (5s) */
.brand-logo{
  position:relative;
  font-weight:800;
  font-size:20px;
  letter-spacing:.5px;
  background:linear-gradient(90deg,var(--neon1),var(--neon2));
  -webkit-background-clip:text; background-clip:text; color:transparent;
  text-shadow:0 0 18px rgba(124,77,255,.25);
  overflow:hidden;
}
.brand-logo .sheen{
  position:absolute; inset:0;
  transform:translateX(-120%) skewX(-20deg);
  background:linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent);
  animation:sweep 5s infinite;
}
@keyframes sweep{
  0%{transform:translateX(-120%) skewX(-20deg); opacity:0;}
  6%{transform:translateX(120%) skewX(-20deg); opacity:1;}
  100%{transform:translateX(120%) skewX(-20deg); opacity:0;}
}

.badge{padding:4px 10px;border:1px solid var(--border); border-radius:999px; font-size:12px; color:var(--muted)}

/* Search overlay (icon only in header) */
.searchbar{display:flex; align-items:center; justify-content:flex-end; gap:8px}
.btn{padding:12px 16px; border:1px solid var(--border); border-radius:12px; background:linear-gradient(180deg,rgba(255,255,255,.06),rgba(255,255,255,.02));
color:var(--fg); cursor:pointer; transition:transform .12s ease, box-shadow .25s;}
.btn:hover{transform:translateY(-1px); box-shadow:0 8px 30px rgba(124,77,255,.25)}
.btn-primary{border-color:transparent; background:linear-gradient(135deg,var(--neon1),var(--neon2)); color:#051018; font-weight:700}
.btn.icon-only{padding:10px 12px; display:grid; place-items:center}
.btn-block{width:100%}

.search-overlay{
  display:none; position:fixed; left:0; right:0; top:60px; z-index:30;
  padding:10px 16px; backdrop-filter: blur(10px);
  background: linear-gradient(180deg, rgba(9,12,20,.96), rgba(9,12,20,.88));
  border-bottom:1px solid var(--border);
}
body.search-open .search-overlay{display:flex}
.search-overlay form{width:100%; display:flex; gap:8px}
.search-overlay input{
  flex:1; padding:12px 14px; border:1px solid var(--border); border-radius:12px; background:var(--glass); color:var(--fg); outline:none;
}
.search-overlay .close{padding:10px 14px; border:1px solid var(--border); border-radius:12px; background:rgba(255,255,255,.04); color:var(--fg)}

.input, select, textarea, button{font-size:16px}

.hero{padding:32px 24px 8px; display:grid; grid-template-columns:1.2fr .8fr; gap:24px; align-items:center; position:relative; z-index:1}
.hero h1{font-size:38px; margin:0 0 10px}
.hero p{color:var(--muted); margin-top:0}

.card{background:var(--card); border:1px solid var(--border); border-radius:16px; padding:16px; overflow:hidden}
.card *{max-width:100%}
.grid{display:grid; gap:16px}
.grid-3{grid-template-columns: repeat(3, 1fr)}
.grid-4{grid-template-columns: repeat(4, 1fr)}
.list{display:grid; gap:10px}
.product-mini{display:flex; align-items:flex-start; gap:12px; padding:10px; border:1px solid var(--border); border-radius:14px; background:rgba(255,255,255,.03);}
.product-mini img{width:36px; height:36px}
.price{font-weight:700; color:#bffcff}
.kv{display:flex; gap:8px; flex-wrap:wrap}

.featured .item{position:relative; padding:14px; border:1px solid var(--border); border-radius:16px; background:linear-gradient(180deg,rgba(255,255,255,.06),rgba(255,255,255,.03)); overflow:hidden}
.featured .item:hover{box-shadow:0 10px 40px rgba(0,229,255,.24)}
.featured .item img{width:44px; height:44px}
.featured .name{font-weight:700; margin:10px 0 6px}
.featured .meta{display:flex; gap:8px; align-items:center; color:var(--muted); font-size:12px}
.featured .spec{font-size:11px}
.featured .spec img{width:12px; height:12px}
.featured .price{font-size:14px}
.cta{display:flex; gap:10px; align-items:center}

.ticker{
  width:100%;
  height:34px;
  border:1px solid var(--border);
  border-radius:8px;
  background:linear-gradient(90deg,rgba(0,229,255,.08),rgba(124,77,255,.08),rgba(24,255,178,.08));
  display:flex; align-items:center; overflow:hidden;
  margin:6px 0 14px 0;
}
.ticker .track{white-space:nowrap; animation:marquee 26s linear infinite; font-size:13px; color:#d5edff; padding:0 10px}
.ticker strong{color:#bffcff}
@keyframes marquee {0% {transform:translateX(0)} 100% {transform:translateX(-50%)}}

.footer{padding:32px; color:var(--muted); text-align:center}

.audio-toggle{position:fixed; right:18px; bottom:18px; z-index:20}
.audio-toggle .circle{width:52px; height:52px; border-radius:50%; display:grid; place-items:center; border:2px solid var(--neon2);
background: radial-gradient(140px 120px at 50% 0%, rgba(0,229,255,.28), transparent 60%); box-shadow:0 0 18px rgba(124,77,255,.25), inset 0 0 22px rgba(124,77,255,.16);
cursor:pointer; animation:pulse 3s ease-in-out infinite}
.audio-toggle .circle svg{width:22px; height:22px; opacity:.95; transition:transform .2s ease}
.audio-toggle .circle.playing svg{transform:scale(1.05)}
.audio-toggle .status{position:absolute; top:8px; right:8px; width:12px; height:12px; border-radius:50%; background:var(--warn); border:2px solid #051018}
.audio-toggle[data-enabled="0"] .circle{opacity:.5; filter:grayscale(1); cursor:not-allowed; animation:none}
.audio-toggle[data-enabled="1"] .circle.playing{box-shadow:0 0 24px rgba(0,229,255,.5), inset 0 0 26px rgba(124,77,255,.26)}
@keyframes pulse {0%,100%{transform:scale(1)}50%{transform:scale(1.06)}}

/* online bubble */
.audio-toggle .badge-online{
  position:absolute; bottom:64px; right:0;
  background:rgba(24,255,178,.95); color:#051018; font-size:11px; padding:4px 8px; border-radius:999px;
  box-shadow:0 6px 24px rgba(24,255,178,.35);
  display:none;
}
.audio-toggle[data-online="1"] .badge-online{display:block}

/* blinking online dot */
@keyframes online-blink {
  0%,100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37,211,102,0.65); }
  50% { transform: scale(1.18); box-shadow: 0 0 14px 6px rgba(37,211,102,0.35); }
}
.audio-toggle[data-online="1"] .status{ animation: online-blink 1.4s ease-in-out infinite; background: var(--ok); }

.table{width:100%; border-collapse: collapse}
.table th,.table td{padding:10px 12px; border-bottom:1px solid var(--border); text-align:left}
.table th{color:#b6c6ff; font-weight:600;}

.form{display:grid; gap:12px}
.input, select, textarea{width:100%; padding:12px 14px; border:1px solid var(--border); border-radius:12px; background:var(--glass); color:var(--fg); outline:none}
label{font-size:13px; color:#bcd1ff}
.req{color:#ff8fab}
.help{font-size:12px; color:#bcd1ff}

.paybox{display:grid; gap:12px}
.qrbox{display:grid; place-items:center; padding:18px; border-radius:16px; border:1px dashed var(--neon1); background:rgba(0,229,255,.06);
box-shadow: inset 0 0 40px rgba(0,229,255,.1); animation:flicker 4s infinite}
@keyframes flicker{0%,100%{opacity:1}50%{opacity:.9}}
.loader-overlay{position:fixed; inset:0; background:radial-gradient(800px 600px at 50% 0%, rgba(124,77,255,.15), rgba(0,0,0,.9));
 display:none; align-items:center; justify-content:center; flex-direction:column; z-index:99;}
.loader{width:100px; height:100px; border-radius:50%; border:4px solid rgba(255,255,255,.08); position:relative; overflow:hidden}
.loader::before{content:""; position:absolute; inset:-40%; background:conic-gradient(from 0deg, var(--neon1), var(--neon2), var(--neon3), var(--neon1)); animation:spin 1.8s linear infinite}
.loader::after{content:""; position:absolute; inset:8px; background:#0b0f19; border-radius:50%}
.loader-text{margin-top:14px; color:#d8eaff; font-size:14px; text-align:center}
@keyframes spin{to{transform:rotate(1turn)}}

.status-dot{display:inline-block; width:10px; height:10px; border-radius:50%}
.stat-online{background:var(--ok)} .stat-offline{background:var(--warn)}

.notice{padding:10px 12px; border:1px solid var(--border); border-radius:12px; background:rgba(255,255,255,.04); color:#cfe9ff}

.admin-nav{display:flex; gap:10px; margin:14px 0 24px}
.admin-nav a{padding:10px 12px; border:1px solid var(--border); border-radius:10px; background:rgba(255,255,255,.04)}
.admin-nav a.active{background:linear-gradient(90deg,rgba(0,229,255,.12),rgba(124,77,255,.12))}
.small{font-size:12px; color:var(--muted)}

/* Product spec blocks unified */
.spec{display:flex; align-items:center; gap:6px; font-size:11px; color:#bcd1ff}
.spec img, .spec svg{width:12px; height:12px}
.spec-wrap{display:grid; gap:6px}
.spec-wrap-2col{display:grid; grid-template-columns: 1fr 1fr; gap:8px}

/* Announcement like a Facebook post */
.announcement .post-header{display:flex; align-items:center; gap:10px; margin-bottom:8px}
.announcement .post-avatar{
  width:26px; height:26px; border-radius:50%; display:grid; place-items:center;
  background:linear-gradient(120deg, var(--neon2), var(--neon1));
  color:#051018; font-weight:700; font-size:12px;
}
.announcement .post-meta{display:flex; align-items:center; gap:8px; color:#bcd1ff; font-size:12px}
.announcement .post-meta svg{width:12px; height:12px}
.announcement .post-content{white-space:pre-wrap; color:#e9f5ff; margin:6px 0 10px}
.announcement .post-social{display:flex; align-items:center; gap:12px; color:#cfe9ff; font-size:13px; border-top:1px solid var(--border); padding-top:8px}
.announcement .stars{display:inline-flex; gap:3px; vertical-align:middle}
.announcement .stars svg{width:14px; height:14px}

/* Mobile-friendly search overlay (bigger input & buttons) */

  .search-overlay .btn, .search-overlay .close{ font-size:16px; padding:14px 18px }
}

/* Responsive */
@media (max-width: 1200px){ .grid-4{grid-template-columns: repeat(3,1fr)} }
@media (max-width: 900px){
  .hero{grid-template-columns:1fr}
  .grid-4{grid-template-columns: repeat(2,1fr)}
  .paybox .grid{grid-template-columns:1fr !important}
  .cta{flex-wrap:wrap}
  #btn-show-qr, #btn-mark-paid{width:100%}
}
@media (max-width: 720px){
  section.card > div[style*="grid-template-columns"]{grid-template-columns: 1fr !important}
}
@media (max-width: 520px){ .grid-4{grid-template-columns: 1fr} }


@media (max-width: 520px){
  .search-overlay button.btn,
  .search-overlay .close{
    font-size:13px; padding:8px 10px; border-radius:10px
  }
}


/* === Welcome page (text-first, small icons) === */
.welcome .stack{display:grid; gap:14px; margin:16px 0}
.welcome .item{display:flex; align-items:flex-start; gap:10px}
.welcome .item .icon{width:16px; height:16px; margin-top:3px; opacity:.9}
.welcome .hero-title{text-align:center; margin-top:24px}
.welcome .hero-title .brand-logo{font-size:28px}
.welcome .hero-desc{text-align:center; color:#bcd1ff; margin-top:6px}
.welcome .hero-cta{text-align:center; margin-top:10px}
.welcome .metrics{display:grid; grid-template-columns: 1fr 1fr; gap:10px; margin-top:10px}
.welcome .metric{border:1px solid var(--border); border-radius:12px; padding:10px; background:rgba(255,255,255,.04)}
.welcome .metric .num{font-weight:800; color:#bffcff}
.welcome .metric .label{font-size:12px; color:#bcd1ff}

/* === Welcome metric vertical stack === */
.welcome .metric-stack{display:grid; gap:10px; margin:12px auto; max-width:760px}
.welcome .metric-row{display:flex; align-items:center; gap:8px; justify-content:center; font-size:15px}
.welcome .metric-row strong{color:#bffcff; font-weight:800}
.welcome .stars{display:inline-flex; gap:2px}
.welcome .stars svg{width:16px; height:16px}

/* === Sale (Ưu đãi) badge & price highlight === */
@keyframes salePulse { 0%,100%{box-shadow:0 0 0 0 rgba(0,229,255,.0)} 50%{box-shadow:0 0 24px rgba(0,229,255,.35)} }
.sale-badge{display:inline-block; margin-left:8px; padding:3px 8px; border-radius:999px;
  background:linear-gradient(135deg,var(--neon1),var(--neon2)); color:#051018; font-size:11px; font-weight:800; animation:salePulse 2.2s ease-in-out infinite}
.price-promo{position:relative; display:inline-flex; align-items:center; gap:8px}
.price-promo .strikethrough{color:#9aa9c7; text-decoration:line-through; font-size:13px; opacity:.8}

/* === Welcome metrics: compact vertical rows === */
.welcome .metric-set{display:grid; gap:6px; max-width:760px; margin:8px auto}
.welcome .metric-line{display:flex; align-items:center; gap:10px; padding:10px 12px; border:1px solid var(--border); border-radius:10px; background:rgba(255,255,255,.03)}
.welcome .metric-line .stars{display:inline-flex; gap:3px}
.welcome .metric-line .stars svg{width:14px;height:14px}


/* === Welcome CTA center === */
.welcome .cta{display:flex; justify-content:center}

/* === Sale price: white blinking to red === */
@keyframes sale-blink{0%,100%{color:#ffffff; text-shadow:0 0 0 rgba(255,59,107,0)}50%{color:#ff3b6b; text-shadow:0 0 12px rgba(255,59,107,.7)}}
.price-sale{animation:sale-blink 1.2s ease-in-out infinite}

/* Old price muted + strikethrough */
.price-old{opacity:.6; text-decoration: line-through; display:block; font-size:13px}

/* Product list layout improvements */
.product-mini{display:flex; align-items:flex-start; gap:12px}
.product-mini .meta{display:flex; flex-direction:column; gap:4px; flex:1; min-width:0}
.product-mini .title{font-weight:700}
.product-mini .desc{font-size:12px; color:#bcd1ff}
.product-mini .pricebox{margin-left:auto; text-align:right; min-width:110px}
.product-mini .pricebox .price-sale{font-size:14px; font-weight:700; display:block}
.product-mini .pricebox .price-old{margin-top:2px}

/* Line clamp for description */
.line-2{display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden}

/* Spec row horizontal and comfy wrap */
.spec-row{display:flex; gap:10px; flex-wrap:wrap; margin-top:6px}
.spec-row .spec{font-size:11px}

/* Featured item restructure */
.featured .item{display:grid; gap:8px}
.featured .fi-grid{display:grid; grid-template-columns:1fr auto; gap:10px; align-items:start}
.featured .fi-left .name{font-weight:700; margin:8px 0 4px}
.featured .fi-left .desc{font-size:12px; color:#bcd1ff}
.featured .pricebox{ text-align:right }
.featured .pricebox .price-sale{font-size:16px; font-weight:700; display:block}
.featured .pricebox .price-old{margin-top:2px}


/* === v12-fixed r2 additions === */

/* Search overlay buttons smaller on mobile */
@media (max-width: 600px){
  #searchToggle{ width:32px; height:32px; padding:0 !important; }
  .btn.icon-only{ width:32px; height:32px; padding:0 !important; }
  .search-overlay .close{ padding:6px 10px !important; font-size: 12px; }
  .search-overlay .btn{ padding:8px 12px !important; font-size: 13px; }
}

/* Price display: promo (current) + old (struck-through) */
@keyframes priceSlowPulse {
  0%,100% { color:#fff; text-shadow: none; }
  50% { color:#e53935; text-shadow: 0 0 .1em rgba(229,57,53,.25); }
}
.price .current{
  font-weight:800;
  animation: priceSlowPulse 2.8s ease-in-out infinite;
  font-variant-numeric: tabular-nums;
}
.price .old{
  color: rgba(255,255,255,.6);
  text-decoration: line-through;
  text-decoration-thickness: 1.4px;
  text-decoration-color: rgba(255,255,255,.6);
  font-variant-numeric: tabular-nums;
}

/* Welcome hero */
.welcome-hero.card{
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(16px, 4vw, 28px);
}
.welcome-hero .brand-logo{
  display:inline-block;
  font-weight:800;
  font-size: clamp(22px, 6vw, 32px);
}
.welcome-hero .intro{
  font-size: clamp(14px, 3.4vw, 16px);
  line-height: 1.45;
}
.welcome-hero .cta{
  display:flex;
  justify-content:center;
  margin: 8px 0 14px;
}
.welcome-hero .cta .btn{
  min-width: 220px;
}

/* Fix overlapping by ensuring CTA row clears floats and stays relative */
.welcome-hero .cta{ position: relative; clear: both; z-index: 1; }
.welcome-hero .card + .cta { margin-top: 12px; }

/* Ratings block fixes */
.rating-card{ position:relative; }
.rating-card .score{
  font-size: clamp(28px,5vw,42px);
  font-weight: 800;
  line-height: 1;
}
.stars{ display:inline-flex; gap:4px; vertical-align:middle; }
.star{ width:16px; height:16px; display:inline-block; }
.star svg{ width:100%; height:100%; display:block; }
.star .fill{ fill: #ffd166; }
.star .empty{ fill: #333a; }

/* Background sweep effect every 8s on welcome & home */
body[data-page="welcome"]::before,
body[data-page="home"]::before{
  content:""; position:fixed; inset:0; pointer-events:none; z-index:0;
  background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,.06) 45%, transparent 90%);
  transform: translateX(-120%) skewX(-18deg);
  animation: bgSweep 8s linear infinite;
}
@keyframes bgSweep{
  0%{ transform: translateX(-120%) skewX(-18deg); opacity: 0; }
  6%{ transform: translateX(120%) skewX(-18deg); opacity: 1; }
  100%{ transform: translateX(120%) skewX(-18deg); opacity: 0; }
}

/* Ensure content sits above sweep */
.container, header, .card{ position: relative; z-index: 1; }

/* Typography tweaks for names */
.product-mini .title{ font-weight:800; font-size: clamp(1rem, 2.8vw, 1.15rem); line-height:1.2; }
.featured .item .name{ font-weight:800; font-size: clamp(1rem, 2.6vw, 1.15rem); line-height:1.2; }



/* CTA container on intro page to avoid overlap */
.index-cta{ display:flex; margin-top:16px; position:relative; z-index:2; }
.index-cta .btn{ min-width: 240px; }

/* Apply background sweep to intro page as well */
body[data-page="intro"]::before{
  content:""; position:fixed; inset:0; pointer-events:none; z-index:0;
  background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,.06) 45%, transparent 90%);
  transform: translateX(-120%) skewX(-18deg);
  animation: bgSweep 8s linear infinite;
}



/* === r4: Image & mobile performance fixes === */

/* Ensure featured/list images keep aspect ratio and don't cause CLS */
.featured .item img{ width:44px; height:44px; aspect-ratio:1/1; object-fit:cover; border-radius:10px; }
.product-mini img{ width:36px; height:36px; aspect-ratio:1/1; object-fit:cover; border-radius:8px; }

/* Reduce mobile flicker: pause background sweep & heavy blur on small screens */
@media (max-width:600px){
  body.home::after, body.welcome::before{ animation:none !important; opacity:0.06 !important; mix-blend-mode:normal !important; }
  .header{ backdrop-filter:none !important; background:linear-gradient(180deg, rgba(9,12,20,.96), rgba(9,12,20,.90)) !important; }
}

/* GPU hint for sweep layers */
body.home::after, body.welcome::before{
  will-change: transform, opacity;
  backface-visibility: hidden;
  transform: translateZ(0);
}

/* Keep price animation but lighter repaint */
.price .current{ text-shadow:none; }


/* [r5] Stars + CTA */
.stars{ display:inline-flex; gap:3px; vertical-align:middle; }
.stars svg{ width:16px; height:16px; }
.intro-cta{ display:grid; gap:6px; align-items:center; justify-content:start; margin-top:16px; }
.intro-cta .btn{ min-height:44px; padding:12px 16px; display:inline-flex; align-items:center; justify-content:center; }

/* [r5] Product card v12 */
.products-grid{ display:grid; grid-template-columns:repeat(auto-fit, minmax(260px, 1fr)); gap:16px; }
.product-card{ background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.08); border-radius:12px; padding:12px; display:grid; grid-template-rows:auto auto auto; gap:6px; text-decoration:none; color:inherit; }
.product-card:hover{ transform: translateY(-1px); box-shadow:0 8px 30px rgba(124,77,255,.18); }
.product-card .pc-head{ display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:10px; }
.product-card .pc-icon{ width:42px; height:42px; border-radius:10px; object-fit:cover; box-shadow:0 1px 0 rgba(255,255,255,.04), 0 10px 30px rgba(0,0,0,.2) }
.product-card .pc-title{ margin:0; line-height:1.2; font-weight:800; font-size:clamp(1.05rem, 2.8vw, 1.25rem); }
.product-card .pc-price{ display:flex; align-items:baseline; gap:8px; white-space:nowrap; }
@keyframes priceSlowPulse { 0%,100%{ color:#fff; text-shadow:none; } 50%{ color:#e53935; text-shadow:0 0 .1em rgba(229,57,53,.25); } }
.product-card .pc-price .current{ font-weight:800; animation:priceSlowPulse 2.6s ease-in-out infinite; font-variant-numeric:tabular-nums; }
.product-card .pc-price .old{ color:rgba(255,255,255,.6); text-decoration:line-through; text-decoration-thickness:1.5px; text-decoration-color:rgba(255,255,255,.6); }
.product-card .pc-desc{ margin:0; font-size:.9rem; opacity:.9; }
.product-card .pc-meta{ display:flex; gap:8px; margin-top:4px; }
.product-card .spec{ display:inline-flex; align-items:center; gap:6px; font-size:.84rem; opacity:.9; }
.product-card .spec img{ width:14px; height:14px; }

/* [r5] Mobile flicker fix */
@media (max-width:768px){
  body.welcome::before, body.home::after{ opacity:.08; mix-blend-mode:normal; will-change:transform, opacity; }
}
body.welcome::before, body.home::after{ backface-visibility:hidden; transform:translateZ(0); }
/* ===== [r5 override in css.php] Product cards anti-overlap & spec icons ===== */

/* 1) Icon bảo hành / tốc độ: thu nhỏ */
.product-card .spec img,
.spec-wrap-2col .spec img{
  width: 12px; height: 12px; flex: 0 0 12px;
}

/* 2) Bố cục phần meta: 2 cột, khoảng cách xa – tránh chữ đè */
.product-card .pc-meta{
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  column-gap: 12px;
  row-gap: 6px;
  margin-top: 6px;
}
.product-card .spec{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;                /* không xuống dòng lung tung */
}
.product-card .spec span{
  overflow: hidden;
  text-overflow: ellipsis;            /* tên dài sẽ “…” */
}

/* 3) Phần đầu thẻ: ảnh | tên | giá – không chồng chéo */
.product-card .pc-head{
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 10px;
}
.product-card .pc-icon{              /* thu gọn icon sản phẩm một chút */
  width: 36px; height: 36px; border-radius: 10px; object-fit: cover;
}
@media (min-width: 640px){
  .product-card .pc-icon{ width: 42px; height: 42px; }
}

/* 4) Tiêu đề & mô tả: chống tràn bằng line‑clamp */
.product-card .pc-title{
  margin: 0;
  font-weight: 800;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;             /* tối đa 2 dòng */
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-card .pc-desc{
  margin: 0;
  font-size: .9rem;
  opacity: .9;
  display: -webkit-box;
  -webkit-line-clamp: 2;             /* tối đa 2 dòng */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 5) Giá: giữ bên phải, không wrap */
.product-card .pc-price{
  display: flex; align-items: baseline; gap: 8px;
  white-space: nowrap;                /* tránh xuống dòng giữa các số */
  margin-left: 8px;
}

/* 6) Lưới sản phẩm: khoảng cách hợp lý */
.products-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.product-card{ position: relative; overflow: hidden; }

/* 7) Dạng danh sách (list) cũng 2 cột meta + icon nhỏ */
.spec-wrap-2col{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.spec-wrap-2col .spec{
  display: inline-flex; align-items: center; gap: 6px;
  min-width: 0; white-space: nowrap;
}
.spec-wrap-2col .spec span{ overflow: hidden; text-overflow: ellipsis; }

/* 8) Hiệu ứng giá ưu đãi & gạch ngang giá gốc (nếu chưa có) */
@keyframes priceSlowPulse{
  0%,100%{ color:#fff; text-shadow:none; }
  50%{ color:#e53935; text-shadow:0 0 .1em rgba(229,57,53,.25); }
}
.price .current{
  font-weight: 800;
  animation: priceSlowPulse 2.6s ease-in-out infinite;
  font-variant-numeric: tabular-nums;
}
.price .old{
  color: rgba(255,255,255,.6);
  text-decoration: line-through;
  text-decoration-thickness: 1.4px;
  text-decoration-color: rgba(255,255,255,.6);
  font-variant-numeric: tabular-nums;
}

/* 9) Mobile: co giãn vừa mắt, tránh đè nhau */
@media (max-width: 480px){
  .product-card{ padding: 10px; }
  .product-card .pc-head{ gap: 8px; }
  .product-card .pc-price{ margin-left: 6px; }
  .product-card .pc-meta{ column-gap: 10px; row-gap: 4px; }
}
