
/* ===== BASE ===== */

:root {
  color-scheme: dark;

  --cp-background: #121317;
  --cp-night: #0c0d11;
  --cp-night-soft: #101217;
  --cp-night-deep: #0b0c10;

  --cp-surface: #1f2026;
  --cp-surface-high: #282a32;
  --cp-border: #343640;

  --cp-primary: #f2ca50;
  --cp-primary-container: #d4af37;
  --cp-primary-fixed: #ffe088;
  --cp-secondary: #e7c17c;
  --cp-gold-dark: #5c4308;

  --cp-text: #f1f0f5;
  --cp-muted: #d0c9bb;

  --cp-light: #ffffff;
  --cp-light-surface: #f8f9fa;
  --cp-light-border: #e5e7eb;

  --cp-error: #ffb4ab;

  --cp-font-display: "Bodoni Moda", Georgia, serif;
  --cp-font-body: "Plus Jakarta Sans", sans-serif;
  --cp-font-label: "Space Grotesk", sans-serif;

  --cp-header-height: 80px;
  --cp-mobile-nav-height: 68px;
  --cp-ease: cubic-bezier(.22, 1, .36, 1);
}

/* ===== 01. BASE ===== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--cp-header-height) + 12px);
}

body {
  min-width: 0;
  margin: 0;
  background-color: var(--cp-background);
  color: var(--cp-text);
  font-family: var(--cp-font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img,
svg {
  max-width: 100%;
}

img {
  display: block;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: not-allowed;
}

a {
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none;
}

:focus-visible {
  outline: 2px solid var(--cp-primary);
  outline-offset: 3px;
}

::selection {
  color: #2b2100;
  background: var(--cp-primary);
}

section[id] {
  scroll-margin-top: calc(var(--cp-header-height) + 12px);
}

#contenido-principal {
  position: relative;
  isolation: isolate;
}

/* ===== 02. ACCESIBILIDAD ===== */

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 300;
  padding: 12px 18px;
  border-radius: 8px;
  background: var(--cp-primary);
  color: #2b2100;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

/* ===== 03. TIPOGRAFÍA ===== */

.font-headline-lg,
.font-headline-md,
.font-headline-sm,
.font-display-hero {
  font-family: var(--cp-font-display);
}

.font-label-caps,
.font-label-data {
  font-family: var(--cp-font-label);
}

.material-symbols-outlined {
  display: inline-block;
  flex-shrink: 0;
  inline-size: 1em;
  block-size: 1em;
  overflow: hidden;
  font-family: "Material Symbols Outlined";
  font-weight: 400;
  font-style: normal;
  line-height: 1;
  white-space: nowrap;
  font-feature-settings: "liga";
  vertical-align: middle;
  font-variation-settings:
    "FILL" 0,
    "wght" 400,
    "GRAD" 0,
    "opsz" 24;
}

/* ===== 04. CABECERA ===== */

.site-header {
  background-color: rgba(18, 19, 23, .95);
  border-bottom-color: rgba(52, 54, 64, .8);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  transition:
    background-color 250ms ease,
    box-shadow 250ms ease;
}

.site-header.is-scrolled {
  background-color: rgba(18, 19, 23, .985);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
}

.site-header nav[aria-label="Navegación principal"] {
  min-width: 0;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--cp-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 180ms ease;
}

.nav-link:hover,
.nav-link[aria-current="location"] {
  color: var(--cp-primary);
}

.halloween-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  flex-shrink: 0;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}

.halloween-toggle:hover {
  border-color: var(--cp-primary);
}

/* ===== 05. HERO CÓSMICO ===== */

#inicio {
  isolation: isolate;
}

#inicio > .nebula-pulse {
  z-index: 0;
}

#inicio > .relative {
  z-index: 2;
}

#inicio .ufo-ship {
  transform-origin: center;
  filter: drop-shadow(
    0 0 12px rgba(242, 202, 80, .18)
  );
  animation: cp-ufo-float 6.5s ease-in-out infinite;
}

#inicio .orbit-ring {
  transform-origin: center;
  animation: cp-orbit-rotate 90s linear infinite;
}

/* ===== 06. ÓRBITAS DECORATIVAS ===== */

