/* ==========================================================================
   THE GLITCH — UNIFIED HEADER / NAVBAR STYLESHEET (assets/header.css)
   Ensures 100% pixel-perfect consistency across all pages (Home, Our Pubs,
   Food & Drinks, Gallery, and Contact), independent of Tailwind or JS timing.
   ========================================================================== */

/* Main Header Wrapper */
.glitch-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(5, 8, 12, 0.92);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: background-color 0.3s ease, border-color 0.3s ease;
  width: 100%;
}

/* Header Container */
.glitch-header-inner {
  max-width: 80rem; /* max-w-7xl */
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
  height: 5rem; /* 80px / h-20 */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

@media (min-width: 640px) {
  .glitch-header-inner {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .glitch-header-inner {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* Brand Logo Link & Image */
.glitch-header-logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  text-decoration: none;
}

.glitch-header-logo-img {
  height: 3rem; /* 48px */
  max-height: 3.5rem; /* 56px */
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(77, 238, 234, 0.4));
  transition: transform 0.3s ease, filter 0.3s ease;
}

@media (min-width: 640px) {
  .glitch-header-logo-img {
    height: 3.5rem; /* 56px */
  }
}

.glitch-header-logo-link:hover .glitch-header-logo-img {
  transform: scale(1.04);
  filter: drop-shadow(0 0 16px rgba(77, 238, 234, 0.65));
}

/* Desktop Navigation */
.glitch-header-nav {
  display: none;
  align-items: center;
  gap: 1.75rem; /* gap-7 */
  font-size: 0.875rem; /* 14px */
  font-weight: 500;
  color: #cbd5e1; /* neutral-300 */
}

@media (min-width: 768px) {
  .glitch-header-nav {
    display: flex;
  }
}

@media (min-width: 1024px) {
  .glitch-header-nav {
    gap: 2rem; /* lg:gap-8 */
  }
}

/* Nav Items */
.glitch-nav-link {
  color: #cbd5e1;
  text-decoration: none;
  position: relative;
  padding-top: 0.375rem;
  padding-bottom: 0.375rem;
  transition: color 0.2s ease;
  font-family: inherit;
}

.glitch-nav-link:hover {
  color: #ffffff;
}

/* Active Page Indicator Underline */
.glitch-nav-link.active {
  color: #ffffff;
  font-weight: 600;
}

.glitch-nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: #4deeea;
  border-radius: 9999px;
  box-shadow: 0 0 10px rgba(77, 238, 234, 0.7);
}

/* Right Actions Cluster */
.glitch-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Book a Table Pill Button — Fully Responsive (Mobile & Desktop) */
.glitch-book-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.45rem 0.875rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background-color: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  white-space: nowrap;
  text-decoration: none;
}

@media (min-width: 640px) {
  .glitch-book-btn {
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
  }
}

@media (max-width: 380px) {
  .glitch-book-btn {
    padding: 0.375rem 0.7rem;
    font-size: 0.72rem;
  }
}

.glitch-book-btn:hover {
  background-color: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 16px rgba(77, 238, 234, 0.25);
  transform: translateY(-1px);
}

.glitch-book-btn:active {
  transform: scale(0.96);
}

.glitch-book-btn svg {
  width: 1rem;
  height: 1rem;
  color: #4deeea;
  flex-shrink: 0;
}

/* Mobile Hamburger Button */
.glitch-hamburger-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  color: #cbd5e1;
  background: transparent;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.glitch-hamburger-btn:hover {
  color: #ffffff;
}

.glitch-hamburger-btn:focus {
  outline: none;
}

@media (min-width: 768px) {
  .glitch-hamburger-btn {
    display: none;
  }
}

.glitch-hamburger-btn svg {
  width: 1.5rem;
  height: 1.5rem;
}

/* Mobile Navigation Drawer */
.glitch-mobile-drawer {
  display: none;
  background-color: #070b10;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.25rem 1.5rem;
  flex-direction: column;
  gap: 0.75rem;
  animation: glitchDrawerFadeIn 0.2s ease-out;
}

@keyframes glitchDrawerFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.glitch-mobile-drawer.is-open {
  display: flex !important;
}

@media (min-width: 768px) {
  .glitch-mobile-drawer {
    display: none !important;
  }
}

.glitch-mobile-nav-link {
  display: block;
  font-size: 1rem;
  color: #cbd5e1;
  text-decoration: none;
  padding: 0.5rem 0;
  transition: color 0.2s ease;
}

