/* ============================================
   SLIDERS - CARTA DIGITAL
   Paleta: #fef3ed (fondo) / #ff7900 (naranja)
   ============================================ */

:root {
  --primary: #ff7900;
  --primary-dark: #d96400;
  --primary-light: #ff9133;
  --bg: #fef3ed;
  --bg-soft: #fde4d3;
  --surface: #ffffff;
  --surface-2: #fff7f1;
  --text: #2a1a10;
  --text-muted: #7a5a45;
  --text-soft: rgba(42, 26, 16, 0.6);
  --border: rgba(255, 121, 0, 0.25);
  --border-soft: rgba(255, 121, 0, 0.15);
  --shadow: 0 8px 24px rgba(255, 121, 0, 0.12);
  --shadow-lg: 0 20px 60px rgba(255, 121, 0, 0.22);
  --shadow-card: 0 4px 16px rgba(42, 26, 16, 0.08);
  --radius: 18px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --font-display: 'Bebas Neue', 'Impact', sans-serif;
  --font-body: 'Inter', -apple-system, system-ui, sans-serif;
  --rappi-red: #ff0033;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

svg {
  display: inline-block;
  flex-shrink: 0;
  vertical-align: middle;
}

svg:not([width]):not([height]) {
  width: 1em;
  height: 1em;
  max-width: 24px;
  max-height: 24px;
}

button > svg,
a > svg {
  pointer-events: none;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   HEADER
   ============================================ */
.header {
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 121, 0, 0.10) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(255, 121, 0, 0.08) 0%, transparent 50%),
    var(--bg);
  position: relative;
  overflow: hidden;
}

.info-bar {
  background: var(--primary);
  color: #fff;
  text-align: center;
  padding: 8px 16px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.info-bar:empty,
.info-bar[hidden] {
  display: none;
}

/* Header con portada + ojos que siguen el cursor (ancho completo, recorte tipo cover) */
.hero-header {
  position: relative;
  width: 100%;
  height: clamp(180px, 46vw, 560px);
  overflow: hidden;
}

.hero-header .capa {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}

/* Blanco detrás de los huecos (lo posiciona JS según el recorte) */
.hero-header .fondo-ojos {
  position: absolute;
  background: #fff;
  border-radius: 40px;
}

.hero-header img.ojos {
  will-change: transform;
}

.hero-header img.portada {
  position: relative;
  z-index: 2;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 28px 16px 24px;
  position: relative;
  z-index: 1;
  min-height: 140px;
}

.logo {
  max-width: 220px;
  max-height: 120px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(255, 121, 0, 0.20));
}

.mascot {
  max-width: 100px;
  max-height: 120px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(42, 26, 16, 0.18));
  animation: mascotIn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Si no tiene src o el src est\u00e1 vac\u00edo, no reservamos espacio (se asignar\u00e1 por JS) */
.mascot:not([src]),
.mascot[src=""] {
  display: none;
}

/* Cuando JS le pone src v\u00e1lido, forzamos visible */
.mascot[src]:not([src=""]) {
  display: inline-block !important;
}

@keyframes mascotIn {
  0% { transform: translateY(20px) rotate(-8deg) scale(0.7); opacity: 0; }
  60% { transform: translateY(-4px) rotate(3deg) scale(1.05); opacity: 1; }
  100% { transform: translateY(0) rotate(0) scale(1); opacity: 1; }
}

@media (max-width: 480px) {
  .logo {
    max-width: 180px;
    max-height: 90px;
  }
  .mascot {
    max-width: 80px;
    max-height: 90px;
  }
  .header-content {
    gap: 12px;
    min-height: 110px;
  }
}

/* ============================================
   NAV CATEGORIES + SOCIAL
   ============================================ */
