/* Variables de color (basadas en tus requerimientos) */
:root {
  --color-circulo-borde: #FDFBFE;
  --color-circulo-texto: #241000;
  --color-titulo: #616161;
  --color-nombre-comida: #616161;
  --color-descripcion: #A6A39E;
  --color-precio: #494641;
  --color-boton-mas: #C8A16A;
  --color-fondo: #FDFBFE;
  --color-card-bg: #f1efed;
  --color-footer-flotante: #ffffff;
}

@font-face {
    font-family: 'recetaNombre';
    src: url('../../fonts/EduNSWACTFoundation-Regular.ttf') format('truetype');
}

@font-face {
    font-family: 'descripcionReceta';
    src: url('../../fonts/PlaypenSans-Regular.ttf') format('truetype');
}

@font-face {
    font-family: 'categoriaMenu';
    src: url('../../fonts/AmaticSC-Bold.ttf') format('truetype');
}

@font-face {
    font-family: 'recetaPrecio';
    src: url('../../fonts/PlaypenSans-Bold.ttf') format('truetype');
}


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

body {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--color-fondo);
  color: var(--color-nombre-comida);
  overflow-x: hidden; /* Evita desbordamientos horizontales */
}

.menu-cliente {
  max-width: 380px;
  margin: 0 auto;
}

/* Estilo para cada categoría */
.categoria-titulo {
  /*font-family: ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif;*/
  
  font-family: 'categoriaMenu', Georgia, serif;
  font-size: 2.5rem;
  color: var(--color-titulo);
  text-align: center;
  margin: 32px 0 24px;
  letter-spacing: 1px;
  font-weight: 400;
}

/* Grid de recetas */
.recetas-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px 16px;
  margin-bottom: 32px;
  padding: 20px 25px;
}

/* Receta destacada (primera de la categoría) */
.receta-destacada {
  grid-column: 1 / -1;
  margin-bottom: 8px;   
  width: 78%;
  margin: auto; 
}

.receta-destacada .receta-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #f1efed ;
  box-shadow: none;
  padding: 0;
  width: 245px;
}

.receta-destacada .receta-imagen {
  width: 270px;
  height: 270px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--color-circulo-borde);
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  margin: 10px 0 12px;
}

.receta-destacada .receta-nombre {
  font-family: 'recetaNombre', Georgia, serif;
  font-size: 1.6rem;
  color: var(--color-nombre-comida);
  margin-top: 20px;
  text-align: center;
}

.receta-destacada .receta-descripcion {
  color: var(--color-descripcion);
  font-size: 0.9rem;
  text-align: center;
  max-width: 280px;
  margin: 6px auto;
  line-height: 1.4;
}

.receta-destacada .receta-precio {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-precio);
}

.receta-destacada .btn-mas {
  background-color: var(--color-boton-mas);
  border: none;
  color: white;
  width: 37px;
  height: 37px;
  border-radius: 50%;
  font-size: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}

.receta-destacada .btn-mas:active {
  transform: scale(0.95);
}

/* Recetas normales */
.receta-card {
  background: var(--color-card-bg);
  border-radius: 90px 90px 32px 32px;
  padding: 0px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  transition: transform 0.2s;
}

.receta-card:hover {
  transform: translateY(-4px);
}

.receta-imagen {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  /*border: 2px solid var(--color-circulo-borde);*/
  margin-bottom: 10px;
}


.receta-nombre {
  font-family: 'recetaNombre', Georgia, serif;
  font-size: 1.1rem;
  color: var(--color-nombre-comida);
  text-align: center;
  margin-bottom: 4px;
  font-weight: 600;
}

.receta-descripcion {
  font-family: 'descripcionReceta', Georgia, serif;
  color: var(--color-descripcion);
  font-size: 0.75rem;
  text-align: center;
  margin-bottom: 8px;
  line-height: 1.3;
  /*display: -webkit-box;*/
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.receta-precio {
  font-family: 'recetaPrecio', Georgia, serif;
  font-weight: 600;
  color: var(--color-precio);
  font-size: 1.1rem;
}

.receta-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 90%;
  margin-top: auto;
  padding-bottom: 6px;
}

.btn-mas {
  background-color: var(--color-boton-mas);
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.btn-mas:active {
  transform: scale(0.95);
}

.btn-mas:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Footer flotante (carrito) */
.footer-flotante{
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  display: flex;
  justify-content: center;
  pointer-events: none;
  z-index: 2000;
  transform: translate3d(0,0,0);
  max-width: 100vw;
  overflow-x: clip;
}

.btn-mi-pedido {
  background-color: var(--color-boton-mas);
  color: white;
  border: none;
  padding: 14px 32px;
  border-radius: 40px;
  font-size: 1.2rem;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.2s, background 0.2s;
  letter-spacing: 0.5px;
  display: inline-block;
  white-space: nowrap;
}

.btn-mi-pedido:active {
  transform: scale(0.97);
}

/* Overlay */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 4000;
  display: none;
}

/* Popup del carrito (diseño limpio, acorde a la estética) */
.popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 300px;
  background: white;
  border-radius: 32px;
  z-index: 5000;
  display: none;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.popup-content {
  display: flex;
  flex-direction: column;
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #f0f0f0;
}

.popup-titulo {
  font-family: ui-serif, Georgia, serif;
  font-size: 1.8rem;
  color: var(--color-nombre-comida);
  margin: 0;
}

