/* =============================================
   MS ONLINE SHOP PAGE — Dedicated Styles
   ============================================= */

/* SEARCH OVERLAY */
.search-overlay {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: var(--off-white);
  z-index: 500;
  padding: 1.25rem 2rem;
  box-shadow: 0 4px 32px rgba(0,0,0,0.12);
  transform: translateY(-110%);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
}
.search-overlay.open { transform: translateY(0); }
.search-overlay-inner { display: flex; align-items: center; gap: 1rem; max-width: 680px; margin: 0 auto; }
.search-overlay-input {
  flex: 1;
  border: none;
  border-bottom: 2px solid var(--black);
  background: transparent;
  font-family: 'Inter', sans-serif;
  font-size: 1.15rem;
  color: var(--black);
  padding: 0.5rem 0;
  outline: none;
}
.search-overlay-input::placeholder { color: var(--warm-mid); }
.search-overlay-close {
  background: none; border: none; cursor: pointer; color: var(--black);
  padding: 0.25rem; display: flex;
}
.search-results-hint {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.5rem 0 0;
  max-width: 680px;
  margin: 0 auto;
}
.search-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.3);
  z-index: 499; opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.search-backdrop.open { opacity: 1; pointer-events: all; }

/* SHOP HERO STRIP */
.shop-hero {
  background: var(--black);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2.5rem 2.5rem;
  gap: 2rem;
  flex-wrap: wrap;
}
.shop-hero-eyebrow {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--olive-light);
  margin-bottom: 0.4rem;
}
.shop-hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--white);
  font-weight: 600;
  margin-bottom: 0.3rem;
}
.shop-hero-sub {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.45);
}
.shop-hero-stats {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}
.hero-stat span {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--white);
}
.hero-stat small {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}
.hero-stat-div {
  width: 1px;
  height: 36px;
  background: rgba(255,255,255,0.12);
}

/* SHOP BODY LAYOUT */
.shop-body {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 200px);
  align-items: start;
}

/* SIDEBAR */
.shop-sidebar {
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  overflow-y: auto;
  border-right: 1px solid var(--sand);
  background: var(--off-white);
  padding-bottom: 3rem;
}
.shop-sidebar::-webkit-scrollbar { width: 4px; }
.shop-sidebar::-webkit-scrollbar-track { background: transparent; }
.shop-sidebar::-webkit-scrollbar-thumb { background: var(--sand); border-radius: 2px; }

.sidebar-filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--sand);
}
.sidebar-filter-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.clear-all-btn {
  background: none; border: none; cursor: pointer;
  font-size: 0.7rem; color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  transition: color 0.2s;
  text-decoration: underline;
}
.clear-all-btn:hover { color: var(--black); }

.filter-group {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--sand);
}
.filter-group-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--black);
  margin-bottom: 0.85rem;
}
.filter-options { display: flex; flex-direction: column; gap: 0.4rem; }
.filter-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem 0;
  transition: color 0.15s;
}
.filter-checkbox-label:hover { color: var(--black); }
.filter-checkbox {
  accent-color: var(--olive);
  width: 15px;
  height: 15px;
  cursor: pointer;
}
.filter-checkbox-label.cat-option {
  justify-content: space-between;
}
.cat-count-badge {
  font-size: 0.65rem;
  color: var(--warm-mid);
  background: var(--sand);
  padding: 0.1rem 0.4rem;
  border-radius: 2px;
}

/* SIDEBAR SEARCH */
.sidebar-search-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--sand);
  padding: 0.55rem 0.75rem;
  background: #fff;
}
.sidebar-search-input {
  border: none; outline: none;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  color: var(--black);
  width: 100%;
  background: transparent;
}
.sidebar-search-input::placeholder { color: var(--warm-mid); }