.nav-categories {
  position: sticky;
  top: 0;
  background: rgba(254, 243, 237, 0.95);
  border-bottom: 1px solid var(--border-soft);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 50;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.sdm-link {
  flex-shrink: 0;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 800;
  white-space: nowrap;
  border: 1.5px solid var(--primary);
  box-shadow: 0 3px 10px rgba(255, 121, 0, 0.3);
  transition: all 0.2s ease;
}

.sdm-link:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.sdm-link:active {
  transform: scale(0.95);
}

@media (max-width: 480px) {
  .sdm-link {
    font-size: 0.72rem;
    padding: 7px 10px;
  }
}

.nav-categories-scroll {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-behavior: smooth;
}

.nav-categories-scroll::-webkit-scrollbar {
  display: none;
}

.nav-categories-scroll button {
  flex-shrink: 0;
  padding: 8px 16px;
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  font-family: var(--font-body);
}

.nav-categories-scroll button.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 3px 10px rgba(255, 121, 0, 0.3);
}

.nav-categories-scroll button:active {
  transform: scale(0.95);
}

.social-buttons {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  margin-left: 8px;
}

.social-btn {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.25s ease;
  overflow: hidden;
  box-sizing: border-box;
  padding: 0;
  flex-shrink: 0;
}

.instagram-btn {
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
}

.instagram-btn:hover {
  background: var(--primary);
  color: #fff;
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(255, 121, 0, 0.3);
}

.instagram-btn:active {
  transform: scale(0.92);
}

.rappi-btn {
  background: #fff;
  border: 1.5px solid var(--primary);
  padding: 4px;
}

.rappi-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.rappi-fallback {
  background: var(--rappi-red);
  color: #fff;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.1rem;
  font-family: var(--font-body);
  letter-spacing: 0;
}

.rappi-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(255, 0, 51, 0.3);
}

.rappi-btn:active {
  transform: scale(0.92);
}

.rappi-btn.hidden {
  display: none;
}

/* ============================================
   MENU
   ============================================ */
.category-section {
  margin-bottom: 40px;
  scroll-margin-top: 70px;
  padding-top: 8px;
}

.category-section:not(:first-of-type) {
  border-top: 1px dashed var(--border);
  padding-top: 28px;
  margin-top: 16px;
}

.category-section.promo-section {
  background: linear-gradient(180deg, rgba(255, 0, 51, 0.04) 0%, transparent 100%);
  border-radius: var(--radius-lg);
  padding: 20px 16px 8px;
  margin-bottom: 32px;
  border: 2px solid rgba(255, 0, 51, 0.12);
}

.category-section.promo-section:not(:first-of-type) {
  border-top: 2px solid rgba(255, 0, 51, 0.12);
  margin-top: 24px;
  padding-top: 24px;
}

.category-title {
  font-family: var(--font-display);
  font-size: 2.4rem;
  letter-spacing: 2px;
  color: var(--primary);
  margin-bottom: 18px;
  padding: 6px 16px 6px 0;
  position: relative;
  display: inline-block;
  text-transform: uppercase;
  line-height: 1;
}

.category-title::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 70%;
  background: var(--primary);
  border-radius: 3px;
}

.category-title::after {
  content: '';
  display: block;
  height: 2px;
  background: linear-gradient(90deg, var(--primary) 0%, transparent 100%);
  margin-top: 6px;
  width: 100%;
}

.promo-section .category-title {
  color: var(--rappi-red);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  white-space: nowrap;
  font-size: 2rem;
}

.promo-section .category-title::before {
  background: var(--rappi-red);
}

.promo-section .category-title::after {
  background: linear-gradient(90deg, var(--rappi-red) 0%, transparent 100%);
}

.promo-title-rappi-logo {
  height: 26px;
  width: auto;
  vertical-align: middle;
  margin-left: 4px;
}

.menu {
  padding: 24px 16px 24px 32px;
  max-width: 1200px;
  margin: 0 auto;
}

.products-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 640px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

@media (min-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* PRODUCT CARD */
.product-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid var(--border-soft);
  text-align: left;
  width: 100%;
  font-family: var(--font-body);
  color: var(--text);
  position: relative;
  box-shadow: var(--shadow-card);
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--border);
}

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

.product-card.is-promo {
  border-color: var(--rappi-red);
  border-width: 2px;
  background: linear-gradient(180deg, #fff 0%, #fff5f7 100%);
  padding-top: 36px;
}

.product-card.is-promo::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255, 0, 51, 0.12), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.promo-badge {
  position: absolute;
  top: 8px;
  left: 12px;
  right: 12px;
  background: var(--rappi-red);
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(255, 0, 51, 0.35);
}

