/**
 * Luxury Jewelry Catalog — Catalog Layout
 *
 * Header bar, category navigation, search bar, filter panel,
 * product grid, and responsive layout rules.
 *
 * @package LuxuryJewelryCatalog
 * @since   1.0.0
 */

/* =========================================================================
   1. Header Bar (Logo + Category Nav)
   ========================================================================= */

.ljc-header {
  position: sticky;
  top: 0;
  z-index: var(--ljc-z-header);
  padding: var(--ljc-space-3) var(--ljc-space-4);
  margin-bottom: var(--ljc-space-5);
  border-radius: 0 0 var(--ljc-radius-lg) var(--ljc-radius-lg);
  display: flex;
  align-items: center;
  gap: var(--ljc-space-5);
  /* Glassmorphism applied via .ljc-glass class in markup */
}

.ljc-header__logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.ljc-header__logo img {
  max-height: 36px;
  width: auto;
  display: block;
}

.ljc-header__nav {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--ljc-space-1);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: var(--ljc-space-1) 0;
}

.ljc-header__nav::-webkit-scrollbar {
  display: none;
}

.ljc-header__nav-item {
  display: inline-flex;
  align-items: center;
  padding: var(--ljc-space-2) var(--ljc-space-3);
  border-radius: var(--ljc-radius-full);
  font-family: var(--ljc-font-body) !important;
  font-size: var(--ljc-type-caption) !important;
  font-weight: var(--ljc-weight-medium) !important;
  color: var(--ljc-text-secondary) !important;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color var(--ljc-transition-fast),
    color var(--ljc-transition-fast);
  border: none;
  background: transparent;
  min-height: 36px;
  text-decoration: none;
}

.ljc-header__nav-item:hover {
  color: var(--ljc-text-primary) !important;
  background-color: rgba(246, 238, 228, 0.6) !important;
}

.ljc-header__nav-item.is-active {
  color: var(--ljc-text-primary) !important;
  background-color: var(--ljc-blush-stone) !important;
  font-weight: var(--ljc-weight-semibold) !important;
}

/* =========================================================================
   2. Search & Filter Bar — Google pill with camera inside
   ========================================================================= */

.ljc-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  margin-bottom: 16px;
  box-sizing: border-box;
  width: 100%;
  position: relative;
}

/* ---- The pill ----------------------------------------------------------- */
.ljc-search {
  flex: 1 1 0%;
  min-width: 0;
  display: flex;
  align-items: center;           /* vertical centre — children set their own heights */
  height: 48px;
  background: #fff;
  border: 1.5px solid #e0d5c5;
  border-radius: 9999px;
  box-shadow: 0 1px 8px rgba(0,0,0,.08);
  transition: border-color .18s, box-shadow .18s;
  overflow: hidden;              /* clips children to pill corners */
  box-sizing: border-box;
}

