/* ============================================
   DONA FULANA — PRODUCT MODAL & ZOOM (Mobile-First)
   ============================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(44, 19, 32, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* ── Modal Content — Mobile: bottom sheet ── */
.product-modal-content {
  background: var(--white);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-height: 92vh;
  max-height: 92dvh;
  position: relative;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.25);
}
.modal-overlay.active .product-modal-content {
  transform: translateY(0);
}

/* ── Drag Handle (mobile) ── */
.product-modal-content::before {
  content: '';
  display: block;
  width: 40px;
  height: 4px;
  background: var(--cream-dark);
  border-radius: 2px;
  margin: 0.6rem auto 0;
  flex-shrink: 0;
}

.modal-close-btn {
  position: absolute;
  top: 12px; right: 12px;
  background: rgba(var(--cream-rgb), 0.9);
  backdrop-filter: blur(4px);
  border: none;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text-dark);
  cursor: pointer;
  z-index: 10;
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.modal-close-btn:hover {
  background: var(--burgundy);
  color: var(--white);
}

/* ── Grid — Mobile: single column ── */
.product-modal-grid {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Image Column */
.product-modal-image-col {
  background: var(--cream-dark);
  padding: 1rem;
  flex-shrink: 0;
}

.product-modal-image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  cursor: zoom-in;
}
#modal-product-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.product-modal-image-wrapper:active #modal-product-img {
  transform: scale(1.03);
}

/* ── Thumbnails Gallery ── */
.product-thumbnails-gallery {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
}
.product-thumbnails-gallery::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.modal-thumb-img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0.6;
  transition: var(--transition);
}

.modal-thumb-img.active {
  border-color: var(--gold);
  opacity: 1;
}

.zoom-btn {
  position: absolute;
  bottom: 10px; right: 10px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
  border: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: var(--shadow-sm);
  -webkit-tap-highlight-color: transparent;
}

/* Info Column */
.product-modal-info-col {
  padding: 1.25rem 1rem;
}

.modal-badge {
  display: inline-block;
  background: var(--gold-light);
  color: var(--text-dark);
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--burgundy-dark);
  margin-bottom: 0.4rem;
  line-height: 1.15;
}

.modal-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--burgundy);
  margin-bottom: 1rem;
}

.modal-divider {
  height: 1px;
  background: var(--cream-dark);
  margin: 1rem 0;
}

.modal-section-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--text-dark);
  margin-bottom: 0.4rem;
}

.modal-section-subtitle {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 0.75rem;
}

.modal-desc {
  font-size: 0.88rem;
  color: var(--text-medium);
  line-height: 1.6;
}

/* ── Addons ── */
.addons-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.addon-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem;
  border: 1.5px solid var(--cream-dark);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
  min-height: 56px;
}
.addon-item:hover { border-color: var(--gold-light); background: var(--cream); }
.addon-item.selected { border-color: var(--gold); background: rgba(196, 165, 90, 0.08); }

.addon-img {
  width: 44px; height: 44px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}
.addon-info { flex: 1; min-width: 0; }
.addon-name {
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text-dark);
  margin-bottom: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.addon-price {
  font-size: 0.78rem;
  color: var(--burgundy);
  font-weight: 600;
}

.addon-checkbox {
  width: 22px; height: 22px;
  border-radius: 4px;
  border: 2px solid var(--cream-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: var(--transition);
  flex-shrink: 0;
}
.addon-item.selected .addon-checkbox {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--white);
}
.addon-checkbox::after { content: "✓"; font-size: 13px; }

/* ── Modal Footer — Sticky on mobile ── */
.product-modal-footer {
  padding: 1rem;
  background: var(--cream);
  border-top: 1px solid var(--cream-dark);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex-shrink: 0;
  /* iOS safe area */
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}

.modal-footer-price {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-footer-price span {
  font-size: 0.85rem;
  color: var(--text-medium);
}
.modal-footer-price strong {
  font-size: 1.35rem;
  color: var(--burgundy-dark);
}

.modal-add-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--burgundy), var(--burgundy-dark));
  color: var(--white);
  border: none;
  padding: 0.9rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s;
  box-shadow: var(--shadow-sm);
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
}
.modal-add-btn:active { transform: scale(0.97); }

/* ── Lightbox ── */
.lightbox-overlay { z-index: 3000; align-items: center; }
#zoomed-image {
  max-width: 95vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 50px rgba(0,0,0,0.5);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.lightbox-overlay.active #zoomed-image { transform: scale(1); }

.lightbox-close {
  background: rgba(255,255,255,0.1);
  color: var(--white);
  width: 44px; height: 44px;
  font-size: 1.3rem;
  top: 16px; right: 16px;
}
.lightbox-close:hover { background: rgba(255,255,255,0.25); }

/* ============================================
   DESKTOP OVERRIDES (min-width: 1024px)
   ============================================ */
@media (min-width: 1024px) {
  .modal-overlay {
    align-items: center;
  }

  .product-modal-content {
    border-radius: var(--radius-lg);
    width: 900px;
    max-width: 95vw;
    max-height: 88vh;
    transform: scale(0.9) translateY(20px);
  }
  .modal-overlay.active .product-modal-content {
    transform: scale(1) translateY(0);
  }

  .product-modal-content::before { display: none; }

  .product-modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .product-modal-image-col { padding: 2rem; }
  .product-modal-info-col { padding: 2.5rem 2rem; }

  .modal-title { font-size: 2rem; }
  .modal-price { font-size: 1.5rem; }

  .product-modal-footer {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2.5rem;
    padding-bottom: 1.5rem;
  }
  .modal-add-btn {
    width: auto;
    padding: 1rem 2.5rem;
    font-size: 1.05rem;
  }
  .modal-footer-price strong { font-size: 1.6rem; }
}

/* ==========================================
   ADDONS (Extras)
   ========================================== */
.addons-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.addon-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
}

.addon-info {
  display: flex;
  flex-direction: column;
}

.addon-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
}

.addon-price {
  font-size: 0.85rem;
  color: var(--burgundy);
  font-weight: bold;
}

.addon-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--white);
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 0.2rem;
}

.addon-controls button {
  background: none;
  border: none;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-medium);
  transition: color 0.2s;
}

.addon-controls button:hover {
  color: var(--burgundy);
}

.addon-qty {
  font-weight: bold;
  font-size: 0.9rem;
  min-width: 20px;
  text-align: center;
}