/* PRICE RANGE */
.price-range-wrap { display: flex; flex-direction: column; gap: 0.75rem; }
.price-inputs { display: flex; align-items: center; gap: 0.5rem; }
.price-input-group {
  display: flex; align-items: center; gap: 0.25rem;
  border: 1px solid var(--sand); padding: 0.45rem 0.6rem;
  background: #fff; flex: 1;
}
.price-currency { font-size: 0.75rem; color: var(--text-muted); }
.price-input {
  border: none; outline: none;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem; color: var(--black);
  width: 100%; background: transparent;
}
.price-sep { font-size: 0.8rem; color: var(--warm-mid); flex-shrink: 0; }
.apply-price-btn {
  background: var(--black); color: #fff;
  border: none; padding: 0.5rem 1rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  cursor: pointer; transition: background 0.2s;
}
.apply-price-btn:hover { background: var(--olive); }

/* SIZE FILTER */
.size-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
}
.size-filter-btn {
  border: 1px solid var(--sand);
  background: transparent;
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.4rem 0.25rem;
  cursor: pointer;
  transition: all 0.15s;
}
.size-filter-btn:hover,
.size-filter-btn.active {
  background: var(--black);
  color: #fff;
  border-color: var(--black);
}

/* PRODUCTS AREA */
.shop-products-area {
  padding: 1.5rem 2rem;
  min-width: 0;
}

