/* ================================================================
   ARIALE — Listing Pages CSS
   NOTE: mobile-nav uses .open (not .active) to avoid conflict with main.css
   ================================================================ */

/* ----------------------------------------------------------------
   MEGA MENU
   ---------------------------------------------------------------- */
.nav-item-has-mega { position: static !important; }

.mega-menu {
  position: absolute;
  top: 100%; left: 0; right: 0;
  width: 100%;
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(232,228,224,0.6);
  box-shadow: 0 20px 60px rgba(0,0,0,0.08);
  padding: var(--space-8) 0 var(--space-6);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.3s var(--ease-out), visibility 0.3s, transform 0.3s var(--ease-out);
  z-index: 999;
}
.mega-menu::before {
  content: '';
  position: absolute;
  top: -20px; left: 0; right: 0;
  height: 20px;
}
.nav-item-has-mega:hover .mega-menu,
.nav-item-has-mega:focus-within .mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mega-menu-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-8);
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-7);
}

.mega-menu-heading {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.mega-icon { width: 18px; height: 18px; color: var(--color-accent); flex-shrink: 0; }

.mega-menu-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.mega-menu-col ul li a {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  transition: color 0.2s, padding-left 0.2s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.mega-menu-col ul li a:hover { color: var(--color-accent); padding-left: var(--space-2); }
.mega-menu-col ul li.mega-sub a { padding-left: var(--space-3); }
.mega-product-count { font-size: 0.7rem; color: var(--color-text-muted); opacity: 0.6; }

.mega-menu-promo {
  grid-column: 1 / -1;
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-5);
  margin-top: var(--space-2);
  font-size: 0.8rem;
  color: var(--color-text-muted);
}
.mega-menu-promo a { color: var(--color-accent); margin-left: var(--space-4); font-weight: 500; }

/* ----------------------------------------------------------------
   MOBILE NAV — .open class (different from main.css .active)
   ---------------------------------------------------------------- */
.mobile-nav.open { transform: translateX(0) !important; }
.mobile-nav-overlay.visible { opacity: 1 !important; visibility: visible !important; }

/* ================================================================
   ARIALE — Listing Pages CSS (continued)
   Styles for: shop.html, product-category pages, paginated pages
   Imports and extends main.css
   ================================================================ */

/* ----------------------------------------------------------------
   CUSTOM CURSOR
   ---------------------------------------------------------------- */
.custom-cursor {
  position: fixed; top: 0; left: 0;
  width: 12px; height: 12px;
  background: var(--color-accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  mix-blend-mode: difference;
  transition: width .35s var(--ease-out), height .35s var(--ease-out), opacity .3s;
  transform: translate(-50%, -50%);
  opacity: 0;
}
.custom-cursor.visible { opacity: 1; }
.custom-cursor.expand {
  width: 44px; height: 44px;
  background: rgba(200,149,108,0.2);
  mix-blend-mode: normal;
  border: 1.5px solid var(--color-accent);
}
@media (pointer: coarse) { .custom-cursor { display: none !important; } }

/* ----------------------------------------------------------------
   SCROLL PROGRESS BAR
   ---------------------------------------------------------------- */
.scroll-progress {
  position: fixed; top: 0; left: 0;
  width: 0%; height: 2px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-primary));
  z-index: 10001;
  transition: width 0.05s linear;
}

/* ----------------------------------------------------------------
   GLASSMORPHISM HEADER
   ---------------------------------------------------------------- */
.site-header {
  background: rgba(255,255,255,0.9) !important;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}
.site-header.scrolled {
  background: rgba(255,255,255,0.97) !important;
  box-shadow: 0 4px 30px rgba(0,0,0,0.07) !important;
}


/* ----------------------------------------------------------------
   LISTING HERO
   ---------------------------------------------------------------- */
.listing-hero {
  padding: 8rem var(--space-5) 2.5rem;
  background: var(--color-bg);
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}

.listing-hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 300;
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

.listing-subtitle {
  font-size: 1rem;
  color: var(--color-text-muted);
  max-width: 520px;
  margin: 0 auto var(--space-4);
  line-height: 1.7;
}

.result-count {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}