.ljc-search:focus-within {
  border-color: var(--ljc-accent-primary, #d9b983);
  box-shadow: 0 1px 6px rgba(0,0,0,.07), 0 0 0 3px rgba(217,185,131,.18);
}

/* Magnifier icon */
.ljc-search__icon {
  flex-shrink: 0;
  flex-grow: 0;
  flex-basis: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 48px;                  /* match pill height */
  color: #9a9a9a;
  pointer-events: none;
}

/* Text field */
.ljc-search__input {
  flex-grow: 1;
  flex-shrink: 1;
  flex-basis: 0%;
  min-width: 0;
  height: 48px;                  /* explicit — match pill */
  border: none;
  background: transparent;
  outline: none;
  font-size: 15px;
  font-family: inherit;
  color: #222;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
}

.ljc-search__input::-webkit-search-cancel-button { display: none; }

.ljc-search__input::placeholder {
  color: #aaa;
}

/* Clear (×) button — shown only while text is typed */
.ljc-search__clear {
  flex: 0 0 auto;
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #9a9a9a;
  border-radius: 50%;
  transition: background .15s;
}

.ljc-search__clear:hover { background: #f5efe6; }
.ljc-search__clear.is-visible { display: flex; }

/* Hairline divider before camera */
.ljc-search__divider {
  flex-shrink: 0;
  flex-grow: 0;
  flex-basis: auto;
  width: 1px;
  height: 22px;
  background: #e0d5c5;
  margin: 0 2px;
  align-self: center;            /* keep it vertically centred */
}

/* Camera button — lives INSIDE the pill, flush to the right edge */
.ljc-search__camera {
  flex-shrink: 0;
  flex-grow: 0;
  flex-basis: 48px;              /* same as pill height */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;                  /* fills pill height so overflow:hidden clips it */
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;       /* theme overrides handled by higher specificity below */
  cursor: pointer;
  color: var(--ljc-accent-primary, #d9b983);
  border-radius: 0;              /* pill's overflow:hidden handles the rounding */
  transition: background .15s, color .15s;
  -webkit-appearance: none;
  appearance: none;
}

/* Use ID-level specificity trick to win over most themes without !important */
.ljc-search .ljc-search__camera {
  background: transparent;
}

.ljc-search .ljc-search__camera:hover {
  background: rgba(217, 185, 131, 0.14);
}

.ljc-search .ljc-search__camera.is-active,
.ljc-search .ljc-search__camera.is-active:hover {
  background: var(--ljc-accent-primary, #d9b983);
  color: #fff;
}

/* ---- Filter / Saved pill buttons (outside the search pill) ------------- */
.ljc-btn--icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 40px;
  width: auto !important; /* Prevent theme from forcing a square/circle */
  min-width: max-content; /* Ensure text fits */
  aspect-ratio: auto !important; /* Override theme circle shapes */
  padding: 0 14px;
  border-radius: 9999px;
  border: 1.5px solid #e0d5c5;
  background: #fff;
  color: #666;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  white-space: nowrap;
  transition: border-color .15s, background .15s, color .15s;
  box-sizing: border-box;
}

.ljc-btn--icon svg {
  flex-shrink: 0;
}

.ljc-btn--icon:hover,
.ljc-btn--icon.is-active {
  border-color: var(--ljc-accent-primary, #d9b983);
  color: #222;
}

.ljc-btn--icon.is-active {
  background: rgba(217,185,131,.10);
}

/* ---- Responsive: compress on narrow screens ---------------------------- */

/* Desktop: constrain the search pill to a reasonable max width */
@media (min-width: 1024px) {
  .ljc-toolbar {
    /* Keep full width but center the search pill area */
    max-width: 100%;
  }
  /* Don't limit input width – let the pill grow naturally */
  .ljc-search__input {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .ljc-toolbar { gap: 6px; padding: 0 12px; }
}

@media (max-width: 520px) {
  .ljc-toolbar { gap: 5px; padding: 0 10px; }
  .ljc-btn__label { display: none !important; }
  .ljc-btn--icon  { padding: 0 10px; min-width: 40px; }
  .ljc-search__input { font-size: 14px; }
  .ljc-search { height: 44px; }
  .ljc-search__camera { flex: 0 0 44px; width: 44px; height: 44px; }
  .ljc-search__icon { width: 38px; }
}

@media (max-width: 380px) {
  .ljc-toolbar { gap: 4px; padding: 0 8px; }
  .ljc-btn--icon { width: 36px; padding: 0; justify-content: center; }
  .ljc-search { height: 42px; }
  .ljc-search__camera { flex: 0 0 42px; width: 42px; height: 42px; }
}

/* Legacy: keep wishlist-toggle + filter-toggle in the row */
.ljc-wishlist-toggle,
.ljc-filter-toggle { flex-shrink: 0; }

/* =========================================================================
   2b. Inline Image-Search Panel
   ========================================================================= */

.ljc-img-search {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 380px;
  max-width: calc(100vw - 32px);
  z-index: 100;
  margin: 0;
  background: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(217, 185, 131, 0.3);
  border-radius: var(--ljc-radius-lg);
  padding: var(--ljc-space-5);
  box-shadow: 0 10px 40px rgba(58, 50, 44, 0.12);
  box-sizing: border-box;
  animation: ljc-slide-down .2s ease both;
}

@keyframes ljc-slide-down {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ljc-img-search[hidden] { display: none !important; }

/* The inner layout: dropzone + submit button side-by-side on desktop,
   stacked on mobile */
.ljc-img-search__inner {
  display: flex;
  align-items: center;
  gap: var(--ljc-space-4);
  flex-wrap: nowrap;
}

/* Close (×) button */
.ljc-img-search__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--ljc-text-secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}

.ljc-img-search__close:hover { background: #f5efe6; }

/* Dropzone */
.ljc-img-search__dropzone {
  flex: 1 1 200px;
  min-height: 90px;
  border: 2px dashed #e0d5c5;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color var(--ljc-transition-fast), background var(--ljc-transition-fast);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.ljc-img-search__dropzone:hover,
.ljc-img-search__dropzone.is-drag-over {
  border-color: var(--ljc-accent-primary, #d9b983);
  background: rgba(217,185,131,.05);
}

/* Hidden real file input covers the dropzone */
.ljc-img-search__file {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

/* Idle placeholder */
.ljc-img-search__idle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #aaa;
  font-size: 13px;
  text-align: center;
  pointer-events: none;
  padding: 8px;
}

.ljc-img-search__idle small { opacity: .7; font-size: 11px; }

/* Preview state */
.ljc-img-search__preview {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.ljc-img-search__preview[hidden] { display: none; }

.ljc-img-search__thumb {
  display: block;
  max-height: 80px;
  max-width: 140px;
  border-radius: 8px;
  object-fit: cover;
}

/* Remove-photo (×) badge */
.ljc-img-search__remove {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 22px;
  height: 22px;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

/* Submit button */
.ljc-img-search__submit {
  flex: 0 0 auto;
  white-space: nowrap;
}

.ljc-img-search__submit[hidden] { display: none; }

/* Status messages inside panel */
.ljc-img-search__loading,
.ljc-img-search__error {
  width: 100%;
  margin-top: 10px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ljc-img-search__error { color: #c0392b; }
.ljc-img-search__loading[hidden],
.ljc-img-search__error[hidden] { display: none; }

/* On very small screens, stack submit under dropzone */
@media (max-width: 480px) {
  .ljc-img-search__inner { flex-direction: column; align-items: stretch; }
  .ljc-img-search__submit { width: 100%; justify-content: center; }
  .ljc-img-search { margin: 0 12px 12px; }
}

/* =========================================================================
   2c. AI Loading / Result Banner
   ========================================================================= */

.ljc-ai-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  font-size: 13px;
  color: #888;
}

.ljc-ai-loading[hidden] { display: none; }

/* AI fallback banner — hidden from customer view */
.ljc-ai-banner {
  display: none !important;
}

.ljc-ai-banner[hidden] { display: none; }
.ljc-ai-banner__text { flex: 1; min-width: 0; }

.ljc-ai-banner__dismiss {
  border: none;
  background: transparent;
  cursor: pointer;
  text-decoration: underline;
  font-size: 12px;
  color: #888;
  white-space: nowrap;
}

/* =========================================================================
   2d. Spinner (shared)
   ========================================================================= */

.ljc-spinner {
  display: inline-block;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border: 2px solid #e0d5c5;
  border-top-color: var(--ljc-accent-primary, #d9b983);
  border-radius: 50%;
  animation: ljc-spin .7s linear infinite;
}

@keyframes ljc-spin { to { transform: rotate(360deg); } }
   3. Active Filters Summary
   ========================================================================= */

/* Active filter chips — hidden from customer view */
.ljc-active-filters {
  display: none !important;

  flex-wrap: wrap;
  display: none;
}

.ljc-active-filters.has-filters {
  display: flex;
}

.ljc-active-filters__tag {
  display: inline-flex;
  align-items: center;
  gap: var(--ljc-space-1);
  padding: var(--ljc-space-1) var(--ljc-space-3);
  border-radius: var(--ljc-radius-full);
  background-color: var(--ljc-blush-stone);
  font-size: var(--ljc-type-micro);
  color: var(--ljc-text-primary);
}

.ljc-active-filters__tag-remove {
  width: 16px;
  height: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--ljc-text-secondary);
  border-radius: var(--ljc-radius-full);
  padding: 0;
}

.ljc-active-filters__tag-remove:hover {
  color: var(--ljc-text-primary);
}

/* =========================================================================
   3b. AI Image Search Tags Row
   ========================================================================= */

/* AI detected tags row — hidden from customer view */
.ljc-ai-tags-row {
  display: none !important;
}

@keyframes ljc-tags-row-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* "✨ AI detected:" label */
.ljc-ai-tags-row__label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ljc-accent-primary);
  letter-spacing: 0.03em;
  white-space: nowrap;
  flex-shrink: 0;
}

/* pills container */
.ljc-ai-tags-row__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}

/* Individual tag pill */
.ljc-ai-tags-row__pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px 4px 12px;
  background: rgba(184,149,91,0.12);
  border: 1px solid rgba(184,149,91,0.4);
  border-radius: var(--ljc-radius-full);
  font-size: 13px;
  font-family: var(--ljc-font-body);
  color: var(--ljc-text-primary);
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s;
  animation: ljc-pill-in 0.2s ease both;
}

.ljc-ai-tags-row__pill:nth-child(1) { animation-delay: 0.05s; }
.ljc-ai-tags-row__pill:nth-child(2) { animation-delay: 0.10s; }
.ljc-ai-tags-row__pill:nth-child(3) { animation-delay: 0.15s; }
.ljc-ai-tags-row__pill:nth-child(4) { animation-delay: 0.20s; }
.ljc-ai-tags-row__pill:nth-child(5) { animation-delay: 0.25s; }

.ljc-ai-tags-row__pill:hover {
  background: rgba(184,149,91,0.22);
  border-color: rgba(184,149,91,0.65);
}

/* ✕ inside each pill */
.ljc-ai-tags-row__pill-remove {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  color: var(--ljc-text-secondary);
  opacity: 0.65;
  transition: opacity 0.15s, color 0.15s;
  line-height: 1;
  flex-shrink: 0;
}

.ljc-ai-tags-row__pill-remove:hover {
  opacity: 1;
  color: var(--ljc-accent-primary);
}

/* Clear-all ✕ button at the end of the row */
.ljc-ai-tags-row__clear {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  color: var(--ljc-text-secondary);
  opacity: 0.55;
  transition: opacity 0.15s, color 0.15s;
  flex-shrink: 0;
  margin-left: auto;
}

.ljc-ai-tags-row__clear:hover {
  opacity: 1;
  color: var(--ljc-text-primary);
}

/* =========================================================================
   4. Filter Panel — Desktop (Sidebar)
   ========================================================================= */

.ljc-filter-panel {
  position: fixed;
  /* top is controlled by JS via --ljc-drawer-top to sit below sticky site header + admin bar */
  top: var(--ljc-drawer-top, 0px);
  right: 0;
  bottom: 0;
  width: 340px;
  max-width: 90vw;
  z-index: var(--ljc-z-filter);
  padding: var(--ljc-space-6) var(--ljc-space-5);
  border-radius: var(--ljc-radius-xl) 0 0 var(--ljc-radius-xl);
  transform: translateX(100%);
  transition: transform var(--ljc-transition-slow);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--ljc-space-6);
  /* Glassmorphism via .ljc-glass class */
}

.ljc-filter-panel.is-open {
  transform: translateX(0);
}

.ljc-filter-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ljc-filter-panel__title {
  font-family: var(--ljc-font-display);
  font-size: var(--ljc-type-subheading);
  font-weight: var(--ljc-weight-regular);
  color: var(--ljc-text-primary);
}

.ljc-filter-panel__section {
  display: flex;
  flex-direction: column;
  gap: var(--ljc-space-3);
}

.ljc-filter-panel__section-title {
  font-size: var(--ljc-type-caption);
  font-weight: var(--ljc-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ljc-text-secondary);
}

.ljc-filter-panel__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ljc-space-2);
}

.ljc-filter-panel__actions {
  display: flex;
  gap: var(--ljc-space-3);
  margin-top: auto;
  padding-top: var(--ljc-space-4);
  border-top: 1px solid var(--ljc-hairline);
}

.ljc-filter-panel__actions .ljc-btn {
  flex: 1;
}

/* =========================================================================
   4b. Tag Filter (inside filter panel)
   ========================================================================= */

.ljc-filter-panel__section--tags {
  padding-top: var(--ljc-space-2);
}

.ljc-tag-filter-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--ljc-space-2);
}

.ljc-tag-filter__input {
  width: 100%;
  height: 40px;
  padding: 0 var(--ljc-space-3);
  border: 1.5px solid var(--ljc-hairline);
  border-radius: var(--ljc-radius-full);
  background: var(--ljc-bg-base);
  font-family: var(--ljc-font-body);
  font-size: var(--ljc-type-caption);
  color: var(--ljc-text-primary);
  transition: border-color 0.18s, box-shadow 0.18s;
  box-sizing: border-box;
  outline: none;
}

.ljc-tag-filter__input:focus {
  border-color: var(--ljc-accent-primary);
  box-shadow: 0 0 0 3px rgba(184, 149, 91, 0.15);
}

.ljc-tag-filter__input::placeholder {
  color: var(--ljc-text-tertiary, #b0a99a);
  font-style: italic;
}

/* Pills container — shown when AI image search auto-fills tags */
.ljc-tag-filter__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 0;
}

.ljc-tag-filter__pills:empty {
  display: none;
}

/* Individual AI-detected tag pill */
.ljc-tag-filter__pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, rgba(184,149,91,0.12), rgba(184,149,91,0.08));
  border: 1px solid rgba(184,149,91,0.35);
  border-radius: var(--ljc-radius-full);
  padding: 3px 10px 3px 10px;
  font-size: 12px;
  font-family: var(--ljc-font-body);
  color: var(--ljc-text-primary);
  animation: ljc-pill-in 0.2s ease;
}

