﻿/* ============================================================
   SISTEMA DE PLATOS/PRODUCTOS: GOLD RESPONSIVE
   ============================================================ */

/* --- GRID BASE --- */
.grid-gestion-crud {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    width: 100%;
    animation: fadeIn 0.8s ease-out;
}

/* --- TARJETA PRINCIPAL (Micro-interacciones) --- */
.card-principal {
    display: flex;
    align-items: center;
    padding: 20px 30px;
    gap: 25px;
    background: #ffffff;
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(71, 40, 37, 0.04);
    border: 1px solid rgba(211, 171, 128, 0.2);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
}

/* Hover: Elevación y Borde Dorado */
.card-gestion-crud:hover .card-principal {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 20px 45px rgba(71, 40, 37, 0.12);
    border-color: #d3ab80;
}

/* --- IMAGEN DEL PLATO (Efecto Zoom) --- */
.contenedor-foto {
    width: 140px;
    height: 140px;
    overflow: hidden;
    border-radius: 22px;
    flex-shrink: 0;
    box-shadow: 0 8px 25px rgba(71, 40, 37, 0.1);
    border: 2px solid #fff4e2;
}

    .contenedor-foto img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

.card-gestion-crud:hover .contenedor-foto img {
    transform: scale(1.15); /* Zoom elegante al plato */
}

/* --- TEXTOS Y BADGES --- */
.info-basica {
    flex-grow: 1;
}

    .info-basica h3 {
        margin: 0 0 5px 0;
        font-size: 1.5rem;
        color: #472825;
        font-weight: 800;
    }

.descripcion-plato {
    color: #96786f;
    font-size: 0.95rem;
    margin-bottom: 12px;
    line-height: 1.4;
}

.badge-categoria {
    font-size: 0.75rem;
    background: #fff4e2;
    color: #472825;
    padding: 5px 15px;
    border-radius: 50px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(211, 171, 128, 0.3);
    margin-bottom: 10px;
}

    .badge-categoria .dot {
        width: 7px;
        height: 7px;
        background: #d3ab80;
        border-radius: 50%;
        box-shadow: 0 0 8px #d3ab80;
    }

/* --- PRECIO --- */
.precio-tag {
    color: #d3ab80;
    font-weight: 900;
    font-size: 1.8rem;
    letter-spacing: -1px;
    display: block;
    margin-bottom: 10px;
}

/* --- BOTÓN CARRITO (Micro-Animado) --- */
.btn-carrito-moderno {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #472825;
    color: white;
    border: none;
    padding: 14px 25px;
    border-radius: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 6px 20px rgba(71, 40, 37, 0.2);
    position: relative;
    overflow: hidden;
}

    .btn-carrito-moderno:hover {
        background: #d3ab80;
        transform: translateY(-3px);
        box-shadow: 0 10px 25px rgba(211, 171, 128, 0.4);
    }

    /* Brillo que atraviesa el botón */
    .btn-carrito-moderno::after {
        content: '';
        position: absolute;
        top: -50%;
        left: -100%;
        width: 50%;
        height: 200%;
        background: rgba(255, 255, 255, 0.2);
        transform: rotate(35deg);
        transition: all 0.6s ease;
    }

    .btn-carrito-moderno:hover::after {
        left: 150%;
    }

    .btn-carrito-moderno:active {
        transform: scale(0.92); /* Efecto de presión real */
    }

/* --- ANIMACIÓN VUELO (Ajustada) --- */
@keyframes parabolaVuelo {
    0% {
        transform: translate(0, 0) scale(0.5);
        opacity: 0;
    }

    30% {
        opacity: 1;
        transform: translate(calc(var(--x-dist) * 0.3), -120px) scale(1.3) rotate(20deg);
    }

    100% {
        transform: translate(var(--x-dist), var(--y-dist)) scale(0.1) rotate(-15deg);
        opacity: 0;
    }
}

.vuelo-kraft {
    animation: parabolaVuelo 0.9s cubic-bezier(0.45, 0, 0.55, 1) forwards;
}

/* --- RESPONSIVE ADAPTATIVO --- */

@media (max-width: 992px) {
    .contenedor-foto {
        width: 120px;
        height: 120px;
    }

    .info-basica h3 {
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .card-principal {
        flex-direction: column;
        text-align: center;
        padding: 30px 20px;
    }

    .contenedor-foto {
        width: 180px; /* Foto más grande en móvil para lucir el plato */
        height: 180px;
        margin: 0 auto;
    }

    .info-basica {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .badge-categoria {
        margin-left: 0; /* Centramos el badge */
    }

    .btn-carrito-moderno {
        width: 100%; /* Botón ancho para dedos en móvil */
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .precio-tag {
        font-size: 1.5rem;
    }

    .info-basica h3 {
        font-size: 1.2rem;
    }
}

/* Map card utility used in Home/Index to contain Leaflet map */
.map-card {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    padding: 25px;
    border-radius: 30px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    overflow: hidden; /* crucial to clip map tiles to rounded corners */
}

.map-card #map {
    border-radius: 20px;
}

/* Stronger rule for the "CERRADO" badge to ensure spacing in all load orders */
.overlay-cerrado .badge-cerrado,
.restaurant-card .overlay-cerrado .badge-cerrado {
    letter-spacing: 1.2px !important;
    padding: 6px 14px !important;
    font-size: 0.75rem !important;
    transform: translateY(-3px) !important;
}


/* Movimientos / Pedidos responsive fixes */
.movimientos-container .movimientos-card details summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap; /* keep badge and price on one line */
}

/* Ensure left column can shrink (ellipsis) and right column (badge + price) does not wrap */
.movimientos-container .movimientos-card details summary > div:first-child {
    flex: 1 1 auto;
    min-width: 0; /* allow truncation */
}

.movimientos-container .movimientos-card details summary > div:first-child p,
.movimientos-container .movimientos-card details summary > div:first-child .titulo-resumen {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.movimientos-container .movimientos-card details summary > div:last-child {
    flex: 0 0 auto; /* keep price and badge together */
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.movimientos-container .movimientos-card details summary > div:last-child span {
    display: inline-block;
    white-space: nowrap; /* prevent badge from breaking into multiple lines */
    padding: 6px 14px;
    border-radius: 12px;
}

@media (max-width: 420px) {
    /* Very small screens: keep structure but slightly reduce paddings to avoid overflow */
    .movimientos-container .movimientos-card details summary > div:last-child span {
        padding: 5px 8px;
        font-size: 0.72rem;
    }
}
