@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Outfit:wght@400;600;700;800&display=swap');

:root {
  --background: #f8fafc;
  --foreground: #111827;
  --primary: #e11d48; /* Un rojo oscuro parecido al del ejemplo */
  --primary-foreground: #ffffff;
  --card: #ffffff;
  --card-foreground: #111827;
  --border: #e2e8f0;
  --accent: #f1f5f9;
  
  --font-inter: 'Inter', sans-serif;
  --font-outfit: 'Outfit', sans-serif;

  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 1rem;
  --shadow-sm: 0 4px 6px rgba(0,0,0,0.05);
  --shadow-md: 0 10px 25px rgba(0,0,0,0.5);
  
  --header-bg: #000000;
  --header-color: #ffffff;
}

body.theme-dark-premium {
  --background: #111827;
  --foreground: #f9fafb;
  --primary: #d4af37; /* Dorado */
  --primary-foreground: #000000;
  --card: #1f2937;
  --card-foreground: #f9fafb;
  --border: #374151;
  --accent: #374151;
  
  --header-bg: #1f2937;
  --header-color: #d4af37;
}

body.theme-neon-vibes {
  --background: #000000;
  --foreground: #ffffff;
  --primary: #ff00ff;
  --primary-foreground: #ffffff;
  --card: #121212;
  --card-foreground: #ffffff;
  --border: #333333;
  --accent: #1f1f1f;
  
  --header-bg: #000000;
  --header-color: #ff00ff;
}

body.theme-restaurant-elegant {
  --background: #fafafa;
  --foreground: #1a1a1a;
  --primary: #8b7355; 
  --primary-foreground: #ffffff;
  --card: #ffffff;
  --card-foreground: #1a1a1a;
  --border: #e5e5e5;
  --accent: #f5f5f5;
  
  --radius-sm: 0;
  --radius-md: 0;
  --radius-lg: 0;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.02);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.05);
  
  --header-bg: #000000;
  --header-color: #ffffff;
}

body.theme-terrace-sunset {
  --background: #1c1412;
  --foreground: #fdeee9;
  --primary: #ff7e5f; 
  --primary-foreground: #ffffff;
  --card: #2d1f1c;
  --card-foreground: #fdeee9;
  --border: #3d2a25;
  --accent: #3d2a25;
  
  --radius-sm: 0.5rem;
  --radius-md: 1.5rem;
  --radius-lg: 2rem;
  --shadow-sm: 0 8px 16px rgba(255,126,95,0.1);
  --shadow-md: 0 12px 24px rgba(255,126,95,0.15);
  
  --header-bg: #000000;
  --header-color: #ffffff;
}

body.theme-nightclub-vip {
  --background: #09090b;
  --foreground: #fafafa;
  --primary: #8b5cf6; 
  --primary-foreground: #ffffff;
  --card: #18181b;
  --card-foreground: #fafafa;
  --border: #27272a;
  --accent: #27272a;
  
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 1rem;
  --shadow-sm: 0 0 10px rgba(139,92,246,0.3);
  --shadow-md: 0 0 20px rgba(139,92,246,0.5);
  
  --header-bg: #000000;
  --header-color: #8b5cf6;
}