.glitch-mobile-nav-link:hover {
  color: #ffffff;
}

.glitch-mobile-nav-link.active {
  color: #4deeea;
  font-weight: 600;
}

.glitch-mobile-drawer-btn {
  width: 100%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-weight: 500;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: all 0.2s ease;
}

.glitch-mobile-drawer-btn:hover {
  background-color: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.4);
}

/* ==========================================================================
   THE GLITCH — PRELOADER & REDIRECT TRANSITION (2 to 3 SECONDS)
   ========================================================================== */
#glitchPageLoader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background-color: #060a0f;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
  user-select: none;
  -webkit-user-select: none;
}

/* Later pages in the same visit: no branded loading screen, only a plain dark cover until styles apply. */
html.glitch-returning #glitchPageLoader > * {
  display: none !important;
}
html.glitch-returning #glitchPageLoader {
  transition: opacity 0.15s ease-out, visibility 0.15s ease-out;
}

#glitchPageLoader.loader-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.glitch-loader-glow {
  position: absolute;
  width: 22rem;
  height: 22rem;
  border-radius: 9999px;
  background: radial-gradient(circle, rgba(255, 42, 133, 0.25) 0%, rgba(77, 238, 234, 0.2) 50%, transparent 75%);
  filter: blur(52px);
  pointer-events: none;
  animation: glitch-pulse-glow 2.2s ease-in-out infinite alternate;
}

.glitch-loader-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.glitch-spinner-box {
  position: relative;
  width: 7.5rem;
  height: 7.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.glitch-ring-cyan {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  border: 2px solid transparent;
  border-top-color: #4deeea;
  border-right-color: rgba(77, 238, 234, 0.45);
  animation: glitch-spin-cw 1.1s linear infinite;
  filter: drop-shadow(0 0 8px rgba(77, 238, 234, 0.8));
}

.glitch-ring-pink {
  position: absolute;
  inset: 8px;
  border-radius: 9999px;
  border: 2px solid transparent;
  border-bottom-color: #ff2a85;
  border-left-color: rgba(255, 42, 133, 0.45);
  animation: glitch-spin-ccw 1.3s linear infinite;
  filter: drop-shadow(0 0 8px rgba(255, 42, 133, 0.8));
}

.glitch-loader-logo {
  height: 3.25rem;
  max-height: 3.25rem;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 16px rgba(77, 238, 234, 0.85));
  animation: glitch-pulse-logo 1.8s ease-in-out infinite;
}

.glitch-loader-meta {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}

.glitch-loader-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #4deeea;
  text-shadow: 0 0 12px rgba(77, 238, 234, 0.7);
}

.glitch-loader-track {
  width: 10.5rem;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6);
}

.glitch-loader-bar {
  position: absolute;
  inset: 0;
  width: 100%;
  background: linear-gradient(90deg, #ff2a85, #4deeea, #ff2a85);
  background-size: 200% 100%;
  border-radius: 9999px;
  animation: glitch-bar-slide 1.4s ease-in-out infinite;
}

.glitch-loader-tagline {
  font-size: 10px;
  letter-spacing: 0.25em;
  color: #94a3b8;
  font-weight: 700;
  text-transform: uppercase;
  padding-top: 2px;
}

@keyframes glitch-spin-cw {
  to { transform: rotate(360deg); }
}

@keyframes glitch-spin-ccw {
  to { transform: rotate(-360deg); }
}

@keyframes glitch-bar-slide {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(0%); }
  100% { transform: translateX(100%); }
}

@keyframes glitch-pulse-logo {
  0%, 100% { transform: scale(1); opacity: 0.95; }
  50% { transform: scale(1.06); opacity: 1; }
}

@keyframes glitch-pulse-glow {
  0% { transform: scale(0.9); opacity: 0.5; }
  100% { transform: scale(1.15); opacity: 0.85; }
}

/* ==========================================================================
   INTERACTIVE BOOKING MODAL — FULL RESPONSIVENESS & BULLETPROOF STYLING
   ========================================================================== */
#bookingModal {
  position: fixed;
  inset: 0;
  z-index: 10000 !important;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background-color: rgba(0, 0, 0, 0.84);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

#bookingModal:not(.is-open) {
  display: none !important;
}

#bookingModal.is-open {
  display: flex !important;
}