@keyframes ljc-pill-in {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

.ljc-tag-filter__pill-remove {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  color: var(--ljc-text-secondary);
  opacity: 0.7;
  transition: opacity 0.15s;
  line-height: 1;
}

.ljc-tag-filter__pill-remove:hover {
  opacity: 1;
  color: var(--ljc-text-primary);
}

.ljc-tag-filter__hint {
  font-size: 11px;
  color: var(--ljc-text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* ✨ AI badge shown on the Tags section title when auto-filled */
.ljc-tag-filter__ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  color: var(--ljc-accent-primary);
  background: rgba(184,149,91,0.1);
  border: 1px solid rgba(184,149,91,0.25);
  border-radius: 100px;
  padding: 1px 7px;
  margin-left: 6px;
  letter-spacing: 0.03em;
  vertical-align: middle;
  animation: ljc-pill-in 0.25s ease;
}

/* =========================================================================
   5. Weight Range Slider
   ========================================================================= */

.ljc-range-slider {
  padding: var(--ljc-space-4) var(--ljc-space-1);
}

.ljc-range-slider__track {
  position: relative;
  height: 4px;
  background: var(--ljc-hairline);
  border-radius: 2px;
  margin: var(--ljc-space-4) 0;
}

.ljc-range-slider__fill {
  position: absolute;
  height: 100%;
  background: var(--ljc-accent-primary);
  border-radius: 2px;
}

.ljc-range-slider__input {
  position: absolute;
  width: 100%;
  height: 4px;
  top: 0;
  left: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  pointer-events: none;
  margin: 0;
}

.ljc-range-slider__input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ljc-bg-base);
  border: 2px solid var(--ljc-accent-primary);
  box-shadow: 0 2px 6px rgba(58, 50, 44, 0.12);
  cursor: pointer;
  pointer-events: auto;
  transition: box-shadow var(--ljc-transition-fast);
}

