/* ============================================================
   FIRST BAZZAR - Main Stylesheet
   Responsive for smartphones, tablets, iPads & desktops
   ============================================================ */
:root {
  --primary: #1e88e5;
  --primary-dark: #1565c0;
  --accent: #8e24aa;
  --danger: #e53935;
  --success: #43a047;
  --warning: #fb8c00;
  --dark: #1c2333;
  --text: #333;
  --muted: #777;
  --light: #f5f7fa;
  --border: #e3e8ef;
  --radius: 10px;
  --shadow: 0 4px 18px rgba(28, 35, 51, .08);
  --shadow-lg: 0 12px 34px rgba(28, 35, 51, .16);
  --header-h: 74px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background: #fff;
  line-height: 1.55;
  font-size: 15px;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }

.container { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
.wrapper { min-height: calc(100vh - 320px); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 20px; border: 0; border-radius: 8px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all .2s ease; text-align: center;
}
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; }
.btn-primary:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-light { background: #fff; color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 6px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* ---------- Top bar ---------- */
.topbar { background: var(--dark); color: #cfd8e3; font-size: 13px; }
.topbar .container { display: flex; justify-content: space-between; align-items: center; min-height: 36px; flex-wrap: wrap; }
.topbar a { color: #fff; }
.topbar-links { display: flex; gap: 18px; }
.topbar .sep { opacity: .35; }

/* ---------- Main header ---------- */
.main-header { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 500; }
.header-inner { display: flex; align-items: center; gap: 20px; height: var(--header-h); }
.logo { display: flex; align-items: center; }
.logo img { height: 46px; width: auto; }
.header-search { flex: 1; max-width: 460px; position: relative; }
.header-search form { display: flex; }
.header-search input {
  flex: 1; padding: 11px 14px; border: 1.5px solid var(--border);
  border-radius: 30px 0 0 30px; outline: none; background: var(--light);
}
.header-search input:focus { border-color: var(--primary); background: #fff; }
.header-search button {
  padding: 0 20px; border: 0; border-radius: 0 30px 30px 0;
  background: var(--primary); color: #fff; display: flex; align-items: center; gap: 6px; font-weight: 600;
}
.header-search button:hover { background: var(--primary-dark); }
.header-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.header-actions .icon-btn {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; background: none; border: 0; font-size: 12px; color: var(--dark); padding: 4px 8px; border-radius: 8px;
}
.header-actions .icon-btn:hover { background: var(--light); }
.header-actions .icon-btn svg { width: 23px; height: 23px; }
.count-badge {
  position: absolute; top: -2px; right: 2px; background: var(--danger); color: #fff;
  font-size: 10.5px; font-weight: 700; min-width: 17px; height: 17px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.auth-btns { display: flex; gap: 8px; }
.auth-btns .btn { padding: 8px 16px; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 30px; background: var(--light); font-size: 13.5px; font-weight: 600; position: relative; }
.user-chip .avatar { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg,var(--primary),var(--accent)); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:13px; }
.user-menu { position: absolute; top: 120%; right: 0; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); min-width: 180px; padding: 6px; display: none; z-index: 40; }
.user-chip.open .user-menu { display: block; }
.user-menu a { display: block; padding: 9px 12px; border-radius: 6px; font-size: 13.5px; color: var(--text); }
.user-menu a:hover { background: var(--light); color: var(--primary); }
.user-menu .menu-divider { height: 1px; background: var(--border); margin: 5px 0; }
.cart-btn { position: relative; display: flex; align-items: center; gap: 9px; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; padding: 9px 18px; border-radius: 30px; font-weight: 600; font-size: 14px; }
.cart-btn:hover { box-shadow: var(--shadow-lg); }
.cart-btn svg { width: 20px; height: 20px; }
.cart-btn .count-badge { top: -7px; right: -4px; border: 2px solid #fff; }

/* ---------- Mega menu ---------- */
.nav-bar { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
.nav-inner { display: flex; align-items: center; min-height: 46px; }
.nav-item { position: relative; }
.nav-item > a {
  display: flex; align-items: center; gap: 7px; padding: 12px 16px; color: #fff;
  font-size: 14px; font-weight: 600; border-right: 1px solid rgba(255,255,255,.15);
}
.nav-item > a:hover, .nav-item.open > a { background: rgba(255,255,255,.14); }
.nav-item svg { width: 16px; height: 16px; }
.caret { transition: transform .2s; }
.nav-item.open .caret { transform: rotate(180deg); }
.dropdown {
  position: absolute; top: 100%; left: 0; background: #fff; border-radius: 0 0 12px 12px;
  box-shadow: var(--shadow-lg); min-width: 260px; padding: 10px; display: none; z-index: 600;
}
.nav-item.open .dropdown { display: block; }
.dropdown .dd-title { font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); padding: 6px 10px; }
.dropdown a.dd-link { display: flex; align-items: center; justify-content: space-between; padding: 9px 10px; border-radius: 8px; font-size: 14px; font-weight: 500; }
.dropdown a.dd-link:hover { background: var(--light); color: var(--primary); }
.dropdown .has-children { position: relative; }
.dropdown .sub-drop {
  position: absolute; left: 100%; top: -10px; background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg);
  min-width: 220px; padding: 10px; display: none;
}
.dropdown .has-children:hover .sub-drop { display: block; }
.mega-drop { min-width: 720px; display: none; }
.nav-item.open .mega-drop { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 18px; }
.mega-col h4 { font-size: 13px; color: var(--primary); margin: 4px 10px 10px; text-transform: uppercase; letter-spacing: .5px; }
.mega-col a { display: block; padding: 7px 10px; border-radius: 8px; font-size: 14px; color: var(--text); }
.mega-col a:hover { background: var(--light); color: var(--primary); }
.mega-col .brand-img { display:flex; align-items:center; gap:10px; }
.nav-mobile-toggle { display: none; background: none; border: 0; color: #fff; padding: 10px 12px; }
.nav-mobile-toggle svg { width: 24px; height: 24px; }

/* ---------- Mobile drawer ---------- */
.mobile-drawer {
  position: fixed; top: 0; left: 0; width: 300px; height: 100vh; background: #fff; z-index: 900;
  transform: translateX(-105%); transition: transform .3s ease; overflow-y: auto; box-shadow: var(--shadow-lg);
}
.mobile-drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--border); }
.drawer-close { background: none; border: 0; font-size: 26px; color: var(--muted); }
.drawer-nav a { display: block; padding: 13px 18px; border-bottom: 1px solid var(--light); font-weight: 600; }
.drawer-nav .has-sub > a { display: flex; justify-content: space-between; align-items: center; }
.drawer-nav .sub { display: none; background: var(--light); }
.drawer-nav .sub a { font-weight: 400; padding-left: 32px; }
.drawer-nav .has-sub.open .sub { display: block; }
.drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 850; display: none; }
.drawer-overlay.open { display: block; }

/* ---------- Hero banner carousel ---------- */
.hero-section { background: var(--light); padding: 14px 0; }
.banner-carousel { position: relative; overflow: hidden; border-radius: 14px; box-shadow: var(--shadow); }
.banner-viewport { overflow: hidden; border-radius: 14px; }
.banner-track { display: flex; transition: transform .6s cubic-bezier(.4,0,.2,1); }
.banner-slide { min-width: calc(100% / 3); padding: 0 6px; flex: 0 0 calc(100% / 3); }
.banner-slide a { display: block; position: relative; border-radius: 12px; overflow: hidden; }
.banner-slide img { width: 100%; height: 210px; object-fit: cover; transition: transform .5s ease; }
.banner-slide a:hover img { transform: scale(1.06); }
.banner-caption { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; padding: 26px; color: #fff; background: linear-gradient(90deg, rgba(0,0,0,.55), transparent); }
.banner-caption h3 { font-size: 21px; margin-bottom: 4px; }
.banner-caption p { font-size: 13px; opacity: .92; }
.banner-ctrl {
  position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.92); color: var(--dark); border: 0; font-size: 19px; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow); z-index: 5; opacity: 0; transition: opacity .25s;
}
.banner-carousel:hover .banner-ctrl { opacity: 1; }
.banner-prev { left: 10px; }
.banner-next { right: 10px; }
.banner-dots { display: flex; justify-content: center; gap: 7px; padding: 12px 0 2px; }
.banner-dots button { width: 9px; height: 9px; border-radius: 6px; border: 0; background: #c9d3e0; transition: all .25s; padding: 0; }
.banner-dots button.active { width: 24px; background: var(--primary); }

/* ---------- Sections ---------- */
.section { padding: 40px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 22px; flex-wrap: wrap; gap: 10px; }
.section-title { font-size: 24px; font-weight: 800; position: relative; padding-left: 16px; color: var(--dark); }
.section-title::before { content: ''; position: absolute; left: 0; top: 3px; bottom: 3px; width: 5px; border-radius: 4px; background: linear-gradient(180deg, var(--primary), var(--accent)); }
.section-link { color: var(--primary); font-weight: 600; font-size: 14px; }
.section-link:hover { text-decoration: underline; }

/* ---------- Category cards ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.cat-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; text-align: center; transition: all .25s; }
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; }
.cat-card img { width: 100%; height: 120px; object-fit: cover; }
.cat-card h4 { padding: 12px 8px 6px; font-size: 14.5px; }
.cat-card span { display: block; padding: 0 8px 12px; color: var(--muted); font-size: 12.5px; }

/* ---------- Product grid ---------- */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.product-card {
  background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  display: flex; flex-direction: column; position: relative; transition: all .25s;
}
.product-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.product-thumb { position: relative; overflow: hidden; background: var(--light); aspect-ratio: 1/1; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.product-card:hover .product-thumb img { transform: scale(1.07); }
.product-badges { position: absolute; top: 10px; left: 10px; display: flex; flex-direction: column; gap: 5px; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; color: #fff; }
.badge-disc { background: var(--danger); }
.badge-new { background: var(--success); }
.badge-feat { background: var(--accent); }
.wish-btn { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: #fff; box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; color: #999; transition: all .2s; }
.wish-btn svg { width: 18px; height: 18px; }
.wish-btn:hover, .wish-btn.active { color: var(--danger); }
.wish-btn.active svg { fill: var(--danger); }
.product-info { padding: 13px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-brand { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.product-name { font-size: 14.5px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 40px; }
.product-name:hover { color: var(--primary); }
.product-price { display: flex; align-items: center; gap: 8px; }
.price-now { font-size: 17px; font-weight: 800; color: var(--dark); }
.price-old { font-size: 13px; color: #a0a0a0; text-decoration: line-through; }
.product-actions { display: flex; gap: 8px; padding: 0 14px 14px; margin-top: auto; }
.product-actions .btn { flex: 1; padding: 9px 8px; font-size: 13px; }
.quick-view { width: 40px !important; flex: 0 0 40px !important; padding: 0 !important; }
.rating-stars { color: #f5a623; font-size: 13px; display: flex; gap: 1px; }
.rating-stars .empty { color: #d8dee8; }

/* ---------- Feature strip ---------- */
.features-strip { background: var(--dark); color: #fff; }
.features-strip .container { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; padding: 22px 16px; }
.feature-item { display: flex; align-items: center; gap: 13px; }
.feature-item svg { width: 30px; height: 30px; color: #4fc3f7; flex-shrink: 0; }
.feature-item h5 { font-size: 14.5px; }
.feature-item p { font-size: 12.5px; opacity: .75; }

/* ---------- Forms ---------- */
.form-wrap { max-width: 460px; margin: 0 auto; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 30px; box-shadow: var(--shadow); }
.form-wrap.wide { max-width: 560px; }
.form-title { font-size: 22px; font-weight: 800; color: var(--dark); margin-bottom: 4px; }
.form-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 20px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; color: var(--dark); }
.form-group .req { color: var(--danger); }
.form-control {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--border); border-radius: 9px; outline: none; transition: border .2s; background: #fff;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,136,229,.12); }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.alert { padding: 12px 15px; border-radius: 9px; margin-bottom: 16px; font-size: 13.5px; }
.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.alert-danger { background: #fdecea; color: #c62828; border: 1px solid #f5c6cb; }
.alert-info { background: #e3f2fd; color: #1565c0; border: 1px solid #bbdefb; }
.alert-warning { background: #fff3e0; color: #e65100; border: 1px solid #ffe0b2; }
.otp-input { display: flex; gap: 10px; justify-content: center; margin: 18px 0; }
.otp-input input { width: 48px; height: 54px; text-align: center; font-size: 22px; font-weight: 700; border: 1.5px solid var(--border); border-radius: 10px; outline: none; }
.otp-input input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,136,229,.12); }
.resend-link { font-size: 13px; color: var(--primary); cursor: pointer; }

/* ---------- Page header / breadcrumb ---------- */
.page-head { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; padding: 34px 0; }
.page-head h1 { font-size: 26px; font-weight: 800; }
.breadcrumb { font-size: 13px; opacity: .9; margin-top: 6px; }
.breadcrumb a:hover { text-decoration: underline; }

/* ---------- Shop / sidebar ---------- */
.shop-layout { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; padding: 26px 0; }
.sidebar { position: sticky; top: 130px; }
.side-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 16px; overflow: hidden; }
.side-card h4 { padding: 13px 16px; font-size: 14.5px; border-bottom: 1px solid var(--light); background: var(--light); }
.side-card .side-body { padding: 12px 16px; }
.side-card a.side-link { display: block; padding: 7px 0; font-size: 14px; color: var(--text); }
.side-card a.side-link:hover, .side-card a.side-link.active { color: var(--primary); font-weight: 600; }
.side-card a.side-link .count { float: right; color: var(--muted); }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 10px; flex-wrap: wrap; }
.toolbar .result-count { color: var(--muted); font-size: 13.5px; }
.sort-select { padding: 9px 12px; border: 1.5px solid var(--border); border-radius: 9px; background: #fff; }

/* ---------- Product detail ---------- */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; padding: 30px 0; }
.gallery-main { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--light); aspect-ratio: 1/1; position: relative; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; padding-bottom: 4px; }
.gallery-thumbs button { width: 74px; height: 74px; border-radius: 10px; overflow: hidden; border: 2px solid var(--border); background: none; flex-shrink: 0; padding: 0; }
.gallery-thumbs button.active { border-color: var(--primary); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.detail-title { font-size: 25px; font-weight: 800; color: var(--dark); margin-bottom: 8px; }
.detail-brand { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.detail-brand b { color: var(--primary); }
.detail-price { display: flex; align-items: baseline; gap: 12px; margin: 14px 0; }
.detail-price .now { font-size: 28px; font-weight: 800; color: var(--dark); }
.detail-price .old { font-size: 16px; color: #a0a0a0; text-decoration: line-through; }
.detail-price .save { background: #e8f5e9; color: var(--success); font-weight: 700; font-size: 12.5px; padding: 3px 10px; border-radius: 20px; }
.detail-meta { display: flex; gap: 18px; margin: 12px 0; font-size: 13.5px; color: var(--muted); flex-wrap: wrap; }
.detail-meta .val { color: var(--dark); font-weight: 600; }
.stock-avail { color: var(--success); font-weight: 700; }
.stock-out { color: var(--danger); font-weight: 700; }
.qty-box { display: inline-flex; align-items: center; border: 1.5px solid var(--border); border-radius: 10px; overflow: hidden; }
.qty-box button { width: 40px; height: 42px; border: 0; background: var(--light); font-size: 18px; }
.qty-box input { width: 52px; text-align: center; border: 0; height: 42px; font-weight: 700; outline: none; }
.detail-actions { display: flex; gap: 12px; margin: 20px 0; flex-wrap: wrap; }
.detail-actions .btn { padding: 13px 26px; font-size: 15px; }
.media-block { margin-top: 18px; }
.media-block h4 { font-size: 14px; margin-bottom: 8px; color: var(--dark); }
.media-block iframe, .media-block video { width: 100%; border-radius: 12px; border: 0; max-height: 340px; background: #000; }
.media-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.custom-link { display: flex; align-items: center; gap: 8px; color: var(--primary); font-weight: 600; padding: 10px 14px; border: 1px dashed var(--primary); border-radius: 10px; }
.custom-link:hover { background: #e3f2fd; }
.tabs { margin-top: 40px; }
.tab-btns { display: flex; gap: 4px; border-bottom: 2px solid var(--border); }
.tab-btns button { background: none; border: 0; padding: 12px 22px; font-size: 15px; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tab-btns button.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; padding: 24px 2px; }
.tab-panel.active { display: block; }
.review-card { border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.review-card .rev-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.review-card .rev-user { font-weight: 700; font-size: 14px; }
.review-card .rev-date { color: var(--muted); font-size: 12px; }
.related-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }

/* ---------- Cart ---------- */
.cart-layout { display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: start; padding: 26px 0; }
.cart-table { background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.cart-row { display: grid; grid-template-columns: 2.2fr 1fr 1fr 1fr 40px; align-items: center; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--light); }
.cart-row.header { background: var(--light); font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.cart-row:last-child { border-bottom: 0; }
.cart-prod { display: flex; gap: 14px; align-items: center; }
.cart-prod img { width: 74px; height: 74px; border-radius: 10px; object-fit: cover; border: 1px solid var(--border); }
.cart-prod .name { font-weight: 600; font-size: 14px; }
.cart-prod .meta { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.cart-remove { background: none; border: 0; color: #bbb; width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.cart-remove:hover { background: #fdecea; color: var(--danger); }
.cart-summary { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 22px; position: sticky; top: 130px; }
.cart-summary h3 { font-size: 18px; margin-bottom: 16px; }
.sum-row { display: flex; justify-content: space-between; padding: 9px 0; font-size: 14px; color: var(--text); }
.sum-row.total { border-top: 1.5px dashed var(--border); margin-top: 8px; padding-top: 14px; font-weight: 800; font-size: 17px; }
.free-ship-progress { background: var(--light); border-radius: 20px; height: 8px; overflow: hidden; margin: 12px 0; }
.free-ship-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--success), #7cb342); border-radius: 20px; }

/* ---------- Checkout ---------- */
.checkout-layout { display: grid; grid-template-columns: 1fr 400px; gap: 24px; align-items: start; padding: 26px 0; }
.checkout-form { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 24px; }
.checkout-form h3 { font-size: 17px; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--light); }
.pay-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pay-option { border: 1.5px solid var(--border); border-radius: 10px; padding: 14px; cursor: pointer; transition: all .2s; display: flex; gap: 10px; align-items: center; }
.pay-option:hover, .pay-option.selected { border-color: var(--primary); background: #f4f9ff; }

/* ---------- Account / dashboard ---------- */
.account-layout { display: grid; grid-template-columns: 250px 1fr; gap: 24px; align-items: start; padding: 26px 0; }
.account-menu { background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; position: sticky; top: 130px; }
.account-menu .menu-user { padding: 20px; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; text-align: center; }
.account-menu .menu-user .avatar-lg { width: 58px; height: 58px; border-radius: 50%; background: rgba(255,255,255,.25); margin: 0 auto 10px; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800; }
.account-menu a { display: block; padding: 13px 18px; border-bottom: 1px solid var(--light); font-size: 14px; font-weight: 500; }
.account-menu a:hover, .account-menu a.active { background: var(--light); color: var(--primary); border-left: 3px solid var(--primary); }
.account-panel { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 24px; }
.account-panel h3 { font-size: 18px; margin-bottom: 18px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 22px; }
.stat-card { border: 1px solid var(--border); border-radius: 12px; padding: 18px; text-align: center; }
.stat-card .num { font-size: 26px; font-weight: 800; color: var(--primary); }
.stat-card .lbl { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ---------- Tables ---------- */
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { background: var(--light); padding: 12px 14px; text-align: left; font-size: 12.5px; text-transform: uppercase; color: var(--muted); }
.data-table td { padding: 13px 14px; border-bottom: 1px solid var(--light); vertical-align: middle; }
.data-table tr:hover td { background: #fafbfd; }
.data-table .thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 9px; border: 1px solid var(--border); }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--border); border-radius: 12px; }

/* ---------- Status pills ---------- */
.pill { display: inline-block; padding: 3px 11px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.pill-success { background: #e8f5e9; color: #2e7d32; }
.pill-warning { background: #fff3e0; color: #e65100; }
.pill-danger { background: #fdecea; color: #c62828; }
.pill-info { background: #e3f2fd; color: #1565c0; }
.pill-default { background: #eceff1; color: #546e7a; }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state svg { width: 70px; height: 70px; color: #c3cdd9; margin-bottom: 14px; }
.empty-state h3 { color: var(--dark); margin-bottom: 6px; }

/* ---------- Newsletter / CTA ---------- */
.newsletter { background: linear-gradient(135deg, var(--primary), var(--accent)); padding: 44px 0; color: #fff; text-align: center; }
.newsletter h2 { font-size: 24px; margin-bottom: 6px; }
.newsletter p { opacity: .9; margin-bottom: 20px; }
.newsletter-form { display: flex; max-width: 460px; margin: 0 auto; }
.newsletter-form input { flex: 1; padding: 13px 16px; border: 0; border-radius: 30px 0 0 30px; outline: none; }
.newsletter-form button { padding: 0 26px; border: 0; border-radius: 0 30px 30px 0; background: var(--dark); color: #fff; font-weight: 700; }

/* ---------- Footer ---------- */
.site-footer { background: var(--dark); color: #b7c2d0; padding-top: 46px; font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 30px; padding-bottom: 34px; }
.footer-grid h4 { color: #fff; font-size: 15px; margin-bottom: 16px; }
.footer-grid a { display: block; padding: 5px 0; }
.footer-grid a:hover { color: #fff; }
.footer-brand .logo img { height: 40px; margin-bottom: 12px; }
.footer-brand p { font-size: 13px; line-height: 1.7; }
.footer-contact li { display: flex; gap: 10px; padding: 6px 0; }
.footer-contact svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 3px; color: var(--primary); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 16px 0; text-align: center; font-size: 12.5px; }
.footer-bottom a { color: #4fc3f7; }

/* ---------- Toast ---------- */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast { background: #fff; border-radius: 10px; box-shadow: var(--shadow-lg); padding: 14px 18px; min-width: 260px; font-size: 14px; display: flex; align-items: center; gap: 10px; animation: slideIn .3s ease; border-left: 4px solid var(--primary); }
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--primary); }
@keyframes slideIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ---------- Login helpers ---------- */
.login-methods { display: flex; gap: 10px; margin-bottom: 18px; }
.login-methods button { flex: 1; padding: 12px; border-radius: 9px; border: 1.5px solid var(--border); background: #fff; font-weight: 600; }
.login-methods button.active { border-color: var(--primary); background: #f4f9ff; color: var(--primary); }
.field-hidden { display: none; }
.social-row { text-align: center; margin-top: 14px; font-size: 13px; color: var(--muted); }
.social-row a { color: var(--primary); font-weight: 600; }

/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 1000; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal { background: #fff; border-radius: 14px; max-width: 640px; width: 100%; max-height: 90vh; overflow-y: auto; padding: 26px; position: relative; }
.modal-close { position: absolute; top: 12px; right: 12px; background: none; border: 0; font-size: 24px; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .product-grid, .related-grid { grid-template-columns: repeat(3, 1fr); }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .mega-drop { min-width: 620px !important; grid-template-columns: repeat(3, 1fr) !important; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .cart-layout, .checkout-layout { grid-template-columns: 1fr; }
  .cart-summary, .checkout-summary { position: static; }
}
@media (max-width: 820px) {
  .header-inner { flex-wrap: wrap; height: auto; padding: 12px 0; gap: 12px; }
  .header-search { order: 3; max-width: 100%; flex-basis: 100%; }
  .shop-layout, .account-layout { grid-template-columns: 1fr; }
  .sidebar, .account-menu { position: static; }
  .nav-item > a { padding: 11px 12px; }
  .nav-bar { display: none; }
  .nav-mobile-toggle { display: inline-flex; }
}
@media (max-width: 767px) {
  .topbar .topbar-links { display: none; }
  .auth-btns .btn { padding: 7px 12px; font-size: 13px; }
  .product-grid, .related-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .product-detail { grid-template-columns: 1fr; gap: 22px; padding: 20px 0; }
  .section { padding: 28px 0; }
  .section-title { font-size: 20px; }
  .banner-slide { min-width: 100%; flex-basis: 100%; }
  .banner-slide img { height: 190px; }
  .banner-caption h3 { font-size: 17px; }
  .features-strip .container { grid-template-columns: repeat(2, 1fr); }
  .features-strip .container { gap: 14px; padding: 18px 16px; }
  .cart-row { grid-template-columns: 1.6fr 0.8fr 0.8fr 34px; grid-auto-rows: auto; }
  .cart-row.header { display: none; }
  .cart-row .cell-hide { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .checkout-form { padding: 18px; }
  .tab-btns button { padding: 10px 14px; font-size: 14px; }
  .stat-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .media-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .product-grid, .related-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .product-actions .btn { font-size: 12px; padding: 9px 6px; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .header-actions { gap: 6px; }
  .header-actions .icon-btn span { display: none; }
  .cart-btn { padding: 9px 12px; }
  .cart-btn .cart-txt { display: none; }
  .logo img { height: 38px; }
  .banner-caption { padding: 16px; }
  .banner-caption h3 { font-size: 15px; }
  .banner-caption p { font-size: 11px; }
  .footer-grid { grid-template-columns: 1fr; gap: 22px; }
  .nav-item > a { font-size: 13px; padding: 10px; }
  .banner-ctrl { width: 32px; height: 32px; }
  .detail-actions .btn { padding: 12px 16px; font-size: 13.5px; flex: 1; }
}
