/* ================================================================
   CLV SHOP — Clovia-style archive layout
================================================================ */

/* ── Shop wrapper ── */
/* .clv-shop { padding: 0 0 16px; } */
.clv-shop .woocommerce-breadcrumb { padding: 12px 0; font-size: 0.78rem; color: #888; }

/* ── Sort Bar ── */
.clv-sort-bar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
  border-top: 1px solid #eee; border-bottom: 1px solid #eee;
  padding: 10px 0;
  margin-bottom: 14px;
}
.clv-sort-bar__left  { display: flex; align-items: center; flex-wrap: wrap; gap: 0; }
.clv-sort-bar__right { display: flex; align-items: center; gap: 10px; }
.clv-sort-bar__label {
  font-size: 0.75rem; font-weight: 800; color: #444;
  margin-right: 14px; white-space: nowrap; text-transform: uppercase; letter-spacing: 0.3px;
}
.clv-sort-opt {
  font-size: 0.75rem; font-weight: 600; color: #666;
  text-decoration: none; text-transform: uppercase; letter-spacing: 0.2px;
  padding: 4px 10px; position: relative; white-space: nowrap;
  transition: color 0.15s;
}
.clv-sort-opt + .clv-sort-opt::before {
  content: ''; position: absolute; left: 0; top: 20%; height: 60%;
  width: 1px; background: #ddd;
}
.clv-sort-opt--active { color: var(--color-primary,#E91E8C); }
.clv-sort-opt--active::after {
  content: ''; position: absolute; bottom: -1px; left: 10px; right: 10px;
  height: 2px; background: var(--color-primary,#E91E8C); border-radius: 2px;
}
.clv-sort-opt:hover { color: var(--color-primary,#E91E8C); }

/* Filter buttons top-right */
.clv-filter-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--color-primary,#E91E8C); border: 1.5px solid var(--color-primary,#E91E8C);
  background: #fff; border-radius: 4px;
  padding: 6px 14px; cursor: pointer; transition: all 0.18s; white-space: nowrap;
}
.clv-filter-btn:hover { background: #fff0f8; }
.clv-filter-count {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--color-primary,#E91E8C); color: #fff;
  font-size: 0.65rem; font-weight: 800;
}

/* ── Sub-category pills ── */
.clv-subcat-scroll {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; margin-bottom: 16px;
}
.clv-subcat-scroll::-webkit-scrollbar { display: none; }
.clv-subcat-pills { display: flex; gap: 8px; white-space: nowrap; padding: 4px 0 8px; }
.clv-subcat-pill {
  display: inline-block; padding: 7px 18px;
  font-size: 0.8rem; font-weight: 600; color: #555;
  border: 1.5px solid #d0d0d0; border-radius: 50px;
  text-decoration: none; background: #fff; transition: all 0.18s; white-space: nowrap;
}
.clv-subcat-pill:hover { border-color: var(--color-primary,#E91E8C); color: var(--color-primary,#E91E8C); }
.clv-subcat-pill--active {
  background: var(--color-primary,#E91E8C); border-color: var(--color-primary,#E91E8C);
  color: #fff !important;
}

/* ── Active filter tags ── */
.clv-active-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.clv-active-tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: 50px;
  font-size: 0.75rem; font-weight: 600; color: #444;
  border: 1.5px solid #d0d0d0; background: #fafafa;
  text-decoration: none; transition: all 0.18s;
}
.clv-active-tag span { color: #aaa; font-size: 0.85rem; }
.clv-active-tag:hover { border-color: #E91E8C; color: #E91E8C; }
.clv-active-tag--clear {
  color: var(--color-primary,#E91E8C); border-color: var(--color-primary,#E91E8C);
  background: #fff0f8;
}

/* ── Result count ── */
.clv-result-info { font-size: 0.8rem; color: #888; margin-bottom: 14px; }

/* ── Product Grid ── */
.clv-products-grid.products {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 16px 12px !important;
  list-style: none !important;
  padding: 0 !important; margin: 0 !important;
}

/* Make WC <li> wrapper transparent */
.clv-products-grid.products > li {
  padding: 0 !important; margin: 0 !important;
}

/* ── Pagination ── */
.clv-pagination {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; margin-top: 28px;
}
.clv-load-more {
  padding: 12px 40px; border-radius: 50px;
  border: 2px solid var(--color-primary,#E91E8C);
  color: var(--color-primary,#E91E8C); background: #fff;
  font-size: 0.85rem; font-weight: 800; letter-spacing: 0.4px;
  cursor: pointer; transition: all 0.2s;
}
.clv-load-more:hover { background: var(--color-primary,#E91E8C); color: #fff; }
.clv-load-more.loading { opacity: 0.6; cursor: wait; }

/* WC pagination styling */
.clv-pagination .woocommerce-pagination { display: none; } /* hide if load-more visible */

/* ── No products ── */
.clv-no-products {
  text-align: center; padding: 60px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.clv-no-products p { color: #aaa; font-size: 0.9rem; }
.clv-btn-primary {
  display: inline-block; padding: 11px 28px;
  background: var(--color-primary,#E91E8C); color: #fff !important;
  border-radius: 50px; font-size: 0.85rem; font-weight: 700;
  text-decoration: none; transition: background 0.2s;
}
.clv-btn-primary:hover { background: var(--color-primary-dark,#c2177a); }

/* Loading state */
#products-grid.is-loading { opacity: 0.5; pointer-events: none; transition: opacity 0.2s; }

/* ================================================================
   FILTER MODAL
================================================================ */
.clv-filter-modal {
  position: fixed; inset: 0; z-index: 999999; /* above the fixed site header */
  display: flex; align-items: center; justify-content: center;
}
/* Clovia-style header / count elements (base) */
.clv-filter-modal__back {
  display: inline-flex; align-items: center; gap: 8px;
  background: none; border: none; cursor: pointer; padding: 0;
  font-size: 17px; font-weight: 700; color: #1a1a1a; font-family: 'Poppins', sans-serif;
}
.clv-filter-modal__clearall {
  background: none; border: none; cursor: pointer; padding: 0;
  color: #2bb3c0; font-size: 15px; font-weight: 600; font-family: 'Poppins', sans-serif;
}
.clv-filter-modal__count {
  display: none;
  padding: 14px 20px; font-size: 15px; font-weight: 600; color: #222;
  font-family: 'Poppins', sans-serif; border-top: 1px solid #f0f0f0;
}
.clv-filter-modal[hidden] { display: none; }
.clv-filter-modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.5); }

.clv-filter-modal__panel {
  position: relative; z-index: 1;
  background: #fff;
  width: 90%; max-width: 780px;
  border-radius: 4px;
  display: flex; flex-direction: column;
  max-height: 85vh;
  box-shadow: 0 8px 40px rgba(0,0,0,0.2);
  animation: clvModalIn 0.2s ease;
}
@keyframes clvModalIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to   { opacity: 1; transform: scale(1)  translateY(0); }
}

/* Header */
.clv-filter-modal__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px; border-bottom: 1px solid #eee;
  flex-shrink: 0;
}
.clv-filter-modal__head h3 { font-size: 0.95rem; font-weight: 800; margin: 0; color: #222; }
.clv-filter-modal__close {
  width: 28px; height: 28px; border-radius: 50%;
  border: none; background: #f0f0f0; color: #666;
  font-size: 1.1rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.clv-filter-modal__close:hover { background: #ffe0ef; color: var(--color-primary,#E91E8C); }

/* Body: left nav + right panes */
.clv-filter-modal__body {
  display: flex; flex: 1; min-height: 0; overflow: hidden;
}

/* Left nav */
.clv-filter-nav {
  width: 160px; flex-shrink: 0;
  border-right: 1px solid #eee;
  overflow-y: auto; background: #fafafa;
}
.clv-filter-nav__item {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 14px 18px;
  font-size: 0.8rem; font-weight: 700; color: #666;
  text-transform: uppercase; letter-spacing: 0.4px;
  background: none; border: none; text-align: left;
  cursor: pointer; transition: all 0.15s;
  border-bottom: 1px solid #f0f0f0;
  position: relative;
}
.clv-filter-nav__item:hover { color: var(--color-primary,#E91E8C); background: #fff; }
.clv-filter-nav__item--active {
  color: var(--color-primary,#E91E8C); background: #fff;
  font-weight: 800;
}
.clv-filter-nav__item--active::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--color-primary,#E91E8C); border-radius: 0 2px 2px 0;
}
.clv-filter-nav__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--color-primary,#E91E8C); flex-shrink: 0;
}

/* Right panes */
.clv-filter-panes { flex: 1; overflow-y: auto; padding: 18px 20px; }
.clv-filter-pane  { display: none; }
.clv-filter-pane--active { display: block; }

/* Filter pills */
.clv-filter-pills {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.clv-filter-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 16px; border-radius: 50px;
  font-size: 0.78rem; font-weight: 600; color: #555;
  border: 1.5px solid #d0d0d0; background: #fff;
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.clv-filter-pill:hover { border-color: var(--color-primary,#E91E8C); color: var(--color-primary,#E91E8C); }
.clv-filter-pill--active {
  background: #fff0f8; border-color: var(--color-primary,#E91E8C);
  color: var(--color-primary,#E91E8C); font-weight: 700;
}
.clv-filter-pill__count { color: #bbb; font-size: 0.72rem; font-weight: 500; }
.clv-filter-pill--active .clv-filter-pill__count { color: #f48fb1; }

/* Color pills */
.clv-filter-pill--color { padding: 6px 14px; }
.clv-color-swatch {
  width: 14px; height: 14px; border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.12); flex-shrink: 0;
}

/* Price range */
.clv-price-range__row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.clv-price-range__field { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 120px; }
.clv-price-range__field label { font-size: 0.72rem; font-weight: 700; color: #888; text-transform: uppercase; }
.clv-price-range__field input {
  border: 1.5px solid #e0e0e0; border-radius: 8px; padding: 9px 12px;
  font-size: 0.85rem; color: #333; outline: none; transition: border-color 0.2s;
}
.clv-price-range__field input:focus { border-color: var(--color-primary,#E91E8C); }
.clv-price-range__sep { color: #bbb; font-size: 1.1rem; margin-top: 20px; }

/* Footer */
.clv-filter-modal__foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 14px 20px; border-top: 1px solid #eee;
  flex-shrink: 0;
}
.clv-filter-foot__clear {
  margin-right: auto; font-size: 0.82rem; font-weight: 700;
  color: var(--color-primary,#E91E8C); background: none; border: none;
  cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}
.clv-filter-foot__cancel,
.clv-filter-foot__apply {
  padding: 10px 28px; border-radius: 4px;
  font-size: 0.82rem; font-weight: 800; letter-spacing: 0.4px;
  cursor: pointer; transition: all 0.18s;
}
.clv-filter-foot__cancel {
  border: 1.5px solid #d0d0d0; background: #fff; color: #555;
}
.clv-filter-foot__cancel:hover { background: #f5f5f5; }
.clv-filter-foot__apply {
  border: none; background: var(--color-primary,#E91E8C); color: #fff;
}
.clv-filter-foot__apply:hover { background: var(--color-primary-dark,#c2177a); }

/* ── Responsive ── */
@media (max-width: 1023px) {
  .clv-products-grid.products { grid-template-columns: repeat(3,1fr) !important; }
}
@media (max-width: 767px) {
  .clv-sort-bar { gap: 6px; }
  .clv-sort-bar__left { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; flex-wrap: nowrap; }
  .clv-sort-bar__left::-webkit-scrollbar { display: none; }
  .clv-sort-bar__label { display: none; }
  .clv-sort-opt { font-size: 0.7rem; padding: 4px 8px; }

  /* Hide entire sort bar (DEFAULT/LOW-HIGH/HIGH-LOW/NEW ARRIVALS) + SIZE/FILTERS on mobile */
  .clv-sort-bar,
  .clv-sort-bar__left,
  .clv-sort-bar__right,
  .clv-filter-btn,
  .clv-filter-btn--size,
  .clv-filter-btn--main { display: none !important; }
  .clv-products-grid.products { grid-template-columns: repeat(2,1fr) !important; gap: 10px 8px !important; }

  /* ── Filter modal: FULL-SCREEN Clovia look on mobile ── */
  .clv-filter-modal {
    align-items: stretch !important;
    justify-content: stretch !important;
    padding: 0 !important;
  }
  .clv-filter-modal__backdrop { display: none; }
  .clv-filter-modal__panel {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    margin: 0 !important;
    position: relative !important;
    top: auto !important; bottom: auto !important;
    box-shadow: none !important;
    animation: none !important;
  }

  /* Header: ‹ Filter by .......... Clear All */
  .clv-filter-modal__head { padding: 16px 18px !important; border-bottom: 1px solid #ececec !important; }
  .clv-filter-modal__back span { font-size: 17px; }

  /* Left nav — cream bg, white active, title-case */
  .clv-filter-nav { width: 150px !important; background: #faf3f1 !important; border-right: none !important; }
  .clv-filter-nav__item {
    text-transform: none !important; letter-spacing: 0 !important;
    font-size: 15px !important; font-weight: 500 !important; color: #555 !important;
    padding: 16px 16px !important; border-bottom: none !important; background: transparent !important;
  }
  .clv-filter-nav__item--active { background: #fff !important; color: #1a1a1a !important; font-weight: 600 !important; }
  .clv-filter-nav__item--active::before { display: none; }

  /* Right panes */
  .clv-filter-panes { padding: 8px 18px 18px !important; }

  /* Options as CHECKBOX ROWS (only real filter pills, not price presets) */
  #clv-pane-size .clv-filter-pills,
  #clv-pane-color .clv-filter-pills,
  #clv-pane-style .clv-filter-pills,
  #clv-pane-fabric .clv-filter-pills,
  #clv-pane-offers .clv-filter-pills {
    flex-direction: column !important; flex-wrap: nowrap !important; gap: 0 !important;
  }
  .clv-filter-pill[data-filter] {
    width: 100% !important;
    display: flex !important; align-items: center !important; gap: 14px !important;
    padding: 15px 2px !important;
    border: none !important; border-bottom: 1px solid #f0f0f0 !important; border-radius: 0 !important;
    background: none !important;
    font-size: 15px !important; font-weight: 500 !important; color: #222 !important;
    white-space: normal !important; text-align: left !important;
  }
  .clv-filter-pill[data-filter]::before {
    content: ''; width: 22px; height: 22px; flex-shrink: 0;
    border: 1.8px solid #cfcfcf; border-radius: 5px; background: #fff; transition: all .15s;
  }
  .clv-filter-pill[data-filter].clv-filter-pill--active { background: none !important; color: #1a1a1a !important; font-weight: 600 !important; }
  .clv-filter-pill[data-filter].clv-filter-pill--active::before {
    border-color: var(--color-primary, #E91E8C);
    background: var(--color-primary, #E91E8C)
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E")
      center / 14px no-repeat;
  }
  .clv-filter-pill[data-filter] .clv-filter-pill__count { margin-left: auto !important; color: #aaa !important; font-size: 14px !important; font-weight: 400 !important; }
  .clv-filter-pill[data-filter].clv-filter-pill--active .clv-filter-pill__count { color: #aaa !important; }
  .clv-filter-pill--color .clv-color-swatch { width: 16px; height: 16px; }

  /* Products available line */
  .clv-filter-modal__count { display: block !important; }

  /* Footer: CLOSE (outline) + Apply (pink) full-width */
  .clv-filter-modal__foot {
    justify-content: stretch !important; gap: 0 !important; padding: 0 !important;
    border-top: 1px solid #ececec !important;
  }
  .clv-filter-foot__cancel,
  .clv-filter-foot__apply {
    flex: 1 !important; border-radius: 0 !important; padding: 18px 0 !important;
    font-size: 16px !important; font-weight: 700 !important; letter-spacing: 0.5px !important;
  }
  .clv-filter-foot__cancel { border: none !important; border-right: 1px solid #ececec !important; background: #fff !important; color: #555 !important; }
  .clv-filter-foot__apply  { background: var(--color-primary, #E91E8C) !important; color: #fff !important; }
}

/* ════════════════════════════════════════════════════════════
   MOBILE BOTTOM BAR — Sort | Filter  (Clovia-style)
   ════════════════════════════════════════════════════════════ */
.clv-mobile-bar { display: none; }
.clv-sort-sheet { display: none; }

@media (max-width: 767px) {
  /* Bottom Sort | Filter bar — replaces the theme bottom-nav on listing pages */
  .post-type-archive-product .bottom-nav,
  .tax-product_cat .bottom-nav,
  .post-type-archive-product #bottom-nav,
  .tax-product_cat #bottom-nav { display: none !important; }

  .clv-mobile-bar {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 9000;
    background: #fff;
    border-top: 1px solid #ececec;
    box-shadow: 0 -2px 12px rgba(0,0,0,.06);
    height: 56px;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .clv-mobile-bar__btn {
    flex: 1;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background: none; border: none; cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 15px; font-weight: 600; color: #222;
    position: relative;
  }
  .clv-mobile-bar__btn svg { color: var(--color-primary, #E91E8C); }
  .clv-mobile-bar__sep { width: 1px; background: #ececec; margin: 10px 0; }
  .clv-mobile-bar__count {
    min-width: 18px; height: 18px; padding: 0 4px;
    background: var(--color-primary, #E91E8C); color: #fff;
    border-radius: 9px; font-size: 11px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
  }

  /* Give the grid clearance so the last row isn't hidden behind the bar */
  .post-type-archive-product .site-main,
  .tax-product_cat .site-main { padding-bottom: 0 !important; }

  /* ── Sort bottom-sheet ── */
  .clv-sort-sheet[hidden] { display: none; }
  .clv-sort-sheet {
    display: block;
    position: fixed; inset: 0; z-index: 9500;
  }
  .clv-sort-sheet__backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.45);
    animation: clvSortFade .2s ease-out;
  }
  @keyframes clvSortFade { from { opacity: 0; } to { opacity: 1; } }
  .clv-sort-sheet__panel {
    position: absolute; left: 0; right: 0; bottom: 0;
    background: #fff;
    border-radius: 16px 16px 0 0;
    max-height: 80vh; overflow-y: auto;
    animation: clvSortSlide .3s cubic-bezier(.16,1,.3,1);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  @keyframes clvSortSlide { from { transform: translateY(100%); } to { transform: translateY(0); } }
  .clv-sort-sheet__head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 18px 14px;
    border-bottom: 1px solid #f0f0f0;
  }
  .clv-sort-sheet__head h3 {
    margin: 0; font-size: 18px; font-weight: 700; color: #1a1a1a;
    font-family: 'Poppins', sans-serif;
  }
  .clv-sort-sheet__close {
    background: none; border: none; cursor: pointer; padding: 2px; color: #222;
    display: flex; align-items: center;
  }
  .clv-sort-sheet__list { padding: 4px 0 8px; }
  .clv-sort-sheet__opt {
    display: flex; align-items: center; gap: 14px;
    padding: 16px 20px;
    text-decoration: none; color: #333;
    border-bottom: 1px solid #f3f3f3;
    font-family: 'Poppins', sans-serif;
  }
  .clv-sort-sheet__opt:last-child { border-bottom: none; }
  .clv-sort-sheet__opt-icon {
    width: 24px; display: flex; align-items: center; justify-content: center;
    color: #777; flex-shrink: 0;
  }
  .clv-sort-sheet__opt-label { flex: 1; font-size: 16px; font-weight: 500; }
  .clv-sort-sheet__opt--active .clv-sort-sheet__opt-label { color: var(--color-primary, #E91E8C); font-weight: 600; }
  .clv-sort-sheet__check { color: var(--color-primary, #E91E8C); flex-shrink: 0; }
  .clv-sort-sheet__badge {
    background: #2bb3c0; color: #fff;
    font-size: 10px; font-weight: 700; text-transform: lowercase;
    padding: 2px 7px; border-radius: 3px;
  }
}

