/* Variables */
:root {
    --primary: #e63946;
    --secondary: #2a9d8f;
    --dark: #1d3557;
    --light: #f1faee;
    --accent: #ffbe0b;
    --text: #2b2d42;
    --text-light: #8d99ae;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: #fff9f5;
    background-image: 
        radial-gradient(at 10% 20%, rgba(255, 237, 225, 0.8) 0%, transparent 20%),
        radial-gradient(at 90% 90%, rgba(255, 217, 179, 0.6) 0%, transparent 25%),
        radial-gradient(at 10% 90%, rgba(255, 204, 153, 0.5) 0%, transparent 20%),
        linear-gradient(to bottom, #fff9f5, #fff2e6);
    background-attachment: fixed;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23e67e22' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    z-index: -1;
    pointer-events: none;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: var(--transition);
}

a:hover {
    color: var(--accent);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: var(--dark);
    margin-bottom: 3rem;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    border: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(230, 57, 70, 0.4);
}

/* Botón de WhatsApp */
.btn-whatsapp {
    background-color: #25d366;
    color: white;
    border: 2px solid #25d366;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-whatsapp:hover {
    background-color: #128c7e;
    border-color: #128c7e;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
    color: white;
}

.btn-whatsapp i {
    font-size: 1.2em;
}

.btn-primary:hover {
    background-color: #c1121f;
    transform: translateY(-3px);
    box-shadow: 0 7px 20px rgba(230, 57, 70, 0.5);
}

/* Hero Section */
.hero {
    height: 100vh;
    min-height: 600px;
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('../img/hero/3480d94d-84f1-423c-b531-856deef4cfc2.webp') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 800px;
    padding: 0 20px;
    position: relative;
    z-index: 2;
    animation: fadeInUp 1s ease-out;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    color: white;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
    opacity: 1 !important;
    transform: translateY(0) !important;
    animation: none !important;
}

.hero p {
    font-size: 1.5rem;
    margin-bottom: 2.5rem;
    color: white !important;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8);
    opacity: 1 !important;
    transform: translateY(0) !important;
    animation: none !important;
}

/* Gallery Section */
.gallery-section {
    padding: 6rem 0;
    background-color: #f9f9f9;
    position: relative;
    overflow: hidden;
}

.gallery-container {
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.gallery-slider {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
}

.gallery-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.gallery-slide.active {
    opacity: 1;
    z-index: 1;
}

.gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-nav {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    gap: 20px;
    padding: 10px;
}

.gallery-nav-btn {
    background: rgba(255, 255, 255, 0.8);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--dark);
}

.gallery-nav-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

.gallery-dots {
    display: flex;
    gap: 10px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    background: var(--primary);
    transform: scale(1.2);
}

/* Menu Section */
.menu {
    padding: 6rem 0;
    background-color: #fff;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.menu-item {
    background: transparent;
    perspective: 1000px;
    min-height: 500px;      /* Increased for better content fit */
    margin-bottom: 2rem;
}

.menu-item-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.menu-item.flipped .menu-item-inner {
    transform: rotateY(180deg);
}

.menu-item-front,
.menu-item-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 12px;
    overflow: hidden;
    background: white;
}

.menu-item-back {
    transform: rotateY(180deg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
}

.menu-item-back img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    border: none;
    font-size: 18px;
    font-weight: bold;
    color: var(--dark);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: var(--primary);
    color: white;
    transform: rotate(90deg);
}

.menu-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.menu-item-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
    position: relative;
    background: #f5f5f5;
}

.menu-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}

.menu-item-content {
    padding: 1.5rem;
    position: relative;
    z-index: 1;
    background: white;
    min-height: 180px;   /* Minimum height for content area */
    flex: 1 1 auto;     /* Allow content to grow as needed */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.menu-item-header {
    margin-bottom: 0.5rem;
}

.menu-item h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: var(--dark);
    text-align: center;
}

.menu-item p.menu-item-description {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0.5rem 0 1rem 0;
    flex-grow: 1;
}

