/* ============================================================
   Săn Hàng Giá Tốt – Main Stylesheet
   sanhanggiatot.io.vn
   ============================================================ */

:root {
  --red:       #E8232A;
  --red-dark:  #C41B22;
  --orange:    #FF6B00;
  --yellow:    #FFD200;
  --green:     #00B14F;
  --bg:        #F5F5F5;
  --white:     #FFFFFF;
  --gray-100:  #F0F0F0;
  --gray-200:  #E0E0E0;
  --gray-400:  #9E9E9E;
  --gray-600:  #5A5A5A;
  --gray-800:  #212121;
  --radius:    10px;
  --shadow:    0 2px 12px rgba(0,0,0,0.08);
  --shadow-h:  0 6px 24px rgba(0,0,0,0.14);
}

*,*::before,*::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior:smooth; }
body { font-family:'Be Vietnam Pro',sans-serif; background:var(--bg); color:var(--gray-800); font-size:14px; line-height:1.6; }
a { text-decoration:none; color:inherit; }
img { max-width:100%; display:block; }
button { cursor:pointer; font-family:inherit; }

/* TOP BAR */
.topbar { background:var(--red-dark); color:#fff; text-align:center; padding:7px 16px; font-size:12.5px; font-weight:500; }
.topbar span { color:var(--yellow); font-weight:700; }

/* HEADER */
header { background:var(--red); padding:0 20px; position:sticky; top:0; z-index:100; box-shadow:0 2px 8px rgba(0,0,0,0.2); }
.header-inner { max-width:1200px; margin:0 auto; display:flex; align-items:center; gap:16px; height:62px; }
.logo { display:flex; align-items:center; gap:8px; flex-shrink:0; }
.logo-icon { width:38px; height:38px; background:var(--yellow); border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:20px; }
.logo-text { color:#fff; font-size:17px; font-weight:800; line-height:1.2; }
.logo-text span { color:var(--yellow); display:block; font-size:14px; }
.search-bar { flex:1; display:flex; align-items:center; background:#fff; border-radius:24px; padding:0 6px 0 16px; gap:8px; height:40px; }
.search-bar input { flex:1; border:none; outline:none; font-size:13.5px; font-family:inherit; background:transparent; }
.search-bar button { background:var(--red-dark); color:#fff; border:none; border-radius:20px; padding:6px 16px; font-size:13px; font-weight:600; transition:background .2s; }
.search-bar button:hover { background:#a01218; }
.header-actions { display:flex; align-items:center; gap:6px; flex-shrink:0; }
.header-btn { color:#fff; padding:7px 13px; border-radius:20px; font-size:13px; font-weight:600; border:1.5px solid rgba(255,255,255,0.4); transition:background .2s; white-space:nowrap; }
.header-btn:hover { background:rgba(255,255,255,0.15); }
.header-btn.fav { background:rgba(255,255,255,0.18); border-color:transparent; }

/* NAV */
nav { background:var(--white); border-bottom:1px solid var(--gray-200); }
.nav-inner { max-width:1200px; margin:0 auto; display:flex; align-items:center; padding:0 20px; gap:2px; overflow-x:auto; scrollbar-width:none; }
.nav-inner::-webkit-scrollbar { display:none; }
.nav-item { padding:11px 14px; font-size:13.5px; font-weight:600; color:var(--gray-600); cursor:pointer; white-space:nowrap; border-bottom:2.5px solid transparent; transition:all .18s; display:flex; align-items:center; gap:5px; user-select:none; }
.nav-item:hover,.nav-item.active { color:var(--red); border-bottom-color:var(--red); }
.nav-badge { background:var(--red); color:#fff; font-size:10px; font-weight:700; padding:1px 5px; border-radius:8px; line-height:1.4; }

/* MAIN */
.main-wrap { max-width:1200px; margin:0 auto; padding:16px 20px; }

/* SEARCH RESULT */
.search-result-bar { background:var(--white); border-radius:var(--radius); padding:12px 16px; margin-bottom:16px; display:none; align-items:center; justify-content:space-between; box-shadow:var(--shadow); }
.search-result-bar.visible { display:flex; }
.search-result-bar span { font-size:14px; color:var(--gray-600); }
.search-result-bar strong { color:var(--red); }
.clear-search { font-size:13px; color:var(--gray-400); cursor:pointer; padding:4px 10px; border:1px solid var(--gray-200); border-radius:6px; transition:all .15s; }
.clear-search:hover { color:var(--red); border-color:var(--red); }

/* HERO */
.hero-banner { border-radius:14px; overflow:hidden; margin-bottom:20px; background:linear-gradient(135deg,#1a1a2e 0%,#16213e 40%,var(--red) 100%); padding:40px 48px; display:flex; align-items:center; justify-content:space-between; min-height:200px; }
.hero-eyebrow { background:var(--yellow); color:var(--red-dark); font-size:11.5px; font-weight:800; padding:4px 12px; border-radius:20px; display:inline-block; margin-bottom:12px; letter-spacing:.5px; text-transform:uppercase; }
.hero-title { font-size:36px; font-weight:800; color:#fff; line-height:1.15; margin-bottom:10px; letter-spacing:-1px; }
.hero-title span { color:var(--yellow); }
.hero-sub { color:rgba(255,255,255,0.75); font-size:14px; margin-bottom:22px; }
.hero-cta { background:var(--yellow); color:var(--red-dark); border:none; padding:12px 28px; border-radius:24px; font-size:15px; font-weight:800; transition:transform .15s,box-shadow .15s; box-shadow:0 4px 16px rgba(255,210,0,0.4); }
.hero-cta:hover { transform:translateY(-2px); box-shadow:0 8px 24px rgba(255,210,0,0.5); }
.hero-tags { display:flex; gap:8px; flex-wrap:wrap; margin-top:14px; }
.hero-tag { background:rgba(255,255,255,0.15); color:rgba(255,255,255,0.9); border:1px solid rgba(255,255,255,0.25); font-size:12px; padding:4px 11px; border-radius:20px; }
.hero-visual { font-size:110px; line-height:1; filter:drop-shadow(0 8px 24px rgba(0,0,0,0.3)); flex-shrink:0; margin-left:20px; }

/* PROMO BAR */
.promo-bar { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; background:var(--white); border-radius:12px; padding:16px 20px; box-shadow:var(--shadow); margin-bottom:24px; }
.promo-item { display:flex; align-items:center; gap:10px; }
.promo-icon { font-size:28px; }
.promo-text strong { display:block; font-size:13.5px; font-weight:700; }
.promo-text span { font-size:12px; color:var(--gray-400); }

/* MINI BANNERS */
.mini-banners { display:grid; grid-template-columns:1fr 1fr 1fr; gap:12px; margin-bottom:24px; }
.mini-banner { border-radius:12px; padding:18px 20px; display:flex; align-items:center; gap:14px; cursor:pointer; transition:transform .15s,box-shadow .15s; }
.mini-banner:hover { transform:translateY(-3px); box-shadow:0 8px 20px rgba(0,0,0,0.15); }
.mini-banner.mb1 { background:linear-gradient(135deg,#FF6B00,#FF9900); }
.mini-banner.mb2 { background:linear-gradient(135deg,#00B14F,#00D966); }
.mini-banner.mb3 { background:linear-gradient(135deg,#0052D4,#4364F7); }
.mb-icon { font-size:36px; }
.mb-text { color:#fff; }
.mb-text strong { display:block; font-size:15px; font-weight:800; }
.mb-text span { font-size:12px; opacity:.85; }

/* FLASH SALE */
.flash-sale-header { background:linear-gradient(90deg,var(--red-dark),var(--red)); border-radius:12px 12px 0 0; padding:14px 20px; display:flex; align-items:center; justify-content:space-between; }
.flash-title { color:#fff; font-size:20px; font-weight:800; display:flex; align-items:center; gap:8px; }
.flash-sub { color:var(--yellow); font-size:14px; font-weight:600; }
.countdown { display:flex; align-items:center; gap:6px; }
.count-box { background:var(--gray-800); color:#fff; font-size:18px; font-weight:800; padding:4px 10px; border-radius:6px; min-width:38px; text-align:center; font-family:monospace; }
.count-sep { color:#fff; font-size:18px; font-weight:800; }
.flash-sale-grid { background:var(--white); border-radius:0 0 12px 12px; padding:16px; display:grid; grid-template-columns:repeat(5,1fr); gap:12px; margin-bottom:32px; box-shadow:var(--shadow); }

/* SECTION HEADER */
.section-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
.section-title { font-size:18px; font-weight:800; color:var(--gray-800); display:flex; align-items:center; gap:8px; }
.section-title::before { content:''; display:block; width:4px; height:22px; background:var(--red); border-radius:2px; }
.see-all { font-size:13px; color:var(--red); font-weight:600; cursor:pointer; }
.see-all:hover { text-decoration:underline; }

/* FILTER CHIPS */
.filter-chips { display:flex; gap:8px; margin-bottom:16px; flex-wrap:wrap; }
.chip { padding:6px 14px; border-radius:20px; font-size:13px; font-weight:600; cursor:pointer; border:1.5px solid var(--gray-200); background:var(--white); color:var(--gray-600); transition:all .15s; white-space:nowrap; user-select:none; }
.chip:hover { border-color:var(--red); color:var(--red); }
.chip.active { background:var(--red); border-color:var(--red); color:#fff; }

/* PRODUCT GRID */
.product-grid { display:grid; grid-template-columns:repeat(5,1fr); gap:12px; margin-bottom:32px; }
.product-card { background:var(--white); border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow); cursor:pointer; transition:transform .18s,box-shadow .18s; position:relative; display:flex; flex-direction:column; }
.product-card:hover { transform:translateY(-4px); box-shadow:var(--shadow-h); }
.card-badge { position:absolute; top:8px; left:8px; z-index:2; display:flex; flex-direction:column; gap:4px; }
.badge { padding:3px 8px; border-radius:6px; font-size:11px; font-weight:700; color:#fff; line-height:1.4; }
.badge.sale { background:var(--red); }
.badge.hot  { background:var(--orange); }
.badge.new  { background:var(--green); }
.card-wishlist { position:absolute; top:8px; right:8px; z-index:2; width:28px; height:28px; background:rgba(255,255,255,0.9); border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:15px; box-shadow:0 1px 4px rgba(0,0,0,0.12); transition:background .15s; border:none; }
.card-wishlist:hover { background:#fff; }
.card-img { width:100%; aspect-ratio:1; background:var(--gray-100); display:flex; align-items:center; justify-content:center; font-size:60px; }
.card-body { padding:10px 12px 12px; flex:1; display:flex; flex-direction:column; }
.card-store { font-size:11px; color:var(--gray-400); margin-bottom:4px; display:flex; align-items:center; gap:4px; }
.store-dot { width:6px; height:6px; background:var(--orange); border-radius:50%; }
.card-title { font-size:13px; font-weight:600; color:var(--gray-800); line-height:1.4; margin-bottom:8px; flex:1; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.price-current { font-size:17px; font-weight:800; color:var(--red); line-height:1; }
.price-row { display:flex; align-items:center; gap:6px; margin-top:3px; }
.price-old { font-size:12px; color:var(--gray-400); text-decoration:line-through; }
.price-discount { font-size:11px; font-weight:700; color:var(--orange); }
.card-meta { display:flex; align-items:center; justify-content:space-between; margin:8px 0; }
.stars { color:var(--yellow); font-size:12px; }
.sold-count { font-size:11px; color:var(--gray-400); }
.btn-buy { width:100%; background:var(--red); color:#fff; border:none; border-radius:7px; padding:9px; font-size:13px; font-weight:700; transition:background .15s; display:flex; align-items:center; justify-content:center; gap:6px; }
.btn-buy:hover { background:var(--red-dark); }

/* BLOG */
.blog-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:16px; margin-bottom:32px; }
.blog-card { background:var(--white); border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow); cursor:pointer; transition:transform .18s,box-shadow .18s; }
.blog-card:hover { transform:translateY(-4px); box-shadow:var(--shadow-h); }
.blog-img { width:100%; height:160px; background:var(--gray-100); display:flex; align-items:center; justify-content:center; font-size:56px; }
.blog-body { padding:14px 16px; }
.blog-cat { font-size:11px; font-weight:700; color:var(--red); text-transform:uppercase; letter-spacing:.5px; margin-bottom:6px; }
.blog-title { font-size:14.5px; font-weight:700; color:var(--gray-800); line-height:1.45; margin-bottom:8px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.blog-excerpt { font-size:12.5px; color:var(--gray-600); line-height:1.55; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; margin-bottom:10px; }
.blog-footer { display:flex; align-items:center; justify-content:space-between; padding-top:10px; border-top:1px solid var(--gray-100); }
.blog-date { font-size:11.5px; color:var(--gray-400); }
.blog-read { font-size:12px; font-weight:700; color:var(--red); }

/* FOOTER */
footer { background:var(--gray-800); color:rgba(255,255,255,0.7); padding:40px 20px 20px; margin-top:20px; }
.footer-inner { max-width:1200px; margin:0 auto; }
.footer-disclaimer { background:rgba(255,255,255,0.06); border-radius:8px; padding:12px 16px; font-size:12px; line-height:1.6; margin-bottom:20px; border-left:3px solid var(--yellow); }
.footer-grid { display:grid; grid-template-columns:2fr 1fr 1fr 1fr; gap:32px; margin-bottom:32px; }
.footer-logo { color:#fff; font-size:20px; font-weight:800; margin-bottom:12px; }
.footer-logo span { color:var(--yellow); }
.footer-brand p { font-size:13px; line-height:1.65; }
.footer-col h4 { color:#fff; font-size:14px; font-weight:700; margin-bottom:12px; padding-bottom:8px; border-bottom:1px solid rgba(255,255,255,0.1); }
.footer-col ul { list-style:none; }
.footer-col li { font-size:13px; padding:4px 0; cursor:pointer; transition:color .15s; }
.footer-col li:hover { color:var(--yellow); }
.footer-bottom { border-top:1px solid rgba(255,255,255,0.1); padding-top:16px; display:flex; align-items:center; justify-content:space-between; font-size:12.5px; }

/* BOTTOM NAV */
.bottom-nav { display:none; position:fixed; bottom:0; left:0; right:0; background:#fff; border-top:1px solid var(--gray-200); z-index:200; padding:8px 0 4px; }
.bottom-nav-inner { display:flex; justify-content:space-around; }
.bn-item { display:flex; flex-direction:column; align-items:center; gap:2px; font-size:10px; color:var(--gray-400); font-weight:600; cursor:pointer; min-width:56px; padding:2px 4px; }
.bn-item.active { color:var(--red); }
.bn-icon { font-size:22px; }

/* MODAL */
.modal-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.5); z-index:300; align-items:center; justify-content:center; }
.modal-overlay.open { display:flex; }
.modal-box { background:#fff; border-radius:16px; padding:28px; max-width:520px; width:90%; position:relative; max-height:86vh; overflow-y:auto; }
.modal-close { position:absolute; top:14px; right:18px; font-size:22px; color:var(--gray-400); background:none; border:none; line-height:1; }
.modal-close:hover { color:var(--gray-800); }
.modal-img { width:100%; height:220px; background:var(--gray-100); border-radius:10px; display:flex; align-items:center; justify-content:center; font-size:90px; margin-bottom:16px; }
.modal-store { font-size:12px; color:var(--gray-400); margin-bottom:6px; }
.modal-title { font-size:18px; font-weight:800; margin-bottom:10px; line-height:1.3; }
.modal-price { font-size:28px; font-weight:800; color:var(--red); margin-bottom:4px; }
.modal-old-row { display:flex; gap:8px; align-items:center; margin-bottom:14px; }
.modal-old { text-decoration:line-through; color:var(--gray-400); font-size:14px; }
.modal-disc-badge { background:var(--orange); color:#fff; font-size:12px; font-weight:700; padding:2px 8px; border-radius:6px; }
.modal-desc { font-size:13px; color:var(--gray-600); line-height:1.65; margin-bottom:16px; }
.modal-note { background:#FFF8E1; border-radius:8px; padding:10px 14px; font-size:12.5px; color:#7B5800; margin-bottom:20px; }
.modal-cta { width:100%; background:var(--red); color:#fff; border:none; border-radius:10px; padding:14px; font-size:16px; font-weight:800; transition:background .15s; display:flex; align-items:center; justify-content:center; gap:8px; }
.modal-cta:hover { background:var(--red-dark); }

/* RESPONSIVE */
@media(max-width:1024px){ .product-grid,.flash-sale-grid{grid-template-columns:repeat(4,1fr);} }
@media(max-width:900px){ .product-grid,.flash-sale-grid{grid-template-columns:repeat(3,1fr);} .footer-grid{grid-template-columns:1fr 1fr;} .hero-visual{display:none;} .mini-banners{grid-template-columns:1fr 1fr;} .mini-banners .mb3{display:none;} .promo-bar{grid-template-columns:1fr 1fr;} .blog-grid{grid-template-columns:1fr 1fr;} }
@media(max-width:600px){ .product-grid,.flash-sale-grid{grid-template-columns:repeat(2,1fr);} .blog-grid{grid-template-columns:1fr;} .mini-banners{grid-template-columns:1fr;} .header-btn:not(.fav){display:none;} .hero-banner{padding:28px 22px;} .hero-title{font-size:26px;} .footer-grid{grid-template-columns:1fr;} .footer-bottom{flex-direction:column;gap:8px;text-align:center;} .bottom-nav{display:block;} body{padding-bottom:60px;} .promo-bar{grid-template-columns:1fr 1fr;gap:10px;padding:12px;} }
