/*
 * Wine Detail Page & Index Styles
 * Linear-inspired: tight spacing, 1px borders, no shadows, muted hierarchy
 */

/* ===== Wine Detail Container ===== */
.wine-detail {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

@media (min-width: 769px) {
  .wine-detail {
    padding: 0;
  }
}

/* ===== Wine Header (Compact) ===== */
.wine-header {
  margin-bottom: var(--space-xl);
}

.wine-header h1 {
  font-size: var(--font-size-xl);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-xs);
}

.wine-header .producer {
  font-size: var(--font-size-base);
  color: var(--color-text-light);
  margin: 0 0 var(--space-xs);
}

.wine-header .producer a {
  color: var(--color-text-light);
  text-decoration: none;
}

.wine-header .producer a:hover {
  color: var(--color-primary);
}

.wine-header .meta {
  color: var(--color-text-muted);
  font-size: var(--font-size-base);
  margin: 0;
}

/* ===== Vintage Pills (Ghost Buttons) ===== */
.vintage-selector {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.vintage-pill {
  display: inline-block;
  padding: var(--space-sm) var(--space-lg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text-light);
  text-decoration: none;
  transition: all 0.15s ease;
}

.vintage-pill:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  text-decoration: none;
}

.vintage-pill.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-text-inverse);
}

/* ===== 2-Column Info Grid ===== */
.wine-info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
  align-items: start;
}

@media (min-width: 769px) {
  .wine-info-grid {
    grid-template-columns: 260px 1fr;
    gap: var(--space-xl);
  }
}

/* ===== Info Cards ===== */
.info-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-xl);
}

.info-card h3 {
  font-size: var(--font-size-md);
  font-weight: 600;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

.info-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

.info-card-header h3 {
  margin: 0;
  padding: 0;
  border: none;
}

.info-card-actions {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

/* Wishlist button — square, matching btn-small height */
.info-card-actions .wishlist-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: var(--radius);
}

.info-card-actions .wishlist-btn svg {
  width: 14px;
  height: 14px;
}

/* ===== Definition Lists ===== */
.info-card dl {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.info-card dt {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 500;
  margin-top: var(--space-md);
}

.info-card dt:first-child {
  margin-top: 0;
}

.info-card dd {
  margin: var(--space-xs) 0 0 0;
  font-size: var(--font-size-md);
  font-weight: 400;
}

.info-card-separator {
  margin: var(--space-lg) 0;
  border: none;
  border-top: 1px solid var(--color-border);
}

/* ===== Wine Image ===== */
.wine-image {
  text-align: center;
}

.wine-image a {
  cursor: zoom-in;
}

.wine-image img {
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: var(--radius);
}

/* ===== Ratings Grid ===== */
.ratings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 1fr;
  gap: var(--space-md);
}

@media (max-width: 480px) {
  .ratings-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Rating Cards ===== */
.rating-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-xl);
  text-align: center;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.rating-card h3 {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: var(--space-md);
  border: none;
  padding: 0;
}

.rating-card .rating-score {
  font-size: 1.125rem; /* 18px */
  font-weight: 600;
  color: var(--color-text);
}

.rating-card .rating-source,
.rating-card .rating-reviews {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-xs);
}

.rating-card .rating-price {
  font-size: var(--font-size-sm);
  color: var(--color-text);
  font-weight: 500;
  margin-top: var(--space-sm);
}

.rating-card .rating-price-primary {
  font-size: 1.125rem;
  font-weight: 600;
}

.rating-card .btn {
  margin-top: var(--space-xl);
}

.rating-card .not-found {
  color: var(--color-warning);
  font-weight: 500;
}

.rating-card .pending {
  color: var(--color-text-muted);
}

/* Rating card colored top borders — 2px provider color */
.rating-card.lcbo {
  border-top: 2px solid var(--color-secondary);
}

.rating-card.producer {
  border-top: 2px solid var(--color-producer);
}

.rating-card[style] {
  border-top: 2px solid var(--provider-color);
}

/* ===== Wine Actions (Back / Report) ===== */
.wine-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
}

@media (max-width: 480px) {
  .wine-actions {
    flex-direction: column;
  }

  .wine-actions .btn {
    width: 100%;
    text-align: center;
  }
}

/* ===== Buy Section ===== */
.wine-buy-section .btn-buy {
  width: 100%;
  text-align: center;
  font-weight: 600;
}

/* ===== Buy Modal ===== */
.buy-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: var(--color-overlay);
  align-items: center;
  justify-content: center;
}

.buy-modal-content {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-2xl);
  max-width: 480px;
  width: 90%;
  position: relative;
  box-shadow: var(--shadow-float);
}

.buy-modal-close {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  line-height: 1;
}

.buy-modal-close:hover {
  color: var(--color-text);
}

.buy-modal-content h2 {
  margin-bottom: var(--space-lg);
  font-size: var(--font-size-lg);
}

.buy-modal-intro {
  color: var(--color-text-light);
  margin-bottom: var(--space-lg);
  font-size: var(--font-size-base);
}

.buy-modal-steps {
  margin: 0 0 var(--space-xl) 0;
  padding-left: var(--space-xl);
}

.buy-modal-steps li {
  margin-bottom: var(--space-sm);
  line-height: 1.5;
  font-size: var(--font-size-base);
}

.buy-modal-steps strong {
  color: var(--color-primary);
}

.buy-modal-actions {
  display: flex;
  gap: var(--space-md);
}

.buy-modal-actions .btn {
  flex: 1;
  text-align: center;
}

@media (max-width: 480px) {
  .buy-modal-actions {
    flex-direction: column;
  }
}

/* ===== Copy Button ===== */
.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-sm);
  cursor: pointer;
  color: var(--color-text-muted);
  margin-left: var(--space-xs);
  vertical-align: middle;
  transition: all 0.15s ease;
}

.copy-btn:hover {
  background: var(--color-surface);
  color: var(--color-primary);
  border-color: var(--color-border-hover);
}

.copy-btn.copied {
  background: var(--color-success);
  border-color: var(--color-success);
  color: var(--color-text-inverse);
}

.copy-btn svg {
  display: block;
}

/* ===== Image Modal ===== */
.image-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: var(--color-overlay-heavy);
  cursor: zoom-out;
}

.image-modal-content {
  display: block;
  max-width: 90%;
  max-height: 90%;
  margin: auto;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: var(--radius);
}

.image-modal-close {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 1001;
}

.image-modal-close:hover {
  color: #ccc;
}
