/* ============================================
   JEWELL FILTER BAR — rebuilt from scratch
   Enqueued only on shop / product category / tag
   ============================================ */

.jewell-filter {
  position: sticky;
  top: var(--jewell-filter-top, 0px);
  z-index: 4000;
  background: var(--cgc-alabaster, #fffdf7);
  border-bottom: 1px solid var(--cgc-border, #eaeaea);
  margin-bottom: 40px;
  overflow: visible;
}

/* Top bar row */
.jewell-filter__bar {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 16px;
  padding: 14px 0;
}

.jewell-filter__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 3000;
  min-height: 40px;
  min-width: 110px;
  background: #fff;
  border: 1px solid var(--cgc-border, #eaeaea);
  border-radius: 8px;
  padding: 9px 16px;
  font-family: var(--font-sans, sans-serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cgc-obsidian, #111);
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.jewell-filter__toggle:hover,
.jewell-filter__toggle[aria-expanded="true"] {
  background: #fff; /* beat global button:hover gold bg (luxury-foundations.css) */
  border-color: var(--cgc-gold, #c8a24a);
  color: var(--cgc-gold, #c8a24a);
  transform: none; /* neutralize global button:hover lift */
}
.jewell-filter__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--cgc-gold, #c8a24a);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.jewell-filter__count[hidden] {
  display: none;
}
.jewell-filter__chevron {
  transition: transform 0.25s ease;
}
.jewell-filter__toggle[aria-expanded="true"] .jewell-filter__chevron {
  transform: rotate(180deg);
}

.jewell-filter__total {
  font-size: 13px;
  color: #8a8a8a;
}

.jewell-filter__sort {
  margin-left: auto;
  display: flex;
  justify-content: flex-end;
}
.jewell-filter__sort .woocommerce-ordering {
  margin: 0;
}
.jewell-filter__sort select.orderby {
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid var(--cgc-border, #eaeaea);
  border-radius: 8px;
  background: #fff
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23111' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E")
    no-repeat right 12px center;
  padding: 9px 32px 9px 14px;
  font-family: var(--font-sans, sans-serif);
  font-size: 13px;
  font-weight: 500;
  color: var(--cgc-obsidian, #111);
  cursor: pointer;
}
.jewell-filter__sort select.orderby:focus {
  outline: none;
  border-color: var(--cgc-gold, #c8a24a);
}

/* Active filter summary */
.jewell-filter__summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--cgc-border, #eaeaea);
}
.jewell-filter__summary[hidden] {
  display: none;
}
.jewell-filter__summary-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8a8a8a;
}
.jewell-filter__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.jewell-filter__clear-link {
  margin-left: auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--cgc-gold, #c8a24a);
  text-decoration: none;
  white-space: nowrap;
}
.jewell-filter__clear-link:hover {
  text-decoration: underline;
}

/* Chips */
.jewell-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--cgc-border, #eaeaea);
  background: #fff;
  color: var(--cgc-obsidian, #111);
  font-family: var(--font-sans, sans-serif);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}
.jewell-chip:hover {
  background: #fff; /* beat global button:hover gold bg */
  border-color: var(--cgc-gold, #c8a24a);
  color: var(--cgc-gold, #c8a24a);
  transform: none;
}
.jewell-chip.is-active,
.jewell-chip--active {
  background: var(--cgc-gold, #c8a24a);
  border-color: var(--cgc-gold, #c8a24a);
  color: #fff;
}

/* Backdrop */
.jewell-filter__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.45);
  z-index: 4000;
}
.jewell-filter__backdrop[hidden] {
  display: none;
}

/* Panel (desktop dropdown) */
.jewell-filter__panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 4001;
  background: #fff;
  border: 1px solid var(--cgc-border, #eaeaea);
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.14);
}
.jewell-filter__panel[hidden] {
  display: none;
}
.jewell-filter__panel:not([hidden]) {
  animation: jewellFilterIn 0.28s ease;
}
@keyframes jewellFilterIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Mobile drag handle */
.jewell-filter__handle {
  display: none;
  width: 100%;
  padding: 12px 0 4px;
  background: transparent;
  border: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.jewell-filter__handle span {
  display: block;
  width: 40px;
  height: 4px;
  background: #d9d9d9;
  border-radius: 2px;
  margin: 0 auto;
  transition: background 0.2s ease, width 0.2s ease;
}
.jewell-filter__handle:hover span {
  background: var(--cgc-gold, #c8a24a);
  width: 48px;
}

.jewell-filter__panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px 0;
}
.jewell-filter__panel-title {
  margin: 0;
  font-family: var(--font-serif, Georgia, serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.jewell-filter__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--cgc-obsidian, #111);
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.jewell-filter__close:hover {
  background: #f4f0e6;
  transform: none;
}

.jewell-filter__panel-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: 24px 40px 32px;
}

.jewell-filter__group-title {
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--cgc-border, #eaeaea);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.jewell-filter__presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.jewell-filter__price-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.jewell-filter__price-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #8a8a8a;
}
.jewell-filter__price-field input {
  width: 130px;
  padding: 10px 12px;
  border: 1px solid var(--cgc-border, #eaeaea);
  border-radius: 8px;
  font-size: 14px;
  color: var(--cgc-obsidian, #111);
}
.jewell-filter__price-field input:focus {
  outline: none;
  border-color: var(--cgc-gold, #c8a24a);
}
.jewell-filter__price-sep {
  padding-bottom: 12px;
  color: #8a8a8a;
}
.jewell-filter__price-go {
  padding: 11px 22px;
  border: none;
  border-radius: 8px;
  background: var(--cgc-obsidian, #111);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.jewell-filter__price-go:hover {
  background: var(--cgc-gold, #c8a24a);
  color: #fff;
  transform: none;
}

.jewell-filter__cats {
  list-style: none;
  margin: 0;
  padding: 0;
}
.jewell-filter__cats li + li {
  margin-top: 2px;
}
.jewell-filter__cats a {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--cgc-obsidian, #111);
  font-size: 14px;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.jewell-filter__cats a:hover,
.jewell-filter__cats a.is-active {
  background: rgba(200, 162, 74, 0.12);
  color: var(--cgc-gold, #c8a24a);
}

.jewell-filter__panel-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 40px 24px;
  border-top: 1px solid var(--cgc-border, #eaeaea);
}
.jewell-filter__clear-btn {
  padding: 10px 18px;
  border: 1px solid var(--cgc-border, #eaeaea);
  border-radius: 8px;
  background: #fff;
  font-family: var(--font-sans, sans-serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cgc-obsidian, #111);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.jewell-filter__clear-btn:hover {
  background: #fff; /* beat global button:hover gold bg */
  border-color: var(--cgc-gold, #c8a24a);
  color: var(--cgc-gold, #c8a24a);
  transform: none;
}
.jewell-filter__apply-btn {
  padding: 10px 26px;
  border: none;
  border-radius: 8px;
  background: var(--cgc-obsidian, #111);
  font-family: var(--font-sans, sans-serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.jewell-filter__apply-btn:hover {
  background: var(--cgc-gold, #c8a24a);
  color: #fff;
  transform: none;
}

/* Loading state */
.jewell-filter.is-loading .jewell-filter__total {
  opacity: 0.5;
}
.jewell-archive-loading ul.products {
  opacity: 0.45;
  transition: opacity 0.2s ease;
}

/* Tablets */
@media (max-width: 1024px) {
  .jewell-filter__panel-body {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}
@media (min-width: 768px) {
  .jewell-filter {
    top: var(--jewell-filter-top, 106px);
  }
}

/* Mobile: bottom sheet */
@media (max-width: 767px) {
  .jewell-filter {
    margin-bottom: 28px;
    top: var(--jewell-filter-top, 121px);
  }
  .jewell-filter__handle {
    display: flex;
  }
  .jewell-filter__bar {
    gap: 10px;
  }
  .jewell-filter__total {
    display: none;
  }
  .jewell-filter__toggle {
    padding: 8px 12px;
    font-size: 12px;
    flex-shrink: 0;
  }
  .jewell-filter__sort {
    flex: 1 1 auto;
    min-width: 0;
  }
  .jewell-filter__sort select.orderby {
    width: 100%;
    max-width: 180px;
    padding: 8px 28px 8px 10px;
    font-size: 12px;
  }
  .jewell-filter__panel {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.18);
  }
  .jewell-filter__panel:not([hidden]) {
    animation: jewellSheetIn 0.32s cubic-bezier(0.25, 1, 0.5, 1);
  }
  @keyframes jewellSheetIn {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }
  .jewell-filter__panel-head {
    padding: 18px 20px 0;
  }
  .jewell-filter__panel-body {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 20px 20px calc(24px + 110px);
  }
  .jewell-filter__panel-foot {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: 14px 20px 20px;
  }
  .jewell-filter__clear-link {
    margin-left: 0;
  }
}

@media (max-width: 360px) {
  .jewell-filter__bar {
    gap: 8px;
  }
  .jewell-filter__sort select.orderby {
    max-width: 132px;
    font-size: 11px;
    padding: 7px 24px 7px 10px;
  }
  .jewell-filter__toggle {
    padding: 7px 10px;
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .jewell-filter__panel:not([hidden]),
  .jewell-filter__chevron,
  .jewell-chip,
  .jewell-filter__toggle,
  .jewell-filter__apply-btn,
  .jewell-filter__clear-btn {
    animation: none !important;
    transition: none !important;
  }
}

/* Shop archives footer must stay full-bleed — FIX 2026-09-15 white-gap:
   parent theme gives .wp-site-blocks outer padding; footer inner must cancel
   it with negative margins (NOT margin:0, which leaves 40-70px light gutters).
   No 100vw (avoids scrollbar overflow). */
.woocommerce-shop .wp-site-blocks > footer,
.woocommerce-shop footer.wp-block-template-part,
.woocommerce-archive .wp-site-blocks > footer,
.woocommerce-archive footer.wp-block-template-part {
  max-width: none !important;
  width: 100% !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  background: #0f0f0f;
}
.woocommerce-shop .cgc-footer--v3.alignfull,
.woocommerce-archive .cgc-footer--v3.alignfull {
  width: auto !important;
  max-width: none !important;
  margin-left: calc(-1 * var(--wp--custom--spacing--outer, 1.25rem)) !important;
  margin-right: calc(-1 * var(--wp--custom--spacing--outer, 1.25rem)) !important;
  left: auto !important;
  transform: none !important;
}
/* FIX 2026-09-15: zero margins caused side white gaps once .wp-site-blocks
   was restored to full width + outer padding. Negative margins restore
   edge-to-edge. Doubled class keeps specificity (0,5,2) to beat old rules. */
body.woocommerce-shop footer.wp-block-template-part > .cgc-footer--v3.cgc-footer--v3.alignfull,
body.woocommerce-archive footer.wp-block-template-part > .cgc-footer--v3.cgc-footer--v3.alignfull {
  margin-left: calc(-1 * var(--wp--custom--spacing--outer, 1.25rem)) !important;
  margin-right: calc(-1 * var(--wp--custom--spacing--outer, 1.25rem)) !important;
  width: auto !important;
  max-width: none !important;
  left: auto !important;
  right: auto !important;
  transform: none !important;
  translate: none !important;
}
@media (max-width: 1024px) {
  .woocommerce-shop .cgc-footer--v3 .cgc-footer__main,
  .woocommerce-archive .cgc-footer--v3 .cgc-footer__main {
    justify-items: center !important;
    text-align: center !important;
  }
}

/* FIX 2026-09-15: sticky filter button — broken native WooCommerce price
   "Filter" button (gold outline ghost overlapping the black fill, unreadable
   label) + purple jQuery-UI slider leaking into the sheet next to
   "Price: ₹60 — ₹150" (see mobile screenshot). The Jewell sheet already
   filters price via presets + min/max + sticky APPLY, so any native
   WooCommerce price-filter remnants inside .jewell-filter are a redundant
   duplicate whose .button inherits the theme's global button styles
   (obsidian bg, gold hover, translateY lift) and breaks. Hide them. */
.jewell-filter .widget_price_filter,
.jewell-filter .price_slider_wrapper,
.jewell-filter .wc-block-components-price-slider,
.jewell-filter .wc-block-price-filter,
.jewell-filter [class*="price_slider"] {
  display: none !important;
}

/* Harden the sticky action footer so CLEAR ALL / APPLY reliably stick to
   the sheet bottom on mobile (incl. Safari) and scrolled content slides
   UNDER it instead of overlapping it. */
.jewell-filter__panel-foot {
  position: -webkit-sticky;
  position: sticky;
  bottom: 0;
  z-index: 5;
  background: #fff;
  border-top: 1px solid var(--cgc-border, #eaeaea);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.06);
  padding-bottom: max(20px, env(safe-area-inset-bottom));
}

/* Make the custom price form wrap-proof on narrow screens so its inputs +
   Go button can never overlap each other like the broken native button. */
.jewell-filter__price-form {
  min-width: 0;
}
.jewell-filter__price-field {
  flex: 1 1 110px;
  min-width: 0;
}
.jewell-filter__price-field input {
  width: 100%;
  max-width: 150px;
  box-sizing: border-box;
}
@media (max-width: 380px) {
  .jewell-filter__price-go {
    flex: 1 1 100%;
    width: 100%;
  }
}

/* Guard: if a native price-filter widget is ever placed on the shop page
   OUTSIDE the sheet, replace its float layout with flex so its button and
   label can never overlap. Beat WooCommerce + global button rules. */
.woocommerce-shop .widget_price_filter .price_slider_amount,
.woocommerce-archive .widget_price_filter .price_slider_amount {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  flex-wrap: wrap !important;
}
.woocommerce-shop .widget_price_filter .price_slider_amount .button,
.woocommerce-archive .widget_price_filter .price_slider_amount .button {
  float: none !important;
  transform: none !important;
  margin: 0 !important;
  flex-shrink: 0 !important;
}
.woocommerce-shop .widget_price_filter .price_label,
.woocommerce-archive .widget_price_filter .price_label {
  float: none !important;
  text-align: right !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
}
