/* ============================================================
   Variables
   ============================================================ */
:root {
  color-scheme: light;
  --brand: #ffd21f;
  --brand-dim: rgba(255, 210, 31, 0.16);
  --brand-strong: #c49700;
  --bg: #f6f2e0;
  --bg-alt: #edeadb;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: #ffffff;
  --text: #111111;
  --muted: #6b6353;
  --line: rgba(0, 0, 0, 0.09);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 56px rgba(0, 0, 0, 0.13);
  --radius: 16px;
  --radius-lg: 26px;
  --header-h: 64px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --brand-strong: #e6b800;
  --bg: #090909;
  --bg-alt: #0f0f11;
  --surface: rgba(18, 18, 20, 0.92);
  --surface-strong: #161618;
  --text: #eeebe2;
  --muted: #908772;
  --line: rgba(255, 255, 255, 0.08);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 56px rgba(0, 0, 0, 0.65);
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 15px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--text);
  background-color: var(--bg);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input { font: inherit; }
h1, h2, h3, p { margin: 0; }

.container {
  width: min(1180px, 100% - 40px);
  margin: 0 auto;
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
  width: min(1180px, 100% - 40px);
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  margin-right: auto;
}

.brand-logo {
  position: relative;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--brand);
  overflow: hidden;
  background: var(--brand-dim);
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.logo-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1rem;
  color: var(--brand-strong);
  opacity: 0;
  pointer-events: none;
}

.no-logo img { display: none; }
.no-logo .logo-fallback { opacity: 1; }

.brand-name {
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.2;
  max-width: 200px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  transition: background 160ms, color 160ms;
}

.nav-link:hover {
  background: var(--brand-dim);
  color: var(--brand-strong);
}

.icon-button {
  position: relative;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--text), transparent 90%);
  cursor: pointer;
}

.theme-icon {
  position: absolute;
  inset: 11px;
  border-radius: 50%;
  transition: opacity 200ms, transform 200ms;
}

.theme-icon-light {
  background: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-dim);
}

.theme-icon-dark {
  opacity: 0;
  background: #cbd5e1;
  clip-path: circle(58% at 68% 42%);
}

[data-theme="dark"] .theme-icon-light { opacity: 0; transform: scale(0.6) rotate(40deg); }
[data-theme="dark"] .theme-icon-dark { opacity: 1; }


/* ============================================================
   Sections
   ============================================================ */
.page-section {
  padding: clamp(52px, 7vw, 88px) 0;
}

.section-alt { background: var(--bg-alt); }

.section-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: clamp(20px, 3.5vw, 36px);
}

.section-title {
  font-size: clamp(1.65rem, 3.5vw, 2.5rem);
  font-weight: 900;
  letter-spacing: -0.015em;
}

.section-count {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

/* ============================================================
   Toolbar
   ============================================================ */
.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin-bottom: 28px;
}

.search-box { min-width: 0; }

.search-control {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  cursor: text;
  transition: border-color 180ms;
  box-shadow: var(--shadow);
}

.search-control:focus-within { border-color: var(--brand); }

.search-icon {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border: 2.5px solid var(--brand-strong);
  border-radius: 50%;
  box-shadow: 9px 9px 0 -6px var(--brand-strong);
  transform: rotate(-18deg);
  opacity: 0.7;
}

.search-control input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
}

.search-control input::-webkit-search-cancel-button { appearance: none; }

.search-clear {
  position: relative;
  display: none;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--text), transparent 88%);
  cursor: pointer;
}

.search-clear::before,
.search-clear::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 12px; height: 2px;
  border-radius: 999px;
  background: var(--muted);
}
.search-clear::before { transform: translate(-50%, -50%) rotate(45deg); }
.search-clear::after  { transform: translate(-50%, -50%) rotate(-45deg); }
.search-box.has-query .search-clear { display: inline-flex; }

.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: all 160ms ease;
  box-shadow: var(--shadow);
}

.chip:hover,
.chip.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #111;
}

/* ============================================================
   States
   ============================================================ */
.state-box {
  display: none;
  padding: 48px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  text-align: center;
}

.state-box.is-visible {
  display: grid;
  place-items: center;
  gap: 12px;
}

.loader {
  width: 40px;
  height: 40px;
  border: 3px solid var(--brand-dim);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.state-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #111;
  font-weight: 900;
  font-size: 1.1rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: #111;
  font-weight: 900;
  font-size: 0.88rem;
  cursor: pointer;
}