.ljc-range-slider__input::-webkit-slider-thumb:hover {
  box-shadow: 0 2px 10px rgba(217, 185, 131, 0.3);
}

.ljc-range-slider__input::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ljc-bg-base);
  border: 2px solid var(--ljc-accent-primary);
  box-shadow: 0 2px 6px rgba(58, 50, 44, 0.12);
  cursor: pointer;
  pointer-events: auto;
}

.ljc-range-slider__labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--ljc-font-mono);
  font-size: var(--ljc-type-micro);
  color: var(--ljc-text-secondary);
}

/* =========================================================================
   6. Product Grid
   ========================================================================= */

.ljc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--ljc-grid-gap, 16px);
  padding: 0 var(--ljc-space-4, 16px);
}

/* Responsive fallback columns (overridden by PHP inline style per admin settings) */
@media (min-width: 480px)  { .ljc-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px)  { .ljc-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .ljc-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1280px) { .ljc-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1920px) { .ljc-grid { grid-template-columns: repeat(4, 1fr); } }

/* =========================================================================
   7. Product Card
   ========================================================================= */

.ljc-card {
  position: relative;
  border-radius: var(--ljc-radius-lg);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.45) !important;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.7) !important;
  box-shadow: 0 4px 20px rgba(58, 50, 44, 0.02) !important;
  transition:
    transform var(--ljc-transition-base),
    background-color var(--ljc-transition-base),
    border-color var(--ljc-transition-base),
    box-shadow var(--ljc-transition-base);
  cursor: pointer;
}

