/* =========================================================
   KLIKCAFE CSS v3.3 (STABLE + JOURNEY CONTRACT LAYER)
   ========================================================= */

/* =========================================================
   1. RESET
   ========================================================= */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;

  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;

  background: var(--bg, #ffffff);
  color: var(--text, #111111);
}

img {
  max-width: 100%;
  display: block;
}

h1,
h2,
h3,
p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}
body[data-page="menu"] {
  --page-colour: var(--menu-colour);
}

body[data-page="findus"] {
  --page-colour: var(--findus-colour);
}

body[data-page="hours"] {
  --page-colour: var(--hours-colour);
}

body[data-page="spotlight"] {
  --page-colour: var(--spotlight-colour);
}

body[data-page="wander"] {
  --page-colour: var(--wander-colour);
}
/* =========================================================
   2. VISIBILITY / APP READY STATE
   ========================================================= */

body {
  visibility: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;

  background:
    var(--page-background-image, none) center/cover no-repeat fixed,
    var(--bg);
}

body.page-ready {
  visibility: visible;
}

.hidden {
  display: none !important;
}

/* =========================================================
   3. THEME CONTRACT
   ========================================================= */

:root {
  --bg: #ffffff;
  --surface: #f7f7f7;
  --text: #111111;
  --muted: #666666;

  --cta-bg: #111111;
  --cta-text: #ffffff;

  --card-border: #e6e6e6;

  --radius: 12px;
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.06);

  --accent: #111111;

  /* PAGE COLOURS */

  --menu-colour: #2f80ed;
  --findus-colour: #27ae60;
  --hours-colour: #f2994a;
  --spotlight-colour: #9b51e0;
  --wander-colour: #8b5e3c; /* coffee brown */
  --catalogue-colour: #666;
  --on-colour: #ffffff;

  /* default */
  --page-colour: var(--menu-colour);

  /* SPACING SYSTEM */
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;

  --page-max: 480px;
}

/* =========================================================
   4. LAYOUT CORE
   ========================================================= */

.page {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* DISCOVERY FULL WIDTH */
body.discovery-page .page {
  max-width: none;
  margin: 0;
  padding: var(--space-md);
}

/* =========================================================
   5. HEADER
   ========================================================= */

#siteHeader {
  display: flex;
  align-items: center;
  justify-content: flex-start;

  width: 100%;
  padding: var(--space-lg) var(--space-md);
}

#logo {
  font-size: 1rem;
  font-weight: 700;
  padding-left: 2ch;
}

/* CLOSE BUTTON (THEMED CONTROL) */
#closePageButton {
  margin-left: auto;

  width: 44px;
  height: 44px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: var(--surface);
  color: var(--text);

  border: 1px solid var(--card-border);
  border-radius: var(--radius);

  box-shadow: var(--shadow);

  font-size: 18px;
  cursor: pointer;

  transition:
    transform 120ms ease,
    filter 120ms ease;
}

#closePageButton:active {
  transform: scale(0.98);
}

body.discovery-page #closePageButton {
  display: none;
}

body.content-page #siteHeader {
  justify-content: space-between;
}

/* =========================================================
   6. DISCOVERY NAV
   ========================================================= */

#discoveryMain {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-xl) 0;
}

.nav-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  width: 100%;
}

.nav-button {
  width: 100%;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: var(--space-lg);

  border: 1px solid var(--card-border);
  border-radius: var(--radius);

  box-shadow: var(--shadow);

  font-size: 16px;
  font-weight: 600;

  transition:
    transform 120ms ease,
    filter 120ms ease;
}
.nav-button.menu {
  background: var(--menu-colour);
  color: var(--on-colour);
}

.nav-button.findus {
  background: var(--findus-colour);
  color: var(--on-colour);
}

.nav-button.hours {
  background: var(--hours-colour);
  color: var(--on-colour);
}

.nav-button.spotlight {
  background: var(--spotlight-colour);
  color: var(--on-colour);
}

