/**
 * Estilos para la página de Platos
 * Con efectos 3D usando Vanilla Tilt y GSAP
 */

/* Ajustar altura y eliminar scroll innecesario */
html:has(body.page-template-page-platos) {
    height: auto;
}

body.page-template-page-platos {
    overflow-x: hidden;
    height: auto !important;
    min-height: 100vh;
}

.platos-page {
    background: var(--bg, #111111);
    color: var(--fg, #e6e6e6);
    padding: 4rem 0;
    position: relative;
    z-index: 1;
    clear: both;
    display: block;
    flex: 1 0 auto;
    /* Asegurar que ocupe el espacio correcto en el flexbox del body */
}

.platos-page .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
    overflow: visible;
}

/* Header de la página */
.page-header {
    text-align: center;
    margin-bottom: 5rem;
    padding-top: 2rem;
}

.page-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--fg, #e6e6e6);
    letter-spacing: -0.02em;
}

.page-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: rgba(230, 230, 230, 0.7);
    font-weight: 300;
    max-width: 600px;
    margin: 0 auto;
}

/* Grid de platos */
.platos-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
    margin-bottom: 4rem;
    width: 100%;
    max-width: 100%;
}

/* Tarjeta de plato */
.plato-card {
    position: relative;
    background: var(--card, #141414);
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    min-height: 450px;
    opacity: 1;
    visibility: visible;
    border: 1px solid #2a2a2a;
    max-width: 100%;
}

.plato-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Imagen del plato */
.plato-image-wrapper {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    border-radius: 20px 20px 0 0;
}

.plato-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

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

/* Overlay con efecto de brillo */
.plato-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(255, 90, 95, 0.1) 0%,
        transparent 50%,
        rgba(255, 90, 95, 0.05) 100%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.plato-card:hover .plato-overlay {
    opacity: 1;
}

/* Contenido de la tarjeta */
.plato-content {
    padding: 2rem;
    background: var(--card, #141414);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.plato-nombre {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--fg, #e6e6e6);
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.plato-descripcion {
    font-size: 1rem;
    color: rgba(230, 230, 230, 0.7);
    line-height: 1.6;
    font-weight: 300;
}

/* Efectos de hover */
.plato-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 20px;
    padding: 2px;
    background: linear-gradient(
        135deg,
        var(--accent, #ff5a5f) 0%,
        transparent 50%,
        var(--accent, #ff5a5f) 100%
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.plato-card:hover::before {
    opacity: 0.5;
}

/* Efecto de sombra 3D */
.plato-card {
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.3),
        0 1px 8px rgba(0, 0, 0, 0.2);
}

.plato-card:hover {
    box-shadow: 
        0 30px 60px rgba(0, 0, 0, 0.5),
        0 10px 30px rgba(255, 90, 95, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .platos-page {
        padding: 2rem 0 3rem;
    }
    
    .platos-page .container {
        padding: 0 1rem;
    }
    
    .page-header {
        margin-bottom: 2.5rem;
        padding-top: 1rem;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .page-subtitle {
        font-size: 1rem;
    }
    
    .platos-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .plato-card {
        min-height: 380px;
        /* Mejorar área táctil en móvil */
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    .plato-image-wrapper {
        height: 300px;
    }
    
    .plato-content {
        padding: 1.25rem;
    }
    
    .plato-nombre {
        font-size: 1.125rem;
        margin-bottom: 0.5rem;
    }
    
    .plato-descripcion {
        font-size: 0.875rem;
        line-height: 1.5;
    }
    
    /* Simplificar efectos en móvil */
    .plato-card:hover {
        transform: none;
    }
    
    .plato-card::before {
        display: none;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .platos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem;
    }
}

/* Móviles muy pequeños */
@media (max-width: 375px) {
    .platos-page .container {
        padding: 0 0.75rem;
    }
    
    .plato-card {
        min-height: 350px;
    }
    
    .plato-image-wrapper {
        height: 200px;
    }
    
    .plato-nombre {
        font-size: 1rem;
    }
    
    .plato-descripcion {
        font-size: 0.813rem;
    }
}

/* Animación de entrada suave */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-header {
    animation: fadeInUp 0.8s ease-out forwards;
}

/* Efecto de brillo al pasar el ratón */
.plato-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.05) 50%,
        transparent 70%
    );
    transform: rotate(45deg);
    transition: all 0.6s ease;
    opacity: 0;
}

.plato-card:hover::after {
    opacity: 1;
    animation: shine 0.8s ease-in-out;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* Mejoras de rendimiento */
.plato-card,
.plato-image,
.plato-overlay {
    will-change: transform;
}

.plato-card:not(:hover) {
    will-change: auto;
}

/* Asegurar que el footer aparezca después del contenido */
.platos-page + .site-footer,
.platos-page ~ .site-footer {
    position: relative;
    z-index: 2;
    clear: both;
    display: block;
}