#bookingModal .booking-modal-card {
  background-color: #0c1219;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 1.25rem;
  width: 100%;
  max-width: 32rem;
  margin: auto;
  position: relative;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.9), 0 0 35px rgba(77, 238, 234, 0.15);
  animation: glitchModalPop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes glitchModalPop {
  0% {
    opacity: 0;
    transform: scale(0.95) translateY(12px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Ensure mobile form fields never trigger iOS auto-zoom (< 16px) */
#bookingModal input,
#bookingModal select,
#bookingModal textarea {
  font-size: 16px;
  color-scheme: dark;
}

@media (min-width: 640px) {
  #bookingModal input,
  #bookingModal select,
  #bookingModal textarea {
    font-size: 0.875rem;
  }
}

@media (max-width: 639px) {
  #bookingModal {
    padding: 0.75rem 0.6rem;
    align-items: center;
  }
  #bookingModal .booking-modal-card {
    padding: 1.35rem 1.15rem !important;
    max-height: 88vh;
    max-height: 88dvh;
    border-radius: 1.1rem;
  }
}

/* Custom Styled Close Button with generous touch target */
.booking-modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 20;
}

.booking-modal-close-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  transform: scale(1.05);
}

.booking-modal-close-btn:active {
  transform: scale(0.94);
}

/* ==========================================================================
   BOOKING MODAL — VISUAL PUB SELECTOR, INPUTS & CONFIRMATION TICKET
   ========================================================================== */

/* Visual Pub Selection Cards / Tabs */
.booking-pub-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 0.5rem;
}

.booking-pub-tab {
  position: relative;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.85rem;
  padding: 0.75rem 0.85rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.22s ease;
  user-select: none;
}

.booking-pub-tab:hover {
  background-color: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

/* Pub 01 Active State (Prince of Wales Rd Cyan) */
.booking-pub-tab.active-pub1 {
  background: linear-gradient(135deg, rgba(92, 225, 230, 0.12) 0%, rgba(8, 13, 20, 0.9) 100%);
  border-color: #5ce1e6;
  box-shadow: 0 0 20px rgba(92, 225, 230, 0.25), inset 0 0 12px rgba(92, 225, 230, 0.08);
}
.booking-pub-tab.active-pub1 .pub-tab-badge {
  background-color: rgba(92, 225, 230, 0.2);
  border-color: rgba(92, 225, 230, 0.5);
  color: #5ce1e6;
}

/* Pub 02 Active State (Norwich Market Pink) */
.booking-pub-tab.active-pub2 {
  background: linear-gradient(135deg, rgba(255, 59, 148, 0.12) 0%, rgba(8, 13, 20, 0.9) 100%);
  border-color: #ff3b94;
  box-shadow: 0 0 20px rgba(255, 59, 148, 0.25), inset 0 0 12px rgba(255, 59, 148, 0.08);
}
.booking-pub-tab.active-pub2 .pub-tab-badge {
  background-color: rgba(255, 59, 148, 0.2);
  border-color: rgba(255, 59, 148, 0.5);
  color: #ff3b94;
}

/* Form Input & Validation States */
#bookingForm input.is-invalid,
#bookingForm select.is-invalid,
#bookingForm textarea.is-invalid {
  border-color: #fb7185 !important;
  box-shadow: 0 0 10px rgba(251, 113, 133, 0.3) !important;
  background-color: rgba(251, 113, 133, 0.04) !important;
}

.booking-error-msg {
  color: #fb7185;
  font-size: 0.72rem;
  font-weight: 600;
  margin-top: 0.25rem;
  display: block;
  min-height: 1rem;
}

/* Styled Confirmation Ticket */
.booking-ticket {
  background: linear-gradient(180deg, #090e15 0%, #06090f 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1rem;
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
}

.booking-ticket-header {
  border-bottom: 1px dashed rgba(255, 255, 255, 0.18);
  padding-bottom: 0.85rem;
  margin-bottom: 0.85rem;
  position: relative;
}

.booking-ticket-header::before,
.booking-ticket-header::after {
  content: '';
  position: absolute;
  bottom: -0.45rem;
  width: 0.9rem;
  height: 0.9rem;
  background-color: #0c1219;
  border-radius: 50%;
}
.booking-ticket-header::before {
  left: -1.75rem;
}
.booking-ticket-header::after {
  right: -1.75rem;
}

