/* ==========================================================================
   THE WONTHAGGI MARKET - Components Stylesheet
   Modals, Off-Canvas Drawer, Lightbox, Mobile Sticky Bar, Toasts & Animations
   ========================================================================== */

/* ==========================================================================
   1. Off-Canvas Mobile Drawer
   ========================================================================== */
.drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(18, 36, 25, 0.65);
  backdrop-filter: blur(6px);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.drawer-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  height: 100vh;
  background: var(--bg-cream);
  z-index: 999;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.8rem 1.5rem;
  transition: right var(--transition-normal);
  overflow-y: auto;
}

.mobile-drawer.active {
  right: 0;
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-medium);
}

.mobile-drawer-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-cream-alt);
  border: 1px solid var(--border-medium);
  font-size: 1.25rem;
  color: var(--umber-text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.mobile-drawer-close:hover {
  background: var(--terracotta);
  color: #FFFFFF;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 2rem;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-family: var(--font-heading-sans);
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--forest-green);
  transition: all var(--transition-fast);
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
  background: var(--forest-green-subtle);
  color: var(--terracotta);
  border-color: rgba(196, 93, 62, 0.3);
  transform: translateX(4px);
}

.mobile-drawer-footer {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-medium);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.drawer-hours-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--forest-green-subtle);
  color: var(--forest-green);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  border: 1px solid rgba(27, 56, 40, 0.15);
}

.drawer-hours-badge i {
  color: var(--terracotta);
}

/* ==========================================================================
   2. Sticky Mobile Bottom Quick Bar
   ========================================================================== */
.mobile-sticky-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(251, 248, 242, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border-medium);
  padding: 0.65rem 1rem;
  z-index: 90;
  box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.08);
}

.mobile-sticky-inner {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.65rem;
  max-width: 500px;
  margin: 0 auto;
}

.mobile-sticky-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.5rem 0.25rem;
  border-radius: var(--radius-md);
  font-family: var(--font-heading-sans);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  transition: all var(--transition-fast);
}

.mobile-sticky-btn i {
  font-size: 1.1rem;
}

.mobile-sticky-btn.btn-call {
  background: var(--terracotta);
  color: #FFFFFF;
}

.mobile-sticky-btn.btn-directions {
  background: var(--forest-green);
  color: #FFFFFF;
}

.mobile-sticky-btn.btn-photos {
  background: var(--brass-gold-light);
  color: #7D5716;
  border: 1px solid var(--brass-gold-border);
}

.mobile-sticky-btn.btn-photos.active {
  background: var(--brass-gold);
  color: #FFFFFF;
}

@media (max-width: 768px) {
  .mobile-sticky-bar {
    display: block;
  }
  body {
    padding-bottom: 72px; /* Space for sticky bar */
  }
}

/* ==========================================================================
   3. Hours Badges & Direct Display Helpers
   ========================================================================== */
.hours-badge-top {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.12);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
}

.hours-badge-top i {
  color: var(--brass-gold);
}

.visit-hours-direct-box {
  border-left: 4px solid var(--forest-green);
  background: var(--bg-card-warm);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
}

.hours-highlight-text {
  font-size: 1.2rem;
  color: var(--forest-green);
  font-family: var(--font-heading-sans);
  margin-bottom: 0.25rem;
}

/* ==========================================================================
   4. Gallery Fullscreen Lightbox
   ========================================================================== */
.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(14, 26, 19, 0.95);
  backdrop-filter: blur(12px);
  z-index: 1010;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.lightbox-modal.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content-box {
  position: relative;
  max-width: 900px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-image-wrap {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
  border: 4px solid rgba(255, 255, 255, 0.15);
  max-height: 72vh;
}

.lightbox-image-wrap img {
  max-width: 100%;
  max-height: 72vh;
  object-fit: contain;
  display: block;
}

.lightbox-caption {
  margin-top: 1rem;
  text-align: center;
  color: #FAF6EF;
}

.lightbox-caption-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: #FFFFFF;
}

.lightbox-caption-tag {
  font-family: var(--font-heading-sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--brass-gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.lightbox-close-btn {
  position: absolute;
  top: -3.5rem;
  right: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #FFFFFF;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.lightbox-close-btn:hover {
  background: var(--terracotta);
  border-color: var(--terracotta);
}

.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #FFFFFF;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  z-index: 10;
}

.lightbox-nav-btn:hover {
  background: var(--forest-green);
  border-color: var(--brass-gold);
}

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

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

@media (max-width: 1024px) {
  .lightbox-nav-btn.prev-btn {
    left: 0.5rem;
  }
  .lightbox-nav-btn.next-btn {
    right: 0.5rem;
  }
  .lightbox-close-btn {
    top: 1rem;
    right: 1rem;
  }
}

/* ==========================================================================
   5. Floating Back-to-Top Button
   ========================================================================== */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--forest-green);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  z-index: 80;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all var(--transition-normal);
}

.back-to-top.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--terracotta);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

@media (max-width: 768px) {
  .back-to-top {
    bottom: 5.5rem; /* Above mobile sticky bar */
    right: 1rem;
  }
}

/* ==========================================================================
   6. Toast Notifications
   ========================================================================== */
.toast-notice {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--umber-dark);
  color: #FAF6EF;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-heading-sans);
  font-size: 0.92rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(255, 255, 255, 0.15);
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.toast-notice.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.toast-notice i {
  color: var(--brass-gold);
}

/* ==========================================================================
   7. Micro-Interactions & Scroll Animations
   ========================================================================== */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays */
.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }
.delay-400 { transition-delay: 0.4s; }
.delay-500 { transition-delay: 0.5s; }

/* Accessible Focus States */
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--terracotta);
  outline-offset: 3px;
}

/* Reduced Motion Mode */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
