/* ============================================================
   HANDICRAFTS PAGE — Premium Layout & Product Cards
   ============================================================ */
:root {
  --hc-bg: #f8f6f3;
  --hc-card-bg: #ffffff;
  --hc-accent: #c26a3d;
  --hc-accent-hover: #a5552c;
  --hc-secondary: #2f5d50;
  --hc-text-primary: #2b2b2b;
  --hc-text-secondary: #7a7a7a;
  --hc-border: #e8e5e0;
}

body {
  background-color: var(--hc-bg);
}

/* Navbar Override for Active State */
.nav-link.active-tab {
  position: relative;
  color: var(--hc-accent) !important;
}
.nav-link.active-tab::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--hc-accent);
}

/* ─── SHOP PAGE WRAPPER (2-COLUMN) ───────────────────────── */
.shop-page-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 60px 40px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 48px;
  align-items: start;
}

/* Hidden utility for JS filtering */
.hidden {
  display: none !important;
}

/* ─── SIDEBAR ────────────────────────────────────────────── */
.shop-sidebar {
  position: sticky;
  top: 100px;
}
.sidebar-section {
  margin-bottom: 32px;
}
.sidebar-title {
  font-family: var(--font-display, 'Playfair Display', serif);
  font-size: 1.1rem;
  color: var(--hc-text-primary);
  margin-bottom: 16px;
  font-weight: 600;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--hc-border);
}
.sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sidebar-list li {
  margin-bottom: 10px;
}
.sidebar-link {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.95rem;
  color: var(--hc-text-secondary);
  cursor: pointer;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  gap: 12px;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  padding: 4px 0;
}
.sidebar-link:hover, .sidebar-link.active {
  color: var(--hc-accent);
}
.sidebar-link.active {
  font-weight: 600;
}
/* Mock Checkboxes for Price (or categories if requested) */
.custom-checkbox {
  width: 16px;
  height: 16px;
  border: 1px solid var(--hc-border);
  border-radius: 4px;
  display: inline-block;
  position: relative;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.sidebar-link:hover .custom-checkbox {
  border-color: var(--hc-accent);
}
.sidebar-link.active .custom-checkbox {
  background-color: var(--hc-accent);
  border-color: var(--hc-accent);
}
.sidebar-link.active .custom-checkbox::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 4.5px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ─── MAIN CONTENT AREA ──────────────────────────────────── */
.shop-main {
  min-width: 0; /* allows grid to shrink */
  background:
    linear-gradient(rgba(248, 246, 243, 0.8), rgba(248, 246, 243, 0.8)),
    url('images/floral2.png') center / cover no-repeat;
  border-radius: 20px;
  padding: 32px;
  margin: -8px; /* Compensate for added padding */
}

/* Search bar */
.modern-search-wrap {
  margin-bottom: 32px;
  display: flex;
  justify-content: center;
}
.modern-search-inner {
  width: 100%;
  position: relative;
}
.modern-search-input {
  width: 100%;
  padding: 14px 20px 14px 48px;
  background: var(--hc-card-bg);
  border: 1px solid var(--hc-border);
  border-radius: 10px;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.95rem;
  color: var(--hc-text-primary);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.modern-search-input::placeholder {
  color: var(--hc-text-secondary);
}
.modern-search-input:focus {
  border-color: var(--hc-accent);
  box-shadow: 0 0 0 3px rgba(194, 106, 61, 0.1);
}
.modern-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--hc-text-secondary);
  pointer-events: none;
}

/* ─── PRODUCTS GRID ──────────────────────────────────────── */
.shop-products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px 24px;
}

/* ─── NEW PRODUCT CARD ───────────────────────────────────── */
.premium-market-card {
  background: var(--hc-card-bg);
  border-radius: 18px;
  border: 1px solid var(--hc-border);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}
.premium-market-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.08);
}

.market-card-img-wrap {
  width: 100%;
  height: 240px;
  position: relative;
  overflow: hidden;
  background: #f4f4f4;
}
.market-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.premium-market-card:hover .market-card-img-wrap img {
  transform: scale(1.04);
}
.market-card-wishlist {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(4px);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--hc-text-secondary);
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  z-index: 2;
}
.market-card-wishlist:hover {
  background: #fff;
  color: var(--hc-accent);
}
.market-card-wishlist svg {
  width: 18px;
  height: 18px;
}