.nav-button.wander {
  background: var(--wander-colour);
  color: var(--on-colour);
}
.nav-button.catalogue {
  background: var(--catalogue-colour);
  color: var(--on-colour);
}
.nav-button:active {
  transform: scale(0.98);
}

.nav-button:hover {
  filter: brightness(0.98);
}

/* =========================================================
   7. HERO
   ========================================================= */

#heroSection {
  text-align: center;
  padding: var(--space-xl) 0;
}

#heroCafeName {
  margin-bottom: var(--space-sm);
}

#heroTagline {
  color: var(--muted);
}

/* =========================================================
   8. MENU SYSTEM
   ========================================================= */

#menuContainers {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  padding: var(--space-xl) 0;
  width: 100%;
}

.menu-container {
  width: 100%;
  background: var(--surface);
  border: 2px solid var(--page-colour);
  border-radius: var(--radius);
  overflow: hidden;
}

/* MENU CTA = JOURNEY ENTRY */
.menu-cta {
  width: 100%;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: var(--space-lg);

  background: var(--page-colour);
  color: var(--on-colour);

  border: none;

  font-size: 16px;
  font-weight: 600;

  cursor: pointer;
}

.menu-body {
  width: 100%;
  padding: var(--space-md);
}

.menu-section {
  width: 100%;
  margin-bottom: var(--space-md);
  border-bottom: 1px solid var(--card-border);
}

.section-header {
  width: 100%;
  padding: var(--space-md);

  border: none;
  background: var(--surface);
  border-radius: var(--radius);
  border-left: 5px solid var(--page-colour);
  text-align: left;

  font-size: 16px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--text);

  cursor: pointer;
}

.section-items {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding-top: var(--space-sm);
}

/* MENU ITEM */
.menu-item {
  width: 100%;

  padding: var(--space-md);

  background: var(--bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);

  font-size: 16px;
  line-height: 1.4;

  color: var(--text);

  display: flex;
  justify-content: space-between;
  align-items: center;
}
/* ============================================================
   OPENING HOURS
   ============================================================ */

.hours-card {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;

  padding: var(--space-lg);

  text-align: center;
}

.hours-card h1 {
  margin-bottom: var(--space-lg);
}
.hours-card {
  border: 2px solid var(--hours-colour);
}
.hours-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.hours-row {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 12px 16px;

  border-radius: 12px;

  background: rgba(255, 255, 255, 0.08);
}

.hours-day {
  font-weight: 600;
}

.hours-time {
  opacity: 0.85;
}
.hours-row.today {
  border: 2px solid var(--hours-colour);
  border-radius: 12px;
  padding: 10px 12px;
}
.hours-row.today {
  font-weight: 700;
  transform: scale(1.02);
}
/* ============================================================
   HOLIDAY OPENINGS
   ============================================================ */

.holiday-hours {
  width: 100%;
  margin-top: var(--space-md);

  text-align: center;
}
.holiday-hours {
  margin-top: var(--space-xl);
}
.holiday-hours details {
  width: 100%;
}

.holiday-hours summary {
  cursor: pointer;

  color: var(--hours-colour);

  font-weight: 600;

  list-style: none;
}

.holiday-hours summary::-webkit-details-marker {
  display: none;
}

.holiday-hours summary::after {
  content: " ▾";
  font-size: 0.9em;
}

.holiday-hours details[open] summary::after {
  content: " ▴";
}

.holiday-hours-content {
  margin-top: var(--space-sm);

  padding: var(--space-sm);

  border-top: 1px solid var(--hours-colour);

  opacity: 0.9;
}
/* =========================================================
   9. MODAL
   ========================================================= */

.modal {
  position: fixed;
  inset: 0;
  display: none;

  background: rgba(0, 0, 0, 0.6);

  justify-content: center;
  align-items: center;
}

.modal:not(.hidden) {
  display: flex;
}