.ljc-card:hover {
  transform: translateY(-6px);
  background: rgba(255, 255, 255, 0.8) !important;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-color: rgba(255, 255, 255, 0.95) !important;
  box-shadow: 0 16px 36px rgba(58, 50, 44, 0.09) !important;
}

.ljc-card__image-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background-color: var(--ljc-bg-warm);
}

.ljc-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--ljc-transition-slow);
}

.ljc-card__image-hover {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity var(--ljc-transition-base);
  z-index: 1;
}

@media (hover: hover) {
  .ljc-card:hover .ljc-card__image-hover {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ljc-card__image-hover {
    transition: none;
  }
}

.ljc-card:hover .ljc-card__image {
  transform: scale(1.04);
}

.ljc-card__seal {
  position: absolute;
  top: var(--ljc-space-3);
  right: var(--ljc-space-3);
  z-index: 3;
}

/* Touch-target compliant, glassmorphism backdropped wishlist button */
.ljc-card__wishlist {
  position: absolute !important;
  top: var(--ljc-space-3) !important;
  left: var(--ljc-space-3) !important;
  z-index: 3;
  width: 44px !important;
  height: 44px !important;
  border-radius: var(--ljc-radius-full) !important;
  background: rgba(255, 255, 255, 0.65) !important;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.8) !important;
  box-shadow: 0 4px 12px rgba(58, 50, 44, 0.08) !important;
  color: var(--ljc-text-secondary) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  min-height: 44px !important;
  min-width: 44px !important;
  transition: 
    background-color var(--ljc-transition-fast), 
    transform var(--ljc-transition-fast), 
    box-shadow var(--ljc-transition-fast) !important;
}