.market-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.market-card-tag {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.75rem;
  color: var(--hc-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: 8px;
  display: block;
}

.market-card-title {
  font-family: var(--font-display, 'Playfair Display', serif);
  font-size: 1.1rem;
  color: var(--hc-text-primary);
  margin: 0 0 8px 0;
  line-height: 1.3;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.market-card-desc {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.85rem;
  color: var(--hc-text-secondary);
  line-height: 1.5;
  margin: 0 0 16px 0;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

.market-card-price {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--hc-text-primary);
  margin-bottom: 16px;
}

.market-card-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 0;
  background-color: var(--hc-accent);
  color: #ffffff !important;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: 8px;
  text-decoration: none;
  transition: background-color 0.2s ease;
  border: none;
  cursor: pointer;
}
.market-card-btn:hover {
  background-color: var(--hc-accent-hover);
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 1180px) {
  .shop-page-wrapper {
    padding: 60px 24px;
  }
  .shop-products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 800px) {
  .shop-page-wrapper {
    grid-template-columns: 1fr;
    padding: 32px 20px;
  }
  .shop-sidebar {
    position: static;
    display: flex;
    overflow-x: auto;
    gap: 24px;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--hc-border);
    scrollbar-width: none; /* Firefox */
  }
  .shop-sidebar::-webkit-scrollbar {
    display: none; /* Chrome */
  }
  .sidebar-section {
    flex: 0 0 auto;
    margin-bottom: 0;
    min-width: 180px;
  }
}

@media (max-width: 600px) {
  .shop-products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .market-card-body {
    padding: 16px;
  }
  .market-card-title {
    font-size: 1rem;
  }
  .market-card-price {
    font-size: 1.1rem;
  }
  .market-card-btn {
    font-size: 0.85rem;
    padding: 10px 0;
  }
  .market-card-img-wrap {
    height: 180px;
  }
}
@media (max-width: 480px) {
  .shop-products-grid {
    grid-template-columns: 1fr;
  }
}

/* ══════════════════════════════════════════════════════════
   FULL-SCREEN IMMERSIVE PRODUCT MODAL
   ══════════════════════════════════════════════════════════ */

.product-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
  visibility: hidden;
}
.product-modal.show {
  pointer-events: auto;
  visibility: visible;
}

