/* ============================================================
   SulokShops — Main Stylesheet
   Theme: Deep Violet — unique in PH marketplace space
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:      #6D28D9;
  --primary-dk:   #5B21B6;
  --primary-lt:   #EDE9FE;
  --primary-mid:  #8B5CF6;
  --accent:       #F59E0B;
  --accent-dk:    #D97706;
  --dark:         #1E1B4B;
  --gray-700:     #4B5563;
  --gray-500:     #6B7280;
  --gray-300:     #D1D5DB;
  --gray-100:     #F3F4F6;
  --gray-50:      #F9FAFB;
  --white:        #FFFFFF;
  --green:        #059669;
  --red:          #DC2626;
  --radius:       12px;
  --radius-sm:    8px;
  --shadow:       0 2px 10px rgba(109,40,217,.08);
  --shadow-md:    0 6px 24px rgba(109,40,217,.14);
  --shadow-card:  0 2px 8px rgba(0,0,0,.07);
}

body { font-family:'Segoe UI',system-ui,-apple-system,sans-serif; font-size:15px; color:var(--dark); background:var(--gray-50); line-height:1.6; }
a { color:var(--primary); text-decoration:none; }
a:hover { color:var(--primary-dk); }
img { max-width:100%; display:block; }
.container { max-width:1200px; margin:0 auto; padding:0 20px; }

/* Buttons */
.btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; padding:10px 22px; border-radius:var(--radius); font-size:14px; font-weight:600; cursor:pointer; border:none; transition:all .15s; white-space:nowrap; }
.btn-primary { background:var(--primary); color:#fff; }
.btn-primary:hover { background:var(--primary-dk); color:#fff; }
.btn-accent { background:var(--accent); color:#fff; }
.btn-accent:hover { background:var(--accent-dk); color:#fff; }
.btn-outline { background:transparent; color:var(--primary); border:1.5px solid var(--primary); }
.btn-outline:hover { background:var(--primary); color:#fff; }
.btn-sm { padding:7px 14px; font-size:13px; }
.btn-full { width:100%; }

/* Alerts */
.alert { padding:12px 16px; border-radius:var(--radius-sm); font-size:14px; margin-bottom:16px; }
.alert-error   { background:#FEE2E2; color:var(--red); border:1px solid #FECACA; }
.alert-success { background:#D1FAE5; color:var(--green); border:1px solid #A7F3D0; }

/* Header */
.site-header { background:var(--white); border-bottom:1px solid var(--gray-300); position:sticky; top:0; z-index:100; box-shadow:var(--shadow); }
.header-inner { display:flex; align-items:center; gap:14px; height:62px; }
.brand { display:flex; align-items:center; gap:8px; text-decoration:none; flex-shrink:0; }
.brand img { height:28px; width:auto; border-radius:5px; object-fit:contain; display:block; }
.brand span { font-size:17px; font-weight:800; color:var(--primary); letter-spacing:-.4px; white-space:nowrap; }
.brand span em { font-style:normal; color:var(--accent); }
.brand:hover span { color:var(--primary-dk); }
.header-search { flex:1; max-width:400px; }
.header-search input { width:100%; padding:9px 16px; border:1.5px solid var(--gray-300); border-radius:30px; font-size:14px; background:var(--gray-100); outline:none; transition:all .15s; color:var(--dark); }
.header-search input:focus { border-color:var(--primary); background:var(--white); box-shadow:0 0 0 3px var(--primary-lt); }
.header-nav { display:flex; align-items:center; gap:4px; margin-left:auto; }
.nav-link { padding:7px 12px; border-radius:var(--radius-sm); font-size:14px; color:var(--gray-700); font-weight:500; transition:all .15s; }
.nav-link:hover { background:var(--primary-lt); color:var(--primary); }
.notif-link { position:relative; }
.notif-badge { position:absolute; top:2px; right:4px; background:var(--red); color:#fff; font-size:10px; font-weight:700; width:16px; height:16px; border-radius:50%; display:flex; align-items:center; justify-content:center; }

/* Hero */
.hero { background:linear-gradient(135deg,var(--primary) 0%,#4C1D95 100%); color:#fff; padding:56px 0; text-align:center; }
.hero h1 { font-size:clamp(26px,5vw,46px); font-weight:800; line-height:1.15; margin-bottom:12px; }
.hero .accent { color:#FCD34D; }
.hero p { font-size:16px; opacity:.85; margin-bottom:30px; }
.search-bar { display:flex; align-items:center; max-width:560px; margin:0 auto; background:var(--white); border-radius:50px; overflow:hidden; box-shadow:var(--shadow-md); }
.search-bar input { flex:1; border:none; outline:none; padding:14px 20px; font-size:15px; color:var(--dark); background:transparent; }
.search-bar select { border:none; border-left:1px solid var(--gray-300); outline:none; padding:14px 12px; font-size:13px; color:var(--gray-700); background:transparent; cursor:pointer; }
.search-bar button { background:var(--primary); color:#fff; border:none; padding:14px 26px; font-weight:700; font-size:14px; cursor:pointer; transition:background .15s; white-space:nowrap; }
.search-bar button:hover { background:var(--primary-dk); }

/* Sections */
.section { padding:48px 0; }
.section-title { font-size:20px; font-weight:700; margin-bottom:20px; color:var(--dark); display:flex; align-items:center; gap:10px; }
.section-title::after { content:''; flex:1; height:2px; background:var(--primary-lt); border-radius:2px; }

/* Category grid — always balanced columns */
.category-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; }
.cat-card { background:var(--white); border:1.5px solid var(--gray-300); border-radius:var(--radius); padding:18px 10px; text-align:center; font-size:13px; font-weight:500; color:var(--gray-700); transition:all .15s; display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:70px; cursor:pointer; }
.cat-card:hover { border-color:var(--primary); color:var(--primary); background:var(--primary-lt); transform:translateY(-2px); box-shadow:var(--shadow); }

/* Store grid — balanced columns, equal height cards */
.store-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; align-items:stretch; }
.store-card { background:var(--white); border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow-card); border:1px solid var(--gray-300); transition:all .2s; color:var(--dark); display:flex; flex-direction:column; height:100%; }
.store-card:hover { transform:translateY(-4px); box-shadow:var(--shadow-md); border-color:var(--primary-mid); }
.store-cover { height:110px; background:linear-gradient(135deg,var(--primary-lt),#DDD6FE); background-size:cover; background-position:center; position:relative; flex-shrink:0; }
.store-logo { width:48px; height:48px; border-radius:10px; border:3px solid var(--white); object-fit:cover; position:absolute; bottom:-20px; left:14px; background:var(--gray-100); box-shadow:var(--shadow-card); }
.badge-verified { position:absolute; top:8px; right:8px; background:var(--green); color:#fff; font-size:10px; font-weight:700; padding:3px 8px; border-radius:20px; }
.store-info { padding:34px 14px 14px; flex:1; display:flex; flex-direction:column; justify-content:space-between; }
.store-name { font-size:14px; font-weight:700; margin-bottom:4px; line-height:1.3; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.store-meta { font-size:11px; color:var(--gray-500); margin-bottom:6px; }
.store-rating { font-size:12px; font-weight:600; color:var(--accent-dk); }
.rating-count { color:var(--gray-500); font-weight:400; }
.empty-state { color:var(--gray-500); padding:48px 20px; text-align:center; background:var(--white); border-radius:var(--radius); border:2px dashed var(--gray-300); grid-column:1/-1; }
.empty-state a { color:var(--primary); font-weight:600; }

/* CTA */
.cta-section { background:linear-gradient(135deg,var(--dark) 0%,#312E81 100%); color:#fff; padding:64px 0; text-align:center; }
.cta-section h2 { font-size:28px; font-weight:800; margin-bottom:10px; }
.cta-section p { color:#A5B4FC; margin-bottom:28px; font-size:16px; max-width:480px; margin-left:auto; margin-right:auto; }

/* Footer */
.site-footer { background:var(--dark); color:#A5B4FC; padding:40px 0 20px; font-size:14px; }
.footer-inner { display:flex; flex-wrap:wrap; gap:24px; align-items:flex-start; justify-content:space-between; margin-bottom:24px; }
.footer-brand strong { color:#fff; font-size:16px; font-weight:800; display:block; margin-bottom:4px; }
.footer-links { display:flex; gap:20px; flex-wrap:wrap; align-items:center; }
.footer-links a { color:#A5B4FC; font-size:14px; transition:color .15s; }
.footer-links a:hover { color:#fff; }
.footer-copy { text-align:center; color:#6B7280; font-size:12px; border-top:1px solid #312E81; padding-top:20px; }

/* Auth pages */
.auth-page { min-height:100vh; display:flex; align-items:center; justify-content:center; background:linear-gradient(135deg,var(--primary-lt),var(--gray-100)); padding:20px; }
.auth-box { background:var(--white); border-radius:16px; box-shadow:var(--shadow-md); padding:40px; width:100%; max-width:420px; border:1px solid var(--gray-300); }
.auth-logo { display:block; font-size:22px; font-weight:800; color:var(--primary); margin-bottom:24px; letter-spacing:-.5px; }
.auth-box h1 { font-size:22px; font-weight:700; margin-bottom:20px; color:var(--dark); }
.role-toggle { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-bottom:20px; }
.role-toggle a { text-align:center; padding:10px; border-radius:var(--radius-sm); border:1.5px solid var(--gray-300); font-size:14px; font-weight:500; color:var(--gray-700); transition:all .15s; }
.role-toggle a.active { border-color:var(--primary); background:var(--primary-lt); color:var(--primary); font-weight:600; }
.auth-box label { display:block; font-size:13px; font-weight:600; color:var(--gray-700); margin-bottom:14px; }
.auth-box label input { display:block; width:100%; margin-top:5px; padding:10px 14px; border:1.5px solid var(--gray-300); border-radius:var(--radius-sm); font-size:14px; outline:none; transition:all .15s; color:var(--dark); }
.auth-box label input:focus { border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-lt); }
.auth-switch { text-align:center; font-size:14px; color:var(--gray-500); margin-top:20px; }

/* Store page — default theme */
.sulok-announcement { background:var(--primary); color:#fff; padding:10px 20px; text-align:center; font-size:14px; font-weight:500; }
.default-header { background:var(--white); padding:40px 20px 30px; text-align:center; box-shadow:var(--shadow-card); border-bottom:1px solid var(--gray-300); }
.default-logo { width:80px; height:80px; border-radius:16px; object-fit:cover; margin:0 auto 14px; border:3px solid var(--primary-lt); }
.default-header h1 { font-size:24px; font-weight:800; margin-bottom:8px; }
.default-desc { color:var(--gray-700); margin-bottom:12px; max-width:500px; margin-left:auto; margin-right:auto; font-size:14px; }
.default-meta { display:flex; gap:16px; justify-content:center; flex-wrap:wrap; font-size:13px; color:var(--gray-500); }
.default-main { max-width:1100px; margin:32px auto; padding:0 20px; }
.default-main h2 { font-size:18px; font-weight:700; margin-bottom:16px; }

/* Product grid — balanced columns, equal height cards */
.sulok-product-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; align-items:stretch; }
.sulok-product-card { background:var(--white); border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow-card); border:1px solid var(--gray-300); transition:all .2s; display:flex; flex-direction:column; height:100%; }
.sulok-product-card:hover { transform:translateY(-3px); box-shadow:var(--shadow-md); border-color:var(--primary-mid); }
.sulok-product-img { height:160px; background:var(--primary-lt); background-size:cover; background-position:center; position:relative; flex-shrink:0; }
.out-of-stock,.low-stock { position:absolute; bottom:8px; left:8px; font-size:10px; font-weight:700; padding:3px 8px; border-radius:20px; }
.out-of-stock { background:var(--red); color:#fff; }
.low-stock { background:var(--accent); color:#fff; }
.sulok-product-body { padding:14px; flex:1; display:flex; flex-direction:column; }
.sulok-product-name { font-size:13px; font-weight:600; margin-bottom:4px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; line-height:1.4; }
.sulok-product-desc { font-size:12px; color:var(--gray-500); margin-bottom:8px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; flex:1; }
.sulok-product-price { font-size:16px; font-weight:800; color:var(--primary); margin-bottom:10px; }
.sulok-add-cart { width:100%; padding:9px; background:var(--primary); color:#fff; border:none; border-radius:var(--radius-sm); font-weight:600; font-size:13px; cursor:pointer; transition:background .15s; margin-top:auto; }
.sulok-add-cart:hover:not(:disabled) { background:var(--primary-dk); }
.sulok-add-cart:disabled { background:var(--gray-100); color:var(--gray-500); cursor:not-allowed; border:1px solid var(--gray-300); }
.no-products { color:var(--gray-500); text-align:center; padding:40px; grid-column:1/-1; }
.default-footer { text-align:center; padding:30px; font-size:14px; color:var(--gray-500); border-top:1px solid var(--gray-300); margin-top:40px; }

/* Responsive — always balanced grid lines */
@media(max-width:1024px) {
  .store-grid,.sulok-product-grid { grid-template-columns:repeat(3,1fr); }
}
@media(max-width:768px) {
  .store-grid,.sulok-product-grid { grid-template-columns:repeat(3,1fr); gap:10px; }
  .category-grid { grid-template-columns:repeat(3,1fr); }
  .header-search { display:none; }
}
@media(max-width:560px) {
  .store-grid,.sulok-product-grid { grid-template-columns:repeat(2,1fr); gap:10px; }
  .hero { padding:40px 0 36px; }
  .search-bar { border-radius:var(--radius); flex-wrap:wrap; padding:8px; gap:6px; }
  .search-bar input,.search-bar select,.search-bar button { width:100%; border-left:none; padding:10px 14px; }
  .search-bar button { border-radius:var(--radius-sm); }
  .footer-inner { flex-direction:column; align-items:center; text-align:center; }
  .footer-links { justify-content:center; }
  .auth-box { padding:28px 18px; }
  .nav-link { padding:7px 8px; font-size:13px; }
}

/* ── Form groups (auth pages) ────────────────────────────── */
.auth-subtitle { font-size:14px; color:var(--gray-500); margin-bottom:20px; margin-top:-14px; }
.label-opt     { font-weight:400; color:var(--gray-500); }

.form-group { margin-bottom:16px; }
.form-group label { display:block; font-size:13px; font-weight:600; color:var(--gray-700); margin-bottom:6px; }
.form-group input {
  display:block; width:100%;
  padding:10px 14px;
  border:1.5px solid var(--gray-300);
  border-radius:var(--radius-sm);
  font-size:14px; outline:none;
  transition:all .15s; color:var(--dark);
  background:var(--white);
}
.form-group input:focus { border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-lt); }

/* Password input with show/hide toggle */
.input-pw { position:relative; }
.input-pw input { padding-right:44px; }
.pw-toggle {
  position:absolute; right:12px; top:50%; transform:translateY(-50%);
  background:none; border:none; cursor:pointer;
  color:var(--gray-500); display:flex; align-items:center;
  padding:4px; border-radius:4px; transition:color .15s;
}
.pw-toggle:hover { color:var(--primary); }
.eye-icon { display:block; transition:opacity .15s; }

/* Password match indicator */
.pw-match-msg { display:block; font-size:12px; margin-top:5px; font-weight:500; min-height:18px; }
.pw-match-msg.match    { color:var(--green); }
.pw-match-msg.no-match { color:var(--red); }

/* ── Auth split layout (login + register) ─────────────────── */
.auth-split-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--gray-50);
}

/* Left panel — branding */
.auth-panel-left {
  background: linear-gradient(160deg, var(--primary) 0%, #4C1D95 100%);
  color: #fff;
  padding: 48px 52px;
  display: flex;
  flex-direction: column;
  gap: 36px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}
.auth-panel-left::before {
  content: '';
  position: absolute;
  width: 360px; height: 360px;
  border-radius: 50%;
  background: rgba(255,255,255,.05);
  bottom: -80px; right: -80px;
  pointer-events: none;
}
.auth-panel-left::after {
  content: '';
  position: absolute;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,.04);
  top: 60px; right: 40px;
  pointer-events: none;
}

.panel-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.5px;
  text-decoration: none;
  position: relative;
  z-index: 1;
}
.panel-logo img { border-radius: 10px; }
.panel-logo:hover { color: #EDE9FE; }

.panel-hero { position: relative; z-index: 1; }
.panel-hero h1 {
  font-size: clamp(22px, 2.5vw, 32px);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 12px;
}
.panel-hero h1 em {
  font-style: normal;
  color: #FCD34D;
}
.panel-hero p {
  font-size: 14px;
  opacity: .85;
  line-height: 1.65;
  max-width: 360px;
}

.panel-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
  z-index: 1;
}
.panel-features li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.feat-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: rgba(255,255,255,.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.panel-features strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}
.panel-features span {
  font-size: 12px;
  opacity: .75;
  line-height: 1.5;
}

.panel-stats {
  display: flex;
  align-items: center;
  gap: 20px;
  border-top: 1px solid rgba(255,255,255,.2);
  padding-top: 24px;
  margin-top: auto;
  position: relative;
  z-index: 1;
}
.stat { text-align: center; }
.stat strong { display: block; font-size: 16px; font-weight: 800; }
.stat span   { font-size: 11px; opacity: .7; }
.stat-div    { width: 1px; height: 32px; background: rgba(255,255,255,.2); }

/* Right panel — form */
.auth-panel-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
}
.auth-form-box {
  width: 100%;
  max-width: 400px;
}
.auth-form-box h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 6px;
}
.form-sub {
  font-size: 14px;
  color: var(--gray-500);
  margin-bottom: 24px;
}

/* Responsive — stack on mobile */
@media (max-width: 768px) {
  .auth-split-page {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .auth-panel-left {
    position: static;
    height: auto;
    padding: 32px 24px;
    gap: 24px;
  }
  .auth-panel-left::before,
  .auth-panel-left::after { display: none; }
  .panel-features { display: none; }
  .panel-hero p   { display: none; }
  .panel-stats    { display: none; }
  .panel-hero h1  { font-size: 20px; margin-bottom: 0; }
  .auth-panel-right { padding: 32px 20px; }
}

/* Logo override — full logo image replaces text+icon combo */
.panel-logo img { border-radius: 0; filter: brightness(0) invert(1); }
.panel-logo span { display: none; }

/* Logo — drop shadow so it reads on dark panel regardless of bg */
.panel-logo { display: inline-block; }
.panel-logo img {
  border-radius: 12px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.3));
  display: block;
}
.panel-logo span { display: none; }

/* ── Categories — centered strip, scrollable on overflow ─── */
.cat-strip-wrap {
  background: var(--white);
  border-bottom: 1px solid var(--gray-300);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.cat-strip-wrap::-webkit-scrollbar { display: none; }
.cat-strip {
  display: flex;
  gap: 8px;
  padding: 10px 20px;
  width: fit-content;
  margin: 0 auto;
}
.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--gray-300);
  background: var(--white);
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
  white-space: nowrap;
  text-decoration: none;
  transition: all .15s;
  flex-shrink: 0;
}
.cat-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-lt);
}
/* Store logo placeholder when no logo uploaded */
.store-logo-ph {
  width: 48px; height: 48px;
  border-radius: 10px;
  border: 3px solid var(--white);
  background: var(--primary);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  bottom: -20px;
  left: 14px;
  box-shadow: var(--shadow-card);
}

/* Remove old section spacing above stores since categories are now in strip */
.cat-strip-wrap + .section { padding-top: 28px; }

/* ── Search page ──────────────────────────────────────────── */
.search-page-bar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-300);
  padding: 14px 0;
}
.search-page-form {
  display: flex;
  gap: 8px;
  align-items: center;
}
.search-page-form input {
  flex: 1;
  padding: 10px 16px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
  transition: border .15s;
}
.search-page-form input:focus { border-color: var(--primary); }
.search-page-form select {
  padding: 10px 14px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--dark);
  background: var(--white);
  outline: none;
  cursor: pointer;
}
.search-results { padding: 28px 0 48px; }
.search-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.search-results-header h1 { font-size: 18px; font-weight: 700; }
.clear-search { font-size: 13px; color: var(--gray-500); }
.clear-search:hover { color: var(--red); }

/* Active category pill */
.cat-pill-active {
  background: var(--primary);
  color: #fff !important;
  border-color: var(--primary) !important;
}

/* Store description snippet in search results */
.store-desc {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 3px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* No products message on store page */
.no-products-msg {
  padding: 32px 20px;
  text-align: center;
  background: var(--gray-50);
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  color: var(--gray-500);
  font-size: 14px;
}

@media(max-width:640px) {
  .search-page-form { flex-wrap: wrap; }
  .search-page-form input  { width: 100%; }
  .search-page-form select { width: 100%; }
  .search-page-form .btn   { width: 100%; }
}

/* Reactive main page */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.results-count {
  font-size: 13px;
  color: var(--gray-500);
}
#store-grid {
  transition: opacity .25s ease, transform .25s ease;
}

/* Category pills as buttons */
.cat-pill {
  background: none;
  border: 1.5px solid var(--gray-300);
  cursor: pointer;
  font-family: inherit;
}
.cat-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-lt);
}
.cat-pill-active {
  background: var(--primary) !important;
  color: #fff !important;
  border-color: var(--primary) !important;
}

/* Store desc in card */
.store-desc {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 3px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Improved header ──────────────────────────────────────── */
.nav-context {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  background: var(--gray-100);
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: .02em;
}
.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 4px;
}
.nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.nav-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
}
.nav-signout {
  font-size: 11px;
  color: var(--gray-500);
}
.nav-signout:hover { color: var(--red); }

@media(max-width:560px) {
  .nav-context    { display: none; }
  .nav-user-name  { display: none; }
  .nav-user-info  { flex-direction: row; align-items: center; }
}

/* Map link on store cards */
.store-map-link {
  display: inline-block;
  font-size: 11px;
  color: var(--primary);
  margin-top: 5px;
  font-weight: 500;
}
.store-map-link:hover { text-decoration: underline; }

/* Distance badge on store cards */
.store-dist {
  display: inline-block;
  background: var(--primary-lt);
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  margin-left: 6px;
  vertical-align: middle;
}

/* Location accuracy note */
.location-note {
  font-size: 13px;
  color: var(--gray-500);
  background: var(--gray-100);
  border-left: 3px solid var(--primary-mid);
  padding: 10px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 16px;
  line-height: 1.5;
}
.location-note strong { color: var(--dark); }

/* ── Map toggle button ────────────────────────────────────── */
.btn-map-toggle {
  background: var(--white);
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all .15s;
  line-height: 1;
}
.btn-map-toggle:hover,
.btn-map-active {
  border-color: var(--primary) !important;
  background: var(--primary-lt) !important;
}
#map-panel {
  border-bottom: 1px solid var(--gray-300);
  box-shadow: inset 0 -4px 12px rgba(0,0,0,.06);
}

/* ── Nearby notice bar ────────────────────────────────────── */
.nearby-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--primary-lt);
  border: 1px solid var(--primary-mid);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--primary);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.show-all-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}
.show-all-btn:hover { background: var(--primary-dk); }

/* ── Mobile: global ──────────────────────────────────────── */
@media(max-width:768px) {
  /* Header */
  .site-header { padding: 0; }
  .header-inner { padding: 0 14px; height: 52px; gap: 10px; }
  .brand span { font-size: 15px; }
  .brand img  { height: 26px; }
  .header-nav { gap: 8px; }
  .nav-link   { font-size: 13px; }
  .btn-sm     { padding: 6px 12px; font-size: 12px; }

  /* Hero */
  .hero h1      { font-size: 26px; }
  .hero p       { font-size: 14px; }
  .hero         { padding: 32px 0; }
  .search-bar   { flex-wrap: nowrap; gap: 6px; }
  .search-bar input { flex: 1; min-width: 0; }
  .search-bar button { flex: none; }

  /* Store grid */
  .store-grid { grid-template-columns: repeat(2,1fr); gap: 10px; }
  .store-cover { height: 80px; }
  .store-name  { font-size: 13px; }
  .store-meta  { font-size: 11px; }
  .store-info  { padding: 30px 10px 10px; }

  /* Sections */
  .section { padding: 20px 0; }
  .container { padding: 0 14px; }
  .results-header { flex-wrap: wrap; gap: 8px; }

  /* CTA */
  .cta-section h2 { font-size: 20px; }
}

@media(max-width:480px) {
  .store-grid { grid-template-columns: 1fr; }
  .hero h1    { font-size: 22px; }
}

/* ── Mobile: seller dashboard ────────────────────────────── */
@media(max-width:768px) {
  /* Sidebar becomes top strip */
  .dashboard-wrap { flex-direction: column; }
  .dash-sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--gray-200);
    flex-direction: row;
    overflow-x: auto;
    padding: 6px 10px;
    gap: 2px;
    position: static;
    scrollbar-width: none;
  }
  .dash-sidebar::-webkit-scrollbar { display: none; }
  .dash-user   { display: none; }
  .dash-nav    { flex-direction: row; gap: 2px; flex-wrap: nowrap; }
  .dash-link   { padding: 8px 12px; font-size: 12px; white-space: nowrap; border-radius: 8px; }
  .dash-icon   { display: none; }
  .dash-divider { display: none; }
  .dash-main   { padding: 14px; }

  /* Page headers */
  .page-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .page-header > div:last-child { width: 100%; display: flex; flex-wrap: wrap; gap: 6px; }

  /* Stats */
  .dash-stats { gap: 8px; }
  .dash-stat-card { padding: 14px 10px; }
  .stat-val   { font-size: 22px; }

  /* Quick actions */
  .quick-actions { grid-template-columns: repeat(2,1fr); gap: 10px; }
  .qa-card p  { display: none; }
  .qa-card    { padding: 16px 10px; }

  /* Store cards */
  .stores-grid { grid-template-columns: 1fr; }
  .smc-actions { flex-wrap: wrap; }
  .smc-cover   { height: 80px; }

  /* Inventory tables */
  .inv-table-wrap { overflow-x: auto; }
  .inv-table { min-width: 600px; }

  /* Inventory tabs */
  .inv-tabs   { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .inv-tabs::-webkit-scrollbar { display: none; }
  .inv-tab    { white-space: nowrap; }

  /* Store selector */
  .store-selector-bar { flex-direction: column; align-items: stretch; }

  /* Edit store */
  .edit-two-col { grid-template-columns: 1fr; }
  .edit-card    { padding: 16px; }

  /* POS */
  .pos-wrap { grid-template-columns: 1fr; }
  .pos-products { grid-template-columns: repeat(2,1fr); }
  .pos-right, .pos-orders-panel { position: static; }

  /* Builder */
  .builder-wrap { grid-template-columns: 1fr; }
  .style-grid { grid-template-columns: repeat(2,1fr); }

  /* Modals */
  .modal-box { width: 95vw; max-height: 90vh; overflow-y: auto; }
  .modal-grid { grid-template-columns: 1fr !important; }

  /* Reports */
  .reports-grid { grid-template-columns: 1fr; }
  .period-tabs  { flex-wrap: wrap; gap: 4px; }

  /* Map picker */
  #map-container { height: 260px !important; }
}

/* ── Distance selector bar ─────────────────────────────────── */
.distance-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.dist-label { font-size: 13px; color: rgba(255,255,255,.8); font-weight: 500; }
.dist-pill {
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 1.5px solid rgba(255,255,255,.3);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.dist-pill:hover  { background: rgba(255,255,255,.25); }
.dist-pill.active { background: #fff; color: var(--primary); border-color: #fff; font-weight: 700; }
.btn-view-map {
  background: #F59E0B; color: #fff;
  border: none; border-radius: 20px;
  padding: 5px 16px; font-size: 13px; font-weight: 700;
  text-decoration: none; margin-left: 4px;
  transition: background .15s;
}
.btn-view-map:hover { background: #D97706; color: #fff; }

/* Search button - text on desktop, icon on mobile */
.search-btn { padding: 14px 24px; background: var(--primary); color: #fff; border: none; border-radius: 0; font-size: 15px; font-weight: 600; cursor: pointer; transition: background .15s; flex-shrink: 0; white-space: nowrap; }
.search-btn:hover { background: var(--primary-dk); }
.search-btn-icon { display: none; }
.search-btn-text { display: inline; }

@media(max-width:520px) {
  .search-btn { padding: 0 !important; width: 44px !important; min-width: 0 !important; height: 44px; font-size: 18px; flex-shrink: 0; }
  .search-btn-text { display: none; }
  .search-btn-icon { display: inline; }
}
