/**
 * ComprasGuate Theme — Shop styles.
 * Loaded on the shop archive + product category archive pages.
 */

/* =========================
   SHOP BANNER (category header)
   ========================= */
.cg-shop-banner {
  background: linear-gradient(135deg, #DBEAFE 0%, #BFDBFE 100%);
  padding: 32px 32px;
  border-radius: var(--radius-lg);
  margin-top: 16px;
  margin-bottom: 16px;
}
.cg-shop-banner-tag {
  display: inline-block;
  background: var(--c-blue);
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.cg-shop-banner-title {
  font-size: 28px;
  font-weight: 900;
  color: var(--c-text);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.cg-shop-banner-desc {
  font-size: 14px;
  color: var(--c-text-muted);
  margin: 0;
  max-width: 720px;
  line-height: 1.55;
}
@media (max-width: 768px) {
  .cg-shop-banner { padding: 22px 18px; }
  .cg-shop-banner-title { font-size: 22px; }
}

/* =========================
   SHOP LAYOUT (sidebar + main)
   ========================= */
.cg-shop-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 1024px) {
  .cg-shop-layout { grid-template-columns: 1fr; }
}

/* =========================
   SHOP SIDEBAR (filters)
   ========================= */
.cg-shop-sidebar {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 18px;
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
}
@media (max-width: 1024px) {
  .cg-shop-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(420px, 92vw);
    max-width: 100vw;
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.12);
    border-radius: 0;
    overflow-y: auto;
    margin: 0;
  }
  .cg-shop-sidebar.is-open { transform: translateX(0); }
}

.cg-filter-group {
  border-bottom: 1px solid var(--c-border);
  padding-bottom: 14px;
  margin-bottom: 14px;
}
.cg-filter-group:last-of-type { border-bottom: 0; padding-bottom: 4px; }
.cg-filter-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 800;
  color: var(--c-text);
  margin: 0 0 10px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cg-filter-title-arrow {
  font-size: 11px;
  color: var(--c-text-muted);
  transition: transform 0.2s;
}
.cg-filter-group.is-collapsed .cg-filter-body { display: none; }
.cg-filter-group.is-collapsed .cg-filter-title-arrow { transform: rotate(-90deg); }

.cg-filter-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cg-filter-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--c-text);
  cursor: pointer;
}
.cg-filter-list li.subcat { padding-left: 18px; }
.cg-filter-list input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--c-blue);
  cursor: pointer;
}
.cg-filter-count {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--c-text-muted);
}
.cg-stars { color: #FBBF24; }

.cg-price-slider {
  padding: 4px 0;
}
.cg-price-slider-track {
  position: relative;
  height: 4px;
  background: var(--c-border);
  border-radius: 2px;
  margin-bottom: 14px;
}
.cg-price-slider-fill {
  position: absolute;
  top: 0;
  left: 18%;
  right: 26%;
  height: 100%;
  background: var(--c-blue);
  border-radius: 2px;
}
.cg-price-slider-handle {
  position: absolute;
  top: -6px;
  width: 16px;
  height: 16px;
  background: #fff;
  border: 2px solid var(--c-blue);
  border-radius: 50%;
  cursor: pointer;
}
.cg-price-slider-handle.left { left: 18%; transform: translateX(-50%); }
.cg-price-slider-handle.right { right: 26%; transform: translateX(50%); }
.cg-price-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
}
.cg-price-inputs input {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid var(--c-border);
  border-radius: 4px;
  font-size: 12.5px;
  font-family: inherit;
  text-align: center;
  min-width: 0;
}

.cg-filter-apply {
  width: 100%;
  padding: 10px;
  background: var(--c-blue);
  color: #fff;
  border: 0;
  border-radius: 4px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
}
.cg-filter-apply:hover { background: var(--c-blue-dark); }
.cg-filter-clear {
  display: block;
  text-align: center;
  margin-top: 8px;
  font-size: 12px;
  color: var(--c-text-muted);
  text-decoration: none;
}
.cg-filter-clear:hover { color: var(--c-blue); text-decoration: underline; }

/* Mobile filters head + apply bar */
.cg-mobile-filters-head {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--c-border);
  background: #FAFBFC;
  margin: -18px -18px 14px;
}
.cg-mobile-filters-apply-bar {
  display: none;
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  background: #fff;
  border-top: 1px solid var(--c-border);
  gap: 8px;
  margin: 14px -18px -18px;
}
@media (max-width: 1024px) {
  .cg-mobile-filters-head { display: flex; }
  .cg-mobile-filters-apply-bar { display: flex; }
}
.cg-mobile-filters-close {
  background: none;
  border: 0;
  font-size: 22px;
  color: var(--c-text-muted);
  cursor: pointer;
  font-weight: 600;
}

/* =========================
   SHOP TOOLBAR
   ========================= */
.cg-shop-toolbar {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}
.cg-shop-result-count {
  font-size: 13px;
  color: var(--c-text-muted);
}
.cg-shop-result-count strong { color: var(--c-text); font-weight: 700; }
.cg-shop-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cg-mobile-filters-btn {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--c-blue);
  color: #fff;
  border: 0;
  border-radius: 4px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.cg-mobile-filters-btn:hover { background: var(--c-blue-dark); }
@media (max-width: 1024px) { .cg-mobile-filters-btn { display: inline-flex; } }
.cg-sort-select {
  padding: 8px 12px;
  border: 1px solid var(--c-border);
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  cursor: pointer;
}

/* =========================
   PRODUCT GRID (shop-specific)
   ========================= */
.cg-shop-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
@media (max-width: 1280px) { .cg-shop-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 1024px) { .cg-shop-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  { .cg-shop-grid { grid-template-columns: repeat(2, 1fr); } }

/* Shop empty state (no products) */
.cg-shop-empty {
  background: var(--c-card);
  border: 1px dashed var(--c-border);
  border-radius: var(--radius-lg);
  padding: 60px 30px;
  text-align: center;
}
.cg-shop-empty-icon { font-size: 48px; margin-bottom: 14px; }
.cg-shop-empty h2 {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 8px;
  color: var(--c-text);
}
.cg-shop-empty p {
  font-size: 14px;
  color: var(--c-text-muted);
  margin: 0 0 18px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* =========================
   PAGINATION
   ========================= */
.cg-shop-pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 22px;
}
.cg-shop-pagination .page-numbers,
.cg-shop-pagination a,
.cg-shop-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--c-text);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.cg-shop-pagination a:hover {
  background: var(--c-blue);
  color: #fff;
  border-color: var(--c-blue);
}
.cg-shop-pagination .current,
.cg-shop-pagination .page-numbers.current {
  background: var(--c-blue);
  color: #fff;
  border-color: var(--c-blue);
}

/* Backdrop for the mobile filters drawer */
.cg-mobile-filters-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 9998;
}
.cg-mobile-filters-overlay.is-open { display: block; }