/* ── Backdrop ── */
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(8, 6, 4, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.product-modal.show .modal-backdrop { opacity: 1; }

/* ── Full-screen panel ── */
.modal-drawer {
  position: absolute;
  inset: 24px;
  border-radius: 20px;
  background: #fdf8f0;
  display: grid;
  grid-template-columns: 60% 40%;
  overflow: hidden;
  box-shadow: 0 40px 120px rgba(0,0,0,0.6);

  /* Entry animation — scale up from 94% + fade */
  opacity: 0;
  transform: scale(0.94) translateY(20px);
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.product-modal.show .modal-drawer {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* ── Close button ── */
.modal-close {
  position: absolute;
  top: 18px; right: 18px;
  z-index: 20;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(15, 12, 8, 0.55);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: #fff;
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.modal-close:hover {
  background: var(--gold);
  border-color: var(--gold);
  transform: rotate(90deg) scale(1.1);
}

/* ══ LEFT — Image Area (60%) ══════════════════════════════ */
.modal-img-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  background: transparent;
  overflow: hidden;
  display: flex; flex-direction: column;
}

/* Main large image */
.modal-img-main {
  flex: 1;
  position: relative;
  overflow: hidden;
}
.modal-img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  transform: scale(1);
}
.modal-img-main:hover .modal-img { transform: scale(1.04); }

/* Category badge overlaid on image */
.modal-category-badge {
  position: absolute; top: 20px; left: 20px;
  background: rgba(201,168,76,0.92);
  color: #1a1008;
  font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
}

/* Variants count pill */
.modal-variants-pill {
  position: absolute; top: 20px; right: 20px;
  background: rgba(15,12,8,0.65);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(201,168,76,0.3);
  color: var(--gold-light, #e8c96c);
  font-size: 0.65rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 20px;
  display: none; /* shown via JS when multi-image */
}
.modal-variants-pill.visible { display: block; }

/* Thumbnail strip */
.modal-thumbs {
  display: none; /* shown via JS when multi-image */
  gap: 8px;
  padding: 14px 16px;
  background: rgba(15,12,8,0.6);
  backdrop-filter: blur(8px);
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}
.modal-thumbs::-webkit-scrollbar { display: none; }
.modal-thumbs.visible { display: flex; }

.modal-thumb {
  flex-shrink: 0;
  width: 70px; height: 70px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid rgba(255,255,255,0.1);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.modal-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.modal-thumb:hover { transform: scale(1.05); }
.modal-thumb.active { border-color: var(--gold, #c9a84c); }

/* Arrow navigation for multi-image */
.modal-gallery-arrow {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  background: rgba(15,12,8,0.55);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  width: 44px; height: 44px;
  border-radius: 50%;
  display: none;
  align-items: center; justify-content: center;
  font-size: 1.4rem; line-height: 1;
  cursor: pointer; z-index: 5;
  transition: background 0.2s ease, transform 0.2s ease;
}
.modal-gallery-arrow:hover { background: rgba(201,168,76,0.85); }
.modal-gallery-arrow.visible { display: flex; }
.modal-gallery-prev { left: 16px; }
.modal-gallery-next { right: 16px; }

/* ══ RIGHT — Info Area (40%) ══════════════════════════════ */
.modal-body {
  padding: 60px 48px;
  display: flex; flex-direction: column;
  justify-content: center;
  gap: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(201,168,76,0.3) transparent;

  /* Staggered fade-in */
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease 0.2s, transform 0.5s ease 0.2s;
}
.product-modal.show .modal-body {
  opacity: 1;
  transform: translateY(0);
}

.modal-eyebrow {
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 12px;
}
.modal-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.5vw, 2.4rem);
  font-weight: 600;
  color: var(--brown-dark);
  line-height: 1.15;
  margin-bottom: 0;
}
.modal-divider {
  width: 44px; height: 2px;
  background: linear-gradient(to right, var(--gold), var(--amber));
  border-radius: 2px;
  margin: 20px 0;
}
.modal-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.85;
  margin-bottom: 28px;
  flex-grow: 1;
}

/* Price row */
.modal-meta-row {
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(201,168,76,0.07);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  margin-bottom: 28px;
}
.modal-price-wrap { display: flex; flex-direction: column; gap: 3px; }
.modal-price-label {
  font-size: 0.6rem; letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-light); font-weight: 600;
}
.modal-price {
  font-family: var(--font-display);
  font-size: 2.2rem; font-weight: 700;
  color: var(--gold-dark); line-height: 1;
}
.modal-origin-wrap {
  display: flex; align-items: center; gap: 7px;
  font-size: 0.82rem; color: var(--text-secondary);
}

/* Buttons */
.modal-actions { display: flex; gap: 12px; margin-bottom: 28px; flex-wrap: wrap; }
.modal-wa-btn {
  flex: 1; justify-content: center;
  background: #25d366 !important;
  border-color: #25d366 !important;
  color: #fff !important;
  min-width: 160px;
}
.modal-wa-btn:hover {
  background: #1da851 !important;
  border-color: #1da851 !important;
  box-shadow: 0 8px 24px rgba(37,211,102,0.3) !important;
}
.modal-enquire-btn { white-space: nowrap; }

/* Trust badges */
.modal-trust-row {
  display: flex; flex-direction: column; gap: 12px;
  padding-top: 24px;
  border-top: 1px solid rgba(201,168,76,0.15);
  margin-top: auto;
}
.modal-trust-item {
  display: flex; align-items: center; gap: 12px;
  font-size: 0.82rem; color: var(--text-secondary);
}
.modal-trust-item svg { color: var(--gold-dark); flex-shrink: 0; }

/* ── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .modal-drawer {
    inset: 0;
    border-radius: 0;
    grid-template-columns: 1fr;
    grid-template-rows: 45vh 1fr;
  }
  .modal-img-wrap { height: 100%; }
  .modal-body { padding: 28px 24px 32px; }
}

@media (max-width: 640px) {
  .modal-drawer { grid-template-rows: 40vh 1fr; }
  .modal-title { font-size: 1.5rem; }
  .modal-price { font-size: 1.8rem; }
}

.product-card { cursor: pointer; }

/* ═══════════════════════════════════════════════════════════
   HC-* SYSTEM — matches handicrafts.js rendered classes
   ═══════════════════════════════════════════════════════════ */

/* ── Shop Layout ── */
.hc-shop {
  display: flex;
  max-width: 1400px;
  margin: 90px auto 0;
  padding: 32px 32px 80px;
  gap: 32px;
  align-items: flex-start;
}

/* ── Sidebar ── */
.hc-sidebar {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: 90px;
  background: #fff;
  border: 1px solid var(--hc-border);
  border-radius: 14px;
  padding: 20px 16px;
  font-family: 'Inter', sans-serif;
}
.hc-sidebar-hd {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--hc-border);
}
.hc-sidebar-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--hc-text-primary);
}
.hc-clear-all {
  background: none; border: none; cursor: pointer;
  font-size: 0.75rem; color: var(--hc-accent);
  font-family: 'Inter', sans-serif;
  text-decoration: underline; padding: 0;
}

