/* Extracted styles from index.html */
body {
  margin: 0;
  font-family: 'Roboto', sans-serif;
  background-color: #fdfaf6;
  color: #333;
}

header {
  background-color: #51899A;
  color: white;
  padding: 60px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.header-content {
  display: flex;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
  justify-content: center;
}

.logo img {
  width: 120px;
  height: auto;
}

.title {
  text-align: left;
}

header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 3rem;
  margin: 0;
}

header p {
  font-size: 1.2rem;
  margin-top: 5px;
}

nav {
  background-color: #51899A;
  color: white;
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 15px 0;
}

nav a {
  color: #f2e8e8;
  text-decoration: none;
  font-weight: normal;
  padding: 5px 10px;
  border-radius: 5px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

nav a:hover, nav a.selected {
  background-color: #823838;
  text-decoration: none;
  color: #fff;
}

.section {
  padding: 60px 20px;
  text-align: center;
}

.section h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  margin-bottom: 20px;
}
table.wine-list {
  width: 80%;
  margin: auto;
  border-collapse: collapse;
}
table.wine-list th, table.wine-list td {
  border: 1px solid #ddd;
  padding: 12px 15px;
  text-align: left;
}
table.wine-list .wine-thumbnail {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 5px;
}
table.wine-list th:first-child,
table.wine-list td:first-child {
  width: 80px;
  text-align: center;
  padding: 8px;
}
.products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  max-width: 1000px;
  margin: auto;
}

.product {
  background: white;
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}
.product a {
  display: inline-table;
  height: 75%;
}
.product h3 {
  margin-top: 15px;
  font-size: 1.2rem;
}
.section a i {
  margin-left: 8px;
  color: #823838;
}
.product .price {
  margin-top: 10px;
  font-weight: bold;
  color: #6b2e2e;
  height: 100%;
}
.product .price span { 
  vertical-align: bottom;
}
a {
  color: #6b2e2e;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

footer {
  background-color: #823838;
  color: white;
  text-align: center;
  padding: 40px 20px;
  margin-top: 60px;
}

/* Image Modal/Lightbox Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.9);
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.modal-content {
  max-width: 90%;
  max-height: 80vh;
  object-fit: contain;
  animation: zoom 0.3s;
}

@keyframes zoom {
  from {transform: scale(0.7)}
  to {transform: scale(1)}
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 40px;
  color: #f1f1f1;
  font-size: 50px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}

.modal-close:hover,
.modal-close:focus {
  color: #bbb;
}

.modal-caption {
  margin-top: 20px;
  text-align: center;
  color: #ccc;
  padding: 10px;
  font-size: 1.1rem;
}

.wine-thumbnail {
  transition: opacity 0.3s;
}

.wine-thumbnail:hover {
  opacity: 0.8;
}

/* ── Tablet ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  header {
    padding: 30px 20px;
  }

  header h1 {
    font-size: 2rem;
  }

  .section {
    padding: 30px 20px;
  }

  table.wine-list {
    width: 100%;
  }
}

/* ── Mobile card layout ──────────────────────────────────────── */
@media (max-width: 640px) {
  /* Collapse table into block elements */
  table.wine-list,
  table.wine-list tbody,
  table.wine-list tr,
  table.wine-list th,
  table.wine-list td {
    display: block;
  }

  table.wine-list thead {
    display: none;
  }

  /* Each row becomes a card */
  table.wine-list tr {
    display: grid;
    grid-template-columns: 80px 1fr;
    grid-template-rows: auto auto auto auto;
    gap: 4px 12px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    margin-bottom: 16px;
    padding: 12px;
    border: none;
  }

  /* Thumbnail spans the left column across all rows */
  table.wine-list td:nth-child(1) {
    grid-column: 1;
    grid-row: 1 / 6;
    align-self: start;
    border: none;
    padding: 0;
    text-align: center;
  }

  table.wine-list .wine-thumbnail {
    width: 70px;
    height: auto;
    object-fit: contain;
  }

  /* Wine name — bold, top of right column */
  table.wine-list td:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
    font-weight: bold;
    border: none;
    padding: 0;
  }

  /* Vintage, price, classification — each on its own row */
  table.wine-list td:nth-child(3),
  table.wine-list td:nth-child(4),
  table.wine-list td:nth-child(5) {
    grid-column: 2;
    font-size: 0.85rem;
    color: #555;
    border: none;
    padding: 0;
  }

  table.wine-list td:nth-child(3) { grid-row: 2; }
  table.wine-list td:nth-child(4) { grid-row: 3; }
  table.wine-list td:nth-child(5) { grid-row: 4; }

  /* Show column labels via data-label */
  table.wine-list td[data-label]::before {
    content: attr(data-label) ": ";
    font-weight: bold;
    color: #333;
  }

  /* Description spans full width */
  table.wine-list td:nth-child(6) {
    grid-column: 1 / -1;
    grid-row: 6;
    font-size: 0.85rem;
    color: #555;
    border: none;
    padding: 8px 0 0;
    border-top: 1px solid #eee;
    margin-top: 4px;
  }

  /* Hide empty cells cleanly */
  table.wine-list td:empty {
    display: none;
  }

  /* Section headings */
  .section h2 {
    font-size: 1.8rem;
  }

  .section h3 {
    font-size: 1.2rem;
  }

  /* Disable click-to-enlarge on mobile — images are already visible in cards */
  .wine-thumbnail {
    pointer-events: none;
    cursor: default;
  }
}