/* Breadcrumb */
.listing-breadcrumb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}
.listing-breadcrumb a {
  color: var(--color-text-muted);
  transition: color 0.2s;
}
.listing-breadcrumb a:hover { color: var(--color-accent); }
.bc-sep { opacity: 0.4; }
.bc-current { color: var(--color-text); font-weight: 500; }

/* ----------------------------------------------------------------
   SEARCH BAR (shop only)
   ---------------------------------------------------------------- */
.listing-search-wrap {
  max-width: 480px;
  margin: 0 auto var(--space-5);
  position: relative;
}
.listing-search-wrap svg {
  position: absolute;
  left: 1rem; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--color-text-muted);
  pointer-events: none;
}
#listing-search {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--color-text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
#listing-search:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(200,149,108,0.12);
}
#listing-search::placeholder { color: var(--color-text-muted); }

/* ----------------------------------------------------------------
   FILTERS SECTION
   ---------------------------------------------------------------- */
#listing-filters {
  position: sticky;
  top: var(--header-height);
  z-index: 90;
  background: rgba(250,248,245,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  padding: 0.875rem 0;
}

.filters-inner {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-wrap: wrap;
}

/* ----------------------------------------------------------------
   CUSTOM DROPDOWN
   ---------------------------------------------------------------- */
.listing-dropdown {
  position: relative;
}

.dd-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  user-select: none;
}
.dd-trigger:hover {
  border-color: var(--color-accent);
  background: #fff;
}
.listing-dropdown.active .dd-trigger {
  border-color: var(--color-accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(200,149,108,0.1);
}

.dd-arrow {
  width: 12px; height: 12px;
  color: var(--color-text-muted);
  transition: transform 0.25s, color 0.2s;
  flex-shrink: 0;
}
.listing-dropdown.active .dd-arrow {
  transform: rotate(180deg);
  color: var(--color-accent);
}

.dd-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 210px;
  max-width: 300px;
  width: max-content;
  background: rgba(255,255,255,0.99);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(232,228,224,0.8);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 40px rgba(0,0,0,0.10), 0 2px 8px rgba(0,0,0,0.04);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.97);
  transform-origin: top left;
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  z-index: 200;
  overflow: hidden;
}
.listing-dropdown.active .dd-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.dd-menu ul {
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
  max-height: 300px;
  overflow-y: auto;
}
.dd-menu ul::-webkit-scrollbar { width: 4px; }
.dd-menu ul::-webkit-scrollbar-track { background: transparent; }
.dd-menu ul::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 2px; }

.dd-menu ul li {
  padding: 0.55rem 1rem;
  font-size: 0.825rem;
  color: var(--color-text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  transition: background 0.15s, color 0.15s;
  white-space: normal;
  word-break: break-word;
}
.dd-menu ul li:hover { background: rgba(200,149,108,0.07); color: var(--color-accent); }
.dd-menu ul li.selected {
  background: rgba(200,149,108,0.1);
  color: var(--color-accent);
  font-weight: 600;
}
.dd-menu ul li.selected::after { content: '✓'; font-size: 0.75rem; }

.opt-count {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  font-weight: 400;
}

/* Separator line inside dropdown */
.dd-menu ul li.dd-separator {
  padding: 0;
  height: 1px;
  background: var(--color-border);
  pointer-events: none;
  cursor: default;
  margin: 0.25rem 0;
}

/* Price-only toggle */
.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text);
  transition: border-color 0.2s;
  white-space: nowrap;
  user-select: none;
}
.filter-toggle:hover { border-color: var(--color-accent); }
.filter-toggle input[type="checkbox"] {
  width: 14px; height: 14px;
  accent-color: var(--color-accent);
  cursor: pointer;
  flex-shrink: 0;
}
.filter-toggle.active { border-color: var(--color-accent); background: rgba(200,149,108,0.06); }