/* Filter Groups */
.hc-fg { margin-bottom: 12px; border-bottom: 1px solid var(--hc-border); padding-bottom: 10px; }
.hc-fg:last-of-type { border-bottom: none; margin-bottom: 0; }
.hc-fg-toggle {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  background: none; border: none; cursor: pointer; padding: 6px 0;
  font-size: 0.8rem; font-weight: 600; color: var(--hc-text-primary);
  font-family: 'Inter', sans-serif;
}
.hc-fg-body { padding: 6px 0; }
.hc-fg-body.collapsed { display: none; }
.hc-chevron { transition: transform 0.2s; }
.hc-fg-toggle[aria-expanded="false"] .hc-chevron { transform: rotate(-90deg); }

/* Checkboxes */
.hc-check {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.8rem; color: var(--hc-text-secondary);
  cursor: pointer; padding: 3px 0; user-select: none;
}
.hc-check input[type="checkbox"],
.hc-check input[type="radio"] { display: none; }
.hc-box {
  width: 14px; height: 14px; flex-shrink: 0;
  border: 1.5px solid #ccc; border-radius: 3px;
  transition: all 0.15s;
}
.hc-radio-box { border-radius: 50%; }
.hc-check input:checked ~ .hc-box {
  background: var(--hc-accent); border-color: var(--hc-accent);
}

/* Price Slider */
.hc-price-labels { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--hc-text-secondary); margin-bottom: 6px; }
.hc-slider-track-wrap { position: relative; height: 20px; margin-bottom: 8px; }
.hc-slider-fill {
  position: absolute; top: 50%; transform: translateY(-50%);
  height: 4px; background: var(--hc-accent); border-radius: 2px; pointer-events: none;
}
.hc-range {
  position: absolute; width: 100%; top: 50%; transform: translateY(-50%);
  -webkit-appearance: none; appearance: none;
  height: 4px; background: transparent; pointer-events: none;
}
.hc-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 2px solid var(--hc-accent);
  cursor: pointer; pointer-events: all;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.hc-price-presets { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.hc-preset {
  font-size: 0.72rem; padding: 3px 8px; border-radius: 20px;
  border: 1px solid var(--hc-border); background: #fff;
  cursor: pointer; color: var(--hc-text-secondary);
  font-family: 'Inter', sans-serif; transition: all 0.15s;
}
.hc-preset.active, .hc-preset:hover { background: var(--hc-accent); color: #fff; border-color: var(--hc-accent); }

/* Apply Button */
.hc-apply-btn {
  width: 100%; margin-top: 12px; padding: 9px;
  background: var(--hc-accent); color: #fff; border: none;
  border-radius: 8px; cursor: pointer;
  font-size: 0.82rem; font-family: 'Inter', sans-serif; font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: background 0.2s;
}
.hc-apply-btn:hover { background: var(--hc-accent-hover); }

/* ── Main Content ── */
.hc-main { flex: 1; min-width: 0; }

/* Controls Bar */
.hc-controls {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.hc-search-wrap {
  position: relative; flex: 1; min-width: 180px;
  display: flex; align-items: center;
}
.hc-search-icon { position: absolute; left: 12px; color: var(--hc-text-secondary); pointer-events: none; }
.hc-search-input {
  width: 100%; padding: 9px 36px 9px 36px;
  border: 1px solid var(--hc-border); border-radius: 8px;
  font-size: 0.875rem; font-family: 'Inter', sans-serif;
  outline: none; background: #fff;
  transition: border-color 0.2s;
}
.hc-search-input:focus { border-color: var(--hc-accent); }
.hc-search-clear {
  position: absolute; right: 10px; background: none; border: none;
  cursor: pointer; color: var(--hc-text-secondary);
  display: flex; align-items: center; justify-content: center;
}
.hc-controls-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.hc-item-count { font-size: 0.82rem; color: var(--hc-text-secondary); white-space: nowrap; }
.hc-sort-select {
  padding: 8px 10px; border: 1px solid var(--hc-border); border-radius: 8px;
  font-size: 0.82rem; font-family: 'Inter', sans-serif;
  background: #fff; cursor: pointer; outline: none;
}
.hc-grid-toggle { display: flex; gap: 4px; }
.hc-gt-btn {
  width: 30px; height: 30px; border: 1px solid var(--hc-border);
  border-radius: 6px; background: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--hc-text-secondary); transition: all 0.15s;
}
.hc-gt-btn.active, .hc-gt-btn:hover {
  background: var(--hc-accent); border-color: var(--hc-accent); color: #fff;
}

/* Active Filter Tags */
.hc-active-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.hc-tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; background: rgba(194,106,61,0.1);
  border: 1px solid rgba(194,106,61,0.25); border-radius: 20px;
  font-size: 0.78rem; color: var(--hc-accent);
  font-family: 'Inter', sans-serif;
}
.hc-tag-close { cursor: pointer; display: flex; align-items: center; }

/* ── Product Grid ── */
.hc-grid {
  display: grid;
  gap: 24px;
}
.hc-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.hc-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

/* ── Product Card ── */
.hc-card {
  background: #fff;
  border: 1px solid var(--hc-border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}
.hc-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(43,43,43,0.1);
}
.hc-card-img-wrap {
  position: relative;
  width: 100%;
  padding-top: 100%; /* square */
  overflow: hidden;
  background: #f4f0eb;
}
.hc-card-img-wrap img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}
.hc-card:hover .hc-card-img-wrap img { transform: scale(1.05); }

