/* ============================================================
   WINES PAGE — Filter bar, wine grid, cards, pagination, legal
   Updated for 8000+ wines with images
   ============================================================ */

/* ============================================================
   WINE HERO
   ============================================================ */
.wine-hero {
  background:
    radial-gradient(ellipse 50% 40% at 30% 60%, rgba(92, 26, 42, 0.35) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 70% 40%, rgba(58, 14, 27, 0.25) 0%, transparent 70%),
    var(--bg-deep);
}

/* ============================================================
   WINE CATALOG SECTION
   ============================================================ */
.wine-catalog {
  position: relative;
  padding-bottom: var(--section-pad);
}

.page-wines {
  --wines-nav-offset: 68px;
}

/* Force nav visibility on wines page to prevent disappearing header */
.page-wines .nav {
  transform: translateY(0) !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* ============================================================
   FILTER BAR — Sticky below nav
   ============================================================ */
.wine-filters {
  position: sticky;
  top: var(--wines-nav-offset);
  z-index: 90;
  background: #0d0508; /* solid background matching theme to cover scrolled elements */
  border-bottom: 1px solid rgba(212, 175, 55, 0.1);
  padding: 20px 0;
  transition: box-shadow 0.4s var(--ease);
}
.wine-filters.scrolled {
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.8);
}
.wine-filters-inner {
  width: var(--container);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Filter rows */
.filter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  width: 100%;
}
.filter-row-top {
  border-bottom: 1px solid rgba(212, 175, 55, 0.04);
  padding-bottom: 12px;
}
.filter-row-bottom {
  align-items: center;
}

/* Filter group */
.filter-group {
  display: flex;
  align-items: center;
  gap: 12px 14px;
  flex-wrap: wrap;
}
.filter-group-secondary {
  display: flex;
  align-items: center;
  gap: 12px 14px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

/* Filter pills */
.filter-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(26, 10, 15, 0.6);
  border: 1px solid rgba(212, 175, 55, 0.1);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.35s var(--ease);
  white-space: nowrap;
}
.filter-pill:hover {
  border-color: rgba(212, 175, 55, 0.35);
  color: var(--cream);
  background: rgba(92, 26, 42, 0.25);
}
.filter-pill.active {
  background: var(--gold);
  color: var(--bg-deep);
  border-color: var(--gold);
  font-weight: 600;
}
.filter-pill.active:hover {
  background: var(--gold-light);
  border-color: var(--gold-light);
}

