/* ══════════════════════════════════════════════════════════════
   Dynamic Door Filter — v1.0.0
   Fixes: mobile topbar single-row, filter button theme-match,
          door type 3-col, footer overlap, reset btn mobile,
          fully responsive.
   ══════════════════════════════════════════════════════════════ */


/* ──────────────────────────────────────────────────────────────
   DESIGN TOKENS
   ────────────────────────────────────────────────────────────── */
#ddf-wrapper {

  --surface-0: #ffffff;
  --surface-1: #f7f8fa;
  --surface-2: #eef0f4;
  --surface-3: #e2e5ec;

  --ink-900: #0f1117;
  --ink-700: #3a3d47;
  --ink-400: #7c8090;
  --ink-200: #b8bcc8;

  --line-soft: #eaecf1;
  --line-mid: #d4d7e0;
  --line-hard: #bdc1cf;

  /* Brand — warm peach/amber to match site theme */
  --brand: #0d2855;
  --brand-mid: #1e50a0;
  --brand-sat: #ce8d5e;
  --brand-glow: rgba(206,141,94,0.12);
  --brand-tint: #ce8d5e1a;
  --brand-btn:  #faebe1;      /* button background */
  --brand-btn-hover: #f0d9c8; /* button hover */
  --brand-btn-text: #3a2510;  /* text on peach */

  --img-bg: #eceff5;

  --topbar-h: 64px;
  --sidebar-w: 310px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 50px;

  --ease: cubic-bezier(.4, 0, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --t-fast: 120ms;
  --t-mid: 220ms;
  --t-slow: 360ms;
}

/* ──────────────────────────────────────────────────────────────
   RESET
   ────────────────────────────────────────────────────────────── */
#ddf-wrapper, #ddf-wrapper * {
  box-sizing: border-box;
  font-family: inherit; /* ← inherits active theme font */
}
#ddf-wrapper ul, #ddf-wrapper ol { margin: 0; padding: 0; list-style: none; }
#ddf-wrapper p, #ddf-wrapper h1, #ddf-wrapper h2, #ddf-wrapper h3 { margin: 0; padding: 0; }
#ddf-wrapper a { text-decoration: none; color: inherit; }
#ddf-wrapper img { display: block; max-width: 100%; }
#ddf-wrapper button {
  font-family: inherit; /* ← inherits active theme font */
  cursor: pointer; border: none; background: none; padding: 0; outline: none;
}
#ddf-wrapper button:focus-visible {
  outline: 2px solid var(--brand-sat);
  outline-offset: 2px;
}

/* ══════════════════════════════════════════════════════════════
   OUTER WRAPPER
   ══════════════════════════════════════════════════════════════ */
#ddf-wrapper {
  display: flex;
  flex-direction: column;
  background: transparent;
  min-height: 60vh;
  color: var(--ink-900);
  width: 100%;
  /* FIX: Ensure wrapper doesn't push into footer */
  overflow: visible;
}

/* ══════════════════════════════════════════════════════════════
   TOP BAR
   Single flex row: [HideFilters] [──cat tabs──] [MobileBtn]
   ══════════════════════════════════════════════════════════════ */
#ddf-wrapper #ddf-topbar {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;       /* SINGLE ROW — no wrapping */
  background: var(--surface-0);
  border-bottom: 1px solid var(--line-soft);
  position: sticky;
  top: 0;
  z-index: 200;
  flex-shrink: 0;
  gap: 8px;
  height: var(--topbar-h);
  padding: 0 14px;
  min-height: 52px;
}

/* ── Desktop: Hide/Show Filters button ── */
#ddf-wrapper #ddf-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  border-radius: var(--radius-pill);
  padding: 0 18px;
  background: var(--brand-btn);
  color: var(--brand-btn-text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1.5px solid transparent;
  transition: background var(--t-fast), border-color var(--t-fast);
}
#ddf-wrapper #ddf-filter-toggle:hover {
  background: var(--brand-btn-hover);
  border-color: var(--brand-sat);
}
#ddf-wrapper #ddf-filter-toggle svg { flex-shrink: 0; opacity: 0.7; }

/* ── Category tab nav — takes all remaining space, scrollable ── */
#ddf-wrapper #ddf-cat-tabs {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;       /* allow shrinking */
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  gap: 6px;
  padding: 0 2px;
}
#ddf-wrapper #ddf-cat-tabs::-webkit-scrollbar { display: none; }

#ddf-wrapper .ddf-cat-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  height: 36px;
  background: var(--brand-btn);
  color: var(--brand-btn-text);
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  flex-shrink: 0;
  border: 1.5px solid transparent;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