.hc-wishlist {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,0.85); backdrop-filter: blur(4px);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--hc-text-secondary); transition: color 0.2s, background 0.2s;
}
.hc-wishlist:hover { background: #fff; color: #ef4444; }

.hc-discount-badge {
  background: var(--hc-accent); color: #fff;
  font-size: 0.7rem; font-weight: 600;
  padding: 3px 8px; border-radius: 20px;
  font-family: 'Inter', sans-serif;
}

.hc-card-body {
  padding: 14px 16px 16px;
  display: flex; flex-direction: column; flex: 1;
  position: relative;
}
.hc-card-title {
  font-family: 'Lora', serif;
  font-size: 0.95rem; font-weight: 500;
  color: var(--hc-text-primary);
  margin: 0 0 6px; line-height: 1.35;
  display: -webkit-box; line-clamp: 2; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hc-card-origin {
  display: flex; align-items: center; gap: 4px;
  font-size: 0.75rem; color: var(--hc-text-secondary);
  margin-bottom: 10px;
}
.hc-card-bottom-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto;
}
.hc-card-price-row { display: flex; align-items: center; gap: 6px; }
.hc-card-price { font-size: 1rem; font-weight: 700; color: var(--hc-text-primary); }
.hc-card-old-price { font-size: 0.82rem; color: #aaa; text-decoration: line-through; }
.hc-card-rating {
  display: flex; align-items: center; gap: 3px;
  font-size: 0.78rem; color: var(--hc-accent); font-weight: 500;
}

.hc-fab-cart {
  position: absolute; bottom: 14px; right: 14px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--hc-accent); color: #fff; border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.2s, transform 0.2s;
  box-shadow: 0 2px 8px rgba(194,106,61,0.35);
}
.hc-fab-cart:hover { background: var(--hc-accent-hover); transform: scale(1.1); }
.hc-fab-cart.added { background: var(--hc-secondary); }

/* ── Empty State ── */
.hc-empty {
  text-align: center; padding: 60px 20px;
  color: var(--hc-text-secondary);
}
.hc-empty svg { margin-bottom: 16px; opacity: 0.35; }
.hc-empty-title { font-size: 1.1rem; font-weight: 600; color: var(--hc-text-primary); margin-bottom: 6px; }
.hc-empty-sub { font-size: 0.875rem; margin-bottom: 20px; }
.hc-reset-btn {
  padding: 10px 24px; border-radius: 8px;
  background: var(--hc-accent); color: #fff; border: none;
  cursor: pointer; font-family: 'Inter', sans-serif; font-size: 0.875rem;
}

/* ── Reveal animation ── */
.reveal { animation: hcReveal 0.4s ease both; }
@keyframes hcReveal {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ── */
@media (max-width: 1200px) { .hc-grid.cols-4 { grid-template-columns: repeat(3,1fr); } }
@media (max-width: 960px)  { .hc-grid.cols-4 { grid-template-columns: repeat(2,1fr); } .hc-sidebar { width: 190px; } }

/* ─────────────────────────────────────────────────────────────
   MOBILE RESPONSIVENESS OVERHAUL — 768px and below
   Root causes fixed:
   1. Sidebar consumes full viewport height — now collapsible drawer
   2. Grid gap / padding too large for 360px
   3. No overflow-x control — fixed via body
   4. shop margin-top too large on mobile
   5. Controls row overflow on tiny screens
   6. Modal body padding too wide on 360px
   ───────────────────────────────────────────────────────────── */

/* PART 5 — Prevent horizontal scroll globally */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

/* ── 768px: Tablet and below ──────────────────────────── */
@media (max-width: 768px) {
  /* PART 1 — Layout: stack sidebar above main */
  .hc-shop {
    flex-direction: column;
    padding: 72px 0 60px;   /* nav height top, zero side (card padding handles it) */
    gap: 0;
    margin-top: 0;
  }

  /* PART 3 — Collapsible filter drawer ────────────────── */
  /* Hide sidebar by default; shown via toggle */
  .hc-sidebar {
    width: 100%;
    position: static;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    border-bottom: 1px solid var(--hc-border);
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.2s ease;
  }
  /* JS adds .hc-sidebar--open class to expand */
  .hc-sidebar.hc-sidebar--open {
    max-height: 600px;
    padding: 16px;
  }

  /* Filter toggle button — shown only on mobile */
  .hc-filter-toggle-btn {
    display: flex !important; /* hidden on desktop */
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #fff;
    border: 1px solid var(--hc-border);
    border-radius: 8px;
    font-size: 0.82rem;
    font-family: 'Inter', sans-serif;
    color: var(--hc-text-primary);
    cursor: pointer;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .hc-filter-toggle-btn.active {
    background: var(--hc-accent);
    border-color: var(--hc-accent);
    color: #fff;
  }

  /* PART 1 — Main content padding */
  .hc-main {
    padding: 12px 12px 40px;
  }

  /* PART 4 — Controls bar: wrap cleanly */
  .hc-controls {
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
  }
  .hc-search-wrap {
    flex: 1;
    min-width: 0;
  }
  .hc-controls-right {
    gap: 6px;
    flex-shrink: 0;
  }
  .hc-item-count {
    display: none; /* hide count on small screens to save space */
  }
  .hc-sort-select {
    font-size: 0.78rem;
    padding: 7px 8px;
    max-width: 130px;
  }
}

/* ── 768px: Tablet and Mobile (2-column layout) ───────────────── */
@media (max-width: 768px) {
  /* PART 1 — Layout: stack sidebar above main */
  .hc-shop {
    flex-direction: column;
    padding: 72px 0 60px;   /* nav height top, zero side */
    gap: 0;
    margin-top: 0;
  }

  /* PART 3 — Collapsible filter drawer ────────────────── */
  .hc-sidebar {
    width: 100%;
    position: static;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    border-bottom: 1px solid var(--hc-border);
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.2s ease;
  }
  .hc-sidebar.hc-sidebar--open {
    max-height: 600px;
    padding: 16px;
  }

  /* Filter toggle button */
  .hc-filter-toggle-btn {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #fff;
    border: 1px solid var(--hc-border);
    border-radius: 8px;
    font-size: 0.82rem;
    font-family: 'Inter', sans-serif;
    color: var(--hc-text-primary);
    cursor: pointer;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .hc-filter-toggle-btn.active {
    background: var(--hc-accent);
    border-color: var(--hc-accent);
    color: #fff;
  }

  /* Main content padding */
  .hc-main {
    padding: 10px;
  }

  /* Controls bar */
  .hc-controls {
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
  }
  .hc-search-wrap {
    flex: 1;
    min-width: 0;
  }
  .hc-controls-right {
    gap: 6px;
    flex-shrink: 0;
  }
  .hc-item-count {
    display: none;
  }
  .hc-sort-select {
    font-size: 0.78rem;
    padding: 7px 8px;
    max-width: 130px;
  }

  /* Grid: 2-column Amazon style */
  .hc-grid.cols-4,
  .hc-grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  /* Card normalization for 2-column mobile layout */
  .hc-card {
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    height: 100%; /* Equal heights */
  }
  .hc-card-img-wrap {
    width: 100%;
    padding-top: 100%; /* aspect-ratio: 1/1 square */
    background: #f4f0eb;
    border-radius: 8px 8px 0 0;
  }
  .hc-card-img-wrap img {
    object-fit: cover;
  }
  .hc-wishlist {
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
  }

  .hc-card-body {
    padding: 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
  }
  
  .hc-card-title {
    font-size: 0.85rem;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    line-height: 1.2;
    margin-bottom: 4px;
  }
  
  .hc-card-origin { 
    display: none; /* Hide descriptions to save space */
  }
  
  .hc-card-bottom-row {
    margin-top: auto;
    flex-direction: column; /* Stack price and rating on small screens */
    align-items: flex-start;
    gap: 2px;
    margin-bottom: 2px; /* space for cart button */
  }
  
  .hc-card-price-row {
    gap: 4px;
  }
  .hc-card-price {
    font-size: 0.95rem;
    font-weight: 700;
  }
  .hc-card-old-price {
    font-size: 0.75rem;
  }
  
  .hc-card-rating {
    font-size: 0.75rem;
    margin-top: 2px;
  }

  .hc-fab-cart {
    width: 32px;
    height: 32px;
    bottom: 8px;
    right: 8px;
  }
  
  /* Modal adjustments for small screens */
  .modal-body {
    padding: 16px 14px 20px;
  }
  .modal-title {
    font-size: 1.25rem;
  }
  .modal-price {
    font-size: 1.5rem;
  }
  .modal-actions {
    flex-direction: column;
    gap: 8px;
  }
  .modal-actions .btn,
  .modal-actions a {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
}

/* ── 360px: Samsung Galaxy S8+ and below tweaks ────────────── */
@media (max-width: 380px) {
  .hc-card-title {
    font-size: 0.8rem;
  }
  .hc-card-price {
    font-size: 0.9rem;
  }
  .hc-fab-cart {
    width: 28px;
    height: 28px;
  }
}

/* ── Desktop: Filter toggle button hidden ────────────── */
@media (min-width: 769px) {
  .hc-filter-toggle-btn {
    display: none !important;
  }
  .hc-sidebar {
    /* Reset any max-height applied by mobile JS toggle */
    max-height: none !important;
    overflow: visible;
    padding: 20px 16px;
  }
}

/* ─── DYNAMIC CATEGORY SYSTEM — category-nav.js ──────────── */

/* Skeleton loading bars (while categories fetch from backend) */
.hc-cat-skeleton {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 4px 0;
}
.hc-skel-bar {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #ede9e3 25%, #f5f2ee 50%, #ede9e3 75%);
  background-size: 200% 100%;
  animation: hc-shimmer 1.4s infinite;
  width: 90%;
}
.hc-skel-bar--short { width: 60%; }
@keyframes hc-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Category product count badge */
.hc-cat-count {
  font-size: 0.7rem;
  color: var(--hc-text-secondary);
  margin-left: auto;
}

/* Subcategory indented checkbox */
.hc-subcat-check {
  padding-left: 12px;
  opacity: 0.82;
}
.hc-subcat-check:hover { opacity: 1; }
.hc-box--sub {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}
.hc-subcat-name {
  font-size: 0.75rem;
  color: var(--hc-text-secondary);
}

/* ─── SUBCATEGORY PILL BAR ────────────────────────────────── */
.hc-subcategory-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--hc-border);
  border-radius: 10px;
  align-items: center;
}
.hc-subcat-pill {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid var(--hc-border);
  background: #faf8f5;
  color: var(--hc-text-secondary);
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.hc-subcat-pill:hover {
  border-color: var(--hc-accent);
  color: var(--hc-accent);
}
.hc-subcat-pill.active {
  background: var(--hc-accent);
  border-color: var(--hc-accent);
  color: #fff;
}

/* Loading state inside grid */
.hc-loading-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--hc-text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
}