/* ============================================================
   Cards Grid
   ============================================================ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

/* ============================================================
   Link Card
   ============================================================ */
.link-card {
  position: relative;
  display: grid;
  grid-template-rows: 180px 1fr;
  min-height: 280px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  animation: rise 380ms ease both;
}

.link-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--brand), transparent 20%);
  box-shadow: 0 12px 40px rgba(255, 210, 31, 0.18);
}

.link-media {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, var(--brand-dim), transparent 60%),
    var(--bg-alt);
  display: grid;
  place-items: center;
}

.link-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 280ms ease;
}

.link-card:hover .link-media img { transform: scale(1.04); }

.link-media.has-pair {
  grid-template-columns: 1fr 1fr;
  place-items: stretch;
  background: transparent;
}

.link-placeholder {
  width: 68px; height: 68px;
  border-radius: 50%;
  background: var(--brand);
  color: #111;
  font-size: 1.7rem;
  font-weight: 900;
  display: grid;
  place-items: center;
}

.link-content {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 12px;
}

.link-meta {
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.link-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.link-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.open-status {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.52rem;
  font-weight: 900;
  text-transform: uppercase;
}
.open-status.is-open  { color: #10b85f; background: rgba(16, 184, 95, 0.1); }
.open-status.is-closed { color: #d85b5b; background: rgba(216, 91, 91, 0.08); }

.open-status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.link-about       { font-size: 0.78rem; line-height: 1.45; }
.link-description { font-size: 0.76rem; color: var(--muted); line-height: 1.4; }

.link-details { display: grid; gap: 12px; }

.link-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.link-gallery img {
  width: 100%; aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.link-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.link-action {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--brand);
  border-radius: 999px;
  background: var(--brand);
  color: #111;
  font-size: 0.76rem;
  font-weight: 800;
  transition: background 150ms;
}
.link-action:hover { background: var(--surface-strong); }

/* Hours panel */
.hours-panel { display: grid; gap: 8px; }

.hours-summary {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg), transparent 30%);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color 180ms;
}
.hours-summary:hover { border-color: var(--brand); }

.hours-today-label,
.hours-toggle { font-size: 0.6rem; font-weight: 900; text-transform: uppercase; color: var(--muted); }
.hours-toggle { color: var(--brand-strong); }
.hours-today-value { font-size: 0.76rem; font-weight: 700; overflow-wrap: anywhere; }

.hours-week { display: grid; gap: 5px; }

.hours-day {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.72rem;
  color: var(--muted);
}
.hours-day.is-today {
  color: var(--text);
  border-color: color-mix(in srgb, var(--brand), transparent 40%);
  background: var(--brand-dim);
}
.hours-day span:first-child { font-weight: 800; text-transform: uppercase; }

/* ============================================================
   Card Modal
   ============================================================ */
.card-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  place-items: center;
  padding: 20px;
}

.card-overlay.is-open {
  display: grid;
  animation: fadeIn 200ms ease;
}

.card-modal {
  position: relative;
  width: min(520px, 100%);
  max-height: 90dvh;
  overflow-y: auto;
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  box-shadow: var(--shadow-lg);
  animation: scaleUp 240ms ease;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.card-modal-close {
  position: sticky;
  top: 12px;
  float: right;
  margin: 12px 12px 0 0;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: color-mix(in srgb, var(--text), transparent 82%);
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 160ms;
  backdrop-filter: blur(8px);
}
.card-modal-close::before { content: "×"; }
.card-modal-close:hover { background: color-mix(in srgb, var(--text), transparent 70%); }

.card-modal-media {
  width: 100%;
  height: 260px;
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background:
    linear-gradient(135deg, var(--brand-dim), transparent 60%),
    var(--bg-alt);
  display: grid;
  place-items: center;
}

.card-modal-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-modal-media.has-pair {
  grid-template-columns: 1fr 1fr;
  place-items: stretch;
}

.card-modal-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--brand);
  color: #111;
  font-size: 2rem;
  font-weight: 900;
  display: grid;
  place-items: center;
}

.card-modal-body {
  display: grid;
  gap: 14px;
  padding: 20px 24px 28px;
  clear: both;
}

.card-modal-meta {
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.card-modal-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.card-modal-title {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -0.01em;
  line-height: 1.2;
  text-transform: uppercase;
}

.card-modal-about  { font-size: 0.9rem; line-height: 1.55; }
.card-modal-desc   { font-size: 0.88rem; color: var(--muted); line-height: 1.5; }

.card-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 4px;
}

