/* =============================================================== */
/* --- 1. VARIABLES Y RESETEO --- */
/* =============================================================== */
:root {
    --color-pink: #e684b5;
    --color-brown: #583529;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Roboto', sans-serif;
    --color-text: #666;
    --bg-light: #fefafc;
}

body, html {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    background-color: #fff;
    color: var(--color-text);
    line-height: 1.7;
}

* { box-sizing: border-box; }

h1, h2, h3, h4, h5 {
    font-family: var(--font-heading);
    color: var(--color-brown);
    margin: 0 0 15px;
    font-weight: 700;
}

p { margin: 0 0 15px; }

a {
    color: var(--color-pink);
    text-decoration: none;
    transition: color 0.3s ease;
}
a:hover { color: var(--color-brown); }

/* --- Estructura General --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
.site-main {
    padding: 0;
    min-height: 70vh;
}
.text-center { text-align: center; }

/* --- Títulos --- */
.section-subtitle {
    font-family: var(--font-heading);
    color: var(--color-pink);
    font-size: 1.3em;
    display: block;
    margin-bottom: 5px;
}
.section-title {
    font-size: 2.8em;
    margin-bottom: 25px;
}

/* --- Botones --- */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: bold;
    font-family: var(--font-body);
    text-decoration: none;
    transition: all 0.3s ease;
}
.btn-primary-solid {
    background-color: var(--color-pink);
    color: white;
    border: 2px solid var(--color-pink);
}
.btn-primary-solid:hover {
    background-color: var(--color-brown);
    border-color: var(--color-brown);
    color: white;
}
.btn-secondary-outline {
    background-color: transparent;
    color: var(--color-brown);
    border: 2px solid var(--color-brown);
}
.btn-secondary-outline:hover {
    background-color: var(--color-brown);
    color: white;
}

/* =============================================================== */
/* --- 2. HEADER Y NAVEGACIÓN --- */
/* =============================================================== */
.site-header {
    background-color: #e684b5;
    padding: 10px 40px; 
    border-bottom: 2px solid #583529;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000; 
    box-sizing: border-box;
}
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo img {
    height: 120px;
    width: auto;
    display: block;
}
.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}
.header-cart a {
    display: flex;
    align-items: center;
    font-size: 1.1em;
    color: #FFFFFF;
    font-weight: bold;
    text-decoration: none;
}
.header-cart .cart-icon {
    font-size: 1.5em;
    margin-right: 8px;
}

/* --- Menú Desktop --- */
.main-nav {
    display: flex;
    gap: 30px;
}
.main-nav a {
    font-family: var(--font-body);
    font-size: 16px;
    color: #FFFFFF;
    font-weight: 200;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 5px 0; 
    border-bottom: 2px solid transparent;
}
.main-nav a:hover, .main-nav a.active {
    color: #FFFFFF;
    border-bottom-color: #FFFFFF;
}

/* --- Botón Hamburguesa (Móvil) --- */
.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 24px;
    position: relative;
    z-index: 1001;
}
.nav-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #FFFFFF;
    border-radius: 3px;
    position: absolute;
    left: 0;
    transition: all 0.3s ease;
}
.nav-toggle span:nth-child(1) { top: 0; }
.nav-toggle span:nth-child(2) { top: 10px; opacity: 1; }
.nav-toggle span:nth-child(3) { top: 20px; }

.nav-toggle.active span:nth-child(1) { transform: rotate(45deg); top: 10px; }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg); top: 10px; }

/* =============================================================== */
/* --- 3. SECCIONES PRINCIPALES (HOME) --- */
/* =============================================================== */

/* --- Hero Section --- */
.hero-section {
    display: flex;
    align-items: center;
    padding: 150px 0;
    min-height: 80vh;
    position: relative;
    overflow: hidden;
    background-image: url('../images/hero-banner.jpg');
    background-size: cover;
    background-position: center;
}
.hero-container { position: relative; z-index: 2; }
.hero-content {
    max-width: 600px;
    position: relative;
    z-index: 2;
    left: -90px;
    transition: transform 0.1s linear;
    will-change: transform;
}
.hero-subtitle {
    font-family: var(--font-heading);
    color: var(--color-pink);
    font-size: 1.8em;
    display: block;
}
.hero-title {
    font-size: 5em;
    color: var(--color-brown);
    margin: 5px 0 15px;
    line-height: 1.1;
}
.hero-content p {
    font-size: 1.2em;
    color: var(--color-text);
    margin-bottom: 30px;
    line-height: 1.4;
}
.hero-floating-image {
    display: block;
    position: absolute;
    right: 5%;
    top: 30%;
    transform: translateY(-50%);
    width: 70%;
    max-width: 700px;
    z-index: 1;
    transition: transform 0.1s linear;
    will-change: transform;
}