.cp-section-ambient {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.cp-section-ambient svg {
  position: absolute;
  width: clamp(190px, 26vw, 360px);
  height: auto;
  opacity: .11;
  overflow: visible;
}

.cp-section-ambient--right svg {
  top: 8%;
  right: -5%;
}

.cp-section-ambient--left svg {
  left: -5%;
  bottom: 4%;
}

.cp-section-ambient--center svg {
  top: 3%;
  left: 50%;
  transform: translateX(-50%);
}

#momentos,
#carta,
#carta-digital,
#pasteleria,
#catering {
  position: relative;
  isolation: isolate;
}

#momentos > :not(.cp-section-ambient),
#carta > :not(.cp-section-ambient),
#carta-digital > :not(.cp-section-ambient),
#pasteleria > :not(.cp-section-ambient),
#catering > :not(.cp-section-ambient) {
  position: relative;
  z-index: 1;
}

/* ===== 07. DELIMITADORES CÓSMICOS SIN DIFUMINADO ===== */

.cp-cosmic-divider {
  --cp-divider-color: #121317;

  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 62px;
  margin: 0;
  padding: 6px 20px;

  background-color: var(--cp-divider-color);
  background-image: none;

  overflow: hidden;
  pointer-events: none;
}

.cp-cosmic-divider--dark {
  --cp-divider-color: #121317;
}

.cp-cosmic-divider--dark-light {
  --cp-divider-color: #ffffff;
}

.cp-cosmic-divider--light-dark {
  --cp-divider-color: #101217;
}

.cp-cosmic-divider--light-dark-alt,
.cp-cosmic-divider--dark-dark {
  --cp-divider-color: #121317;
}

.cp-cosmic-divider--night-dark,
.cp-cosmic-divider--light {
  --cp-divider-color: #ffffff;
}

.cp-cosmic-divider__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 1152px);
  margin-inline: auto;
}

.cp-cosmic-divider svg {
  display: block;
  width: min(100%, 896px);
  height: auto;
  max-height: 48px;
  overflow: visible;
}

.cosmic-divider {
  margin-block: 0;
}

.cosmic-divider > svg,
.cosmic-divider > div > svg {
  display: block;
  width: min(100%, 900px);
  height: auto;
  max-height: 52px;
  margin-inline: auto;
}

/* ===== 08. ESTRELLAS Y NEBULOSAS ===== */

.star-twinkle-1 {
  animation: cp-twinkle 3.5s ease-in-out infinite;
}

.star-twinkle-2 {
  animation: cp-twinkle 4.8s ease-in-out -1.2s infinite;
}

.star-twinkle-3 {
  animation: cp-twinkle 3s ease-in-out -.6s infinite;
}

.nebula-pulse {
  transform-origin: center;
  animation: cp-nebula-pulse 9s ease-in-out infinite;
}

/* ===== 09. TARJETAS ===== */

#momentos article,
#destacados article,
#cafe article,
#resenas article,
.menu-item {
  min-width: 0;
}

#momentos article,
#destacados article,
.menu-item {
  transition:
    transform 300ms var(--cp-ease),
    box-shadow 300ms ease,
    border-color 300ms ease;
}

@media (hover: hover) {
  #momentos article:hover,
  #destacados article:hover,
  .menu-item:hover {
    transform: translateY(-3px);
  }
}

/* ===== 10. ESPECIALIDADES ===== */

#destacados {
  color: #121317;
}

#destacados article img {
  object-fit: cover;
}

#destacados article a {
  min-height: 44px;
}

/* ===== 11. PASTELERÍA ===== */

#pasteleria figure {
  isolation: isolate;
}

#pasteleria figure img {
  transition: transform 450ms ease;
}

@media (hover: hover) {
  #pasteleria figure:hover img {
    transform: scale(1.04);
  }
}

/* ===== 12. CAFÉ ===== */

#cafe {
  color: #121317;
}

#cafe article {
  min-width: 0;
}

/* ===== 13. ACCESOS RÁPIDOS ===== */

.quick-action-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;

  border: 1px solid var(--cp-border);
  border-radius: 12px;

  background: var(--cp-surface);
  color: var(--cp-text);

  font-family: var(--cp-font-label);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .04em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;

  transition:
    color 200ms ease,
    background-color 200ms ease,
    border-color 200ms ease;
}

.quick-action-chip:hover {
  background: var(--cp-surface-high);
  color: var(--cp-primary);
  border-color: rgba(242, 202, 80, .45);
}