.card-modal-action {
  display: inline-flex;
  align-items: center;
  height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--brand);
  border: 1px solid var(--brand);
  color: #111;
  font-size: 0.84rem;
  font-weight: 800;
  transition: background 150ms, transform 150ms;
}
.card-modal-action:hover { background: var(--surface-strong); transform: translateY(-2px); }

.card-modal-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.card-modal-gallery img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
}

/* ============================================================
   Gallery
   ============================================================ */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.gallery-item {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  padding: 0;
  box-shadow: var(--shadow);
}

.gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 300ms ease, filter 300ms ease;
}

.gallery-item:hover img {
  transform: scale(1.07);
  filter: brightness(1.06);
}

/* ============================================================
   Lightbox
   ============================================================ */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.93);
  place-items: center;
}

.lightbox.is-open {
  display: grid;
  animation: fadeIn 220ms ease;
}

.lightbox-img {
  max-width: min(94vw, 1080px);
  max-height: 90dvh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: scaleUp 240ms ease;
}

.lightbox-close {
  position: absolute;
  top: 20px; right: 20px;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  backdrop-filter: blur(8px);
  transition: background 160ms;
}
.lightbox-close::before { content: "×"; }
.lightbox-close:hover { background: rgba(255, 255, 255, 0.22); }

/* ============================================================
   Location
   ============================================================ */
.location-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.location-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.location-card-title {
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.location-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.9rem;
  line-height: 1.55;
}

.location-icon { flex: 0 0 auto; font-size: 1.05rem; margin-top: 2px; }

.location-actions { display: flex; flex-direction: column; gap: 10px; }

.location-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 800;
  transition: transform 160ms, box-shadow 160ms;
}
.location-action:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.location-action--whatsapp { background: #25d366; color: #fff; }
.location-action--maps     { background: var(--brand); color: #111; }
.location-action--phone    { background: var(--surface-strong); color: var(--text); border: 1px solid var(--line); }

.location-hours-row {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--muted);
}
.location-hours-row:last-of-type { border-bottom: 0; padding-bottom: 0; }
.location-hours-row > span:first-child { font-weight: 700; }
.location-hours-row.is-today { color: var(--text); }
.location-hours-row.is-today > span:first-child { color: var(--brand-strong); font-weight: 900; }

#locationLoading { grid-column: 1 / -1; border: none; background: transparent; box-shadow: none; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  padding: 36px 20px;
  text-align: center;
  border-top: 1px solid var(--line);
}

.developer-credit { display: inline-grid; place-items: center; gap: 2px; }

.developer-label {
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}

.meuweb-logo {
  font-family: "Oleo Script Swash Caps", cursive;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brand);
  transition: opacity 200ms;
}
.developer-credit:hover .meuweb-logo { opacity: 0.65; }

/* ============================================================
   Animations
   ============================================================ */
@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes rise    { from { opacity: 0; transform: translateY(14px); } }
@keyframes fadeIn  { from { opacity: 0; } }
@keyframes scaleUp { from { opacity: 0; transform: scale(0.93); } }

/* ============================================================
   Responsive — Tablet
   ============================================================ */
@media (max-width: 960px) {
  .toolbar { grid-template-columns: 1fr; }

  .category-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .category-chips::-webkit-scrollbar { display: none; }

  .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .location-wrap { grid-template-columns: 1fr; }
}

/* ============================================================
   Responsive — Mobile
   ============================================================ */
@media (max-width: 560px) {
  :root { --header-h: 56px; }
  html { font-size: 14px; }

  .brand-name { display: none; }

  .nav-link { font-size: 0.76rem; padding: 0 10px; height: 32px; }

  /* Cards horizontal on mobile */
  .cards-grid { grid-template-columns: 1fr; }

  .link-card {
    grid-template-columns: 38% minmax(0, 1fr);
    grid-template-rows: 1fr;
    min-height: 118px;
  }

  .link-card .link-media { min-height: 118px; }
  .link-media.has-pair { grid-template-columns: 1fr; }
  .link-media.has-pair img:not(:first-child) { display: none; }

  .link-meta { display: none; }
  .link-content { align-content: center; gap: 10px; padding: 10px; }

  /* Gallery 2 cols */
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .gallery-item { border-radius: 12px; }

}

/* ============================================================
   Responsive — Large
   ============================================================ */
@media (min-width: 1140px) {
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}

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