/* ============================================================================
   GRAND MARKET — Multipurpose marketplace theme
   Inspired by Porto / Big Market. Light, dense, conversion-focused.
   All colors come from CSS vars (overridable per-tenant via theme_colors).
   ============================================================================ */

:root {
  --gm-primary:   #1d2b3a;   /* dark navy — top bars, footer, headings */
  --gm-primary-2: #25374b;
  --gm-accent:    #1d2b3a;   /* default mirrors primary (single-colour); header.php overrides inline per store */
  --gm-accent-d:  #16202c;
  --gm-link:      #2563eb;
  --gm-bg:        #f4f5f7;
  --gm-card:      #ffffff;
  --gm-ink:       #1f2937;
  --gm-muted:     #6b7280;
  --gm-line:      #e6e8ec;
  --gm-success:   #16a34a;
  --gm-star:      #ffb400;
  --gm-radius:    10px;
  --gm-shadow:    0 1px 3px rgba(16,24,40,.06), 0 1px 2px rgba(16,24,40,.04);
  --gm-shadow-lg: 0 12px 32px rgba(16,24,40,.14);
  --gm-maxw:      1280px;
  --gm-font:      'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.gm-active {
  margin: 0; padding: 0;
  font-family: var(--gm-font);
  background: var(--gm-bg);
  color: var(--gm-ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body.gm-active a { color: inherit; text-decoration: none; }
body.gm-active img { max-width: 100%; display: block; }
.gm-wrap { max-width: var(--gm-maxw); margin: 0 auto; padding: 0 16px; }

/* ── Top utility bar ─────────────────────────────────────────────────── */
.gm-topbar {
  background: var(--gm-primary);
  color: #cdd6e0;
  font-size: 12.5px;
}
.gm-topbar .gm-wrap { display: flex; align-items: center; justify-content: space-between; height: 38px; }
.gm-topbar a { color: #cdd6e0; transition: color .15s; }
.gm-topbar a:hover { color: #fff; }
.gm-topbar-left, .gm-topbar-right { display: flex; align-items: center; gap: 18px; }
.gm-topbar i { margin-right: 5px; opacity: .8; }
@media (max-width: 760px){ .gm-topbar-left span:not(:first-child){ display:none; } }

/* ── Main header ─────────────────────────────────────────────────────── */
.gm-header { background: var(--gm-card); border-bottom: 1px solid var(--gm-line); position: sticky; top: 0; z-index: 1000; }
.gm-header-main { display: flex; align-items: center; gap: 28px; height: 84px; }
.gm-logo { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.gm-logo img { height: 48px; width: auto; object-fit: contain; }
.gm-logo-fallback {
  width: 46px; height: 46px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--gm-accent), var(--gm-accent-d));
  color: #fff; font-weight: 800; font-size: 1.3rem;
  display: flex; align-items: center; justify-content: center;
}
.gm-logo-name { font-size: 1.3rem; font-weight: 800; color: var(--gm-primary); line-height: 1.05; letter-spacing: -.3px; }
.gm-logo-tag  { font-size: .72rem; color: var(--gm-muted); font-weight: 500; }

/* search */
.gm-search-wrap { position: relative; flex: 1; max-width: 820px; }
.gm-search { display: flex; align-items: stretch; height: 50px;
  border: 2px solid var(--gm-accent); border-radius: 10px; overflow: hidden; background: #fff; }
.gm-search select {
  border: none; border-right: 1px solid var(--gm-line); background: #f7f8fa;
  padding: 0 16px; font-size: .88rem; color: #444; outline: none; cursor: pointer; max-width: 180px;
}
.gm-search input { flex: 1; border: none; outline: none; padding: 0 20px; font-size: 1rem; min-width: 0; }
.gm-search button {
  border: none; background: var(--gm-accent); color: #fff; padding: 0 30px;
  font-size: 1.15rem; cursor: pointer; display: flex; align-items: center; gap: 6px; transition: background .15s;
}
.gm-search button:hover { background: var(--gm-accent-d); }

/* live search dropdown (light theme — .search-result-item structure/classes
   are shared with js/main.js, which drives this via #liveSearchInput /
   #searchResults; only colours differ per theme) */
.search-results-dropdown {
  position: absolute; top: 100%; left: 0; right: 0; margin-top: 8px;
  background: #fff; border: 1px solid var(--gm-line); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,.14);
  max-height: 420px; overflow-y: auto; z-index: 1500; display: none; text-align: left;
}
.search-result-item { display: flex; align-items: center; padding: 10px 14px; gap: 10px;
  border-bottom: 1px solid var(--gm-line); text-decoration: none; color: #222; transition: background .15s; min-width: 0; }
.search-result-item:hover { background: #f7f8fa; }
.search-result-heading { padding: 8px 14px 4px; font-size: .7rem; font-weight: 800; color: var(--gm-accent); letter-spacing: .08em; text-transform: uppercase; }
.search-result-divider { height: 1px; background: var(--gm-line); margin: 4px 0; }
.search-result-icon { width: 36px; height: 36px; border-radius: 8px; background: rgba(0,0,0,.04); border: 1px solid var(--gm-line); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.search-result-icon i { color: var(--gm-accent); font-size: .85rem; }
.search-result-info { min-width: 0; flex: 1; overflow: hidden; }
.search-result-title { font-size: .87rem; font-weight: 700; color: #222; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-parent { color: #888; font-weight: 500; }
.search-result-sub { font-size: .72rem; color: #888; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-price { font-size: .82rem; font-weight: 800; color: var(--gm-primary); margin-top: 2px; }
.search-result-oldprice { text-decoration: line-through; color: #888; margin-left: 4px; }
.search-result-thumb { width: 42px; height: 52px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.search-result-viewall { display: block; padding: 10px 14px; text-align: center; font-size: .8rem; font-weight: 700; color: var(--gm-accent); border-top: 1px solid var(--gm-line); text-decoration: none; }
.search-result-viewall i { font-size: .7rem; }
.search-result-empty { padding: 18px; text-align: center; color: #888; font-size: .85rem; }
.search-result-empty i { margin-right: 6px; color: #aaa; }

/* header actions */
.gm-actions { display: flex; align-items: center; gap: 22px; flex-shrink: 0; }
.gm-action { display: flex; align-items: center; gap: 9px; color: var(--gm-ink); position: relative; }
.gm-action i { font-size: 1.45rem; color: var(--gm-primary); }
.gm-action .gm-act-sub { font-size: .68rem; color: var(--gm-muted); line-height: 1.1; }
.gm-action .gm-act-main { font-size: .84rem; font-weight: 700; line-height: 1.1; }
.gm-action:hover i { color: var(--gm-accent); }
.gm-badge {
  position: absolute; top: -7px; left: 15px; background: var(--gm-accent); color: #fff;
  font-size: .65rem; font-weight: 800; min-width: 18px; height: 18px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

/* ── Nav bar with departments ────────────────────────────────────────── */
.gm-nav { background: var(--gm-card); border-bottom: 1px solid var(--gm-line); position: sticky; top: 84px; z-index: 990; }
@media (max-width: 980px){ .gm-nav { top: 0; } .gm-header-main{ height:64px; } .gm-nav{ position:static; } .gm-header{ position:static; } }
.gm-nav-inner { display: flex; align-items: stretch; gap: 4px; height: 50px; position: relative; }

/* departments dropdown */
.gm-dept { position: relative; width: 264px; flex-shrink: 0; }
.gm-dept-btn {
  background: var(--gm-accent); color: #fff; height: 50px; display: flex; align-items: center; gap: 10px;
  padding: 0 18px; font-weight: 700; font-size: .9rem; cursor: pointer; border-radius: 8px 8px 0 0; width: 100%;
}
.gm-dept-btn i.fa-bars { font-size: 1rem; }
.gm-dept-menu {
  position: absolute; top: 50px; left: 0; width: 264px; background: #fff; border: 1px solid var(--gm-line);
  border-top: none; box-shadow: var(--gm-shadow-lg); border-radius: 0 0 8px 8px; overflow: hidden;
  max-height: 0; opacity: 0; visibility: hidden; transition: opacity .18s; z-index: 50;
}
.gm-dept:hover .gm-dept-menu, .gm-dept-menu:hover { max-height: 640px; opacity: 1; visibility: visible; }
.gm-dept-menu a {
  display: flex; align-items: center; gap: 11px; padding: 11px 18px; font-size: .86rem; color: var(--gm-ink);
  border-bottom: 1px solid #f3f4f6; transition: background .12s, color .12s;
}
.gm-dept-menu a:last-child { border-bottom: none; }
.gm-dept-menu a:hover { background: #fff7f0; color: var(--gm-accent); padding-left: 22px; }
.gm-dept-menu a i { width: 18px; color: var(--gm-muted); }
.gm-dept-menu a:hover i { color: var(--gm-accent); }

/* main menu links */
.gm-menu { display: flex; align-items: stretch; gap: 2px; flex: 1; }
.gm-menu > a, .gm-menu > .gm-has-mega > a {
  display: flex; align-items: center; gap: 6px; padding: 0 16px; height: 50px; font-weight: 600;
  font-size: .9rem; color: var(--gm-ink); transition: color .15s; position: relative;
}
.gm-menu > a:hover, .gm-has-mega:hover > a { color: var(--gm-accent); }
.gm-menu a.gm-hot { color: var(--gm-accent); }
.gm-menu-deal { color: #e11d48 !important; }
.gm-nav-phone { margin-left: auto; display: flex; align-items: center; gap: 9px; color: var(--gm-primary); font-weight: 700; }
.gm-nav-phone i { color: var(--gm-accent); font-size: 1.3rem; }
.gm-nav-phone small { display:block; font-weight:500; font-size:.66rem; color:var(--gm-muted); }

/* mega menu */
.gm-has-mega { position: static; }
.gm-mega {
  position: absolute; left: 0; right: 0; top: 50px; background: #fff; border: 1px solid var(--gm-line);
  box-shadow: var(--gm-shadow-lg); border-radius: 0 0 12px 12px; padding: 26px 30px; display: none;
  grid-template-columns: repeat(4, 1fr); gap: 26px; z-index: 60;
}
.gm-has-mega:hover .gm-mega { display: grid; }
.gm-mega-col h5 { margin: 0 0 12px; font-size: .82rem; font-weight: 800; color: var(--gm-primary); text-transform: uppercase; letter-spacing: .4px; }
.gm-mega-col a { display: block; padding: 6px 0; font-size: .86rem; color: var(--gm-muted); }
.gm-mega-col a:hover { color: var(--gm-accent); }

/* mobile menu toggle */
.gm-burger { display: none; }
@media (max-width: 980px){
  .gm-search-wrap { order: 3; flex-basis: 100%; max-width: 100%; margin-top: 10px; }
  .gm-header-main { flex-wrap: wrap; height: auto; padding: 12px 0; gap: 14px; }
  .gm-dept, .gm-nav-phone, .gm-menu > .gm-has-mega .gm-mega { display: none; }
  .gm-nav-inner { gap: 0; overflow-x: auto; height: 46px; }
  .gm-menu { gap: 0; }
  .gm-menu > a { padding: 0 13px; height: 46px; white-space: nowrap; font-size: .85rem; }
  .gm-actions { gap: 16px; }
  .gm-action .gm-act-sub, .gm-action .gm-act-main { display: none; }
}

/* announcement */
.gm-announce { background: linear-gradient(90deg, var(--gm-accent), var(--gm-accent-d)); color: #fff;
  text-align: center; font-size: .82rem; font-weight: 600; padding: 8px 12px; }
.gm-announce a { color: #fff; text-decoration: underline; }

/* ── Section scaffolding ─────────────────────────────────────────────── */
.gm-section { margin: 36px 0; }
.gm-section-hd { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; }
.gm-section-title { font-size: 1.5rem; font-weight: 800; color: var(--gm-primary); letter-spacing: -.4px; position: relative; }
.gm-section-title::after { content:''; display:block; width:48px; height:3px; background:var(--gm-accent); border-radius:3px; margin-top:8px; }
.gm-section-sub { font-size: .85rem; color: var(--gm-muted); margin-top: 4px; }
.gm-viewall { font-size: .85rem; font-weight: 700; color: var(--gm-accent); white-space: nowrap; }
.gm-viewall:hover { color: var(--gm-accent-d); }

/* ── Hero row ────────────────────────────────────────────────────────── */
.gm-hero-row { display: grid; grid-template-columns: 264px 1fr 300px; gap: 18px; margin-top: 22px; }
/* ── Signature blocks: circular category avatars (Guccy/Wearix) ── */
.gm-avatars-wrap { margin-top: 22px; background: #fff; border: 1px solid var(--gm-line); border-radius: var(--gm-radius); padding: 16px 10px; overflow: hidden; }
.gm-avatars { display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; padding: 2px 6px; }
.gm-avatars::-webkit-scrollbar { display: none; }
.gm-avatar { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 8px; width: 78px; text-align: center; }
.gm-avatar-img { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; border: 2px solid var(--gm-line);
                 display: flex; align-items: center; justify-content: center; background: #f7f7f9; transition: .2s; }
.gm-avatar:hover .gm-avatar-img { border-color: var(--gm-accent); transform: translateY(-2px); }
.gm-avatar-img img { width: 100%; height: 100%; object-fit: cover; }
.gm-avatar-fallback { background: linear-gradient(135deg,var(--gm-primary),var(--gm-accent)); color: #fff; font-size: 1.3rem; }
.gm-avatar-nm { font-size: .76rem; font-weight: 600; color: var(--gm-ink); line-height: 1.2;
                white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 78px; }

/* ── Signature block: "I'm looking for…" icon tiles (Wearix) ── */
.gm-iconrow { display: grid; grid-template-columns: repeat(8, 1fr); gap: 14px; }
@media (max-width: 900px){ .gm-iconrow { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 520px){ .gm-iconrow { grid-template-columns: repeat(3, 1fr); } }
.gm-icontile { display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 16px 8px;
               background: #fff; border: 1px solid var(--gm-line); border-radius: var(--gm-radius);
               font-size: .8rem; font-weight: 600; color: var(--gm-ink); text-align: center; transition: .2s; }
.gm-icontile:hover { border-color: var(--gm-accent); box-shadow: 0 6px 18px rgba(0,0,0,.06); transform: translateY(-2px); }
.gm-icontile-ic { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
                  background: var(--gm-soft, #f3f4f6); color: var(--gm-accent); font-size: 1.15rem; }

/* ── Signature block: tabbed product collection (premium fashion themes) ── */
.gm-tabs-nav { display: flex; gap: 6px; justify-content: center; margin-bottom: 22px; flex-wrap: wrap; }
.gm-tab-btn { border: 1px solid var(--gm-line); background: #fff; color: var(--gm-muted);
              font-size: .9rem; font-weight: 700; padding: 9px 22px; border-radius: 999px; cursor: pointer; transition: .2s; }
.gm-tab-btn:hover { color: var(--gm-ink); border-color: var(--gm-ink); }
.gm-tab-btn.active { background: var(--gm-primary); color: #fff; border-color: var(--gm-primary); }
.gm-tab-panel { display: none; }
.gm-tab-panel.active { display: block; animation: gmFade .25s ease; }
@keyframes gmFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Layout variants — full-width / static heroes drop the rail & side cards */
.gm-hero-row.gm-hero-norail { grid-template-columns: 1fr; }
.gm-hero-full .gm-slider, .gm-hero-static .gm-slider { min-height: 440px; }
.gm-hero-static .gm-slide:not(.active) { display: none; }
@media (max-width: 1100px){ .gm-hero-row { grid-template-columns: 1fr; } .gm-hero-cats, .gm-hero-side { display: none; } }

.gm-hero-cats { background: #fff; border: 1px solid var(--gm-line); border-radius: var(--gm-radius); overflow: hidden; }
.gm-hero-cats a { display: flex; align-items: center; gap: 11px; padding: 11px 16px; font-size: .86rem;
  border-bottom: 1px solid #f3f4f6; color: var(--gm-ink); transition: background .12s, padding .12s; }
.gm-hero-cats a:last-child { border-bottom: none; }
.gm-hero-cats a:hover { background: #fff7f0; color: var(--gm-accent); padding-left: 20px; }
.gm-hero-cats a i { width: 18px; color: var(--gm-muted); }
.gm-hero-cats a:hover i { color: var(--gm-accent); }

.gm-slider { position: relative; border-radius: var(--gm-radius); overflow: hidden; background: var(--gm-primary); min-height: 420px; }
/* Slides stay absolutely positioned at ALL times (active or not) — the
   slider's own min-height defines the box, so nothing needs to join normal
   document flow. Toggling position on .active used to cause a visible
   double-exposure glitch during the .6s crossfade (position isn't
   animatable, so it snapped while opacity was still mid-transition). */
.gm-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .6s ease; display: flex; align-items: center; z-index: 1; }
.gm-slide.active { opacity: 1; z-index: 2; }
.gm-slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gm-slide-overlay { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(13,18,28,.72) 0%, rgba(13,18,28,.25) 55%, transparent 100%); }
/* Left padding scales up on wide screens so the text still lines up with the
   rest of the page's centered content column, even though the slider itself
   (.gm-slider-wide) now stretches full-bleed edge-to-edge behind it. */
.gm-slide-body { position: relative; z-index: 2; padding: 0 56px; padding-left: max(56px, calc((100vw - var(--gm-maxw)) / 2 + 40px)); max-width: 560px; color: #fff; }
.gm-slide-label { display: inline-block; background: var(--gm-accent); color: #fff; font-size: .72rem; font-weight: 800;
  letter-spacing: 1px; text-transform: uppercase; padding: 6px 14px; border-radius: 999px; margin-bottom: 16px; }
.gm-slide-title { font-size: 2.6rem; font-weight: 800; line-height: 1.08; margin: 0 0 12px; letter-spacing: -1px; }
.gm-slide-sub { font-size: 1rem; opacity: .92; margin: 0 0 22px; max-width: 440px; }
@media (max-width: 600px){ .gm-slide-title { font-size: 1.7rem; } .gm-slide-body { padding: 0 24px; } .gm-slider{ min-height:320px; } }

/* Full-bleed hero — breaks out of .gm-wrap's max-width/padding so the
   carousel spans edge-to-edge instead of sitting inside the content column.
   Uses the "negative margin" breakout so it works regardless of .gm-wrap's
   own width/padding, and doesn't need position:relative on the wrap. */
.gm-slider-wide {
  width: auto;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  border-radius: 0;
}
.gm-slide-arrows { position: absolute; bottom: 16px; right: 18px; z-index: 5; display: flex; gap: 8px; }
.gm-slide-arrows button { width: 38px; height: 38px; border-radius: 50%; border: none; background: rgba(255,255,255,.85);
  color: var(--gm-primary); cursor: pointer; font-size: 1rem; transition: background .15s; }
.gm-slide-arrows button:hover { background: #fff; }
.gm-slide-dots { position: absolute; bottom: 18px; left: 56px; z-index: 5; display: flex; gap: 8px; }
.gm-slide-dots span { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.5); cursor: pointer; transition: all .2s; }
.gm-slide-dots span.active { background: var(--gm-accent); width: 26px; border-radius: 5px; }

.gm-hero-side { display: flex; flex-direction: column; gap: 18px; }
.gm-side-card { position: relative; flex: 1; border-radius: var(--gm-radius); overflow: hidden; min-height: 180px;
  display: flex; align-items: flex-end; background: #e8ebf0; }
.gm-side-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.gm-side-card:hover img { transform: scale(1.06); }
.gm-side-card-body { position: relative; z-index: 2; padding: 18px; background: linear-gradient(0deg, rgba(0,0,0,.55), transparent); width: 100%; color: #fff; }
.gm-side-card-body h4 { margin: 0 0 4px; font-size: 1.05rem; font-weight: 800; }
.gm-side-card-body span { font-size: .78rem; font-weight: 600; color: var(--gm-accent); background:#fff; padding:3px 9px; border-radius:5px; }

/* ── Service / trust strip ───────────────────────────────────────────── */
.gm-services { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; background: #fff;
  border: 1px solid var(--gm-line); border-radius: var(--gm-radius); margin-top: 24px; overflow: hidden; }
.gm-service { display: flex; align-items: center; gap: 14px; padding: 20px 22px; border-right: 1px solid var(--gm-line); }
.gm-service:last-child { border-right: none; }
.gm-service i { font-size: 1.7rem; color: var(--gm-accent); }
.gm-service-t { font-weight: 800; font-size: .9rem; color: var(--gm-primary); }
.gm-service-s { font-size: .76rem; color: var(--gm-muted); }
@media (max-width: 860px){ .gm-services { grid-template-columns: repeat(2, 1fr); } .gm-service:nth-child(2){border-right:none;} }
@media (max-width: 480px){ .gm-services { grid-template-columns: 1fr; } .gm-service{border-right:none;border-bottom:1px solid var(--gm-line);} }

/* ── Category cards ──────────────────────────────────────────────────── */
.gm-cat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
@media (max-width: 900px){ .gm-cat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 520px){ .gm-cat-grid { grid-template-columns: repeat(2, 1fr); } }
.gm-cat-card { background: #fff; border: 1px solid var(--gm-line); border-radius: var(--gm-radius); padding: 18px 10px;
  text-align: center; transition: transform .18s, box-shadow .18s, border-color .18s; }
.gm-cat-card:hover { transform: translateY(-4px); box-shadow: var(--gm-shadow-lg); border-color: var(--gm-accent); }
.gm-cat-thumb { width: 92px; height: 92px; margin: 0 auto 12px; border-radius: 50%; overflow: hidden; background: #f3f4f6; }
.gm-cat-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gm-cat-card .nm { font-weight: 700; font-size: .86rem; color: var(--gm-ink); }
.gm-cat-card .ct { font-size: .72rem; color: var(--gm-muted); margin-top: 3px; }

/* ── Product grid + cards ────────────────────────────────────────────── */
/* Cards size to a comfortable minimum width and wrap responsively, so they stay
   wide enough to read whether the page has a sidebar (shop) or not (home). */
.gm-prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
@media (max-width: 600px){ .gm-prod-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } }
@media (max-width: 380px){ .gm-prod-grid { grid-template-columns: 1fr; } }

.gm-card { background: #fff; border: 1px solid var(--gm-line); border-radius: var(--gm-radius); overflow: hidden;
  position: relative; transition: box-shadow .18s, transform .18s, border-color .18s; display: flex; flex-direction: column; }
.gm-card:hover { box-shadow: var(--gm-shadow-lg); border-color: #dfe3e8; transform: translateY(-3px); }
.gm-card-media { position: relative; aspect-ratio: 1/1.08; background: #f6f7f9; overflow: hidden; cursor: pointer; }
.gm-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.gm-card:hover .gm-card-media img { transform: scale(1.07); }
.gm-card-badges { position: absolute; top: 10px; left: 10px; display: flex; flex-direction: column; gap: 5px; z-index: 3; }
.gm-badge-pill { font-size: .66rem; font-weight: 800; color: #fff; padding: 3px 8px; border-radius: 5px; letter-spacing: .3px; }
.gm-badge-off { background: var(--gm-accent); }
.gm-badge-new { background: var(--gm-success); }
.gm-badge-hot { background: #e11d48; }
.gm-card-wish { position: absolute; top: 10px; right: 10px; z-index: 3; width: 34px; height: 34px; border-radius: 50%;
  background: #fff; border: 1px solid var(--gm-line); color: var(--gm-muted); cursor: pointer; display: flex;
  align-items: center; justify-content: center; opacity: 0; transform: translateX(8px); transition: all .2s; }
.gm-card:hover .gm-card-wish { opacity: 1; transform: translateX(0); }
.gm-card-wish:hover, .gm-card-wish.on { color: #e11d48; border-color: #e11d48; }
.gm-card-quick { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 3; opacity: 0; transform: translateY(10px);
  transition: all .22s; }
.gm-card:hover .gm-card-quick { opacity: 1; transform: translateY(0); }
.gm-card-quick button { width: 100%; border: none; background: var(--gm-primary); color: #fff; font-weight: 700;
  font-size: .82rem; padding: 10px; border-radius: 7px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 7px; transition: background .15s; }
.gm-card-quick button:hover { background: var(--gm-accent); }

.gm-card-body { padding: 13px 13px 15px; display: flex; flex-direction: column; flex: 1; }
.gm-card-brand { font-size: .68rem; color: var(--gm-muted); text-transform: uppercase; letter-spacing: .4px; font-weight: 700; }
.gm-card-name { font-size: .87rem; font-weight: 600; color: var(--gm-ink); margin: 4px 0 7px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.4em; }
.gm-card-name:hover { color: var(--gm-accent); }
.gm-card-rate { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.gm-stars { color: var(--gm-star); font-size: .78rem; letter-spacing: 1px; }
.gm-card-rate small { color: var(--gm-muted); font-size: .72rem; }
.gm-card-price { display: flex; align-items: baseline; gap: 8px; margin-top: auto; }
.gm-price { font-size: 1.1rem; font-weight: 800; color: var(--gm-primary); }
.gm-mrp { font-size: .82rem; color: var(--gm-muted); text-decoration: line-through; }
.gm-off { font-size: .76rem; font-weight: 800; color: var(--gm-success); }
.gm-card-ship { font-size: .72rem; color: var(--gm-success); font-weight: 600; margin-top: 6px; }

/* ── Deal of the day ─────────────────────────────────────────────────── */
.gm-deal { background: linear-gradient(120deg, var(--gm-primary), var(--gm-primary-2)); border-radius: var(--gm-radius);
  padding: 26px; display: grid; grid-template-columns: 1fr; gap: 18px; color: #fff; }
.gm-deal-hd { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; }
.gm-deal-hd h3 { margin: 0; font-size: 1.4rem; font-weight: 800; }
.gm-deal-hd h3 span { color: var(--gm-accent); }
.gm-countdown { display: flex; gap: 8px; }
.gm-cd-box { background: rgba(255,255,255,.12); border-radius: 8px; padding: 8px 10px; text-align: center; min-width: 52px; }
.gm-cd-box b { display: block; font-size: 1.25rem; font-weight: 800; line-height: 1; }
.gm-cd-box small { font-size: .62rem; opacity: .8; text-transform: uppercase; letter-spacing: .5px; }

/* ── Promo banners ───────────────────────────────────────────────────── */
.gm-promos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 860px){ .gm-promos { grid-template-columns: 1fr; } }
.gm-promo { position: relative; border-radius: var(--gm-radius); overflow: hidden; min-height: 170px; padding: 26px;
  display: flex; flex-direction: column; justify-content: center; color: #fff; }
.gm-promo.p1 { background: linear-gradient(120deg, var(--gm-accent), var(--gm-primary)); }
.gm-promo.p2 { background: linear-gradient(120deg, var(--gm-primary-2), var(--gm-accent)); }
.gm-promo.p3 { background: linear-gradient(120deg, #1d2b3a, #4b5563); }
.gm-promo small { font-size: .72rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; opacity: .9; }
.gm-promo h3 { margin: 6px 0 4px; font-size: 1.4rem; font-weight: 800; line-height: 1.15; }
.gm-promo p { margin: 0 0 14px; font-size: .85rem; opacity: .92; }
.gm-promo .gm-btn-sm { align-self: flex-start; }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.gm-btn { display: inline-flex; align-items: center; gap: 8px; background: var(--gm-accent); color: #fff;
  font-weight: 700; font-size: .9rem; padding: 12px 26px; border-radius: 7px; cursor: pointer; border: none; transition: background .15s, transform .1s; }
.gm-btn:hover { background: var(--gm-accent-d); }
.gm-btn:active { transform: translateY(1px); }
.gm-btn-outline { background: transparent; border: 2px solid #fff; color: #fff; }
.gm-btn-outline:hover { background: #fff; color: var(--gm-primary); }
.gm-btn-sm { display: inline-flex; align-items: center; gap: 6px; background: #fff; color: var(--gm-primary);
  font-weight: 700; font-size: .8rem; padding: 9px 18px; border-radius: 6px; }
.gm-btn-dark { background: var(--gm-primary); color: #fff; }
.gm-btn-dark:hover { background: var(--gm-primary-2); }

/* ── Brand strip ─────────────────────────────────────────────────────── */
.gm-brands { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
@media (max-width: 860px){ .gm-brands { grid-template-columns: repeat(3, 1fr); } }
.gm-brand { background: #fff; border: 1px solid var(--gm-line); border-radius: var(--gm-radius); height: 84px;
  display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--gm-muted);
  font-size: 1rem; transition: color .15s, border-color .15s; text-align: center; padding: 8px; }
.gm-brand:hover { color: var(--gm-accent); border-color: var(--gm-accent); }

/* ── Newsletter ──────────────────────────────────────────────────────── */
.gm-newsletter { background: linear-gradient(120deg, var(--gm-primary), var(--gm-primary-2)); border-radius: var(--gm-radius);
  padding: 44px 26px; text-align: center; color: #fff; }
.gm-newsletter h2 { margin: 0 0 8px; font-size: 1.7rem; font-weight: 800; }
.gm-newsletter p { margin: 0 0 22px; opacity: .9; font-size: .95rem; }
.gm-nl-form { display: flex; max-width: 480px; margin: 0 auto; gap: 0; }
.gm-nl-form input { flex: 1; border: none; padding: 14px 18px; border-radius: 8px 0 0 8px; font-size: .9rem; outline: none; }
.gm-nl-form button { border: none; background: var(--gm-accent); color: #fff; font-weight: 700; padding: 0 26px; border-radius: 0 8px 8px 0; cursor: pointer; }
.gm-nl-form button:hover { background: var(--gm-accent-d); }

/* ── Shop page layout ────────────────────────────────────────────────── */
.gm-shop { display: grid; grid-template-columns: 270px 1fr; gap: 24px; align-items: start; margin: 26px 0 50px; }
@media (max-width: 940px){ .gm-shop { grid-template-columns: 1fr; } .gm-shop-aside { display: none; } }
.gm-shop-aside { background: #fff; border: 1px solid var(--gm-line); border-radius: var(--gm-radius); padding: 4px 0; position: sticky; top: 150px; }
.gm-filter { padding: 16px 18px; border-bottom: 1px solid var(--gm-line); }
.gm-filter:last-child { border-bottom: none; }
.gm-filter h4 { margin: 0 0 12px; font-size: .82rem; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--gm-primary); }
.gm-filter a { display: flex; justify-content: space-between; padding: 6px 0; font-size: .86rem; color: var(--gm-muted); }
.gm-filter a:hover, .gm-filter a.on { color: var(--gm-accent); font-weight: 700; }
.gm-filter a span { font-size: .74rem; background: #f3f4f6; border-radius: 999px; padding: 1px 8px; }

.gm-shop-bar { background: #fff; border: 1px solid var(--gm-line); border-radius: var(--gm-radius); padding: 12px 18px;
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }
.gm-shop-bar .cnt { font-size: .86rem; color: var(--gm-muted); }
.gm-shop-bar .cnt b { color: var(--gm-ink); }
.gm-shop-bar select { border: 1px solid var(--gm-line); border-radius: 7px; padding: 8px 12px; font-size: .85rem; outline: none; cursor: pointer; }

.gm-crumbs { font-size: .8rem; color: var(--gm-muted); margin: 18px 0 4px; }
.gm-crumbs a:hover { color: var(--gm-accent); }
.gm-crumbs i { font-size: .6rem; margin: 0 7px; }
.gm-page-title { font-size: 1.7rem; font-weight: 800; color: var(--gm-primary); margin: 4px 0 0; }

.gm-empty { background: #fff; border: 1px dashed var(--gm-line); border-radius: var(--gm-radius); padding: 60px 20px; text-align: center; color: var(--gm-muted); }
.gm-empty i { font-size: 2.6rem; color: #d1d5db; margin-bottom: 14px; display: block; }

/* ── Footer ──────────────────────────────────────────────────────────── */
.gm-footer { background: var(--gm-primary); color: #aeb8c4; margin-top: 50px; }
.gm-footer-top { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 36px; padding: 48px 0 36px; }
@media (max-width: 860px){ .gm-footer-top { grid-template-columns: 1fr 1fr; gap: 28px; } }
@media (max-width: 520px){ .gm-footer-top { grid-template-columns: 1fr; } }
.gm-footer h4 { color: #fff; font-size: .9rem; font-weight: 800; margin: 0 0 16px; text-transform: uppercase; letter-spacing: .5px; }
.gm-footer-brand .nm { font-size: 1.35rem; font-weight: 800; color: #fff; margin-bottom: 10px; }
.gm-footer-brand p { font-size: .85rem; line-height: 1.6; margin: 0 0 14px; }
.gm-footer-brand .contact { font-size: .85rem; margin: 5px 0; }
.gm-footer-brand .contact i { color: var(--gm-accent); width: 18px; }
.gm-footer ul { list-style: none; margin: 0; padding: 0; }
.gm-footer ul li { margin-bottom: 9px; }
.gm-footer ul a { font-size: .85rem; transition: color .15s, padding .15s; }
.gm-footer ul a:hover { color: var(--gm-accent); padding-left: 4px; }
.gm-social { display: flex; gap: 10px; margin-top: 14px; }
.gm-social a { width: 38px; height: 38px; border-radius: 8px; background: rgba(255,255,255,.08); display: flex;
  align-items: center; justify-content: center; color: #fff; transition: background .15s; }
.gm-social a:hover { background: var(--gm-accent); }
.gm-footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 18px 0; display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: .8rem; }
.gm-pay { display: flex; gap: 8px; align-items: center; font-size: 1.6rem; color: #8b97a6; }

/* ── Toast (fallback if main.js not present) ─────────────────────────── */
.gm-toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--gm-primary);
  color: #fff; padding: 13px 22px; border-radius: 8px; font-size: .88rem; font-weight: 600; box-shadow: var(--gm-shadow-lg);
  opacity: 0; pointer-events: none; transition: all .25s; z-index: 4000; }
.gm-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ═══════════════════════════════════════════════════════════════════════
   Mobile responsive hardening (defensive layer)
   ═══════════════════════════════════════════════════════════════════════ */
html, body { overflow-x: hidden; max-width: 100%; }
img, table, iframe, video { max-width: 100%; height: auto; }

@media (max-width: 640px){
  .gm-wrap { padding: 0 12px; }
  .gm-announce { font-size: .72rem; padding: 7px 10px; line-height: 1.3; }
  .gm-topbar { display: none; }                 /* reclaim vertical space on phones */
  .gm-header-main { flex-wrap: wrap; height: auto; gap: 10px; padding: 10px 0; align-items: center; }
  .gm-logo-name { font-size: 1.05rem; }
  .gm-logo-tag { display: none; }
  .gm-search-wrap { order: 3; flex-basis: 100%; width: 100%; max-width: 100%; margin-top: 8px; }
  .gm-search { height: 44px; }
  .gm-search select { display: none; }          /* the category dropdown crowds mobile search */
  .gm-search input { padding: 0 14px; font-size: .92rem; min-width: 0; }
  .gm-actions { gap: 14px; margin-left: auto; }
  .gm-action .gm-act-sub, .gm-action .gm-act-main { display: none; }
  .gm-nav-inner { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .gm-nav-inner::-webkit-scrollbar { display: none; }
  .gm-menu > a { font-size: .84rem; height: 46px; padding: 0 12px; white-space: nowrap; }
  .gm-section { margin: 24px 0; }
  .gm-section-title { font-size: 1.2rem; }
  .gm-section-hd { flex-wrap: wrap; gap: 6px; }
  .gm-prod-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .gm-cat-grid  { grid-template-columns: repeat(2, 1fr); }
  .gm-footer-top { grid-template-columns: 1fr; gap: 22px; text-align: left; }
}

/* Keep a comfortable 2-column product grid on the smallest phones (not 1) */
@media (max-width: 380px){ .gm-prod-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; } }