.ljc-card__wishlist:hover {
  background: rgba(255, 255, 255, 0.95) !important;
  box-shadow: 0 6px 16px rgba(58, 50, 44, 0.15) !important;
  transform: scale(1.05) !important;
}

.ljc-card__body {
  padding: var(--ljc-space-4);
  display: flex;
  flex-direction: column;
  gap: var(--ljc-space-2);
}

.ljc-catalog-wrapper .ljc-card__name {
  font-family: var(--ljc-font-display) !important; /* Fraunces */
  font-size: var(--ljc-type-body) !important;
  font-weight: var(--ljc-weight-regular) !important;
  text-transform: none !important; /* Title/Normal case, not uppercase */
  letter-spacing: normal !important;
  color: var(--ljc-text-primary) !important; /* Charcoal Espresso #3A322C */
  line-height: 1.4 !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.8em; /* Reserve space for exactly 2 lines to maintain alignment */
}

.ljc-card__meta {
  display: flex;
  align-items: center;
  gap: var(--ljc-space-2);
  flex-wrap: wrap;
  min-height: 20px;
}

.ljc-catalog-wrapper .ljc-card__weight {
  font-family: var(--ljc-font-body) !important; /* Manrope */
  font-size: var(--ljc-type-caption) !important;
  font-weight: var(--ljc-weight-medium) !important;
  color: var(--ljc-text-secondary) !important; /* Warm Grey #8A7F72 */
  letter-spacing: normal !important;
}

.ljc-catalog-wrapper .ljc-card__sku {
  font-family: var(--ljc-font-mono) !important;
  font-size: var(--ljc-type-micro) !important;
  font-weight: var(--ljc-weight-regular) !important;
  color: rgba(138, 127, 114, 0.6) !important;
  letter-spacing: 0.02em !important;
}

.ljc-card__sku::before {
  content: '·';
  margin-right: var(--ljc-space-2);
  color: var(--ljc-hairline);
}

.ljc-card__actions {
  padding: 0 var(--ljc-space-4) var(--ljc-space-4);
}

/* Premium Gold-filled Preview Button (consistent default state) */
.ljc-catalog-wrapper .ljc-card__preview-btn {
  width: 100% !important;
  font-family: var(--ljc-font-body) !important; /* Manrope */
  font-weight: var(--ljc-weight-semibold) !important;
  font-size: var(--ljc-type-caption) !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  background-color: var(--ljc-accent-primary) !important; /* Gold #D9B983 */
  color: #FFFFFF !important;
  border: 1px solid var(--ljc-accent-primary) !important;
  border-radius: var(--ljc-radius-full) !important;
  min-height: 44px !important;
  box-shadow: 0 4px 12px rgba(217, 185, 131, 0.22) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: var(--ljc-space-2) !important;
  transition: 
    background-color var(--ljc-transition-fast), 
    border-color var(--ljc-transition-fast), 
    box-shadow var(--ljc-transition-fast) !important;
}