/* TOOLBAR */
.shop-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--sand);
  gap: 1rem;
  flex-wrap: wrap;
}
.toolbar-left { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.results-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}
.active-filters { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.active-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--black);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  transition: background 0.15s;
}
.active-filter-chip:hover { background: var(--danger, #c0392b); }
.toolbar-right { display: flex; align-items: center; gap: 0.75rem; }
.sort-label { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; }
.sort-select {
  border: 1px solid var(--sand);
  background: var(--off-white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%236B6560' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 0.6rem center;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: var(--black);
  padding: 0.4rem 2rem 0.4rem 0.75rem;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.grid-toggle { display: flex; border: 1px solid var(--sand); }
.grid-btn {
  background: transparent; border: none;
  padding: 0.4rem 0.6rem;
  cursor: pointer; color: var(--warm-mid);
  transition: all 0.15s;
  display: flex; align-items: center;
  border-right: 1px solid var(--sand);
}
.grid-btn:last-child { border-right: none; }
.grid-btn:hover, .grid-btn.active { background: var(--black); color: #fff; }

/* SHOP GRID */
.shop-grid {
  display: grid;
  gap: 1.5px;
  background: var(--sand);
}
.shop-grid.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.shop-grid.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.shop-grid.grid-list   { grid-template-columns: 1fr; }

/* ── 4-column grid: tighter cards ── */
.shop-grid.grid-cols-4 .product-info {
  padding: 0.55rem 0.75rem 0.7rem;
}
.shop-grid.grid-cols-4 .product-name {
  font-size: 0.8rem;
  margin-bottom: 0.15rem;
}
.shop-grid.grid-cols-4 .product-category {
  font-size: 0.62rem;
  margin-bottom: 0.3rem;
}
.shop-grid.grid-cols-4 .product-price {
  font-size: 0.8rem;
}

/* Smaller product image in shop — was 3/4, now 2/3 */
.shop-grid .product-image-wrap { aspect-ratio: 2/3; }

/* LIST VIEW CARD
   Matches the real markup: .product-card > .product-image-wrap (which itself
   contains the img, tags, stock badge and quick-add button) + .product-info
   as a sibling. Everything inside .product-image-wrap keeps its normal
   absolute positioning from the grid view — we just constrain the box itself
   to a small thumbnail and hide the pieces that don't fit a compact row. */
.shop-grid.grid-list {
  background: transparent;
  gap: 0;
}
.shop-grid.grid-list .product-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.25rem;
  background: var(--off-white);
  border-bottom: 1px solid var(--sand);
  padding: 0.75rem 1.25rem;
  min-height: 120px;
}
.shop-grid.grid-list .product-card:hover { background: #faf9f6; }

.shop-grid.grid-list .product-image-wrap {
  position: relative;
  aspect-ratio: unset !important;
  height: 90px !important;
  width: 90px !important;
  flex: 0 0 90px;
  overflow: hidden;
  border-radius: 4px;
}
.shop-grid.grid-list .product-image-wrap img,
.shop-grid.grid-list .product-image-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* A 90px thumbnail is too small for the quick-add bar or corner badges —
   hide them here. Stock status is still visible via each product's own
   page/modal, and clicking the row opens that. */
.shop-grid.grid-list .quick-add,
.shop-grid.grid-list .backorder-badge,
.shop-grid.grid-list .product-image-wrap > span[style*="position:absolute"] {
  display: none !important;
}
.shop-grid.grid-list .product-tags-wrap {
  position: static !important;
  flex-direction: row !important;
  gap: 0.25rem;
  margin-bottom: 0.25rem;
}

.shop-grid.grid-list .product-info { flex: 1; padding: 0; }
.shop-grid.grid-list .product-name { font-size: 0.92rem; }
.shop-grid.grid-list .product-category { margin-bottom: 0.2rem; }
.shop-grid.grid-list .product-price { margin-top: 0.4rem; }

/* Text stock status — only shown in list view. Grid view already shows
   this via the corner badge on the image, so keep it hidden there to
   avoid saying the same thing twice. */
.product-stock-text { display: none; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; margin: 0.3rem 0 0; }
.shop-grid.grid-list .product-stock-text { display: block; }

/* EMPTY STATE */
.shop-empty {
  text-align: center;
  padding: 5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.shop-empty p {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--text-muted);
}

/* MOBILE FILTER DRAWER */
.filter-drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 400; opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.filter-drawer-overlay.open { opacity: 1; pointer-events: all; }
.filter-drawer {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 300px; background: var(--off-white);
  z-index: 401; transform: translateX(-100%);
  transition: transform 0.4s cubic-bezier(0.4,0,0.2,1);
  display: flex; flex-direction: column;
}
.filter-drawer.open { transform: translateX(0); }
.filter-drawer-header {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--sand);
  font-size: 0.82rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.filter-drawer-header button {
  background: none; border: none; cursor: pointer;
  color: var(--black); display: flex;
}
.filter-drawer-body { flex: 1; overflow-y: auto; }
.filter-drawer-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--sand);
}

/* FOOTER (reuse from main) */
.site-footer {
  background: var(--black);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 3rem 2.5rem 2rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-top: 4rem;
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .shop-body { grid-template-columns: 1fr; }
  .shop-sidebar { display: none; }
  .filter-toggle { display: flex !important; }
  .shop-products-area { padding: 1rem; }
  .shop-grid.grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
  .shop-hero { padding: 1.5rem; }
  .shop-hero-stats { gap: 1rem; }
  .hero-stat span { font-size: 1.2rem; }
}
@media (max-width: 500px) {
  .shop-grid.grid-cols-3,
  .shop-grid.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .shop-toolbar { gap: 0.5rem; }
  .sort-label { display: none; }
}

/* ── MODAL LEFT PANEL + THUMBNAILS ─────────── */
.modal-left {
  display: flex;
  flex-direction: column;
  background: var(--sand);
}
.modal-main-image {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 300px;
}
.modal-main-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.modal-thumbs {
  display: flex;
  gap: 0;
  background: var(--off-white);
  border-top: 1px solid var(--sand);
  overflow-x: auto;
  min-height: 0;
}
.modal-thumbs:empty { display: none; }
.modal-thumb-btn {
  flex-shrink: 0;
  width: 64px;
  height: 80px;
  border: none;
  padding: 0;
  cursor: pointer;
  background: var(--sand);
  border-right: 1px solid var(--off-white);
  overflow: hidden;
  opacity: 0.55;
  transition: opacity 0.15s;
  position: relative;
}
.modal-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.modal-thumb-btn.active,
.modal-thumb-btn:hover { opacity: 1; }
.modal-thumb-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: var(--olive);
}
/* placeholder in thumb */
.modal-thumb-btn svg { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); }

/* ── TAG FILTER PILLS ───────────────────────── */
.tag-filter-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.tag-filter-pill {
  border: none;
  padding: 0.35rem 0.9rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
  color: #fff;
  opacity: 0.45;
  transition: opacity 0.15s, transform 0.1s;
}
.tag-filter-pill:hover { opacity: 0.75; }
.tag-filter-pill.active { opacity: 1; transform: scale(1.04); }

/* ── DROPDOWN ARROW (select elements) ──────── */
select.sort-select,
select.form-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B6560' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}

/* ── OUT OF STOCK / BACKORDER ───────────────── */
.oos-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.oos-label {
  background: var(--black);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.4rem 1rem;
}
.backorder-badge {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  background: #b8860b;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  z-index: 2;
}
.product-card-oos .product-name,
.product-card-oos .product-category { color: var(--text-muted); }
.product-card-oos .product-image-wrap img { filter: grayscale(35%); }

.quick-add-disabled {
  background: var(--warm-mid) !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  opacity: 1 !important;
  transform: none !important;
}

/* BACKORDER NOTE IN MODAL */
.modal-backorder-note {
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-left: 3px solid #b8860b;
  padding: 0.75rem 0.9rem;
  font-size: 0.78rem;
  color: #7a5c00;
  line-height: 1.6;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.modal-backorder-note svg { flex-shrink: 0; margin-top: 1px; color: #b8860b; }
.modal-backorder-note strong { color: #5a4000; }

/* ── MOBILE FILTER BUTTON (toolbar, replaces header burger) ─── */
.mobile-filter-btn {
  display: none;
  align-items: center;
  gap: 0.4rem;
  background: var(--black);
  color: #fff;
  border: none;
  padding: 0.5rem 0.9rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
@media (max-width: 900px) {
  .mobile-filter-btn { display: inline-flex; }
}

/* ── Category filter pills ────────────────────── */
.cat-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  margin: 0 0.3rem 0.4rem 0;
  background: #fff;
  border: 1.5px solid var(--sand);
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}
.cat-filter-pill:hover {
  border-color: var(--olive);
  color: var(--olive);
}
.cat-filter-pill.active {
  background: var(--olive);
  border-color: var(--olive);
  color: #fff;
}
.cat-pill-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(0,0,0,0.12);
  color: inherit;
}
.cat-filter-pill.active .cat-pill-count {
  background: rgba(255,255,255,0.25);
}

/* ── Category tree filter ─────────────────────── */
.cat-tree { display: flex; flex-direction: column; gap: 0; }

.cat-tree-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.6rem;
  background: none;
  border: none;
  border-radius: 4px;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.cat-tree-item:hover { background: var(--sand); color: var(--black); }
.cat-tree-item.active { background: var(--olive); color: #fff; }
.cat-tree-item.active .cat-tree-count { background: rgba(255,255,255,0.25); color: #fff; }

.cat-tree-all { font-weight: 600; margin-bottom: 0.25rem; }
.cat-tree-parent { font-weight: 600; }

.cat-tree-icon { font-size: 0.5rem; color: var(--warm-mid); flex-shrink: 0; }
.cat-tree-item.active .cat-tree-icon { color: rgba(255,255,255,0.7); }

.cat-tree-arrow {
  font-size: 0.6rem;
  color: var(--warm-mid);
  flex-shrink: 0;
  transition: transform 0.2s;
  cursor: pointer;
  padding: 2px;
}
.cat-tree-arrow.open { transform: rotate(0deg); }
.cat-tree-arrow:not(.open) { transform: rotate(-90deg); }
.cat-tree-item.active .cat-tree-arrow { color: rgba(255,255,255,0.7); }

.cat-tree-label { flex: 1; }

.cat-tree-count {
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--sand);
  color: var(--text-muted);
  padding: 1px 6px;
  border-radius: 10px;
  flex-shrink: 0;
  min-width: 20px;
  text-align: center;
}

.cat-tree-group { display: flex; flex-direction: column; }

.cat-tree-subs {
  display: none;
  flex-direction: column;
  padding-left: 0.5rem;
  border-left: 2px solid var(--sand);
  margin-left: 1.1rem;
  margin-bottom: 0.15rem;
}
.cat-tree-subs.open { display: flex; }

.cat-tree-sub { font-size: 0.78rem; padding: 0.35rem 0.6rem; }
.cat-tree-sub-indent { font-size: 0.75rem; color: var(--warm-mid); flex-shrink: 0; }
.cat-tree-item.active .cat-tree-sub-indent { color: rgba(255,255,255,0.7); }