.view-menu-btn {
    display: block;
    width: 100%;
    padding: 12px;
    margin: 10px 0 0;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.view-menu-btn:hover {
    background-color: var(--dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.price {
    display: inline-block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 0.5rem;
}

/* Benefits Section */
.benefits {
    padding: 6rem 0;
    position: relative;
    overflow: hidden;
}

.benefits::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(135deg, rgba(255, 249, 245, 0.9) 0%, rgba(255, 242, 230, 0.9) 100%);
    z-index: -1;
}

.benefits-container {
    display: flex;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    flex-wrap: wrap;
}

.benefits-cards {
    flex: 1 1 300px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 30%;
}

.benefit-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    height: auto;
    display: flex;
    flex-direction: column;
}

.benefit-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.benefits-video {
    flex: 0 0 30%;
    position: sticky;
    top: 2rem;
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    height: 80vh;
    max-width: 360px; /* Ancho máximo para mantener la proporción */
    margin: 0 auto;
    background: #000;
}

/* Estilos para móviles */
.mobile-device .fade-in,
.mobile-device .slide-in-up {
    opacity: 1 !important;
    transform: none !important;
}


/* Media Queries para responsividad */
@media (max-width: 1024px) {
    .menu-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    
    .benefits-container {
        flex-direction: column;
    }
    
    .benefits-cards {
        max-width: 100%;
        flex: 1 1 100%;
        margin-bottom: 2rem;
    }
    
    .benefits-video {
        position: relative;
        top: auto;
        height: 80vh;
        max-width: 360px;
        margin: 0 auto 2rem;
    }
}

@media (max-width: 768px) {
    .benefits-video {
        height: 70vh;
        max-width: 300px;
    }
    
    .benefit-card {
        padding: 1.2rem;
    }
}

@media (max-width: 480px) {
    .menu-item {
        min-height: 360px;  /* Keep existing mobile height */
    }
    
    .menu-item {
        min-height: 500px;   /* <-- BORRAR esta línea */
    }
    .menu-item-image {
        height: 180px;
    }
    
    .benefits-video {
        height: 70vh;
        max-width: 400px;
    }
    
    .benefit-card {
        padding: 1rem;
    }
}

#benefitsVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    object-position: center;
}


.benefits-container {
    display: flex;
    gap: 3rem;
    margin-top: 3rem;
}

.benefits-cards {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.benefits-video {
    flex: 1;
    position: sticky;
    top: 2rem;
    height: fit-content;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.benefits-video video {
    width: 100%;
    display: block;
    border-radius: 16px;
}

.video-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.8);
    gap: 1rem;
}

.video-btn {
    background: var(--primary);
    color: white;
    border: 2px solid var(--primary);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.video-btn:hover {
    background: var(--dark);
    transform: scale(1.1);
}

#timeDisplay {
    color: white;
    font-family: monospace;
    font-size: 0.9rem;
}

.benefit-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 2.5rem 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.benefit-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.benefit-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.benefit-card:hover::before {
    opacity: 1;
}

.benefit-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, #ff6b6b 0%, #e63946 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    box-shadow: 0 10px 20px rgba(230, 57, 70, 0.2);
    transition: all 0.3s ease;
}

.benefit-card:hover .benefit-icon {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, #ff8e8e 0%, #ff6b6b 100%);
}

.benefit-card h3 {
    color: var(--dark);
    margin-bottom: 1rem;
    font-size: 1.5rem;
    position: relative;
    display: inline-block;
}

.benefit-card h3::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.benefit-card:hover h3::after {
    width: 80px;
}

.benefit-card p {
    color: var(--text-light);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 0;
}

/* Section Header */
.section-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 4rem;
    position: relative;
}

.section-subtitle {
    display: inline-block;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
}

.section-title {
    font-size: 2.8rem;
    color: var(--dark);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.section-divider {
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    margin: 0 auto 1.5rem;
    border-radius: 2px;
}

.section-description {
    font-size: 1.2rem;
    color: var(--text-light);
    line-height: 1.8;
    max-width: 700px;
    margin: 0 auto;
}

/* CTA Section */
.cta {
    background: linear-gradient(135deg, var(--primary), var(--dark));
    color: white;
    padding: 5rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 992px) {
    .hero h1 {
        font-size: 2.8rem;
    }
    
    .hero p {
        font-size: 1.3rem;
    }
    
    .section-title {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .hero {
        min-height: 500px;
    }
    
    .hero h1 {
        font-size: 2.2rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    .video-container iframe {
        height: 350px;
    }
}

@media (max-width: 576px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .video-container iframe {
        height: 250px;
    }
    
    .video-section, .menu {
        padding: 3rem 0;
    }
}

/* Asegurar que el video sea responsivo */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ---------- Flip-card visibility fix Safari ---------- */
/* Sólo se ve la cara pertinente; evita fantasma espejo */
.menu-item:not(.flipped) .menu-item-back { visibility: hidden; }
.menu-item.flipped      .menu-item-front{ visibility: hidden; }

/* Impulso 3-D extra para WebKit */
.menu-item-front{
  transform: rotateY(0deg) translateZ(1px); /* empuja a GPU */
  display: flex;
  flex-direction: column;
}
.menu-item-back {
  transform: rotateY(180deg) translateZ(1px);
}

/* Estilos base para las caras */
.menu-item-front,
.menu-item-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
  border-radius: 12px;
  overflow: hidden;
  background: white;
}

.menu-item-back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.menu-item.flipped .menu-item-inner {
  transform: rotateY(180deg);
}