.popup-close {
  font-size: 2.5rem;
  cursor: pointer;
  color: var(--color-descripcion);
  line-height: 1;
}

.popup-close:hover {
  color: var(--color-nombre-comida);
}

.popup-body {
  padding: 20px 24px;
  max-height: 50vh;
  overflow-y: auto;
}

.popup-footer {
  padding: 20px 24px;
  border-top: 1px solid #f0f0f0;
  text-align: center;
}

.btn-pedir-mesa {
  background-color: var(--color-boton-mas);
  color: white;
  border: none;
  padding: 14px 20px;
  border-radius: 40px;
  font-size: 1.2rem;
  font-weight: 600;
  width: 100%;
  cursor: pointer;
  transition: background 0.2s;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.btn-pedir-mesa:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

/* Estilo para cada item dentro del carrito */
.item-carrito {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #eee;
}

.item-carrito-imagen {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 16px;
  border: 2px solid var(--color-circulo-borde);
}

.item-carrito-info {
  flex: 1;
}

.item-carrito-nombre {
  font-weight: 600;
  color: var(--color-nombre-comida);
  margin-bottom: 4px;
}

.item-carrito-precio-cantidad {
  color: var(--color-precio);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.item-carrito-cantidad {
  background: var(--color-circulo-borde);
  color: var(--color-circulo-texto);
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
}

.item-carrito-eliminar {
  background: none;
  border: none;
  color: #e74c3c;
  font-size: 1.8rem;
  cursor: pointer;
  margin-left: 8px;
  padding: 0 8px;
}

.item-carrito-eliminar:disabled {
  color: #ccc;
  cursor: not-allowed;
}

/* Mensaje de error */
.popup-error {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #e74c3c;
  color: white;
  padding: 12px 24px;
  border-radius: 40px;
  z-index: 9000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  display: none;
  font-weight: 500;
}

/* SVG decorativo (solo para destacadas) */
.receta-destacada-svg-wrapper {
  position: relative;
  display: inline-block;
}

.receta-destacada-svg-wrapper svg {
  position: absolute;
  top: -4.5%;
  left: -8%;
  transform: translate(-50%, -50%) rotate(-90deg);
  width: 315px;
  height: 315px;
  pointer-events: none;
  background-color: #EDD9BE;
  border-radius: 300px;
  z-index: 1;
}

.receta-destacada-svg-wrapper svg text {
  fill: var(--color-circulo-texto);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.7);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--color-boton-mas);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.categoria-sticky {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translate(-50%, -100%);
  width: 100%;
  max-width: 380px;
  background-color: var(--color-fondo);
  font-family: 'categoriaMenu', Georgia, serif;
  font-size: 2.5rem;
  color: var(--color-titulo);
  text-align: center;
  z-index: 2100;
  border-bottom: 1px solid var(--color-circulo-borde);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  padding: 0;
  margin: 0;
  will-change: transform, opacity;
}

.categoria-sticky.visible {
  opacity: 1;
  transform: translate(-50%, 0);
  padding: 16px 0;
  pointer-events: auto;
}

.receta-destacada-svg-wrapper .receta-imagen {
  position: relative;
  z-index: 2;
}

/*.footer-flotante {
  will-change: transform; 
}*/

.footer-flotante.popup-abierto {
  pointer-events: none;
  opacity: 0.5; /* opcional, para indicar que está deshabilitado */
  transition: opacity 0.2s;
}

.countdown-timer {
    margin-top: 10px;
    font-size: 0.9rem;
    text-align: center;
    color: #666;
}

.body-scroll-lock{
  position: fixed;
  width: 100%;
  left: 0;
}

/*html.menu-scroll-lock,
body.menu-scroll-lock {
  overflow: hidden !important;
  height: 100%;
  overscroll-behavior: none;
}*/

.menu-scroll-lock{
  overflow: hidden !important;
  overscroll-behavior: none;
}

body.menu-scroll-lock {
  width: 100%;
  position: relative;
}

.popup,
.popup-body {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.overlay{
  touch-action: none;
  overscroll-behavior: none;
}

.popup{
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

html,
body{
  overflow-x: hidden;
  max-width: 100%;
}

.item-opcion {
    margin-top: 6px;
    margin-bottom: 4px;
}
.item-opcion-fija .opcion-valor {
    font-size: 0.85rem;
    color: #555;
    background: #f5f5f5;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
}
.item-opcion-select select {
    width: 100%;
    padding: 4px 8px;
    font-size: 0.85rem;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.btn-solicitar-pago {
    background-color: #ffc107;
    color: #212529;
    border: none;
    padding: 12px 20px;
    border-radius: 40px;
    font-size: 1.2rem;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
    transition: background 0.2s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    margin-top: 8px;
}
.btn-solicitar-pago:disabled {
    background-color: #e0e0e0;
    cursor: not-allowed;
}
.agotado {
    background-color: #6c757d; /* gris */
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 6px 8px;
    border-radius: 30px; /* bordes ovalados */
    display: inline-block;
    text-align: center;
    min-width: 70px;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.item-carrito-imagen.agotado-imagen {
    filter: grayscale(100%);
    opacity: 0.6;
}

.item-agotado-mensaje {
    font-size: 0.8rem;
    color: #dc3545;
    font-weight: 600;
    margin-top: 4px;
}