.modal-content {
  width: 92%;
  max-width: 420px;
  border-top: 6px solid var(--page-colour);
  background: var(--bg);
  border-radius: var(--radius);

  padding: var(--space-md);

  max-height: 80vh;
  overflow-y: auto;

  box-shadow: var(--shadow);
}
/* =========================================================
   
  10. FIND US
   ========================================================= */
.findus-card {
  max-width: 520px;
  margin: 0 auto;

  display: flex;
  flex-direction: column;

  gap: 24px;
}

.address-card {
  padding: 20px;

  border: 2px solid var(--findus-colour);

  border-radius: 12px;

  text-align: center;
}

.address-line {
  margin: 6px 0;
}

#map {
  width: 100%;

  height: 320px;

  border-radius: 12px;

  overflow: hidden;
}
/* =========================================================
   SPOTLIGHT
   Snapshot driven visual showcase
   ========================================================= */

.spotlight-viewer {
  width: 100%;

  display: flex;
  flex-direction: column;
  align-items: center;

  gap: var(--space-lg);
}

.spotlight-img {
  width: 100%;
  max-width: 480px;

  aspect-ratio: 4 / 3;

  object-fit: cover;

  border: 4px solid var(--spotlight-colour);

  border-radius: var(--radius);

  box-shadow: var(--shadow);

  cursor: pointer;
}

.spotlight-title {
  width: 100%;

  text-align: center;

  font-size: 1.2rem;

  font-weight: 600;

  color: var(--text);

  margin-top: var(--space-sm);
}
/* =========================================================
   SNAPSHOT REVEAL CONTROL
   ========================================================= */

.spotlight-img {
  opacity: 0;
  transition: opacity 200ms ease;
}

.spotlight-img.loaded {
  opacity: 1;
}

/* =========================================================
   WANDER FILTERS
   ========================================================= */

.wander-filters label {
  font-weight: 600;
}

.wander-filters select {
  width: 100%;

  padding: 12px;

  font-size: 16px;

  border: 2px solid var(--page-colour);
  border-radius: var(--radius);

  background: var(--bg);
  color: var(--text);
}
/* =========================================================
   WANDER FILTERS
   ========================================================= */

.wander-filters {
  width: 100%;

  display: flex;

  flex-direction: column;

  gap: var(--space-md);

  padding: var(--space-md);

  margin-bottom: var(--space-lg);

  border: 2px solid var(--page-colour);

  border-radius: var(--radius);

  background: var(--surface);
}

.wander-filters select {
  width: 100%;

  min-height: 44px;

  padding: 0 var(--space-md);

  border: 1px solid var(--page-colour);

  border-radius: var(--radius);

  background: var(--bg);

  color: var(--text);

  font-size: 16px;
}
/* =========================================================
   WANDER CONTROLS
   ========================================================= */

.wander-controls {
  width: 100%;

  display: flex;

  justify-content: center;

  gap: var(--space-md);

  margin-top: var(--space-lg);
}

.wander-controls button {
  width: 44px;
  height: 44px;

  display: flex;

  align-items: center;
  justify-content: center;

  border: 1px solid var(--wander-colour);

  border-radius: var(--radius);

  background: var(--bg);

  color: var(--text);

  font-size: 18px;

  cursor: pointer;
}

.wander-controls button:active {
  transform: scale(0.98);
}
/* =========================================================
   WANDER
   Snapshot driven visual explorer
   ========================================================= */

.wander-viewer {
  width: 100%;

  display: flex;

  flex-direction: column;

  align-items: center;

  gap: var(--space-lg);
}

.wander-img {
  width: 100%;

  max-width: 480px;

  aspect-ratio: 4 / 3;

  object-fit: cover;

  border: 4px solid var(--wander-colour);

  border-radius: var(--radius);

  box-shadow: var(--shadow);
}
#wanderImage.hidden {
  display: none;
}
.wander-title {
  width: 100%;

  text-align: center;

  font-size: 1.2rem;

  font-weight: 600;

  color: var(--text);

  margin-top: var(--space-sm);
}
.wander-nav-button {
  transition: opacity 0.2s ease;
}