#ddf-wrapper .ddf-cat-tab:hover {
  background: var(--brand-btn-hover);
}
#ddf-wrapper .ddf-cat-tab.is-on {
  background: var(--brand-btn-hover);
  border-color: var(--brand-sat);
  color: #1a0d04;
  font-weight: 700;
}

/* ── Mobile Filters button — theme-matched, compact ── */
#ddf-wrapper #ddf-mobile-btn {
  display: none;    /* hidden by default; shown via media query */
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  background: var(--brand-btn);       /* FIXED: peach to match theme */
  color: var(--brand-btn-text);
  border: 1.5px solid var(--brand-sat);
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  white-space: nowrap;
  transition: background var(--t-fast);
}
#ddf-wrapper #ddf-mobile-btn:hover {
  background: var(--brand-btn-hover);
}
#ddf-wrapper #ddf-mobile-btn svg { opacity: 0.7; }

#ddf-wrapper .ddf-mob-count {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}
#ddf-wrapper .ddf-mob-count.is-vis { display: inline-flex; }

/* ══════════════════════════════════════════════════════════════
   BODY — sidebar + main
   ══════════════════════════════════════════════════════════════ */
#ddf-wrapper #ddf-body {
  display: flex;
  align-items: flex-start;
  flex: 1;
  position: relative;
}

/* ══════════════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════════════ */
#ddf-wrapper #ddf-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface-0);
  border-right: 1px solid var(--line-soft);
  position: sticky;
  top: var(--topbar-h);
  max-height: calc(100vh - var(--topbar-h));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width var(--t-mid) var(--ease), opacity var(--t-fast) var(--ease);
}
#ddf-wrapper.ddf-sidebar-hidden #ddf-sidebar {
  width: 0; opacity: 0; border-right: none; pointer-events: none;
}

/* ── Sidebar Header: results count + reset button ── */
#ddf-wrapper .ddf-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--line-soft);
  min-height: 54px;
}
#ddf-wrapper .ddf-result-count {
  font-size: 14px; font-weight: 500; color: var(--ink-700);
}

/* ── Reset button — visible & styled when active ── */
#ddf-wrapper .ddf-reset-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 12px;
  border: 1.5px solid #fca5a5;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: #dc2626;
  background: #fef2f2;
  transition: all var(--t-fast);
  white-space: nowrap;
}
#ddf-wrapper .ddf-reset-btn:hover {
  background: #fee2e2;
  border-color: #dc2626;
}

/* ── Scroll area ── */
#ddf-wrapper .ddf-scroll {
  flex: 1; overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-mid) transparent;
}
#ddf-wrapper .ddf-scroll::-webkit-scrollbar { width: 3px; }
#ddf-wrapper .ddf-scroll::-webkit-scrollbar-thumb { background: var(--line-mid); border-radius: 4px; }

/* ── Collapsible sections ── */
#ddf-wrapper .ddf-section { border-bottom: 1px solid var(--line-soft); }
#ddf-wrapper .ddf-section-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 14px;
  cursor: pointer; user-select: none;
  transition: background var(--t-fast);
}
#ddf-wrapper .ddf-section-head:hover { background: var(--surface-1); }
#ddf-wrapper .ddf-section-label {
  font-size: 13px; font-weight: 700; color: var(--ink-900); line-height: 1;
}
#ddf-wrapper .ddf-arrow {
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-400); flex-shrink: 0;
  transition: transform var(--t-mid) var(--ease);
}
#ddf-wrapper .ddf-arrow svg { width: 14px; height: 14px; display: block; }
#ddf-wrapper .ddf-section.is-closed .ddf-arrow { transform: rotate(180deg); }
#ddf-wrapper .ddf-section-body {
  padding: 0 20px 16px; overflow: hidden;
  transition: max-height var(--t-mid) var(--ease), opacity var(--t-fast) var(--ease), padding var(--t-mid) var(--ease);
}
#ddf-wrapper .ddf-section.is-closed .ddf-section-body {
  max-height: 0; opacity: 0; padding-top: 0; padding-bottom: 0;
}

/* ══════════════════════════════════════════════════════════════
   ENCLOSURE SHAPE — Radio list
   ══════════════════════════════════════════════════════════════ */
#ddf-wrapper #ddf-group-list { display: flex; flex-direction: column; gap: 1px; }
#ddf-wrapper .ddf-group-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 6px;
  border-radius: var(--radius-sm); cursor: pointer; user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--t-fast);
}
#ddf-wrapper .ddf-group-item:hover { background: var(--brand-tint); }

#ddf-wrapper .ddf-radio {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--line-hard); flex-shrink: 0;
  background: var(--surface-0); position: relative;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