.ljc-catalog-wrapper .ljc-card__preview-btn:hover {
  background-color: var(--ljc-accent-secondary) !important; /* Solid Gold hover #B79173 */
  border-color: var(--ljc-accent-secondary) !important;
  color: #FFFFFF !important;
  box-shadow: 0 6px 16px rgba(183, 145, 115, 0.35) !important;
}

/* =========================================================================
   8. Empty & Error States
   ========================================================================= */

.ljc-empty-state,
.ljc-error-state {
  text-align: center;
  padding: var(--ljc-space-10) var(--ljc-space-5);
  max-width: 400px;
  margin: 0 auto;
}

.ljc-empty-state__icon,
.ljc-error-state__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--ljc-space-5);
  color: var(--ljc-accent-primary);
  opacity: 0.5;
}

.ljc-empty-state__title,
.ljc-error-state__title {
  font-family: var(--ljc-font-display);
  font-size: var(--ljc-type-heading);
  font-weight: var(--ljc-weight-regular);
  color: var(--ljc-text-primary);
  margin-bottom: var(--ljc-space-3);
}

.ljc-empty-state__text,
.ljc-error-state__text {
  font-size: var(--ljc-type-body);
  color: var(--ljc-text-secondary);
  margin-bottom: var(--ljc-space-5);
  line-height: 1.6;
}

/* =========================================================================
   9. Result Count
   ========================================================================= */

.ljc-result-count {
  padding: 0 var(--ljc-space-4);
  margin-bottom: var(--ljc-space-3);
  font-size: var(--ljc-type-caption);
  color: var(--ljc-text-secondary);
}

/* =========================================================================
   10. Responsive — Mobile-first breakpoints
   ========================================================================= */

/* ---- Small Mobile (< 480px) -------------------------------------------- */
@media (max-width: 479px) {
  .ljc-header {
    padding: 10px 12px;
    gap: 10px;
    margin-bottom: 12px;
  }
  .ljc-header__logo img { max-height: 24px; }

  .ljc-toolbar {
    padding: 0 12px;
    gap: 6px;
    margin-bottom: 12px;
  }

  .ljc-search { height: 44px; }
  .ljc-search__icon { width: 36px; }
  .ljc-search__input { font-size: 14px; }
  .ljc-search__camera { flex: 0 0 42px; width: 42px; height: 44px; }

  .ljc-btn__label { display: none !important; }
  .ljc-btn--icon { padding: 0 10px; min-width: 38px; }

  .ljc-grid {
    padding: 0 10px;
    gap: 10px;
  }

  .ljc-card__body { padding: 8px 10px 10px; }
  .ljc-card__actions { padding: 0 10px 10px; }

  /* Image panel stacks on tiny screens */
  .ljc-img-search { margin: 0 10px 10px; padding: 14px; }
  .ljc-img-search__inner { flex-direction: column; align-items: stretch; }
  .ljc-img-search__submit { width: 100%; justify-content: center; }

  /* Filter panel = bottom sheet */
  .ljc-filter-panel {
    top: auto; right: 0; bottom: 0; left: 0;
    width: 100%; max-width: 100%; max-height: 88vh;
    border-radius: var(--ljc-radius-xl) var(--ljc-radius-xl) 0 0;
    transform: translateY(100%);
    padding-bottom: calc(var(--ljc-space-6) + env(safe-area-inset-bottom, 0px));
  }
  .ljc-filter-panel.is-open { transform: translateY(0); }
}

