/* === Reset & Base === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --burgundy: #722f37;
  --burgundy-dark: #4a1c22;
  --burgundy-light: #9b4d56;
  --cream: #faf6f0;
  --gold: #c9a84c;
  --dark: #1a1a2e;
  --text: #2c2c2c;
  --text-light: #6b6b6b;
  --white: #ffffff;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
  --radius: 12px;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--cream);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 60px;
  width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

/* === Header === */
header {
  background: var(--dark);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 28px;
  font-weight: bold;
  color: var(--gold);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
}

.nav-links a {
  color: var(--cream);
  font-size: 15px;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--gold);
}

.cart-link {
  position: relative;
}

.cart-badge {
  position: absolute;
  top: -8px;
  right: -14px;
  background: var(--burgundy);
  color: var(--white);
  font-size: 11px;
  font-weight: bold;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* === Hero === */
.hero {
  text-align: center;
  padding: 60px 0 40px;
}

.hero h1 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 42px;
  color: var(--burgundy-dark);
  margin-bottom: 12px;
}

.hero p {
  font-size: 18px;
  color: var(--text-light);
}

/* === Filters === */
.filters {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 40px;
}

.filter-btn {
  background: var(--white);
  border: 2px solid #e0d8d0;
  padding: 8px 24px;
  border-radius: 24px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text);
}

.filter-btn:hover {
  border-color: var(--burgundy-light);
  color: var(--burgundy);
}

.filter-btn.active {
  background: var(--burgundy);
  color: var(--white);
  border-color: var(--burgundy);
}

/* === Wine Grid === */
.wine-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 28px;
}

.wine-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.wine-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.wine-card-link {
  display: block;
  flex: 1;
}

.wine-image {
  background: var(--dark);
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.wine-image img {
  height: 240px;
  width: auto;
  object-fit: contain;
}

.color-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.color-badge.red {
  background: #7a1b2d;
  color: #fce4ec;
}

.color-badge.white {
  background: #c9a84c;
  color: #3e3520;
}

.color-badge.rosé {
  background: #d4829a;
  color: #3e1525;
}

.wine-info {
  padding: 20px;
}

.wine-info h3 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 18px;
  margin-bottom: 4px;
  color: var(--burgundy-dark);
}

.wine-region {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 2px;
}

.wine-grape {
  font-size: 13px;
  color: var(--text-light);
  font-style: italic;
  margin-bottom: 8px;
}

.wine-rating {
  margin-bottom: 8px;
}

.star {
  color: #d0c8c0;
  font-size: 16px;
}

.star.filled {
  color: var(--gold);
}

.wine-price {
  font-size: 22px;
  font-weight: 700;
  color: var(--burgundy);
}

/* === Buttons === */
.btn {
  display: inline-block;
  background: var(--burgundy);
  color: var(--white);
  padding: 12px 28px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  text-align: center;
}

.btn:hover {
  background: var(--burgundy-dark);
}

.btn:active {
  transform: scale(0.98);
}

.add-to-cart {
  width: 100%;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 14px;
}

.add-to-cart.added {
  background: #2d8a4e;
}

/* === Wine Detail === */
.back-link {
  display: inline-block;
  margin: 24px 0;
  color: var(--burgundy);
  font-size: 15px;
}

.back-link:hover {
  text-decoration: underline;
}

.detail-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 48px;
  align-items: start;
}

.detail-image {
  background: var(--dark);
  border-radius: var(--radius);
  padding: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: sticky;
  top: 88px;
}

.detail-image img {
  height: 400px;
  width: auto;
  object-fit: contain;
}

.detail-info h1 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 32px;
  color: var(--burgundy-dark);
  margin: 8px 0 4px;
}

.detail-rating {
  margin-bottom: 12px;
}

.detail-rating .star {
  font-size: 20px;
}

.detail-price {
  font-size: 32px;
  font-weight: 700;
  color: var(--burgundy);
  margin-bottom: 24px;
}

.characteristics {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.char-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid #f0ebe5;
}

.char-row:last-child {
  border-bottom: none;
}

.char-label {
  font-size: 14px;
  color: var(--text-light);
  font-weight: 500;
}

.char-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.detail-section {
  margin-bottom: 20px;
}

.detail-section h3 {
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--burgundy-dark);
  font-size: 18px;
  margin-bottom: 8px;
}

.detail-section p {
  color: var(--text-light);
  line-height: 1.7;
}

.detail-btn {
  width: 100%;
  padding: 16px;
  font-size: 17px;
  margin-top: 8px;
  border-radius: var(--radius);
}

/* === Cart === */
.page-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 32px;
  color: var(--burgundy-dark);
  padding: 32px 0 24px;
}

.empty-cart {
  text-align: center;
  padding: 60px 0;
}

.empty-cart p {
  font-size: 18px;
  color: var(--text-light);
  margin-bottom: 24px;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--white);
  padding: 16px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.cart-item-image {
  width: 60px;
  height: 80px;
  object-fit: contain;
  background: var(--dark);
  border-radius: 6px;
  padding: 4px;
}

.cart-item-info {
  flex: 1;
}

.cart-item-info h3 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 16px;
}

.cart-item-info h3 a:hover {
  color: var(--burgundy);
}

.cart-item-region {
  font-size: 13px;
  color: var(--text-light);
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 12px;
}

.qty-btn {
  width: 32px;
  height: 32px;
  border: 2px solid #e0d8d0;
  background: var(--white);
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  color: var(--text);
}

.qty-btn:hover {
  border-color: var(--burgundy);
  color: var(--burgundy);
}

.qty-value {
  font-size: 16px;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

.cart-item-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--burgundy);
  min-width: 80px;
  text-align: right;
}

.remove-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: #c0b0a0;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}

.remove-btn:hover {
  color: #d44;
}

.cart-summary {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  max-width: 400px;
  margin-left: auto;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 22px;
  font-weight: 700;
  color: var(--burgundy-dark);
  margin-bottom: 20px;
}

.checkout-btn {
  width: 100%;
  padding: 16px;
  font-size: 17px;
  border-radius: var(--radius);
  background: var(--burgundy);
  color: var(--white);
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.checkout-btn:hover {
  background: var(--burgundy-dark);
}

.checkout-btn:disabled {
  background: #999;
  cursor: not-allowed;
}

/* === Success === */
.success-page {
  text-align: center;
  padding: 80px 0;
}

.success-icon {
  width: 80px;
  height: 80px;
  background: #2d8a4e;
  color: var(--white);
  font-size: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.success-page h1 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 36px;
  color: var(--burgundy-dark);
  margin-bottom: 12px;
}

.success-page p {
  font-size: 18px;
  color: var(--text-light);
  margin-bottom: 8px;
}

.success-sub {
  margin-bottom: 32px !important;
}

/* === Not Found === */
.not-found {
  text-align: center;
  padding: 80px 0;
}

.not-found h2 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 28px;
  color: var(--burgundy-dark);
  margin-bottom: 16px;
}

/* === Footer === */
footer {
  background: var(--dark);
  color: #8a8a9a;
  text-align: center;
  padding: 24px;
  font-size: 13px;
  margin-top: auto;
}

/* === Responsive === */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 28px;
  }

  .wine-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
  }

  .detail-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .detail-image {
    position: static;
  }

  .detail-image img {
    height: 300px;
  }

  .cart-item {
    flex-wrap: wrap;
    gap: 12px;
  }

  .cart-item-info {
    min-width: 100%;
    order: -1;
  }

  .cart-summary {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 24px;
  }

  .filters {
    flex-wrap: wrap;
  }

  .wine-grid {
    grid-template-columns: 1fr;
  }
}