#ddf-wrapper .ddf-radio::after {
  content: ''; position: absolute; inset: 0; margin: auto;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand-sat); transform: scale(0);
  transition: transform var(--t-mid) var(--spring);
}
#ddf-wrapper .ddf-group-item.is-on .ddf-radio { border-color: var(--brand-sat); box-shadow: 0 0 0 3px var(--brand-glow); }
#ddf-wrapper .ddf-group-item.is-on .ddf-radio::after { transform: scale(1); }
#ddf-wrapper .ddf-group-label {
  font-size: 14px; font-weight: 400; color: var(--ink-700); line-height: 1.35;
  transition: color var(--t-fast), font-weight var(--t-fast);
}
#ddf-wrapper .ddf-group-item.is-on .ddf-group-label { color: var(--ink-900); font-weight: 600; }

/* ══════════════════════════════════════════════════════════════
   DOOR TYPE — 3-col icon grid (FIXED: was 4-col)
   ══════════════════════════════════════════════════════════════ */
#ddf-wrapper .ddf-type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);  /* ← ALWAYS 3 columns */
  gap: 6px;
}

#ddf-wrapper .ddf-type-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 1.5px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: var(--surface-0);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; outline: none;
  transition: border-color var(--t-fast), background var(--t-fast), transform 160ms var(--spring);
  animation: ddf-cellIn 200ms var(--ease) both;
}
#ddf-wrapper .ddf-type-cell:hover {
  border-color: var(--brand-sat);
  background: var(--brand-tint);
  transform: translateY(-2px) scale(1.04);
}
#ddf-wrapper .ddf-type-cell.is-on {
  border-color: var(--brand-sat);
  background: var(--brand-tint);
}
#ddf-wrapper .ddf-type-cell.is-on::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 3px; background: var(--brand-sat); border-radius: 0 0 6px 6px;
}

@keyframes ddf-cellIn {
  from { opacity: 0; transform: scale(.85) translateY(5px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
#ddf-wrapper .ddf-type-cell:nth-child(1) { animation-delay: 0ms; }
#ddf-wrapper .ddf-type-cell:nth-child(2) { animation-delay: 20ms; }
#ddf-wrapper .ddf-type-cell:nth-child(3) { animation-delay: 40ms; }
#ddf-wrapper .ddf-type-cell:nth-child(4) { animation-delay: 60ms; }
#ddf-wrapper .ddf-type-cell:nth-child(5) { animation-delay: 80ms; }
#ddf-wrapper .ddf-type-cell:nth-child(6) { animation-delay: 100ms; }
#ddf-wrapper .ddf-type-cell:nth-child(n+7) { animation-delay: 120ms; }

#ddf-wrapper .ddf-type-img-a, #ddf-wrapper .ddf-type-img-b {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; padding: 7px; pointer-events: none;
  transition: opacity 150ms var(--ease);
}
#ddf-wrapper .ddf-type-img-a { opacity: 1; z-index: 1; }
#ddf-wrapper .ddf-type-img-b { opacity: 0; z-index: 2; padding: 5px; }
#ddf-wrapper .ddf-type-cell:hover .ddf-type-img-a,
#ddf-wrapper .ddf-type-cell.is-on .ddf-type-img-a { opacity: 0; }
#ddf-wrapper .ddf-type-cell:hover .ddf-type-img-b,
#ddf-wrapper .ddf-type-cell.is-on .ddf-type-img-b { opacity: 1; }

#ddf-wrapper .ddf-type-svg {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 9px; z-index: 1; pointer-events: none;
}
#ddf-wrapper .ddf-type-svg svg {
  width: 100%; height: 100%;
  stroke: var(--brand-sat); fill: none; stroke-width: 1.5;
  transition: stroke var(--t-fast);
}
#ddf-wrapper .ddf-type-cell:hover .ddf-type-svg svg,
#ddf-wrapper .ddf-type-cell.is-on .ddf-type-svg svg { stroke: var(--brand); }

#ddf-wrapper .ddf-no-types {
  grid-column: 1 / -1; font-size: 12px; color: var(--ink-400); font-style: italic; padding: 6px 0;
}

/* Skeleton shimmer */
@keyframes ddf-shimmer {
  from { background-position: -600px 0; }
  to   { background-position: 600px 0; }
}
#ddf-wrapper .ddf-type-cell.is-skel {
  background: linear-gradient(90deg, #eaecf0 25%, #f4f5f7 50%, #eaecf0 75%);
  background-size: 600px 100%;
  animation: ddf-shimmer 1.4s linear infinite;
  border-color: transparent; cursor: default; transform: none; box-shadow: none;
}

/* ══════════════════════════════════════════════════════════════
   MAIN AREA
   ══════════════════════════════════════════════════════════════ */