/* --- Bienvenida --- */
.welcome-section { padding: 80px 0; background-color: #fff; }
.welcome-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}
.welcome-image img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    border-radius: 8px;
}

/* --- Productos Destacados (Grid) --- */
.featured-products { padding: 80px 0; background-color: var(--bg-light); }
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}
.product-card { background-color: #fff; border: 1px solid #eee; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); overflow: hidden; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.product-card:hover { transform: translateY(-5px); box-shadow: 0 8px 15px rgba(0,0,0,0.1); }
.product-image img { width: 100%; height: 250px; object-fit: cover; display: block; }
.product-info { padding: 20px; text-align: center; }
.product-info h3 { font-size: 1.5em; margin: 0 0 10px; }
.product-info .price { font-size: 1.4em; font-weight: bold; color: var(--color-pink); margin-bottom: 15px; }
.btn-add-cart { background-color: var(--color-brown); color: white; border: none; padding: 10px 15px; width: 100%; border-radius: 4px; font-size: 1em; font-weight: bold; cursor: pointer; transition: background-color 0.3s ease; }
.btn-add-cart:hover { background-color: var(--color-pink); color: white; }

/* --- Arreglo Texto Truncado (menu.php) --- */
.product-info p {
    min-height: 5.1em; 
    max-height: 5.1em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3; /* 3 líneas MÁXIMAS */
    margin-bottom: 20px;
}

/* --- CTA Banner --- */
.cta-banner {
    padding: 80px 0;
    background-image: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('../images/banner-textura.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: white;
}
.cta-title { font-size: 3em; color: white; }
.cta-banner p { font-size: 1.2em; color: #f0f0f0; margin-bottom: 30px; }
.cta-banner .btn-primary-solid { background-color: var(--color-pink); border-color: var(--color-pink); }
.cta-banner .btn-primary-solid:hover { background-color: white; border-color: white; color: var(--color-brown); }

/* --- Footer --- */
.site-footer {
    background-color: var(--color-brown);
    color: #aaa;
    padding: 40px 0;
    text-align: center;
    margin-top: 0;
}
.site-footer p { margin: 0; }

/* =============================================================== */
/* --- 4. NUEVO CARRUSEL SWIPER (ALTURA FIJA Y ESTILO DARK) --- */
/* =============================================================== */

.featured-swiper-section {
    position: relative;
    width: 100%;
    /* ALTURA FIJA: Evita que el fondo salte o deje huecos */
    height: 750px; 
    overflow: hidden;
    
    /* Fondo en el contenedor principal */
    background-image: url('../images/backdestacados.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #1a1a1a; /* Respaldo oscuro */
    
    z-index: 1;
}

/* Capa oscura (Overlay) para que se lea el texto */
.featured-swiper-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.4); 
    z-index: 1;
}

.featuredSwiper {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 2;
}

.featuredSwiper .swiper-slide {
    background: transparent;
    height: 100%; 
    display: flex;
    align-items: center;
    justify-content: center;
}

.featured-slide-content {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 1200px;
    width: 100%;
    padding: 40px;
    color: white;
    text-align: left;
    flex-wrap: nowrap;
    max-height: 100%;
}

.slide-product-image {
    max-height: 500px;
    width: auto;
    max-width: 500px;
    object-fit: contain;
    margin-right: 80px;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.3));
}

.slide-text-content {
    max-width: 500px;
    padding: 20px 0;
}

.slide-icon { display: none; }