body.theme-icecream-pop {
  --background: #fdf2f8;
  --foreground: #831843;
  --primary: #f472b6; 
  --primary-foreground: #ffffff;
  --card: #ffffff;
  --card-foreground: #9d174d;
  --border: #fbcfe8;
  --accent: #fce7f3;
  
  --radius-sm: 1rem;
  --radius-md: 2rem;
  --radius-lg: 3rem;
  --shadow-sm: 0 4px 12px rgba(244,114,182,0.15);
  --shadow-md: 0 8px 24px rgba(244,114,182,0.25);
  
  --header-bg: #fdf2f8;
  --header-color: #831843;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-inter);
  -webkit-font-smoothing: antialiased;
h1, h2, h3, .font-outfit { font-family: var(--font-outfit); }

img {
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-select: none;
  pointer-events: none;
}

.container {
  max-width: 480px; /* Tamaño móvil */
  width: 100%;
  margin: 0 auto;
  position: relative;
  min-height: 100vh;
  background-color: var(--background);
  box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

/* Header tipo App */
header {
  background-color: var(--header-bg);
  padding: 0.6rem 1rem 0 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
  color: var(--header-color);
}

.search-box {
  background: white;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  padding: 0.35rem 1rem;
  margin-top: 0.4rem;
  border: 1px solid rgba(0,0,0,0.1);
}

.search-box i {
  color: #666;
  margin-right: 0.5rem;
}

.search-box input {
  border: none;
  background: transparent;
  width: 100%;
  font-size: 0.85rem;
  font-family: var(--font-inter);
  color: #000;
  outline: none;
}

/* Título del negocio en header */
.title {
  font-size: 1rem;
}

/* Carrusel Horizontal de Categorías Destacadas (Animación deslizante) */
.category-slider {
  display: flex;
  overflow-x: auto;
  gap: 1rem;
  padding: 1rem;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none;  /* IE and Edge */
  scroll-snap-type: x mandatory;
}

.category-slider::-webkit-scrollbar {
  display: none;
}

.category-slide-item {
  min-width: 42%;
  height: 68px;
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  scroll-snap-align: center;
  box-shadow: var(--shadow-sm);
  background-color: var(--card);
}

.category-slide-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.category-slide-item:hover .category-slide-img {
  transform: scale(1.05);
}

.category-slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  display: flex;
  align-items: flex-end;
  padding: 1rem;
}

.category-slide-title {
  color: white;
  font-size: 0.85rem;
  font-weight: 800;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.category-slide-overlay {
  padding: 0.5rem;
}

/* Acordeón de Categorías estilo Referencia */
.menu-list {
  padding: 0;
}

.category-block {
  margin-bottom: 0.5rem;
  background: transparent;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  scroll-margin-top: 130px; /* Altura del header colapsado + slider pequeño */
}

.category-header {
  background-color: var(--primary);
  color: var(--primary-foreground);
  margin-top: -1px;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  border: none;
  width: 100%;
  text-align: left;
}

.category-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

.category-header i {
  font-size: 1.5rem;
  transition: transform 0.3s;
}

.category-block.open .category-header i {
  transform: rotate(180deg);
}

/* Cuadrícula de Productos (Grid visual de Tarjetas) */
.products-grid {
  display: none;
  padding: 1rem;
  grid-template-columns: repeat(2, 1fr); /* 2 columnas como en el ejemplo */
  gap: 1rem;
  background: var(--background);
}

.category-block.open .products-grid {
  display: grid;
  animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Tarjeta de Producto */
.product-card {
  background: var(--card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.2s;
}

.product-card:active {
  transform: scale(0.98);
}

/* Imagen del Producto */
.product-img-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--accent);
}

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

/* Etiqueta de Precio estilo Referencia (Negra superior izquierda) */
.price-tag {
  position: absolute;
  top: 0;
  left: 0;
  background-color: #000000;
  color: #ffffff;
  padding: 0.5rem 0.75rem;
  border-bottom-right-radius: var(--radius-md);
  font-weight: 800;
  font-size: 1.1rem;
  z-index: 10;
}

.product-details {
  padding: 0.75rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.product-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--card-foreground);
  margin-bottom: 0.25rem;
  line-height: 1.2;
}

.product-desc {
  font-size: 0.75rem;
  color: var(--card-foreground);
  opacity: 0.7;
  line-height: 1.4;
  margin-top: auto;
}

/* Navegación en Header */
.nav-item {
  color: var(--header-color);
  opacity: 0.5;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
}

.nav-item.active {
  opacity: 1;
  color: var(--primary);
}

.nav-item i { font-size: 1.5rem; }
.nav-item span { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; }

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

/* Vistas */
.view-section { display: none; }
.view-section.active { display: block; animation: fadeIn 0.3s; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.loader {
  border: 4px solid var(--border);
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 4rem auto;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* --- Modal Styles --- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 1rem;
}

.modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--background);
  border-radius: 1.5rem;
  width: 100%;
  max-width: 450px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s ease;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.modal.active .modal-content {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0,0,0,0.5);
  color: white;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-top-left-radius: 1.5rem;
  border-top-right-radius: 1.5rem;
}

.modal-overlay-gradient {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: linear-gradient(to top, var(--background), transparent);
}

.modal-info {
  padding: 1.5rem;
}

.modal-title {
  font-family: var(--font-outfit);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--card-foreground);
  margin-bottom: 0.5rem;
}

.modal-price {
  display: inline-block;
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.modal-desc {
  font-size: 1rem;
  color: var(--card-foreground);
  opacity: 0.8;
  line-height: 1.6;
}