#ddf-wrapper #ddf-main {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  /* FIX: Prevent footer overlap on mobile */
  overflow: hidden;
}

/* ══════════════════════════════════════════════════════════════
   PRODUCT GRID — 3-col with sidebar
   ══════════════════════════════════════════════════════════════ */
#ddf-wrapper .ddf-product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  background: transparent;
  flex: 1;
  align-content: start; /* FIX: prevents empty cells stretching to footer */
}
#ddf-wrapper.ddf-sidebar-hidden .ddf-product-grid {
  grid-template-columns: repeat(4, 1fr);
}

/* ══════════════════════════════════════════════════════════════
   PRODUCT CARD
   ══════════════════════════════════════════════════════════════ */
#ddf-wrapper .ddf-card {
  background: var(--surface-0);
  display: flex; flex-direction: column;
  position: relative; overflow: hidden;
  transition: box-shadow var(--t-mid) var(--ease);
}
#ddf-wrapper .ddf-card:hover { z-index: 2; box-shadow: 0 6px 32px rgba(13,40,85,.10); }

#ddf-wrapper .ddf-card-inner {
  display: flex; flex-direction: column;
  width: 100%; color: inherit; text-decoration: none; flex: 1;
}

#ddf-wrapper .ddf-card-photo {
  position: relative; background: var(--img-bg);
  aspect-ratio: 1 / 1; overflow: hidden; flex-shrink: 0;
}

#ddf-wrapper .ddf-card-badge { display: none !important; }

#ddf-wrapper .ddf-card-cat-tag {
  position: absolute; top: 10px; right: 10px; z-index: 4;
  display: inline-flex; align-items: center;
  height: 20px; padding: 0 8px;
  background: var(--brand-btn);
  border-radius: var(--radius-sm);
  font-size: 9.5px; font-weight: 700; color: var(--brand-btn-text);
  letter-spacing: .05em; pointer-events: none;
}

#ddf-wrapper .ddf-img-a {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; padding: 26px; z-index: 1;
  transition: opacity var(--t-mid), transform var(--t-slow);
}
#ddf-wrapper .ddf-img-b {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; z-index: 2;
  transition: opacity var(--t-mid);
}
#ddf-wrapper .ddf-card:hover .ddf-img-a { opacity: 0; transform: scale(1.04); }
#ddf-wrapper .ddf-card:hover .ddf-img-b { opacity: 1; }

#ddf-wrapper .ddf-card-body {
  padding: 30px 30px 30px;
  /* border-top: 1px solid var(--line-soft); */
  display: flex; flex-direction: column; gap: 5px;
  background: var(--surface-0); flex: 1;
  transition: background var(--t-fast);
}
#ddf-wrapper .ddf-card:hover .ddf-card-body { background: var(--surface-1); }

#ddf-wrapper .ddf-card-title { font-size: 15px; line-height: 1.4; color: var(--ink-900);text-transform: capitalize; }
#ddf-wrapper .ddf-card-title b { font-weight: 700; }
#ddf-wrapper .ddf-card-series { font-weight: 400; color: var(--ink-400); margin-left: 5px; font-size: 12px; }

#ddf-wrapper .ddf-show-more {
  font-size: 13px; font-weight: 400; color: var(--ink-400);
  display: inline-flex; align-items: center; gap: 4px;
  transition: color var(--t-fast), gap var(--t-fast);
}
#ddf-wrapper .ddf-show-more::after { content: '→'; transition: transform var(--t-fast); }
#ddf-wrapper .ddf-card:hover .ddf-show-more { color: var(--brand-sat); gap: 7px; }
#ddf-wrapper .ddf-card:hover .ddf-show-more::after { transform: translateX(2px); }

@keyframes ddf-cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
#ddf-wrapper .ddf-card:not(.is-skel) { animation: ddf-cardIn var(--t-mid) var(--ease) both; }
#ddf-wrapper .ddf-card:nth-child(1) { animation-delay: 0ms; }
#ddf-wrapper .ddf-card:nth-child(2) { animation-delay: 35ms; }
#ddf-wrapper .ddf-card:nth-child(3) { animation-delay: 70ms; }
#ddf-wrapper .ddf-card:nth-child(4) { animation-delay: 100ms; }
#ddf-wrapper .ddf-card:nth-child(n+5) { animation-delay: 130ms; }