/* Color dots in pills */
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-red { background: #8b2a40; }
.dot-white { background: #f5f0e1; }
.dot-sparkling { background: #d4af37; }
.dot-rose { background: #e8a0b0; }
.dot-orange { background: #d4874d; }

.filter-pill.active .dot-red { background: #3a0e1b; }
.filter-pill.active .dot-white { background: #5c4a2a; }
.filter-pill.active .dot-sparkling { background: #3a0e1b; }
.filter-pill.active .dot-rose { background: #5c1a2a; }
.filter-pill.active .dot-orange { background: #5c2a1a; }

/* Styled select dropdown */
.filter-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 8px 38px 8px 16px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: rgba(26, 10, 15, 0.6);
  border: 1px solid rgba(212, 175, 55, 0.1);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.35s var(--ease);
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23a89684' stroke-width='1.2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  min-width: 158px;
  flex: 0 0 auto;
}
.filter-select:hover {
  border-color: rgba(212, 175, 55, 0.35);
  color: var(--cream);
}
.filter-select:focus {
  border-color: var(--gold);
  color: var(--cream);
  outline: none;
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.15);
}
.filter-select option {
  background: var(--bg-card);
  color: var(--cream);
}

/* Search input */
.filter-search-wrap {
  position: relative;
  width: 100%;
  max-width: 320px;
}
.filter-search {
  width: 100%;
  padding: 8px 16px 8px 40px;
  font-size: 13px;
  font-weight: 400;
  color: var(--cream);
  background: rgba(26, 10, 15, 0.6);
  border: 1px solid rgba(212, 175, 55, 0.1);
  border-radius: 999px;
  transition: all 0.35s var(--ease);
}
.filter-search::placeholder {
  color: var(--text-dim);
  font-style: italic;
}
.filter-search:hover {
  border-color: rgba(212, 175, 55, 0.3);
}
.filter-search:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.15);
}
.filter-search-wrap::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237a6856' stroke-width='2' stroke-linecap='round' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E");
  background-size: contain;
  pointer-events: none;
}

/* Wine count */
.wine-count {
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-top: 0;
  align-self: center;
}

/* ============================================================
   WINE GRID
   ============================================================ */
.wine-grid-wrap {
  width: var(--container);
  margin: 0 auto;
  padding-top: 40px;
  position: relative;
  z-index: 1;
}
.wine-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

/* ============================================================
   WINE CATALOG CARD — With image
   ============================================================ */
.wine-catalog-card {
  background: linear-gradient(180deg, rgba(26, 10, 15, 0.6), rgba(13, 5, 8, 0.4));
  border: 1px solid rgba(212, 175, 55, 0.08);
  border-radius: 2px;
  transition: transform 0.5s var(--ease), border-color 0.5s, box-shadow 0.5s;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  z-index: 1;
}
.wine-catalog-card:hover {
  transform: translateY(-6px);
  border-color: rgba(212, 175, 55, 0.4);
  box-shadow: 0 20px 60px -20px rgba(212, 175, 55, 0.12);
}
.wine-catalog-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 0;
  height: 2px;
  background: var(--gold);
  transition: width 0.6s var(--ease);
  z-index: 2;
}
.wine-catalog-card:hover::before {
  width: 100%;
}

/* Card image */
.card-image {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  z-index: 0;
  background: linear-gradient(180deg, rgba(26, 10, 15, 0.3) 0%, rgba(13, 5, 8, 0.8) 100%),
              radial-gradient(ellipse at 50% 30%, rgba(92, 26, 42, 0.15), transparent 70%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-image::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(to top, rgba(13, 5, 8, 0.9), transparent);
  pointer-events: none;
  z-index: 1;
}
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  padding: 20px 16px;
  transition: transform 0.6s var(--ease);
  position: relative;
  z-index: 0;
}
.wine-catalog-card:hover .card-image img {
  transform: scale(1.08);
}
.card-image.img-error {
  display: none;
}
.card-image.img-error + .card-body {
  padding-top: 28px;
}

/* Card body */
.card-body {
  padding: 18px 22px 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
  position: relative;
  z-index: 1;
}

/* Card header: color dot + region */
.wine-catalog-card .card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.wine-catalog-card .card-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.card-color[data-color="red"] { background: #8b2a40; }
.card-color[data-color="white"] { background: #f5f0e1; }
.card-color[data-color="sparkling"] { background: linear-gradient(135deg, #f5f0e1, #d4af37); }
.card-color[data-color="rose"] { background: #e8a0b0; }
.card-color[data-color="orange"] { background: #d4874d; }

.wine-catalog-card .card-region {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  line-height: 1.3;
}

/* Card name */
.wine-catalog-card .card-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.15;
  color: var(--cream);
  margin-bottom: 6px;
}

/* Card grape */
.wine-catalog-card .card-grape {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14px;
  color: var(--cream-muted);
  margin-bottom: 4px;
}

/* Card winery */
.wine-catalog-card .card-winery {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

/* Card rating */
.card-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--gold);
  margin-bottom: 12px;
}
.rating-star {
  font-size: 14px;
}
.rating-count {
  color: var(--text-dim);
  font-size: 11px;
}

/* Card prices */
.wine-catalog-card .card-prices {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(212, 175, 55, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.wine-catalog-card .card-prices--discount {
  flex-direction: column;
  gap: 8px;
}
.card-prices .price-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.card-prices .price-label {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.card-prices .price-value {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--gold);
  font-weight: 500;
}
.card-prices .price-value.price-bottle {
  font-size: 14px;
  color: var(--cream-muted);
}

/* Discount prices */
.price-discount {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.price-old {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--text-dim);
  text-decoration: line-through;
}
.price-new {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--gold);
  font-weight: 500;
}

/* Card reserve button */
.wine-catalog-card .card-reserve {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cream);
  background: transparent;
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.4s var(--ease);
  white-space: nowrap;
  position: relative;
  z-index: 5;
}
.wine-catalog-card .card-reserve:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(212, 175, 55, 0.06);
}
.wine-catalog-card .card-reserve svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ============================================================
   HOVER OVERLAY — Стилистика вина
   ============================================================ */
.wine-catalog-card .card-stylistics {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  padding: 30px 26px 72px;
  background:
    radial-gradient(ellipse 130% 75% at 50% 0%, rgba(92, 26, 42, 0.5) 0%, transparent 72%),
    linear-gradient(165deg, rgba(31, 13, 19, 0.97), rgba(13, 5, 8, 0.985));
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.18);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.5s var(--ease), transform 0.55s var(--ease);
}

.wine-catalog-card:hover .card-stylistics,
.wine-catalog-card:focus-within .card-stylistics,
.wine-catalog-card.active .card-stylistics {
  opacity: 1;
  transform: translateY(0);
}

/* Gilded label with sparkle */
.card-stylistics .stylistics-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
}
.card-stylistics .stylistics-spark {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  color: var(--gold);
  filter: drop-shadow(0 0 5px rgba(212, 175, 55, 0.55));
}

/* The evocative profile — display serif, italic, centered */
.card-stylistics .stylistics-text {
  margin: 0;
  max-width: 32ch;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 16px;
  line-height: 1.55;
  color: var(--cream);
}
/* Hairline gold flourish above the quote */
.card-stylistics .stylistics-text::before {
  content: '';
  display: block;
  width: 30px;
  height: 1px;
  margin: 0 auto 13px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.75;
}

/* Pairing recommendation */
.card-stylistics .card-pairing {
  font-size: 12px;
  color: var(--cream-muted);
  line-height: 1.4;
  font-style: normal;
}
.card-stylistics .card-pairing::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  vertical-align: -2px;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23d4af37' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18 8h1a4 4 0 0 1 0 8h-1M2 8h16v9a4 4 0 0 1-4 4H6a4 4 0 0 1-4-4V8zM6 1v3M10 1v3M14 1v3'/%3E%3C/svg%3E");
  background-size: contain;
}

@media (prefers-reduced-motion: reduce) {
  .wine-catalog-card .card-stylistics {
    transform: none;
    transition: opacity 0.25s linear;
  }
}

/* ============================================================
   LOADING STATE
   ============================================================ */
.wine-loading {
  text-align: center;
  padding: 60px 20px;
}
.wine-loading.hidden { display: none; }
.wine-loading::after {
  content: '';
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 2px solid rgba(212, 175, 55, 0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   LOAD MORE + PAGINATION
   ============================================================ */
.wine-pagination {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 48px;
}
.wine-pagination.hidden { display: none; }

.load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 36px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  background: transparent;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.4s var(--ease);
}
.load-more-btn:hover {
  background: rgba(212, 175, 55, 0.08);
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px -10px rgba(212, 175, 55, 0.2);
}
.load-more-btn:active {
  transform: translateY(0);
}
.load-more-btn[hidden] {
  display: none;
}

.page-indicator {
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

/* ============================================================
   WINE CALLOUT BOTTOM
   ============================================================ */
.wine-callout-bottom {
  width: var(--container);
  margin: 60px auto 0;
}
.wine-callout-bottom .callout-inner {
  padding: 48px;
  background: linear-gradient(125deg, rgba(92, 26, 42, 0.4), rgba(13, 5, 8, 0.3));
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 2px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.wine-callout-bottom .callout-inner::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.08), transparent 70%);
  pointer-events: none;
}
.wine-callout-bottom h3 {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 400;
  color: var(--cream);
  margin-bottom: 12px;
  position: relative;
}
.wine-callout-bottom h3 em {
  font-style: italic;
  color: var(--gold);
}
.wine-callout-bottom p {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.6;
  position: relative;
}

/* ============================================================
   WINE LEGAL
   ============================================================ */
.wine-legal {
  width: var(--container);
  margin: 40px auto 0;
  padding: 24px 32px;
  background: rgba(13, 5, 8, 0.5);
  border: 1px solid rgba(212, 175, 55, 0.06);
  border-radius: 2px;
}
.wine-legal p {
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-dim);
  text-align: center;
  letter-spacing: 0.02em;
}

/* ============================================================
   WINE EMPTY STATE
   ============================================================ */
.wine-empty {
  text-align: center;
  padding: 80px 20px;
}
.wine-empty.hidden { display: none; }
.wine-empty p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  color: var(--cream-muted);
  margin-bottom: 32px;
}
.wine-empty .btn {
  margin: 0 auto;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1024px) {
  .wine-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
  .wine-catalog-card .card-name {
    font-size: 20px;
  }
}

@media (max-width: 768px) {
  .page-wines {
    --wines-nav-offset: 56px; /* Nav height is 56px on mobile/tablet due to padding: 16px 0 */
  }

  .wine-filters {
    padding: 16px 0 14px;
  }
  .wine-filters-inner {
    gap: 14px;
  }
  .filter-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .filter-row-top {
    border-bottom: none;
    padding-bottom: 0;
  }
  .wine-count {
    align-self: flex-start;
  }
  .filter-group,
  .filter-group-secondary {
    gap: 8px;
  }
  .filter-group-secondary {
    justify-content: flex-start;
  }
  .filter-pills {
    gap: 6px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .filter-pills::-webkit-scrollbar {
    display: none;
  }
  .filter-pill {
    padding: 7px 14px;
    font-size: 11px;
  }
  .filter-select {
    min-width: 120px;
    font-size: 11px;
    padding: 7px 32px 7px 14px;
  }
  .filter-search-wrap {
    max-width: none;
    min-width: 0;
    width: 100%;
    margin-left: 0;
  }
  .wine-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .wine-grid-wrap {
    padding-top: 28px;
  }
  .wine-catalog-card .card-body {
    padding: 16px 18px 20px;
  }
  .wine-catalog-card .card-name {
    font-size: 18px;
  }
  .card-prices .price-value {
    font-size: 16px;
  }
  .wine-callout-bottom .callout-inner {
    padding: 36px 24px;
  }
  .wine-legal {
    padding: 20px 20px;
  }
  .load-more-btn {
    padding: 12px 28px;
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .page-wines {
    --wines-nav-offset: 56px;
  }

  .wine-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .wine-catalog-card .card-name {
    font-size: 16px;
  }
  .wine-catalog-card .card-grape {
    font-size: 12px;
  }
  .card-image {
    aspect-ratio: 2 / 3;
  }
  .card-image img {
    padding: 12px 8px;
  }
  .filter-group-secondary {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-select {
    min-width: 0;
    width: 100%;
  }
  .filter-pills-price {
    overflow-x: auto;
    flex-wrap: nowrap;
  }
}
