/* ==========================================================================
   CUBITA CAFÉ - HOJA DE ESTILOS PRINCIPAL (styles.css v3.3)
   Diseño Editorial Cálido, Rendimiento Web Vitals, Accesibilidad y Adaptación Móvil
   ========================================================================== */

:root {
  --color-gold: #c59b27;
  --color-gold-hover: #b0871d;
  --color-gold-light: #dfb746;
  --color-espresso: #1a1614;
  --color-crema: #fdf9f4;
  --color-text-dark: #1c1c19;
  --color-text-body: #4a423d;
  --color-text-muted: #6a5e55;
  --color-surface-container: #f1ede8;
}

/* ==========================================================================
   1. RESET, OPTIMIZACIÓN TÁCTIL Y CONTROL DE LEGIBILIDAD ABSOLUTA
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #fdf9f4;
  color: #1c1c19;
  margin: 0;
  padding: 0;
  overflow-x: clip;
  width: 100%;
  max-width: 100vw;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Imágenes responsivas y sin saltos de layout */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Contraste de lectura óptimo en fondos claros */
p {
  color: #4a423d !important;
  opacity: 1 !important;
  line-height: 1.65;
}

/* En contenedores oscuros o modo nocturno (cocteles) */
.bg-primary-container p,
.bg-primary p,
.bg-\[\#141210\] p,
.bg-\[\#191614\] p,
.bg-\[\#201c19\] p,
.bg-\[\#2c2622\] p,
.bg-emerald-600 p,
.dark-theme p,
.dark-section p,
body.dark-mode p,
[class*="bg-primary-container"] p,
[class*="bg-[#141210]"] p,
[class*="bg-[#191614]"] p,
.text-white p,
.text-gray-300 p {
  color: #f0ebe4 !important;
}

/* Clases específicas de alta prioridad para colores de texto */
.text-body-readable {
  color: #4a423d !important;
}

.text-on-surface-variant {
  color: #4a423d !important;
}

.text-muted-readable {
  color: #6a5e55 !important;
}

/* En contenedores oscuros mantener variantes claras */
.bg-primary-container .text-on-surface-variant,
.bg-\[\#141210\] .text-on-surface-variant,
.bg-\[\#191614\] .text-on-surface-variant {
  color: #c4bbb3 !important;
}

/* ==========================================================================
   2. TIPOGRAFÍAS EDITORIALES
   ========================================================================== */
.font-display,
.font-headline,
.font-title-editorial,
.font-editorial {
  font-family: 'Playfair Display', Georgia, serif;
}

.font-body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ==========================================================================
   3. ADAPTACIÓN MÓVIL, MICROINTERACCIONES Y SCROLL TÁCTIL SUAVE
   ========================================================================== */
/* Contenedores con desplazamiento horizontal suave para móviles */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scroll-behavior: smooth;
}

/* Prevenir que el contenido se desborde horizontalmente en pantallas pequeñas */
main, section, header, footer {
  max-width: 100vw;
  overflow-x: clip;
}

/* Animaciones sutiles aceleradas por GPU */
@keyframes spinSlow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.animate-spin-slow {
  animation: spinSlow 24s linear infinite;
  will-change: transform;
}

/* Mejora visual de tarjetas de carta en escritorio y móvil */
.menu-item-card {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease;
}

@media (hover: hover) and (pointer: fine) {
  .menu-item-card:hover {
    transform: translateY(-3px);
  }
  .card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px -8px rgba(31, 27, 24, 0.12);
  }
}

/* Respeto a usuarios con preferencia de movimiento reducido */
@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;
  }
}

/* Botón Flotante de WhatsApp optimizado para Móvil y Escritorio */
.whatsapp-float-btn {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  right: 20px;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: #25D366;
  color: #ffffff !important;
  padding: 12px 18px;
  border-radius: 9999px;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, background-color 0.25s ease;
  will-change: transform;
}

.whatsapp-float-btn span,
.whatsapp-float-btn p {
  color: #ffffff !important;
}

.whatsapp-float-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 10px 25px rgba(37, 211, 102, 0.55);
  background-color: #20ba5a;
}

.whatsapp-float-btn:active {
  transform: scale(0.97);
}

@media (max-width: 640px) {
  .whatsapp-float-btn {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    right: 16px;
    padding: 10px 15px;
    font-size: 12px;
  }
}

/* ==========================================================================
   4. ACCESIBILIDAD Y NAVEGACIÓN POR TECLADO
   ========================================================================== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}