/* Skeleton */
#ddf-wrapper .ddf-card.is-skel .ddf-card-photo {
  background: linear-gradient(90deg, #e4e8ee 25%, #f0f2f6 50%, #e4e8ee 75%);
  background-size: 600px 100%;
  animation: ddf-shimmer 1.4s linear infinite;
}
#ddf-wrapper .ddf-card.is-skel .ddf-img-a { display: none; }
#ddf-wrapper .ddf-card.is-skel .ddf-card-body { gap: 10px; }
#ddf-wrapper .ddf-skel-line {
  border-radius: var(--radius-sm); height: 12px;
  background: linear-gradient(90deg, #e4e8ee 25%, #f0f2f6 50%, #e4e8ee 75%);
  background-size: 600px 100%;
  animation: ddf-shimmer 1.4s linear infinite;
}

/* ══════════════════════════════════════════════════════════════
   EMPTY STATE
   ══════════════════════════════════════════════════════════════ */
#ddf-wrapper .ddf-empty {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 14px;
  padding: 60px 24px; background: var(--surface-0); text-align: center;
}
#ddf-wrapper .ddf-empty svg { opacity: .15; }
#ddf-wrapper .ddf-empty p { font-size: 15px; font-weight: 500; color: var(--ink-700); }
#ddf-wrapper .ddf-empty-reset {
  height: 38px; padding: 0 22px;
  background: var(--brand-btn);
  border-radius: var(--radius-md);
  font-size: 13px; font-weight: 600;
  color: var(--brand-btn-text);
  border: 1.5px solid var(--brand-sat);
  transition: background var(--t-fast);
}
#ddf-wrapper .ddf-empty-reset:hover { background: var(--brand-btn-hover); }

/* ══════════════════════════════════════════════════════════════
   PAGINATION
   ══════════════════════════════════════════════════════════════ */
#ddf-wrapper #ddf-pagination {
  background: var(--surface-0); border-top: 1px solid var(--line-soft);
}
#ddf-wrapper .ddf-pag-nav {
  display: flex; align-items: center; justify-content: center;
  gap: 5px; flex-wrap: wrap; padding: 14px 16px;
}
#ddf-wrapper .ddf-pg-btn {
  min-width: 38px; height: 38px; padding: 0 10px;
  border: 1.5px solid var(--line-mid); border-radius: var(--radius-sm);
  background: var(--surface-0); color: var(--ink-700);
  font-size: 13px; font-weight: 500;
  transition: all var(--t-fast);
}
#ddf-wrapper .ddf-pg-btn:hover { border-color: var(--brand-sat); color: var(--brand-sat); background: var(--brand-tint); }
#ddf-wrapper .ddf-pg-btn.is-cur { background:#faebe1;   font-weight: 700; }
#ddf-wrapper .ddf-pag-dots { min-width: 24px; text-align: center; color: var(--ink-200); font-size: 14px; line-height: 38px; }

/* ══════════════════════════════════════════════════════════════
   MOBILE OVERLAY
   ══════════════════════════════════════════════════════════════ */
#ddf-wrapper #ddf-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(13,40,85,.4); z-index: 490;
  opacity: 0; pointer-events: none;
  backdrop-filter: blur(3px);
  transition: opacity var(--t-mid);
}
#ddf-wrapper #ddf-overlay.is-vis { opacity: 1; pointer-events: all; }
body.ddf-locked { overflow: hidden; }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */

/* ── Large desktop (1400px+) ── */
@media (min-width: 1400px) {
  #ddf-wrapper { --sidebar-w: 320px; }
}

