/* ============================================
   SelfEvents — Listing Page Styles (port v1)
   Category hero, filters sidebar, subcat nav,
   widget, link cloud, history rail, view toggle
   ============================================ */

:root { --c-border: #E8DED4; }

/* --- Category Hero Banner --- */
.category-hero {
  position: relative;
  overflow: hidden;
}

.category-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(45, 41, 38, 0.7), rgba(45, 41, 38, 0.3));
}

/* --- Filters Sidebar --- */
.filter-section summary {
  cursor: pointer;
  list-style: none;
}

.filter-section summary::-webkit-details-marker {
  display: none;
}

.filter-section summary .chevron {
  transition: transform 0.25s ease;
}

.filter-section[open] summary .chevron {
  transform: rotate(180deg);
}

/* Color Swatch Filter */
.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.color-swatch:hover {
  transform: scale(1.15);
}

.color-swatch.selected {
  border-color: #2D2926;
  box-shadow: 0 0 0 2px #FFFAF5, 0 0 0 4px #2D2926;
}

/* Price Range Slider */
.range-slider {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: #E8DED4;
  outline: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #BA2257;
  cursor: pointer;
  border: 3px solid white;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s ease;
}

.range-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #BA2257;
  cursor: pointer;
  border: 3px solid white;
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* --- Grid View Modes --- */
.view-toggle-btn {
  padding: 6px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.view-toggle-btn.active {
  background-color: #2D2926;
  color: #FFFAF5;
}

/* Vizualizare listă: cardurile devin rânduri orizontale.
   Activă când wrapper-ul are clasa .is-list-view. */
.product-grid.is-list-view {
  grid-template-columns: 1fr !important;
  gap: 1rem;
}

@media (min-width: 640px) {
  .product-grid.is-list-view .product-card {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 1.25rem;
    align-items: center;
    border: 1px solid var(--c-border);
    border-radius: 0.9rem;
    padding: 0.9rem;
    background: #fff;
  }
  .product-grid.is-list-view .product-card .card-image {
    margin-bottom: 0;
  }
}

/* --- Active Filter Tags --- */
.filter-tag {
  transition: all 0.2s ease;
}

.filter-tag:hover {
  background-color: #BA2257;
  color: white;
  border-color: #BA2257;
}

/* --- Responsive: mobile slide-in sidebar --- */
@media (max-width: 1024px) {
  .filters-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 320px;
    max-width: 85vw;
    z-index: 150;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
  }

  .filters-sidebar.open {
    transform: translateX(0);
  }

  .filters-overlay {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .filters-overlay.open {
    opacity: 1;
    visibility: visible;
  }
}

/* ============================================
   SUBCATEGORII (navigație cu link-uri, SEO)
   ============================================ */
.subcat-nav {
  background: #fff;
  border: 1px solid var(--c-border, #E8DED4);
  border-radius: 14px;
  padding: 0.5rem 0.25rem 0.5rem;
  overflow: hidden;
}
.subcat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--c-border, #E8DED4);
  margin-bottom: 0.35rem;
}
.subcat-parent {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: #2D2926;
}
.subcat-total {
  font-size: 0.7rem;
  font-weight: 600;
  color: #BA2257;
  background: rgba(186, 34, 87, 0.08);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}
.subcat-list { list-style: none; margin: 0; padding: 0; }
.subcat-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
  color: #7A6F68;
  border-radius: 8px;
  transition: background 0.2s ease, color 0.2s ease;
}
.subcat-link:hover {
  background: rgba(186, 34, 87, 0.06);
  color: #BA2257;
}
.subcat-link .subcat-count {
  font-size: 0.72rem;
  color: #9E9490;
  flex-shrink: 0;
}
.subcat-link.is-active {
  color: #BA2257;
  font-weight: 600;
  background: rgba(186, 34, 87, 0.07);
}
.subcat-link.is-active .subcat-count { color: #BA2257; }

/* Subcat chips orizontale (varianta deasupra grid-ului, mobile-friendly) */
.subcat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.subcat-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: #7A6F68;
  background: #fff;
  border: 1px solid var(--c-border);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.subcat-chip:hover { color: #fff; background: #BA2257; border-color: #BA2257; }
.subcat-chip.is-active { color: #fff; background: #BA2257; border-color: #BA2257; }
.subcat-chip .chip-count { font-size: 0.7rem; opacity: 0.75; }

/* ============================================
   WIDGET SIDEBAR: Cele mai noi produse
   ============================================ */
.sidebar-widget {
  border-top: 1px solid var(--c-border, #E8DED4);
  padding-top: 1.5rem;
}
.widget-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: #2D2926;
  margin-bottom: 1rem;
}
.widget-products { list-style: none; margin: 0; padding: 0; }
.widget-product {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(232, 222, 212, 0.6);
}
.widget-products li:last-child .widget-product { border-bottom: none; }
.wp-thumb {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #F5EDE4;
}
.wp-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.widget-product:hover .wp-thumb img { transform: scale(1.08); }
.wp-meta { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.wp-name {
  font-size: 0.82rem;
  color: #2D2926;
  line-height: 1.25;
  transition: color 0.2s ease;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.widget-product:hover .wp-name { color: #BA2257; }
.wp-price { font-size: 0.8rem; font-weight: 600; color: #BA2257; }

/* ============================================
   LINKURI UTILE (internal linking cloud)
   ============================================ */
.useful-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 500;
  color: #2D2926;
  margin-bottom: 1.1rem;
}
.link-cloud { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.link-chip {
  display: inline-block;
  font-size: 0.78rem;
  color: #7A6F68;
  background: #fff;
  border: 1px solid var(--c-border, #E8DED4);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  transition: all 0.2s ease;
}
.link-chip:hover {
  color: #fff;
  background: #BA2257;
  border-color: #BA2257;
}
.link-chip.is-muted { color: #9E9490; }
.link-chip.is-muted:hover { color: #fff; background: #8F1842; border-color: #8F1842; }

/* ============================================
   ISTORIC DE NAVIGARE
   ============================================ */
.history-rail {
  display: flex;
  gap: 0.85rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.history-rail::-webkit-scrollbar { height: 4px; }
.history-rail::-webkit-scrollbar-thumb { background: #E8DED4; border-radius: 4px; }
.history-item {
  flex: 0 0 auto;
  width: 84px;
  height: 84px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--c-border, #E8DED4);
  background: #F5EDE4;
  scroll-snap-align: start;
  transition: border-color 0.2s ease;
}
.history-item:hover { border-color: #BA2257; }
.history-item img { width: 100%; height: 100%; object-fit: cover; }

/* ============================================
   PAGINATION (v1 style — butoane rotunde)
   ============================================ */
.pagination-nav { display: flex; align-items: center; justify-content: center; gap: 0.5rem; flex-wrap: wrap; }
.page-btn {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  border: 1px solid var(--c-border);
  color: #7A6F68;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
}
.page-btn:hover { border-color: #BA2257; color: #BA2257; }
.page-btn.is-active { background: #BA2257; border-color: #BA2257; color: #fff; }
.page-btn.is-disabled { opacity: 0.4; pointer-events: none; }
.page-dots { padding: 0 0.25rem; color: #9E9490; }