.promo-badge img {
  height: 12px;
  width: auto;
  filter: brightness(0) invert(1);
}

.product-image {
  width: 100px;
  height: 100px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--surface-2);
  aspect-ratio: 1 / 1;
  position: relative;
  z-index: 1;
}

.product-image-placeholder {
  width: 100px;
  height: 100px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--bg-soft) 0%, var(--surface-2) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--primary);
  letter-spacing: 1px;
  aspect-ratio: 1 / 1;
  position: relative;
  z-index: 1;
}

.product-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-right: 4px;
  position: relative;
  z-index: 1;
}

.product-name {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 4px;
  line-height: 1.2;
  color: var(--text);
}

.product-ingredients {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}

.product-ingredients:empty {
  display: none;
}

.product-price {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: -0.3px;
}

.product-card.is-promo .product-price {
  color: var(--rappi-red);
}

/* ============================================
   LOADER
   ============================================ */
.loader {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   MODAL
   ============================================ */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  justify-content: center;
  align-items: flex-end;
}

.modal.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

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

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(42, 26, 16, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  overflow-y: auto;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-lg);
}

@media (min-width: 640px) {
  .modal {
    align-items: center;
  }
  .modal-content {
    border-radius: var(--radius-lg);
    max-height: 88vh;
  }
}

@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.modal-close:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: rotate(90deg);
}

.modal-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--bg-soft);
  display: block;
}

.modal-image[src=""],
.modal-image:not([src]) {
  display: none;
}

.modal-body {
  padding: 20px 22px 24px;
}

.modal-body h2 {
  font-family: var(--font-body);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.2;
}

.modal-ingredients {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 18px;
}

.modal-ingredients:empty {
  display: none;
}

.modal-price-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 14px 0;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 16px;
}

.modal-price-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
}

.modal-price-value {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.btn-rappi-modal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 20px;
  background: var(--rappi-red);
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(255, 0, 51, 0.3);
}

.btn-rappi-modal img {
  height: 22px;
  width: auto;
  filter: brightness(0) invert(1);
}

.btn-rappi-modal:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 0, 51, 0.4);
}

.btn-rappi-modal:active {
  transform: scale(0.98);
}

/* ============================================
   FOOTER — mascota + Sliders Partners
   ============================================ */
.footer {
  background: var(--primary);
  margin-top: 48px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px 28px;
  text-align: center;
}

.footer .mascot {
  max-width: 84px;
  max-height: 96px;
  flex-shrink: 0;
  filter: drop-shadow(0 8px 18px rgba(42, 26, 16, 0.30));
}

.footer-partners {
  margin-top: 0;
}

.footer-partners-title {
  font-family: var(--font-display);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 3px;
  margin-bottom: 18px;
}

.footer-partners-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 14px;
}

.partner-item {
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  min-height: 64px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(42, 26, 16, 0.12);
  transition: transform 0.15s ease;
}

a.partner-item:hover {
  transform: translateY(-3px);
}

.partner-item img {
  max-height: 44px;
  max-width: 110px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.partner-name {
  font-weight: 800;
  color: var(--primary-dark);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@media (max-width: 480px) {
  .footer .mascot {
    max-width: 70px;
    max-height: 84px;
  }
  .partner-item {
    min-width: 80px;
    min-height: 56px;
    padding: 8px 14px;
  }
  .partner-item img {
    max-height: 36px;
    max-width: 92px;
  }
}

/* ============================================
   ERROR TOAST
   ============================================ */
.error-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--rappi-red);
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 200;
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-lg);
  max-width: calc(100% - 32px);
  text-align: center;
}

.error-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================
   RESPONSIVE TWEAKS
   ============================================ */
@media (max-width: 380px) {
  .category-title {
    font-size: 2rem;
  }
  .menu {
    padding: 20px 12px 20px 28px;
  }
  .product-image,
  .product-image-placeholder {
    width: 84px;
    height: 84px;
  }
}