/* ── Medium desktop (1200–1399px) ── */
@media (max-width: 1200px) {
  #ddf-wrapper { --sidebar-w: 280px; }
  #ddf-wrapper .ddf-product-grid { grid-template-columns: repeat(2, 1fr); }
  #ddf-wrapper.ddf-sidebar-hidden .ddf-product-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Tablet landscape (992–1199px) ── */
@media (max-width: 992px) {
  #ddf-wrapper { --sidebar-w: 260px; }
  #ddf-wrapper .ddf-product-grid { grid-template-columns: repeat(2, 1fr); }
  #ddf-wrapper .ddf-cat-tab { padding: 0 12px; font-size: 13px; }
}

/* ══════════════════════════════════════════════════════════════
   MOBILE BREAKPOINT (≤900px) — Sidebar becomes slide-in drawer
   FIX: Topbar stays single row. Filters button matches theme.
        Products don't overlap footer.
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  /* Show mobile Filters button */
  #ddf-wrapper #ddf-mobile-btn { display: inline-flex; }

  /* Hide desktop Hide/Show Filters button */
  #ddf-wrapper #ddf-filter-toggle { display: none; }

  /* ── Topbar: SINGLE ROW — [cat tabs ...] [Filters btn] ── */
  #ddf-wrapper #ddf-topbar {
    flex-wrap: nowrap;
    padding: 0 12px;
    gap: 8px;
    height: auto;
    min-height: 54px;
    /* Let it auto-height if tabs get tall */
  }
  #ddf-wrapper #ddf-cat-tabs {
    flex: 1;
    min-width: 0;
    order: 1;
  }
  #ddf-wrapper #ddf-mobile-btn {
    order: 2;
    flex-shrink: 0;
  }

  /* Body stacks vertically */
  #ddf-wrapper #ddf-body { flex-direction: column; }

  /* Sidebar becomes fixed drawer from left */
  #ddf-wrapper #ddf-sidebar {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    width: min(300px, 88vw);
    max-height: 100%;
    height: 100%;
    overflow-y: auto;
    transform: translateX(-110%);
    z-index: 500;
    opacity: 1;
    border-right: 1px solid var(--line-mid);
    box-shadow: 4px 0 24px rgba(0,0,0,.15);
    transition: transform var(--t-mid) var(--ease);
    /* Override sticky positioning */
    top: 0 !important;
  }
  #ddf-wrapper #ddf-sidebar.is-open { transform: translateX(0); }

  /* Make overlay visible on mobile */
  #ddf-wrapper #ddf-overlay { display: block; }

  /* Main fills full width */
  #ddf-wrapper #ddf-main { width: 100%; }

  /* Products: 2 columns on tablet/mobile */
  #ddf-wrapper .ddf-product-grid { grid-template-columns: repeat(2, 1fr); }
  #ddf-wrapper.ddf-sidebar-hidden .ddf-product-grid { grid-template-columns: repeat(2, 1fr); }

  /* ── SIDEBAR HEADER: always visible with reset btn ── */
  #ddf-wrapper .ddf-sidebar-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--surface-0);
    border-bottom: 1px solid var(--line-soft);
    padding: 16px 18px;
    /* Close button area */
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  }
  #ddf-wrapper .ddf-result-count {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
  }
  /* Reset btn always styled for visibility in drawer */
  #ddf-wrapper .ddf-reset-btn {
    font-size: 12px;
    height: 32px;
    padding: 0 14px;
  }
}

/* ── Mobile medium (≤640px) ── */
@media (max-width: 640px) {
  #ddf-wrapper .ddf-cat-tab { padding: 0 10px; font-size: 12.5px; height: 34px; }
  #ddf-wrapper #ddf-mobile-btn { padding: 0 12px; font-size: 12.5px; height: 34px; }
  #ddf-wrapper .ddf-product-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  #ddf-wrapper .ddf-card-body { padding: 10px 12px 14px; }
  #ddf-wrapper .ddf-card-title { font-size: 12.5px; }
}

/* ── Small mobile (≤480px) ── */
@media (max-width: 480px) {
  #ddf-wrapper .ddf-product-grid { grid-template-columns: repeat(2, 1fr); }
  /* FIX: Product grid should not extend under footer */
  #ddf-wrapper #ddf-main {
    padding-bottom: 16px;
  }
  #ddf-wrapper .ddf-cat-tab { padding: 0 8px; font-size: 12px; height: 32px; }
  #ddf-wrapper #ddf-mobile-btn { padding: 0 10px; font-size: 12px; height: 32px; }
}

/* ── Very small (≤360px) ── */
@media (max-width: 360px) {
  #ddf-wrapper .ddf-product-grid { grid-template-columns: 1fr; }
  #ddf-wrapper .ddf-cat-tab { padding: 0 7px; font-size: 11.5px; }
}


/* ================================================================
   PRODUCT DETAIL PAGE
================================================================ */

/* ── Full-width breakout ── */
#ddf-detail-page {
    width: 100vw;
    position: relative; left: 50%; right: 50%;
    margin-left: -50vw; margin-right: -50vw;
    overflow-x: hidden;
    font-family: inherit;
    color: #1a1a1a; background: #f8f8f6;
}

/* ── Hero row ── */
#ddf-hero {
    display: flex; width: 100%;
    height: 100vh; min-height: 580px; max-height: 900px; overflow: hidden;
}

/* ── SLIDER PANEL (left 58%) ── */
#ddf-hero-slider {
    position: relative; width: 58%; flex-shrink: 0;
    background: #ece9e3; overflow: hidden;
}
#ddf-main-img-wrap { position: absolute; inset: 0; display: flex; flex-direction: column; }
#ddf-main-img {
    flex: 1; width: 100%; min-height: 0; object-fit: cover; display: block;
    transition: opacity 0.38s cubic-bezier(.4,0,.2,1), transform 0.45s cubic-bezier(.4,0,.2,1);
    opacity: 1; transform: scale(1); will-change: opacity, transform;
}
#ddf-main-img.is-loading { opacity: 0; transform: scale(1.025); }
#ddf-img-overlay {
    position: absolute; bottom: 0; left: 0; right: 0; height: 160px;
    background: linear-gradient(to top, rgba(15,12,8,0.55) 0%, transparent 100%);
    pointer-events: none; z-index: 2;
}