.wander-nav-button:disabled {
  opacity: 0.35;
  cursor: default;
  filter: grayscale(100%);
}
:root {
  --catalogue-colour: #6c757d;
}

/* =========================
   CATALOGUE PAGE
========================= */

#cataloguePage {
  width: 100%;
}

/* =========================
   HEADER
========================= */

#catalogueHeader {
  width: 100%;
}

/* =========================
   FILTER BAR
========================= */

.catalogue-filter {
  background: var(--catalogue-colour);

  width: 100%;
}

.catalogue-filter-button {
  width: 100%;

  display: flex;

  align-items: center;

  gap: 12px;

  padding: 14px 16px;

  border: none;

  background: transparent;

  color: var(--on-colour);

  font-size: 1rem;

  font-weight: 600;

  cursor: pointer;
}

.catalogue-filter-button:hover {
  opacity: 0.9;
}

/* =========================
   DRAWER
========================= */

#catalogueDrawer {
  display: none;

  position: absolute;

  z-index: 1000;

  width: 280px;

  background: white;

  border-right: 1px solid #eee;

  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.catalogue-card {
  visibility: hidden;
}

#catalogue.images-ready .catalogue-card {
  visibility: visible;
}
.catalogue-card.ready {
  visibility: visible;
  opacity: 1;
}
#catalogueDrawer.open {
  display: block;
}
.menu-filter-btn,
.section-btn {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 12px 16px;
  cursor: pointer;
}

.menu-filter-btn {
  font-weight: 600;
}

.menu-sections {
  display: none;
  padding-left: 18px;
}

.menu-sections.open {
  display: block;
}

.section-btn {
  font-size: 0.95rem;
  color: #666;
}
/* =========================
   PRODUCT GRID
========================= */

#catalogue {
  display: grid;

  grid-template-columns: repeat(3, 1fr);

  gap: 16px;

  padding: 16px;
}
.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 12px;

  background: var(--catalogue-colour);

  color: var(--on-colour);

  font-weight: bold;
}
.close-filter {
  position: absolute;
  top: 10px;
  right: 10px;
}
.close-filter {
  border: none;

  background: none;

  color: inherit;

  font-size: 20px;

  cursor: pointer;
}
/* =========================
   MOBILE
========================= */

@media (max-width: 768px) {
  #catalogue {
    grid-template-columns: repeat(2, 1fr);

    padding: 12px;
  }

  #catalogueDrawer {
    width: 75%;
  }
}

/* =========================
   PRODUCT CARD
========================= */

.catalogue-card {
  cursor: pointer;
}

.catalogue-card img {
  width: 100%;

  aspect-ratio: 1/1;

  object-fit: cover;
}

.catalogue-card-title {
  text-align: center;

  padding: 8px;
}
/* =========================
   CATALOGUE GRID
========================= */

#catalogueGrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* =========================
   PRODUCT CARD
========================= */

.product-card {
  border: 1px solid #eee;
  background: white;

  cursor: pointer;

  overflow: hidden;
}

.product-image {
  width: 100%;
  aspect-ratio: 1 / 1;

  object-fit: cover;
}

.product-content {
  padding: 12px;
}

.product-content h3 {
  margin: 0 0 8px 0;
}

.product-price {
  font-weight: bold;
}

/* MOBILE */

@media (max-width: 768px) {
  #catalogueGrid {
    grid-template-columns: repeat(2, 1fr);
  }
}
/* =========================================================
   10. FOOTER
   ========================================================= */

#siteFooter {
  margin-top: auto;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);

  padding: var(--space-lg) 0;
  font-size: 16px;
}

.footer-links,
.footer-social {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.social-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.social-icon svg {
  width: 32px;
  height: 32px;
  display: block;
}
.footer-meta {
  font-weight: 600;
  opacity: 0.85;
}

#siteFooter a,
#siteFooter a:visited {
  color: var(--text);
}

#siteFooter a:hover {
  text-decoration: underline;
}
