/*
  LastPick - Product Section
  This file contains styles for product display components.
*/

.image-frame {
  display: grid;
  min-height: clamp(280px, 35vw, 400px);
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(135deg, #fffdf7 0%, #f4ecd9 100%);
  background-color: #f9f6ed; /* Improvement: Placeholder color */
  box-shadow: var(--shadow-md);
}

.image-frame img {
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 5;
  object-fit: contain;
  padding: clamp(20px, 4vw, 50px);
  transition: opacity var(--transition-base), transform var(--transition-base);

  filter: drop-shadow(0 20px 25px rgba(0,0,0,0.18));
}

.image-frame img[src$="bottle-200ml.webp"] {
  transform: scale(1.15);
}

.product-highlight .image-frame {
  min-height: clamp(240px, 28vw, 330px);
  background: transparent;
  border: none;
  box-shadow: none;
}
.product-highlight .image-frame img[src$="featured-bottle.webp"] {
  width: min(72%, 320px);
  height: auto;
  max-height: 70%;
  aspect-ratio: 1 / 1;
  padding: 0;
  object-fit: contain;
  filter: drop-shadow(0 24px 38px rgba(15, 91, 60, 0.22)) drop-shadow(0 7px 18px rgba(214, 178, 94, 0.16));
}

.product-copy {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  justify-content: center;
}

.product-highlight .product-copy {
  gap: clamp(0.55rem, 1vw, 0.8rem);
}

.product-grid > .section-label {
  grid-column: 1 / -1;
  margin-bottom: 0;
  justify-self: start;
}

.product-buy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-lg);
  margin-top: var(--space-sm);
}
.product-highlight .product-buy {
  width: fit-content;
  align-items: center;
  gap: clamp(0.85rem, 1.6vw, 1.2rem);
  margin-top: clamp(0.35rem, 1vw, 0.7rem);
  padding-top: clamp(0.65rem, 1.2vw, 0.9rem);
  border-top: 1px solid rgba(15, 91, 60, 0.12);
}

.price-wrapper {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: var(--space-xs) var(--space-sm);
  width: 100%;
}

.product-highlight .price-wrapper {
  width: auto;
}

.pack-selector {
  display: grid;
  gap: var(--space-md);
}

.pack-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.pack-card {
  display: grid;
  min-height: 124px;
  place-items: center;
  gap: var(--space-sm);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 12px 8px;
  color: var(--dark-green);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base), background-color var(--transition-base);
}

.pack-card img {
  width: 68px;
  height: 68px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

.pack-card.active {
  outline: 2px solid rgba(167, 212, 111, 0.72);
  outline-offset: 2px;
}

.product-icons,
.feature-cards {
  display: grid; /* REFINEMENT: Use a more flexible minmax to allow cards to shrink more on smaller viewports. */
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-md); /* Keep consistent gap */
}

.feature-item,
.feature-card {
  border-radius: var(--radius-md);
}

.feature-item {
  display: flex;
  min-height: 64px;
  align-items: center;
  gap: var(--space-md);
  background: rgba(15, 91, 60, 0.08);
  color: var(--dark-green);
  padding: 14px 16px;
  font-weight: 800;
}

.feature-icon {
  display: inline-flex;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--leaf-green);
  color: var(--dark-green);
  font-size: 0.95rem;
}

.product-details-section {
  padding: calc(var(--header-height) + var(--space-lg)) var(--gutter) var(--section-y);
}

.product-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
}

.product-rating .stars {
  color: var(--gold);
  letter-spacing: 2px;
}

.product-rating .rating-value {
  color: var(--muted);
}

.product-description p {
  display: none;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.product-description p.active {
  display: block;
}

.purchase-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-lg);
}

.purchase-controls {
  margin-top: var(--space-lg);
}

.quantity-selector {
  display: grid;
  gap: var(--space-sm);
}

.quantity-label {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dark-green);
}

.quantity-input {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.quantity-input input {
  width: 50px;
  border: 0;
  text-align: center;
  background: transparent;
  -moz-appearance: textfield;
}
.quantity-input input::-webkit-outer-spin-button,
.quantity-input input::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}

.quantity-btn {
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.2rem;
}
.quantity-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}


.product-info-tabs {
  margin-top: var(--space-lg);
  display: grid;
  gap: var(--space-xl);
}

.info-item h4 {
  margin: 0 0 var(--space-sm);
  font-size: 1rem;
  font-weight: 800;
  color: var(--dark-green);
}

.info-item p, .nutrition-list {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  line-height: 1.6;
}

.price-subtitle {
  grid-column: 1 / -1;
  margin-top: -12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.price-note {
  grid-column: 1 / -1;
  margin: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(167, 212, 111, 0.2);
  color: var(--dark-green);
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
}

.moq-badge-premium {
  display: none; /* Hidden by default */
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 6px 12px;
  border: 1px solid rgba(15, 91, 60, 0.1);
  border-radius: 999px;
  background-color: #EAF7E3;
  color: var(--dark-green);
  font-size: 13px;
  font-weight: 700;
  justify-self: start;
}

.moq-badge-premium.visible {
  display: inline-flex;
}

.moq-badge-premium::before {
  content: '';
  display: block;
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f5b3c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v2'/%3E%3Cpath d='M3 14v4a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-4'/%3E%3Cpath d='M21 10l-7 4-7-4'/%3E%3Cpath d='M12 22V14'/%3E%3Cpath d='M7 12.5L12 15l5-2.5'/%3E%3C/svg%3E");
  background-size: contain;
}

.product-benefits-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm) var(--space-md);
  margin-top: var(--space-sm);
}

.benefit-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.benefit-item::before {
  content: '✓';
  color: var(--dark-green);
  font-weight: 800;
}