/* src/css/pages/menu.css */
.categories {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 1rem 0;
  margin-bottom: 2rem;
  scrollbar-width: none; /* Firefox */
  width: 100%;
  -webkit-overflow-scrolling: touch;
}

.categories::-webkit-scrollbar {
  display: none; /* Safari and Chrome */
}

.category-btn {
  background-color: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  white-space: nowrap;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.category-btn:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--foreground);
  border-color: rgba(234, 88, 12, 0.3);
}

.category-btn.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 4px 15px rgba(234, 88, 12, 0.45);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding-bottom: 6rem; /* Espacio para el carrito flotante */
}

@media (min-width: 600px) {
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
  }
}

.product-card {
  display: flex;
  flex-direction: column;
  height: 100%; /* Permite que todas las tarjetas de una fila midan lo mismo */
  min-width: 0; /* Crítico para que la tarjeta pueda encogerse más allá del contenido */
  overflow: hidden;
  background: rgba(22, 22, 26, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  animation: menuCardFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.product-card:hover {
  transform: translateY(-6px);
  border-color: rgba(234, 88, 12, 0.5);
  box-shadow: 0 12px 40px rgba(234, 88, 12, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.product-image {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 0.75rem;
  background-color: #333; /* Placeholder */
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card:hover .product-image {
  transform: scale(1.05);
}

@keyframes menuCardFadeIn {
  from {
    opacity: 0;
    transform: translateY(15px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.product-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.product-title {
  font-size: 1rem;
  font-weight: bold;
  line-height: 1.2;
  margin-bottom: 0.5rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.product-desc {
  color: #aaa;
  font-size: 0.75rem;
  flex: 1;
  margin-bottom: 1rem;
  line-height: 1.3;
  word-wrap: break-word;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  width: 100%;
}

.product-price {
  color: var(--foreground);
  font-weight: 900;
  font-size: 1.1rem;
}

.btn-add-round {
  background-color: var(--primary);
  color: white;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.5rem;
  font-weight: bold;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.35);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-add-round:hover {
  transform: scale(1.1) translateY(-1px);
  box-shadow: 0 6px 16px rgba(234, 88, 12, 0.55);
}

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

.qty-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #22c55e; /* Borde verde */
  border-radius: 9999px;
  padding: 0.15rem 0.5rem;
  width: 85px;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.15);
}

.qty-btn {
  background-color: transparent;
  color: var(--foreground);
  border: none;
  font-size: 1.2rem;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.qty-btn:active {
  transform: scale(0.8);
}

.qty-number {
  font-weight: bold;
  font-size: 1rem;
  color: #22c55e;
}

.notes-container {
  margin-top: 0.75rem;
  width: 100%;
}

.notes-input {
  width: 100%;
  padding: 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background-color: rgba(0, 0, 0, 0.3);
  color: var(--foreground);
  font-size: 0.8rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.notes-input:focus {
  outline: none;
  border-color: var(--primary);
}

.notes-input::placeholder {
  color: #888;
}

@media (min-width: 600px) {
  .product-image { height: 180px; }
  .product-title { font-size: 1.25rem; }
  .product-price { font-size: 1.1rem; }
  .product-desc { font-size: 0.875rem; }
  .add-btn { padding: 0.75rem 1.5rem; font-size: 1rem; }
  .product-header { flex-direction: row; justify-content: space-between; }
}

/* Carrito Flotante */
.floating-cart {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: rgba(22, 22, 26, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 1.2rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 40;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.3);
}

.floating-cart.visible {
  transform: translateY(0);
}

.cart-info h4 {
  margin-bottom: 0.25rem;
}

.cart-info p {
  color: #aaa;
  font-size: 0.875rem;
}

/* Nuevas clases para evitar estilos en línea (spaghetti CSS) */
.catalog-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.catalog-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--foreground);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.catalog-back-btn:hover {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  transform: translateX(-3px);
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.45);
}

.catalog-back-btn:active {
  transform: translateX(-3px) scale(0.92);
}

.catalog-back-btn svg {
  width: 20px;
  height: 20px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.catalog-back-btn:hover svg {
  transform: scale(1.05);
}

.cart-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.checkout-delivery-group {
  margin-top: 1.5rem;
  margin-bottom: 0;
}

.checkout-delivery-label {
  color: var(--accent);
  font-weight: bold;
}

.checkout-delivery-select {
  font-size: 1rem;
  padding: 0.8rem;
}

.checkout-section-divider {
  border-top: 1px dashed var(--border);
  padding-top: 1.5rem;
  margin-top: 1rem;
}

.checkout-section-title {
  margin-bottom: 1rem;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--accent);
}

.comprobante-upload-box {
  display: none;
  background: rgba(234, 88, 12, 0.05);
  border: 1px dashed var(--primary);
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1rem;
}

.comprobante-upload-label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--accent);
  font-weight: bold;
}

.comprobante-file-input {
  padding: 0.5rem;
}

.comprobante-help-text {
  color: var(--text-muted);
  display: block;
  margin-top: 0.5rem;
}

.checkout-drawer-footer {
  padding: 1.2rem 1.5rem;
  border-top: 1px solid var(--border);
}

.checkout-total-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--accent);
}

.btn-confirm-checkout {
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
}

/* Modales personalizados */
.modal-overlay {
  z-index: 1050;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-overlay.open {
  opacity: 1;
}

.modal-overlay-success {
  z-index: 1060;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
}

.modal-card {
  max-width: 500px;
  width: 95%;
  background: #18181c;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal-overlay.open .modal-card {
  transform: scale(1);
}

.modal-card-success {
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
}

.modal-header-centered {
  text-align: center;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 1rem;
}

.modal-header-centered.no-border {
  border-bottom: none;
  padding-bottom: 0;
}

.modal-success-emoji {
  font-size: 3.5rem;
  margin-bottom: 0.8rem;
  filter: drop-shadow(0 4px 10px rgba(74, 222, 128, 0.3));
}

.modal-title {
  color: var(--accent);
  font-family: var(--font-serif);
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
}

.modal-title-success {
  color: #4ade80;
  font-family: var(--font-serif);
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}

.modal-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

.modal-subtitle-success {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0;
}

.modal-recibo-badge {
  font-family: monospace;
  background: rgba(234, 88, 12, 0.15);
  color: var(--primary);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  display: inline-block;
  margin-top: 1rem;
  border: 1px solid rgba(234, 88, 12, 0.3);
}

.modal-body-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  color: var(--foreground);
  font-size: 0.95rem;
}

.modal-footer-buttons {
  display: flex;
  gap: 1rem;
  border-top: 1px dashed var(--border);
  padding-top: 1.5rem;
}

.modal-footer-buttons .btn-secondary,
.modal-footer-buttons .btn-primary {
  flex: 1;
  padding: 0.9rem;
}

.modal-recibo-details {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  font-size: 0.95rem;
  color: var(--foreground);
}

.btn-success-close {
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
  background: #22c55e;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.btn-success-close:hover {
  background: #16a34a;
  box-shadow: 0 6px 16px rgba(22, 163, 74, 0.5);
}

/* Clases para HTML generado dinámicamente en JS (resumen del pedido) */
.confirm-resumen-box {
  background: rgba(255, 255, 255, 0.05);
  padding: 1rem;
  border-radius: 8px;
}

.confirm-delivery-type {
  color: var(--primary);
  font-weight: bold;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.confirm-items-title {
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.confirm-item-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #333;
  padding: 0.5rem 0;
}

.confirm-item-notes {
  color: var(--accent);
}

.confirm-payment-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.confirm-total-box {
  display: flex;
  justify-content: space-between;
  font-size: 1.3rem;
  color: var(--accent);
  font-weight: bold;
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
}

.recibo-accent-text {
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.recibo-item-dashed-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed #333;
  padding-bottom: 0.3rem;
}

.recibo-divider-top {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #333;
}

.recibo-total-row {
  display: flex;
  justify-content: space-between;
  font-weight: bold;
  margin-top: 0.5rem;
  font-size: 1.1rem;
  color: var(--primary);
}

.checkout-breakdown {
  display: none;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 0.8rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.checkout-breakdown-row {
  display: flex;
  justify-content: space-between;
}

/* Botón de Eliminar del Carrito en Checkout */
.btn-eliminar-cart {
  background: transparent;
  border: none;
  color: #f87171;
  cursor: pointer;
  font-size: 1.25rem;
  padding: 0.5rem;
  margin-left: 0.75rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.btn-eliminar-cart:hover {
  color: #ef4444;
  background-color: rgba(239, 68, 68, 0.15);
  transform: scale(1.15);
}

.btn-eliminar-cart:active {
  transform: scale(0.9);
}

/* ==========================================
   SHOWCASE ESPECIALIDADES 3D
   ========================================== */
.showcase-especialidades-container {
    width: 100%;
    padding: 3rem 1rem 5rem 1rem;
    background: radial-gradient(circle at center, rgba(30, 30, 30, 0.8) 0%, rgba(15, 15, 15, 1) 100%);
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
    border-top: 1px solid rgba(255, 69, 0, 0.2);
    border-bottom: 1px solid rgba(255, 69, 0, 0.2);
    box-shadow: 0 0 50px rgba(255, 69, 0, 0.05) inset;
    perspective: 1200px;
}

.showcase-header {
    text-align: center;
    margin-bottom: 3rem;
}

.showcase-title {
    color: var(--accent);
    font-size: 2.5rem;
    text-transform: uppercase;
    letter-spacing: 4px;
    text-shadow: 0 0 15px rgba(255, 69, 0, 0.6), 0 0 30px rgba(255, 69, 0, 0.3);
    margin-bottom: 0.5rem;
}

.showcase-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    letter-spacing: 1px;
}

/* 3D Carousel Setup */
.showcase-stage {
    width: 100%;
    height: 440px;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1200px;
}

.carousel-pivot {
    width: 220px;
    height: 340px;
    transform-style: preserve-3d;
}

.carousel-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 220px;
    height: 340px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: grab;
    backface-visibility: visible;
    transform-style: preserve-3d;
}

.carousel-item:active {
    cursor: grabbing;
}

/* Estilos personalizados para la product-card dentro del carrusel 3D (Efecto Flip 3D) */
.carousel-item .product-card.flip-card {
    width: 100%;
    height: 100%;
    margin: 0;
    box-sizing: border-box;
    position: relative;
    z-index: 2; /* Renderizar por encima de la plataforma glowing */
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    perspective: 1000px;
    transform-style: preserve-3d;
    animation: none !important; /* Desactivar la animación de entrada */
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}

/* Al pasar el cursor, voltea la tarjeta 180 grados y la eleva */
.carousel-item:hover .flip-card-inner {
    transform: rotateY(180deg) translateY(-10px);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 16px;
    padding: 1.2rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.flip-card-front {
    background: rgba(22, 22, 26, 0.9);
    border: 1px solid rgba(255, 69, 0, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    color: var(--foreground);
    justify-content: flex-start;
    align-items: center;
    pointer-events: auto;
    z-index: 2;
}

.flip-card-back {
    background: rgba(15, 15, 18, 0.96);
    border: 1px solid rgba(255, 69, 0, 0.6);
    box-shadow: 0 15px 40px rgba(255, 69, 0, 0.25);
    color: var(--foreground);
    transform: rotateY(180deg);
    justify-content: flex-start;
    pointer-events: none;
    z-index: 1;
}

.carousel-item:hover .flip-card-front {
    pointer-events: none;
    z-index: 1;
}

.carousel-item:hover .flip-card-back {
    pointer-events: auto;
    z-index: 2;
}

/* Front element styles */
.flip-card-front .product-image {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 1rem;
    filter: drop-shadow(0px 8px 16px rgba(0, 0, 0, 0.4));
    transform: translateZ(20px);
    transition: transform 0.4s ease;
}

.carousel-item:hover .flip-card-front .product-image {
    transform: translateZ(35px) scale(1.03);
}

.flip-card-front .product-title {
    font-size: 1rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 0.75rem;
    transform: translateZ(25px);
}

.showcase-price-badge {
    background: rgba(255, 69, 0, 0.15);
    border: 1px solid rgba(255, 69, 0, 0.3);
    padding: 0.35rem 1rem;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--accent);
    transform: translateZ(30px);
    box-shadow: 0 4px 12px rgba(255, 69, 0, 0.1);
    margin-top: auto;
}

.flip-hint {
    font-size: 0.7rem;
    color: #888;
    margin-top: 0.5rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    transform: translateZ(15px);
    animation: pulse-text 2s infinite alternate;
}

@keyframes pulse-text {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Back element styles */
.flip-card-back .product-image-back {
    width: 100%;
    height: 85px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    filter: brightness(0.8);
    border: 1px solid rgba(255, 69, 0, 0.2);
    transform: translateZ(15px);
}

.flip-card-back .product-title-back {
    color: var(--accent);
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    border-bottom: 1px dashed rgba(255, 69, 0, 0.2);
    padding-bottom: 0.25rem;
}

.flip-card-back .product-desc-back {
    font-size: 0.72rem;
    color: #ccc;
    line-height: 1.35;
    margin-bottom: auto;
    overflow-y: auto;
    max-height: 60px; /* Reducido de 100px para dar espacio a la imagen trasera */
    padding-right: 4px;
}

/* Scrollbar personalizado para la descripción */
.flip-card-back .product-desc-back::-webkit-scrollbar {
    width: 3px;
}
.flip-card-back .product-desc-back::-webkit-scrollbar-thumb {
    background: rgba(255, 69, 0, 0.3);
    border-radius: 3px;
}

.flip-card-back .card-footer {
    margin-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 0.75rem;
}

.flip-card-back .notes-container {
    margin-top: 0.5rem;
}

.glowing-platform {
    width: 160px;
    height: 40px;
    background: radial-gradient(ellipse at center, rgba(255, 69, 0, 0.6) 0%, rgba(255, 69, 0, 0) 70%);
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(255, 69, 0, 0.5), 0 10px 40px rgba(255, 69, 0, 0.2) inset;
    transform: rotateX(75deg) translateZ(-10px);
    position: absolute;
    bottom: -25px; /* Por debajo del borde inferior de la tarjeta */
    z-index: 1;
    animation: pulse-glow 3s infinite alternate;
    pointer-events: none;
}

@keyframes pulse-glow {
    0% { opacity: 0.6; box-shadow: 0 0 20px rgba(255, 69, 0, 0.4); }
    100% { opacity: 1; box-shadow: 0 0 40px rgba(255, 69, 0, 0.8), 0 0 10px #fff inset; }
}

@media (max-width: 768px) {
    .showcase-especialidades-container {
        padding: 2rem 1rem 3rem 1rem;
        margin-bottom: 1.5rem;
    }
    .showcase-stage {
        height: 320px;
    }
}

@media (max-width: 480px) {
    .showcase-especialidades-container {
        padding: 1.5rem 0.5rem 2rem 0.5rem;
        margin-bottom: 1rem;
    }
    .showcase-stage {
        height: 240px;
    }
    .showcase-title {
        font-size: 1.6rem;
        letter-spacing: 2px;
        margin-bottom: 0.25rem;
    }
    .showcase-subtitle {
        font-size: 0.8rem;
    }
}