/* Filter results count */
.filters-result-count {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* ----------------------------------------------------------------
   ACTIVE FILTER TAGS
   ---------------------------------------------------------------- */
.active-filters-bar {
  padding: 0.625rem 0;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  min-height: 0;
  transition: min-height 0.2s;
}
.active-filters-bar:empty { display: none; }

.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  background: rgba(200,149,108,0.1);
  border: 1px solid rgba(200,149,108,0.3);
  border-radius: var(--radius-pill);
  font-size: 0.775rem;
  font-weight: 500;
  color: var(--color-accent);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.filter-tag:hover { background: rgba(200,149,108,0.2); }
.filter-tag svg { flex-shrink: 0; }

.filter-tag--clear {
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-text-muted);
}
.filter-tag--clear:hover { background: var(--color-bg); color: var(--color-text); }

/* ----------------------------------------------------------------
   PRODUCTS SECTION
   ---------------------------------------------------------------- */
.listing-products {
  padding: 2.5rem 0 5rem;
  background: var(--color-surface);
  min-height: 60vh;
}

/* No products message */
#no-products-msg {
  display: none;
  text-align: center;
  padding: 5rem 2rem;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg);
  margin-bottom: 2rem;
}
#no-products-msg svg { margin: 0 auto 1rem; display: block; color: var(--color-text-muted); }
#no-products-msg h4 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}
#no-products-msg p { color: var(--color-text-muted); font-size: 0.9rem; max-width: 360px; margin: 0 auto 1.5rem; }

/* ----------------------------------------------------------------
   PRODUCT CARD OVERRIDES (extends main.css)
   ---------------------------------------------------------------- */
.product-card {
  opacity: 0;
  transform: translateY(16px);
  animation: cardIn 0.5s var(--ease-out) forwards;
}
@keyframes cardIn { to { opacity: 1; transform: translateY(0); } }

.product-card-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.price-on-request {
  font-style: italic;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* ----------------------------------------------------------------
   PAGINATION
   ---------------------------------------------------------------- */
#pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.375rem;
  margin-top: 3.5rem;
  flex-wrap: wrap;
}

.page-btn {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  border-radius: 50%;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}
.page-btn:hover:not(:disabled) {
  background: var(--color-bg);
  border-color: var(--color-accent);
  color: var(--color-accent);
  transform: translateY(-1px);
}
.page-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(45,74,62,0.25);
}
.page-btn:disabled { opacity: 0.3; cursor: default; }
.page-btn--arrow { border-radius: 50%; }
.page-dots {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  color: var(--color-text-muted);
  font-size: 1rem;
}

/* ----------------------------------------------------------------
   SCROLL TO TOP
   ---------------------------------------------------------------- */
.scroll-to-top {
  position: fixed;
  bottom: 2rem; right: 2rem;
  width: 46px; height: 46px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(45,74,62,0.3);
  opacity: 0; visibility: hidden;
  transform: translateY(16px) scale(0.8);
  transition: all 0.35s var(--ease-out);
  z-index: 999;
  cursor: pointer;
}
.scroll-to-top.visible {
  opacity: 1; visibility: visible;
  transform: translateY(0) scale(1);
}
.scroll-to-top:hover {
  background: var(--color-accent);
  transform: translateY(-3px) scale(1.05);
}
.scroll-to-top svg { width: 20px; height: 20px; }

/* ----------------------------------------------------------------
   TOAST NOTIFICATION
   ---------------------------------------------------------------- */
.listing-toast {
  position: fixed;
  bottom: 5rem; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--color-primary);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-pill);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  z-index: 9999;
  white-space: nowrap;
}
.listing-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ----------------------------------------------------------------
   RESPONSIVE
   ---------------------------------------------------------------- */
@media (max-width: 767px) {
  .listing-hero { padding: 7rem var(--space-5) 2rem; }
  #listing-filters { top: 60px; }
  .filters-inner { gap: 0.5rem; }
  .dd-trigger { padding: 0.45rem 0.75rem; font-size: 0.775rem; }
  .filters-result-count { display: none; }
  .scroll-to-top { bottom: 1.25rem; right: 1.25rem; }
}

@media (max-width: 480px) {
  .filters-inner { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .filters-inner::-webkit-scrollbar { display: none; }
  .dd-menu { max-width: min(260px, 85vw); }
}

/* Prevent any dropdown from causing page horizontal scroll */
#listing-filters { overflow: visible; }
body { overflow-x: hidden; }