/* ---- Mobile (480px – 767px) -------------------------------------------- */
@media (min-width: 480px) and (max-width: 767px) {
  .ljc-header {
    padding: var(--ljc-space-2) var(--ljc-space-4);
    gap: var(--ljc-space-3);
    margin-bottom: 14px;
  }
  .ljc-header__logo img { max-height: 28px; }

  .ljc-toolbar { padding: 0 var(--ljc-space-4); gap: 8px; }

  .ljc-grid { padding: 0 var(--ljc-space-4); gap: var(--ljc-space-3); }

  .ljc-card__body { padding: var(--ljc-space-2) var(--ljc-space-3) var(--ljc-space-3); }
  .ljc-card__actions { padding: 0 var(--ljc-space-3) var(--ljc-space-3); }

  /* Filter panel = bottom sheet */
  .ljc-filter-panel {
    top: auto; right: 0; bottom: 0; left: 0;
    width: 100%; max-width: 100%; max-height: 85vh;
    border-radius: var(--ljc-radius-xl) var(--ljc-radius-xl) 0 0;
    transform: translateY(100%);
    padding-bottom: calc(var(--ljc-space-6) + env(safe-area-inset-bottom, 0px));
  }
  .ljc-filter-panel.is-open { transform: translateY(0); }

  /* Image panel: stack on small mobile */
  .ljc-img-search__inner { flex-direction: column; align-items: stretch; }
  .ljc-img-search__submit { width: 100%; justify-content: center; }
}

/* ---- All mobile (< 768px) common rules --------------------------------- */
@media (max-width: 767px) {
  .ljc-card__name { font-size: var(--ljc-type-caption) !important; }
}

/* ---- Tablet (768px – 1023px) ------------------------------------------- */
@media (min-width: 768px) and (max-width: 1023px) {
  .ljc-header {
    padding: var(--ljc-space-3) var(--ljc-space-5);
    margin-bottom: var(--ljc-space-4);
  }
  .ljc-toolbar { padding: 0 var(--ljc-space-5); }
  .ljc-grid { padding: 0 var(--ljc-space-5); gap: var(--ljc-space-4); }

  /* Filter panel stays as side drawer */
  .ljc-filter-panel {
    top: 0; right: 0; bottom: 0;
    width: 320px; max-width: 90vw;
    border-radius: var(--ljc-radius-xl) 0 0 var(--ljc-radius-xl);
    transform: translateX(100%);
  }
  .ljc-filter-panel.is-open { transform: translateX(0); }
}

/* ---- Small Desktop (1024px – 1279px) ----------------------------------- */
@media (min-width: 1024px) and (max-width: 1279px) {
  .ljc-header { padding: var(--ljc-space-3) var(--ljc-space-7); }
  .ljc-toolbar { padding: 0 var(--ljc-space-7); }
  .ljc-grid { padding: 0 var(--ljc-space-7); gap: var(--ljc-space-4); }
}

/* ---- Large Desktop (1280px+) ------------------------------------------- */
@media (min-width: 1280px) {
  .ljc-header {
    padding: var(--ljc-space-4) var(--ljc-space-8);
    border-radius: 0 0 var(--ljc-radius-xl) var(--ljc-radius-xl);
  }
  .ljc-toolbar { padding: 0 var(--ljc-space-8); }
  .ljc-grid { padding: 0 var(--ljc-space-8); gap: var(--ljc-space-5); }

  /* On large screens the input has comfortable width — no cap needed */
  .ljc-search__input { max-width: none; }
}

/* ---- XL Desktop (1440px+) ---------------------------------------------- */
@media (min-width: 1440px) {
  .ljc-catalog-wrapper {
    max-width: 1600px;
    margin: 0 auto;
  }
  .ljc-header { padding-left: calc((100vw - 1600px) / 2 + var(--ljc-space-8)); padding-right: calc((100vw - 1600px) / 2 + var(--ljc-space-8)); }
  .ljc-toolbar { padding-left: calc((100vw - 1600px) / 2 + var(--ljc-space-8)); padding-right: calc((100vw - 1600px) / 2 + var(--ljc-space-8)); }
  .ljc-grid { padding-left: calc((100vw - 1600px) / 2 + var(--ljc-space-8)); padding-right: calc((100vw - 1600px) / 2 + var(--ljc-space-8)); }
}

/* ---- 2K / 4K screens (1920px+) ----------------------------------------- */
@media (min-width: 1920px) {
  .ljc-catalog-wrapper {
    max-width: 1800px;
    margin: 0 auto;
  }
  .ljc-header,
  .ljc-toolbar,
  .ljc-grid {
    padding-left: var(--ljc-space-10, 64px);
    padding-right: var(--ljc-space-10, 64px);
  }
}

/* =========================================================================
   11. Scroll Sentinel (for IntersectionObserver)
   ========================================================================= */

.ljc-scroll-sentinel {
  height: 1px;
  width: 100%;
  visibility: hidden;
}