.quick-action-chip--primary {
  color: var(--cp-primary);
  background: rgba(242, 202, 80, .13);
  border-color: rgba(242, 202, 80, .35);
}

.quick-action-chip--primary:hover {
  color: #2b2100;
  background: var(--cp-primary);
}

/* ===== 14. CARTA DIGITAL ===== */

#category-chips {
  scrollbar-width: thin;
  scrollbar-color: var(--cp-border) transparent;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

#category-chips button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  flex-shrink: 0;
  padding: 9px 16px;

  border: 1px solid transparent;
  border-radius: 12px;

  background: var(--cp-surface);
  color: var(--cp-muted);

  font-family: var(--cp-font-label);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;

  transition:
    background-color 200ms ease,
    border-color 200ms ease,
    color 200ms ease;
}

#category-chips button:hover {
  background: var(--cp-surface-high);
  border-color: rgba(242, 202, 80, .35);
}

#category-chips button.is-active,
#category-chips button[aria-pressed="true"] {
  background: var(--cp-primary);
  border-color: var(--cp-primary);
  color: #2b2100;
  font-weight: 700;
}

#menu-search-input {
  min-height: 46px;
  color: var(--cp-text);
  accent-color: var(--cp-primary);
}

#menu-search-input::placeholder {
  color: #9c9381;
}

#menu-grid {
  align-items: stretch;
}

.menu-item {
  min-width: 0;
}

.menu-item img {
  object-fit: cover;
}

.menu-item[hidden] {
  display: none;
}

#menu-results-count {
  color: var(--cp-muted);
  font-family: var(--cp-font-label);
  font-size: 12px;
  line-height: 1.5;
}

#menu-empty-state[hidden] {
  display: none;
}

/* ===== 15. GALERÍA ===== */

#galeria figure {
  position: relative;
  isolation: isolate;
}

#galeria figure img {
  transition: transform 600ms ease;
}

@media (hover: hover) {
  #galeria figure:hover img {
    transform: scale(1.04);
  }
}

#galeria figcaption {
  color: #fff;
  font-family: var(--cp-font-display);
  line-height: 1.4;
}

/* ===== 16. ESPACIO ===== */

#espacio {
  color: #121317;
}

#espacio img {
  object-fit: cover;
}

/* ===== 17. RESEÑAS ===== */

#resenas article {
  display: flex;
  flex-direction: column;
}

#resenas article p:last-child {
  margin-top: auto;
}

/* ===== 18. UBICACIÓN ===== */

#ubicacion a[href*="maps.google"] {
  min-height: 44px;
  text-decoration: none;
}

/* ===== 19. CATERING ===== */

#catering-quote-form input,
#catering-quote-form textarea,
#catering-quote-form select {
  min-width: 0;
  min-height: 44px;
}

#catering-quote-form textarea {
  min-height: 105px;
  resize: vertical;
}

#catering-quote-form :is(
  input,
  select,
  textarea
):focus-visible {
  outline-color: var(--cp-primary);
}

#catering-quote-form [aria-invalid="true"] {
  border-color: var(--cp-error);
  box-shadow: 0 0 0 1px var(--cp-error);
}

.field-error {
  display: block;
  margin-top: 5px;
  color: var(--cp-error);
  font-size: 12px;
  line-height: 1.5;
}

.field-error[hidden],
#form-feedback-state[hidden] {
  display: none;
}

/* ===== 20. NAVEGACIÓN MÓVIL ===== */

.mobile-bottom-nav {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 50;

  display: none;
  align-items: center;
  justify-content: space-around;
  gap: 3px;

  min-height: var(--cp-mobile-nav-height);
  padding:
    5px 8px
    max(6px, env(safe-area-inset-bottom));

  border-top: 1px solid var(--cp-surface-high);
  background: rgba(18, 19, 23, .97);

  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);

  box-shadow: 0 -6px 18px rgba(0, 0, 0, .18);
}

