/* ==========================================================================
   CIELO CAFE AND RESTRO - MODALS & FLOATING WIDGETS
   Includes: Reservation Modal, Lightbox Modal, Accessibility, WhatsApp FAB
   ========================================================================== */

/* Universal Modal Overlay */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background-color: rgba(27, 21, 17, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease;
}

.modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* 1. Reservation Modal Window */
.reservation-modal-window {
  position: relative;
  width: 100%;
  max-width: 32rem;
  background-color: var(--bg-card);
  border: 1px solid rgba(27, 21, 17, 0.15);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  padding: 1.25rem 1rem;
  max-height: calc(100svh - 2rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: scale(0.95);
  transition: transform 250ms ease;
}

@media (min-width: 480px) {
  .reservation-modal-window {
    padding: 1.75rem;
    border-radius: var(--border-radius-xl);
    max-height: 90vh;
  }
}

@media (min-width: 640px) {
  .reservation-modal-window {
    padding: 2.25rem;
  }
}

.modal-backdrop.is-open .reservation-modal-window {
  transform: scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.5rem;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  background: none;
  border: none;
  color: rgba(27, 21, 17, 0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

@media (min-width: 480px) {
  .modal-close-btn {
    top: 1.25rem;
    right: 1.25rem;
  }
}

.modal-close-btn:hover {
  color: var(--text-espresso);
  background-color: rgba(27, 21, 17, 0.08);
}

.modal-header-centered {
  text-align: center;
  margin-bottom: 1.5rem;
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  color: var(--text-espresso);
  margin-top: 0.25rem;
}

.modal-subtext {
  font-size: 0.75rem;
  color: var(--text-espresso-muted);
  max-width: 20rem;
  margin: 0.25rem auto 0 auto;
}

/* Reservation Form */
.reservation-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 0.75rem;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .form-row-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .form-row-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-label {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-espresso-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.form-label svg {
  width: 0.875rem;
  height: 0.875rem;
  color: var(--accent-sky-deep);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  min-height: 44px;
  border-radius: var(--border-radius-md);
  border: 1px solid rgba(27, 21, 17, 0.2);
  background-color: rgba(246, 239, 227, 0.6);
  color: var(--text-espresso);
  font-size: 16px;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 200ms ease;
}

@media (min-width: 768px) {
  .form-input,
  .form-select,
  .form-textarea {
    font-size: 0.8125rem;
    min-height: auto;
  }
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent-sky-deep);
  background-color: var(--bg-card);
}

.form-textarea {
  resize: none;
  min-height: 4rem;
}

/* 2. Lightbox Modal */
.lightbox-window {
  position: relative;
  max-width: 56rem;
  width: 100%;
  background-color: var(--text-espresso);
  border: 1px solid rgba(246, 239, 227, 0.2);
  border-radius: var(--border-radius-xl);
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
}

.lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(246, 239, 227, 0.1);
  background-color: var(--text-espresso);
}

.lightbox-category {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent-sky);
  text-transform: uppercase;
}

.lightbox-title {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  color: var(--bg-cream);
}

.lightbox-close {
  background: none;
  border: none;
  color: rgba(246, 239, 227, 0.7);
  padding: 0.5rem;
  border-radius: 50%;
  cursor: pointer;
}

.lightbox-close:hover {
  color: var(--bg-cream);
  background-color: rgba(246, 239, 227, 0.1);
}

.lightbox-viewport {
  position: relative;
  width: 100%;
  height: 50vh;
  min-height: 240px;
  max-height: 550px;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 640px) {
  .lightbox-viewport {
    height: 60vh;
  }
}

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  padding: 0.65rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: rgba(27, 21, 17, 0.75);
  color: var(--bg-cream);
  border: 1px solid rgba(246, 239, 227, 0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.lightbox-nav-btn:hover {
  background-color: var(--accent-terracotta);
}

.lightbox-nav-btn.prev {
  left: 0.5rem;
}

@media (min-width: 640px) {
  .lightbox-nav-btn.prev {
    left: 1rem;
  }
}

.lightbox-nav-btn.next {
  right: 0.5rem;
}

@media (min-width: 640px) {
  .lightbox-nav-btn.next {
    right: 1rem;
  }
}

.lightbox-nav-btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

.lightbox-caption-bar {
  padding: 1rem 1.5rem;
  background-color: rgba(27, 21, 17, 0.95);
  border-top: 1px solid rgba(246, 239, 227, 0.1);
  text-align: center;
}

@media (min-width: 640px) {
  .lightbox-caption-bar {
    text-align: left;
  }
}

.lightbox-caption-text {
  font-size: 0.8125rem;
  color: rgba(246, 239, 227, 0.8);
  font-family: var(--font-sans);
}

/* 3. Floating WhatsApp Action Button */
.whatsapp-fab {
  position: fixed;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  right: 1rem;
  z-index: 50;
}

@media (min-width: 640px) {
  .whatsapp-fab {
    bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
    right: 1.5rem;
  }
}

.whatsapp-fab-link {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  min-height: 44px;
  background-color: var(--text-espresso);
  color: var(--bg-cream);
  text-decoration: none;
  border-radius: var(--border-radius-full);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(246, 239, 227, 0.2);
  transition: var(--transition-smooth);
}

.whatsapp-fab-link:hover {
  background-color: var(--accent-terracotta);
  transform: scale(1.05);
}

.whatsapp-fab-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--accent-sky);
  transition: color 200ms ease;
}

.whatsapp-fab-link:hover .whatsapp-fab-icon {
  color: var(--bg-cream);
}

.whatsapp-fab-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: none;
}

@media (min-width: 640px) {
  .whatsapp-fab-label {
    display: inline;
  }
}