/* ── Thumbnail Strip ── */
#ddf-thumb-strip {
    position: absolute; bottom: 0; left: 0; right: 0; z-index: 10;
    display: flex; flex-direction: row; align-items: center; gap: 10px;
    padding: 16px 20px 18px;
}
.ddf-thumb-nav {
    width: 32px; height: 32px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.18); backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.3); border-radius: 50%; cursor: pointer; padding: 0;
    transition: background 0.18s;
}
.ddf-thumb-nav svg { width: 13px; height: 13px; color: #fff; }
.ddf-thumb-nav:hover { background: rgba(255,255,255,0.32); }
#ddf-thumb-list {
    flex: 1; display: flex; flex-direction: row; gap: 10px;
     transition: transform 0.32s cubic-bezier(.4,0,.2,1);
}
.ddf-thumb-btn {
    width: 68px; height: 68px; flex-shrink: 0;
    border: 2.5px solid rgba(255,255,255,0.35); border-radius: 10px; overflow: hidden;
    background: rgba(255,255,255,0.15); cursor: pointer; padding: 0;
    transition: border-color 0.2s, transform 0.2s cubic-bezier(.34,1.2,.64,1), box-shadow 0.2s;
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.ddf-thumb-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ddf-thumb-btn:hover { transform: translateY(-3px) scale(1.06); border-color: rgba(255,255,255,0.75); }
.ddf-thumb-btn.is-active { border-color: #fff; transform: translateY(-3px) scale(1.08); box-shadow: 0 0 0 1px rgba(255,255,255,0.6), 0 8px 22px rgba(0,0,0,0.32); }

/* ── RIGHT: Info panel ── */
#ddf-info-panel {
    flex: 1; display: flex; flex-direction: column; justify-content: center;
    padding: 56px 52px 56px 60px; background: #f8f8f6; overflow-y: auto;
    scrollbar-width: thin; scrollbar-color: #ddd transparent; position: relative;
}
#ddf-info-panel::before {
    content: ''; position: absolute; top: 0; left: 0; width: 1px; height: 100%;
    background: linear-gradient(to bottom, transparent, #dedad3 30%, #dedad3 70%, transparent);
}
#ddf-info-panel::-webkit-scrollbar { width: 3px; }
#ddf-info-panel::-webkit-scrollbar-thumb { background: #d4cfc7; border-radius: 2px; }

.ddf-info-logo { margin-bottom: 20px; }
.ddf-site-logo-img { max-height: 38px; width: auto; display: block; object-fit: contain; }
.ddf-site-logo-text { font-size: 13px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: #1a1a1a; }

.ddf-info-breadcrumb { font-size: 10px; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: #a09880; margin: 0 0 16px; }
.ddf-info-title { font-size: 34px; font-weight: 300; line-height: 1.18; letter-spacing: -0.02em; color: #1a1a1a; margin: 0 0 22px; }
.ddf-info-divider { width: 36px; height: 2px; background: linear-gradient(to right, #1a1a1a, transparent); margin-bottom: 26px; border-radius: 1px; }

.ddf-swatches-label { font-size: 9.5px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: #a09880; margin: 0 0 10px; }
.ddf-info-swatches { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.ddf-sw-btn {
    display: flex; align-items: center; gap: 9px; background: #fff;
    border: 1.5px solid #e4e0d8; border-radius: 999px; padding: 5px 16px 5px 5px; cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-size: 12px; font-weight: 400; color: #3a3830;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.ddf-sw-btn:hover { border-color: #b8b4aa; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.ddf-sw-btn.is-active { border-color: #1a1a1a; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.ddf-sw-circle { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(0,0,0,0.1); flex-shrink: 0; display: block; transition: transform 0.22s, box-shadow 0.2s; }
.ddf-sw-btn.is-active .ddf-sw-circle { transform: scale(1.12); box-shadow: 0 0 0 2.5px #fff, 0 0 0 4px #1a1a1a; }
.ddf-sw-label { font-size: 12px; font-weight: 400; letter-spacing: 0.02em; white-space: nowrap; }
.ddf-active-swatch-name { font-size: 11px; color: #a09880; letter-spacing: 0.06em; min-height: 16px; margin: 0 0 24px; }

.ddf-info-dims { margin-bottom: 20px; overflow-x: auto; }
.ddf-info-dims table { width: 100%; border-collapse: collapse; }
.ddf-info-dims thead tr { border-bottom: 1px solid #e8e4dc; }
.ddf-info-dims th { text-align: left; padding: 5px 10px 8px; font-size: 9.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.14em; color: #a09880; }
.ddf-info-dims td { padding: 9px 10px; border-bottom: 1px solid #f0ece5; font-size: 12.5px; color: #3a3830; }
.ddf-info-dims tr td:first-child { font-weight: 600; color: #1a1a1a; }

.ddf-info-custom-table { margin-bottom: 20px; overflow-x: auto; }
.ddf-info-custom-table table { width: 100%; border-collapse: collapse; }
.ddf-info-custom-table th, .ddf-info-custom-table td { padding: 8px 10px; border: 1px solid #ebe7e0; font-size: 12px; }
.ddf-info-custom-table th { background: #f4f1ec; font-weight: 600; font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.1em; color: #a09880; }

.ddf-info-secnav { border-top: 1px solid #e8e4dc; margin-bottom: 20px; }
.ddf-secnav-item { display: flex; align-items: center; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid #e8e4dc; text-decoration: none; color: #3a3830; font-size: 12.5px; font-weight: 400; cursor: pointer; transition: color 0.16s, padding-left 0.2s; }
.ddf-secnav-item:hover { color: #1a1a1a; padding-left: 5px; }
.ddf-secnav-item svg { width: 14px; height: 14px; color: #c0bcb4; flex-shrink: 0; }

.ddf-info-back { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: #a09880; text-decoration: none; margin-top: 6px; transition: color 0.18s, gap 0.2s; }
.ddf-info-back:hover { color: #1a1a1a; gap: 10px; }
.ddf-info-back svg { width: 13px; height: 13px; }

/* Detail page responsive */
@media (max-width: 1100px) {
    #ddf-info-panel { padding: 44px 36px 44px 44px; }
    .ddf-info-title { font-size: 28px; }
}
@media (max-width: 820px) {
    #ddf-hero { flex-direction: column; height: auto; max-height: none; }
    #ddf-hero-slider { width: 100%; height: 75vw; min-height: 300px; max-height: 520px; }
    #ddf-info-panel { padding: 36px 28px 48px; }
    #ddf-info-panel::before { display: none; }
    .ddf-info-title { font-size: 26px; }
    .ddf-thumb-btn { width: 56px; height: 56px; }
}
@media (max-width: 480px) {
    #ddf-info-panel { padding: 28px 18px 40px; }
    .ddf-info-title { font-size: 22px; }
    .ddf-thumb-btn { width: 48px; height: 48px; border-radius: 7px; }
    #ddf-thumb-strip { padding: 12px 14px 14px; gap: 8px; }
}

/* ── Sections below hero ── */
#ddf-sections { max-width: 1600px; margin: 0 auto; padding: 0 48px 100px; }
@media (max-width: 640px) { #ddf-sections { padding: 0 20px 64px; } }

.ddf-section-block { padding: 48px 0; border-bottom: 1px solid #f0ede8; scroll-margin-top: 100px; }
.ddf-section-block-title { font-size: 20px; font-weight: 600; color: #0f1117; letter-spacing: -0.02em; margin: 0 0 20px; padding-bottom: 12px; border-bottom: 1.5px solid #f0ede8; }
.ddf-sec-highlight { background: #f5f8ff; border-radius: 8px; padding: 32px; }

/* ── Drawer close button (mobile X) ── */
#ddf-wrapper .ddf-drawer-close {
  display: none;  /* hidden on desktop */
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink-700);
  font-size: 14px; font-weight: 700;
  align-items: center; justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--line-mid);
  transition: background var(--t-fast);
  margin-left: auto;
}
#ddf-wrapper .ddf-drawer-close:hover { background: var(--surface-3); }

@media (max-width: 900px) {
  /* Show close button in mobile drawer */
  #ddf-wrapper .ddf-drawer-close { display: flex; }

  /* Mobile sidebar header layout:
     [N Results]  [✕ Reset]  [X close]
  */
  #ddf-wrapper .ddf-sidebar-header {
    flex-wrap: nowrap;
    gap: 8px;
  }
  #ddf-wrapper .ddf-result-count { 
    flex: 0 0 auto; 
    white-space: nowrap;
  }
  /* Reset button: always has space, push close to far right */
  #ddf-wrapper .ddf-reset-btn {
    flex: 1;
    max-width: 120px;
  }

  /* FIX: Ensure product grid doesn't overflow into footer */
  #ddf-wrapper #ddf-main {
    padding-bottom: 20px;
    /* Clip content to prevent spilling under footer */
    contain: layout;
  }

  /* FIX: Product grid align-content top so orphan cards don't stretch */
  #ddf-wrapper .ddf-product-grid {
    align-content: start;
    align-items: start;
  }
}