.slide-title {
    font-family: var(--font-heading);
    font-size: 3.5em;
    color: white;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.slide-subtitle {
    font-family: var(--font-body);
    font-size: 1.2em;
    color: #ddd;
    display: block;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.slide-description {
    font-size: 1.1em;
    color: #f0f0f0;
    line-height: 1.6;
    margin-bottom: 30px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5); 
}

.slide-button {
    background-color: transparent;
    color: white;
    border: 2px solid white;
    padding: 12px 30px;
    border-radius: 5px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.slide-button:hover {
    background-color: var(--color-pink);
    border-color: var(--color-pink);
    color: white;
}

/* Paginación (Dots) */
.featuredSwiper .swiper-pagination-bullet {
    background: white;
    opacity: 0.5;
    width: 12px; height: 12px;
    margin: 0 6px !important;
    transition: opacity 0.3s ease;
}
.featuredSwiper .swiper-pagination-bullet-active {
    background: var(--color-pink);
    opacity: 1;
    transform: scale(1.2);
}
.swiper-pagination {
    margin-bottom: 20px !important;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 20;
}

/* =============================================================== */
/* --- 5. FILTROS DE CATEGORÍA (NUEVO Y FALTANTE) --- */
/* =============================================================== */
.category-filters {
    display: flex;
    flex-wrap: wrap; /* Permite que los botones bajen a la siguiente línea */
    justify-content: center; /* Centra los botones horizontalmente */
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.category-filters a {
    display: inline-block;
    padding: 10px 20px;
    margin: 5px; /* Espacio entre botones */
    border: 2px solid var(--color-brown);
    background-color: transparent;
    color: var(--color-brown);
    font-weight: bold;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.category-filters a.active,
.category-filters a:hover {
    background-color: var(--color-brown);
    color: white;
}


/* =============================================================== */
/* --- 6. FORMULARIOS, CHECKOUT Y EXTRAS --- */
/* =============================================================== */

/* Formulario de Pasteles */
.cake-form-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 40px; }
.form-step { background-color: #fff; border: 1px solid #eee; border-radius: 8px; padding: 25px; margin-bottom: 25px; }
.form-step h3 { font-size: 1.6em; color: var(--color-pink); padding-bottom: 10px; border-bottom: 2px solid #f0f0f0; margin-bottom: 20px; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-weight: bold; color: var(--color-brown); margin-bottom: 8px; }
.form-group select, .form-group textarea, .form-group input[type="text"] { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 4px; font-size: 1em; font-family: var(--font-body); }
.form-group textarea { height: 100px; resize: vertical; }

/* Resumen Flotante (PC) */
.form-summary { position: sticky; top: 180px; }
.price-card { background-color: var(--bg-light); border: 2px dashed var(--color-pink); border-radius: 8px; padding: 30px; }
.price-card h3 { font-size: 1.6em; text-align: center; margin-top: 0; }
.price-line, .price-total-line { display: flex; justify-content: space-between; font-size: 1.1em; margin-bottom: 10px; }
.price-total-line { font-size: 1.5em; font-weight: bold; color: var(--color-brown); margin-top: 15px; }
.price-total-line span:last-child { color: var(--color-pink); }
.price-card hr { border: none; border-top: 1px solid #ddd; margin: 15px 0; }

/* Checkout Específico */
.checkout-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 40px; }
.checkout-form-details .form-step { margin-bottom: 25px; }
/* En PC no queremos que el sticky tape el botón al final */
.checkout-summary .price-card { position: static; top: auto; } 
#cart-summary-list { max-height: 400px; overflow-y: auto; padding-right: 10px; }
.cart-summary-item { display: flex; justify-content: space-between; align-items: flex-start; padding: 15px 0; border-bottom: 1px solid #eee; }
.cart-summary-item:last-child { border-bottom: none; }
.cart-summary-item .item-info { flex: 1; }
.cart-summary-item .item-price { display: flex; align-items: center; gap: 15px; }
.btn-remove-item { background-color: #f4f4f4; border: 1px solid #ddd; color: #999; font-weight: bold; font-size: 1.2em; width: 28px; height: 28px; line-height: 26px; text-align: center; border-radius: 50%; cursor: pointer; }
.item-details-list { list-style-type: none; padding-left: 10px; margin: 8px 0 0; font-size: 0.9em; color: #555; border-left: 2px solid var(--color-pink); }

/* Toppers y Selectores */
.topper-input { max-width: 120px; padding: 10px !important; }
.style-selector-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 20px; }
.style-option { display: flex; flex-direction: column; align-items: center; text-align: center; cursor: pointer; border: 2px solid #ddd; border-radius: 8px; padding: 10px; transition: all 0.2s ease; user-select: none; }
.style-option:hover { border-color: var(--color-pink); box-shadow: 0 4px 8px rgba(0,0,0,0.08); }
.style-option input[type="radio"] { display: none; }
.style-option input[type="radio"]:checked + img { border: 3px solid var(--color-brown); box-shadow: 0 0 0 2px var(--color-pink); }
.style-option img { width: 100%; height: 120px; object-fit: cover; border-radius: 4px; margin-bottom: 8px; border: 3px solid transparent; transition: border-color 0.2s ease; }
.style-option span { font-weight: bold; color: var(--color-brown); font-family: var(--font-heading); font-size: 1.1em; }
.cake-preview { text-align: center; margin-bottom: 20px; background-color: #fff; border-radius: 8px; padding: 15px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.cake-preview img { max-width: 150px; height: 150px; object-fit: contain; border-radius: 4px; border: 1px solid #eee; margin-bottom: 10px; }

/* Banco y Gracias */
.bank-details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 20px 0; }
.bank-card { background-color: #fff; border: 1px solid #ddd; border-radius: 8px; padding: 20px; }
.btn-whatsapp { display: inline-block; background-color: #25D366; color: white; padding: 15px 30px; border-radius: 50px; font-weight: bold; font-size: 1.1em; text-decoration: none; transition: all 0.3s ease; }

/* =============================================================== */
/* --- 7. REGLAS RESPONSIVE (MÓVILES Y TABLETS) --- */
/* =============================================================== */

/* Tablets (max 992px) */
@media (max-width: 992px) {
    .hero-title { font-size: 4em; }
    .hero-floating-image { width: 50%; right: -5%; }
    .welcome-grid { gap: 30px; }
    
    /* Carrusel Tablet */
    .featured-swiper-section { height: 800px; }
    .featured-slide-content { flex-direction: column; text-align: center; padding: 0 20px; }
    .slide-product-image { 
        margin-right: 0; margin-bottom: 30px; 
        max-height: 350px;
        max-width: 80%; 
    }
    .slide-text-content { max-width: 100%; }
    .slide-title { font-size: 2.8em; }
}

/* MÓVILES (max 768px) */
@media (max-width: 768px) {
    /* --- Menú Móvil --- */
    .nav-toggle { display: block; }
    .nav-links-container {
        position: absolute;
        top: 144px;
        left: 0;
        width: 100%;
        background-color: #ffffff;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-out;
    }
    .nav-links-container.active { max-height: 300px; }
    .main-nav { flex-direction: column; gap: 0; padding: 10px 0; }
    .main-nav a { padding: 15px 20px; text-align: center; border-bottom: 1px solid #f0f0f0; color: var(--color-brown); text-transform: none; letter-spacing: 0; }
    
    /* --- Hero y Secciones --- */
    .hero-section { padding: 80px 0; min-height: 60vh; background-image: url('../images/hero-banner.jpg'); background-position: center center; }
    .hero-floating-image { display: none; }
    .hero-content { margin: 0 auto; text-align: center; left: 0; }
    .hero-title { font-size: 3em; }
    .welcome-grid { grid-template-columns: 1fr; }
    .welcome-image { grid-row: 1; }
    .cta-banner { padding: 60px 20px; background-attachment: scroll; }
    
    /* --- Carrusel Móvil (Altura Fija Alta) --- */
    .featured-swiper-section { height: 850px; }
    .featured-slide-content { padding-top: 0; }
    .slide-title { font-size: 2.2em; }
    .slide-description { font-size: 1em; }
    .slide-product-image { 
        max-height: 280px; 
        max-width: 280px;
        margin-bottom: 20px;
    }

    /* --- Formularios Móvil --- */
    .cake-form-grid { grid-template-columns: 1fr; }
    .form-summary { position: static; grid-row: 1; margin-bottom: 30px; }
    .bank-details-grid { grid-template-columns: 1fr; }
    .style-selector-grid { grid-template-columns: 1fr; }

    /* --- CHECKOUT: ARREGLO BOTÓN TAPADO --- */
    .checkout-grid {
        display: flex !important;
        flex-direction: column !important;
    }
    .checkout-summary {
        order: 2; 
        width: 100% !important;
        position: static !important;
        margin-top: 30px !important;
        padding-bottom: 40px;
    }
    .checkout-summary .price-card {
        position: relative !important;
        top: auto !important;
        width: 100% !important;
        z-index: 1 !important;
    }
    .checkout-summary button[type="submit"] {
        display: block !important;
        width: 100% !important;
        margin-top: 25px !important;
        position: relative !important;
        z-index: 10 !important;
    }
    
    /* --- Arreglo Botones Categoría Móvil --- */
    .category-filters {
        flex-direction: column;
        align-items: center;
        flex-wrap: nowrap;
    }
    .category-filters a {
        width: 80%;
        max-width: 300px;
        text-align: center;
        margin: 8px 0;
    }
}