/* ==========================================  
   product_detail.css  
   FINAL: enlarged variants + arrangements, full-screen lightbox, unified trigger,  
   close “×” positioned at 2rem, fully responsive  
   ========================================== */

/* 0. Theme variables */
:root {
  --primary: #5b7492;
  --bg-light: #f9f6f4;
  --bg-white: #ffffff;
  --text: #333333;
  --heading: #2c3e50;
  --muted: #666666;
  --transition: 0.3s ease;
  --lightbox-z: 9999;
  --spec-odd: white;
  --spec-even: #aabfda;
}

/* ------------------------
   Product Header (Name + Subtitle)
   ------------------------ */
.product-header {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 1.5rem 1rem;
  text-align: center;
}
.product-header-title {
  position: relative;
  font-family: "Montserrat", sans-serif;
  font-size: 3rem;
  font-weight: 700;
  color: var(--heading);
  margin: 0;
}
.product-header-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 4px;
  background: var(--primary);
  margin: 0.5rem auto 0;
  border-radius: 2px;
}
.product-header-subtitle {
  font-family: "Open Sans", sans-serif;
  font-size: 1.2rem;
  color: var(--muted);
  margin-top: 0.75rem;
  font-weight: 300;
}

/* 1. Page wrapper */
.product-detail-mirtillo {
  background: var(--bg-white);
  color: var(--text);
  font-family: "Lato", sans-serif;
  line-height: 1.5;
}

/* 2. Main info container */
.main-info-container {
  display: flex;
  gap: 2.5rem;
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
  flex-wrap: wrap;
}
@media (max-width: 992px) {
  .main-info-container {
    flex-direction: column;
    gap: 1.5rem;
  }
}

/* 3. Left: Main image */
.m-left {
  flex: 1 1 50%;
}
.m-left img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  transition: transform var(--transition);
}
.m-left img:hover {
  transform: scale(1.005);
}

/* 4. Right: Unified specs table */
.m-right {
  flex: 1 1 45%;
  overflow-x: auto;
}
.spec-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-light);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}
.spec-table th,
.spec-table td {
  padding: 0.75rem 1rem;
  text-align: left;
}
.spec-table th {
  background: none;
  color: black;
  text-transform: uppercase;
  font-size: 0.85rem;
  width: 35%;
}
/* new row colors */
.spec-table tr:nth-child(odd) {
  background: var(--spec-odd);
}
.spec-table tr:nth-child(even) {
  background: var(--spec-even);
}

/* 5. Colour variants */
.variants-section {
  max-width: 1200px;
  margin: 3rem auto 1rem;
  padding: 0 1rem;
}
.variants-section h3 {
  font-size: 1.75rem;
  color: var(--heading);
  margin-bottom: 1rem;
  text-transform: uppercase;
}
.variant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.75rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.variant-item {
  border: 2px solid #eee;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-light);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition),
    border-color var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.variant-item img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}
.variant-item span {
  display: block;
  padding: 0.2rem 0.4rem;
  font-size: 0.6rem;
  color: var(--muted);
  text-transform: uppercase;
  text-align: center;
  width: 100%;
  background: #fff;
}
.variant-item:hover,
.variant-item.active {
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  transform: translateY(-4px);
}

/* 6. Arrangements */
.arrangements-section {
  max-width: 1200px;
  margin: 2rem auto 4rem;
  padding: 0 1rem;
}
.arrangements-section h3 {
  font-size: 1.75rem;
  color: var(--heading);
  margin-bottom: 1rem;
  text-transform: uppercase;
}
.arrangement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.75rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.arrangement-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}
.arrangement-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}
.arrangement-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

/* 7. Lightbox (variants + arrangements) */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: var(--lightbox-z);
}
.lightbox.visible {
  display: flex;
}
.lightbox-img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.lightbox-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  font-size: 2.5rem;
  color: #fff;
  cursor: pointer;
  transition: transform var(--transition);
}
.lightbox-close:hover {
  transform: scale(1.2);
}

/* 8. Responsive tweaks */
@media (max-width: 768px) {
  .variant-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  .variant-item img {
    height: 140px;
  }
  .arrangement-item img {
    height: 160px;
  }
  .spec-table th,
  .spec-table td {
    padding: 0.5rem 0.75rem;
  }
  .m-left img {
    height: auto;
  }
  .lightbox-close {
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
  }
}
