/* ============================================================
   products.css
   Product cards grid, product detail modal
   ============================================================ */

#products {
  background: var(--cream);
  padding: var(--section-pad);
}

/* ── Grid ── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px;
}

/* ── Card ── */
.product-card {
  background: var(--offwhite);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
  cursor: pointer;
}

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

/* ── Card Image Area ── */
.product-img {
  background: linear-gradient(135deg, #E8D9B5, #D4C49A);
  height: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.product-img-inner {
  width: 100px;
  height: 130px;
  background: linear-gradient(160deg, #E8D9B5, #C8B887);
  border-radius: 14px 14px 4px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.product-img-label {
  font-family: var(--font-display);
  font-size: 0.6rem;
  color: var(--forest);
  font-weight: 700;
  text-align: center;
  margin-bottom: 6px;
}

.product-orbs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  padding: 4px;
}

.product-orbs .o {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f8f4ec, #cfc4aa);
  box-shadow: inset -1px -1px 3px rgba(0,0,0,0.10);
}

/* ── Badge ── */
.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--gold);
  color: var(--white);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
}

/* ── Card Info ── */
.product-info {
  padding: 20px;
}

.product-info h3 {
  font-size: 1.05rem;
  color: var(--forest);
  margin-bottom: 6px;
}

.product-info .product-desc {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 16px;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.price {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--forest);
}

.price .weight {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 400;
}

.btn-view {
  background: var(--forest);
  color: var(--white);
  border: none;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-view:hover { background: var(--leaf); }

/* ════════════════════════════════════════════════
   PRODUCT DETAIL MODAL
   ════════════════════════════════════════════════ */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(3px);
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: var(--offwhite);
  border-radius: 20px;
  max-width: 860px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 32px 80px rgba(0,0,0,0.28);
  animation: modalIn 0.3s ease;
  position: relative;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  background: var(--sand);
  border: none;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 10;
}
.modal-close:hover { background: var(--gold); color: var(--white); }

.modal-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 420px;
}

/* Modal Image Panel */
.modal-img-panel {
  background: linear-gradient(135deg, #E8D9B5, #D4C49A);
  border-radius: 20px 0 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  position: relative;
}

.modal-img-panel img {
  max-height: 300px;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: var(--shadow-card);
}

/* CSS fallback if no real image */
.modal-product-mockup {
  width: 160px;
  height: 210px;
  background: linear-gradient(160deg, #E8D9B5, #C8B887);
  border-radius: 18px 18px 6px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 16px 40px rgba(0,0,0,0.18);
}

.modal-mockup-label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: var(--forest);
  font-weight: 700;
  text-align: center;
  margin-bottom: 6px;
}

.modal-orbs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
  padding: 6px;
}

.modal-orbs .o {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f8f4ec, #cfc4aa);
  box-shadow: inset -1px -1px 3px rgba(0,0,0,0.10);
}

/* Modal Info Panel */
.modal-info-panel {
  padding: 36px 32px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-badge {
  display: inline-block;
  background: var(--gold);
  color: var(--white);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  width: fit-content;
}

.modal-title {
  font-size: 1.7rem;
  color: var(--forest);
  line-height: 1.15;
}

.modal-tagline {
  font-size: 0.88rem;
  color: var(--gold);
  font-weight: 600;
  font-style: italic;
}

.modal-desc {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.7;
}

.modal-benefits {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.benefit-tag {
  background: rgba(28,74,46,0.08);
  color: var(--forest);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(28,74,46,0.15);
}

.modal-price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 4px;
}

.modal-price {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--forest);
  font-family: var(--font-display);
}

.modal-weight {
  font-size: 0.85rem;
  color: var(--muted);
}

.modal-qty-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.qty-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--charcoal);
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--sand);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.qty-btn {
  width: 36px;
  height: 36px;
  background: var(--cream);
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}
.qty-btn:hover { background: var(--sand); }

.qty-num {
  width: 36px;
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--forest);
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}

.btn-buynow {
  flex: 1;
  background: var(--gold);
  color: var(--white);
  border: none;
  padding: 16px;
  border-radius: var(--radius-pill);
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(196,148,58,0.35);
}
.btn-buynow:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(196,148,58,0.45);
}

.modal-nutrition {
  background: var(--cream);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-top: 4px;
}

.modal-nutrition h4 {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--forest);
  margin-bottom: 8px;
  font-family: var(--font-display);
}

.nut-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  padding: 4px 0;
  border-bottom: 1px solid rgba(28,74,46,0.08);
  color: var(--muted);
}

.nut-row:last-child { border-bottom: none; }
.nut-row strong { color: var(--forest); font-weight: 600; }

/* ── Mobile Modal ── */
@media (max-width: 640px) {
  .modal-inner {
    grid-template-columns: 1fr;
  }
  .modal-img-panel {
    border-radius: 20px 20px 0 0;
    padding: 28px;
    height: 220px;
  }
  .modal-info-panel {
    padding: 24px 20px 28px;
  }
  .modal-actions { flex-direction: column; }
}