.mobile-bottom-nav a {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;

  min-width: 0;
  min-height: 48px;
  padding: 4px 2px;
  border-radius: 10px;

  color: var(--cp-text);
  font-family: var(--cp-font-label);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.mobile-bottom-nav a .material-symbols-outlined {
  font-size: 21px;
}

.mobile-bottom-nav a[aria-current="location"] {
  color: var(--cp-primary);
}

.mobile-bottom-nav .mobile-order-button {
  flex: 0 1 74px;
  background: var(--cp-primary);
  color: #2b2100;
  font-weight: 700;
}

/* ===== 22. ANIMACIONES ===== */

@keyframes cp-twinkle {
  0%, 100% {
    opacity: .25;
    transform: scale(.9);
  }

  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

@keyframes cp-orbit-rotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes cp-nebula-pulse {
  0%, 100% {
    opacity: .2;
    transform: scale(1);
  }

  50% {
    opacity: .34;
    transform: scale(1.03);
  }
}

@keyframes cp-ufo-float {
  0%, 100% {
    transform: translateY(0) rotate(-3deg);
  }

  50% {
    transform: translateY(-11px) rotate(3deg);
  }
}

@keyframes cp-jet-thrust {
  0%, 100% {
    opacity: .7;
    transform: scaleY(.88);
  }

  50% {
    opacity: 1;
    transform: scaleY(1.2);
  }
}

@keyframes cp-steam-rise {
  0% {
    opacity: .25;
    transform: translateY(0);
  }

  50% {
    opacity: .75;
  }

  100% {
    opacity: .05;
    transform: translateY(-9px);
  }
}

/* ===== 23. TABLET ===== */

@media (max-width: 1023px) {
  .cp-section-ambient svg {
    width: 270px;
  }
}

/* ===== 24. MÓVIL ===== */

@media (max-width: 639px) {
  body {
    padding-bottom: calc(
      var(--cp-mobile-nav-height) +
      env(safe-area-inset-bottom)
    );
  }

  .mobile-bottom-nav {
    display: flex;
  }

  .cp-cosmic-divider {
    min-height: 48px;
    padding: 4px 12px;
  }

  .cp-cosmic-divider svg {
    max-height: 35px;
  }

  #inicio {
    padding-top: 136px;
  }

  #inicio .ufo-ship {
    right: 0;
  }

  .cp-section-ambient svg {
    width: 220px;
    opacity: .08;
  }

  #category-chips button {
    padding: 9px 13px;
    font-size: 11px;
  }

  .quick-action-chip {
    padding-inline: 12px;
    font-size: 11px;
  }
}

@media (max-width: 389px) {
  .mobile-bottom-nav a {
    font-size: 9px;
  }

  .mobile-bottom-nav a .material-symbols-outlined {
    font-size: 19px;
  }
}

/* ===== 25. MOVIMIENTO REDUCIDO ===== */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .star-twinkle-1,
  .star-twinkle-2,
  .star-twinkle-3,
  .nebula-pulse,
  #inicio .ufo-ship,
  #inicio .orbit-ring,
  #alien-avatar-trigger .soft-jet-thrust,
  #alien-avatar-trigger .steam-flow {
    animation: none;
  }

  #momentos article,
  #destacados article,
  .menu-item,
  #galeria figure img,
  #pasteleria figure img {
    transition: none;
  }
}

/* ===== ===== CONTENEDORES Y TEXTOS ===== ===== */

:where(header, main, footer, section, article, figure, form, nav) {
  min-inline-size: 0;
}

:where(.grid, .flex) > * {
  min-inline-size: 0;
}

:where(p, h1, h2, h3, h4, label, small, strong) {
  overflow-wrap: break-word;
}

:where(input, select, textarea) {
  max-inline-size: 100%;
  min-inline-size: 0;
  font: inherit;
}

header a[href="#inicio"] > span:last-child {
  min-inline-size: 0;
}

header a[href="#inicio"] strong {
  line-height: 1.2;
  overflow-wrap: anywhere;
}

/* ===== ===== BARRAS DE DESPLAZAMIENTO ===== ===== */

* {
  scrollbar-color: var(--cp-primary-container) var(--cp-surface);
}

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: var(--cp-surface);
}

::-webkit-scrollbar-thumb {
  background: var(--cp-primary-container);
  border: 3px solid var(--cp-surface);
  border-radius: 20px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--cp-primary);
}

/* ===== ===== PREFERENCIAS DE ACCESIBILIDAD ===== ===== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none;
    transition: none;
    scroll-behavior: auto;
  }
}

@media (forced-colors: active) {
  * { scrollbar-color: auto; }
  :focus-visible { outline: 3px solid Highlight; }
  button, input, textarea, select { border: 1px solid ButtonText; }
}
