/* ==========================================================================
   RAIZA - HOJA DE ESTILOS FINAL Y CONSOLIDADA
   ========================================================================== */

/* ==========================================================================
   1. VARIABLES Y CONFIGURACIÓN GLOBAL
   ========================================================================== */

:root {
    --primary-green: #2a6a47;
    --dark-green: #1e4a33;
    --light-gray: #f4f4f4;
    --white-color: #ffffff;
    --dark-text: #333333;
    --light-text: #666666;
    --accent-color: #fca311;
    --font-primary: 'Montserrat', sans-serif;
    --font-secondary: 'Roboto', sans-serif;
    --border-radius: 8px;
    --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --transition-speed: 0.3s ease;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    color: var(--dark-text);
    background-color: var(--white-color);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-secondary);
    font-weight: 700;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: var(--primary-green);
    transition: color var(--transition-speed);
}

a:hover {
    color: var(--dark-green);
}

ul { list-style: none; }
img { max-width: 100%; display: block; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section-padding { padding: 6rem 0; }

.section-title {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--dark-green);
}

.section-title p {
    font-size: 1.1rem;
    color: var(--light-text);
    max-width: 600px;
    margin: 0 auto;
}

/* ==========================================================================
   2. ELEMENTOS REUTILIZABLES (Botones, etc.)
   ========================================================================== */

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: var(--border-radius);
    font-weight: 700;
    text-align: center;
    transition: all var(--transition-speed);
    cursor: pointer;
    border: 2px solid transparent;
}

.btn-primary {
    background-color: var(--accent-color);
    color: var(--white-color);
}

.btn-primary:hover {
    background-color: #e8940e;
    color: var(--white-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(252, 163, 17, 0.4);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-green);
    border-color: var(--primary-green);
}

.btn-secondary:hover {
    background-color: var(--primary-green);
    color: var(--white-color);
}

/* ==========================================================================
   3. ENCABEZADO Y NAVEGACIÓN
   ========================================================================== */

.main-header {
    background-color: var(--white-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    height: 50px;
    transition: transform var(--transition-speed);
}
.logo:hover { transform: scale(1.05); }

.navigation-wrapper {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-left: auto; /* Empuja este grupo a la derecha */
}

.nav-list {
    display: flex;
    gap: 2.5rem;
}

.nav-link {
    font-weight: 700;
    font-size: 1rem;
    color: var(--dark-text);
    position: relative;
    padding: 0.5rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background-color: var(--primary-green);
    transition: width var(--transition-speed);
}

.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.mobile-nav-toggle { display: none; }

/* ==========================================================================
   4. PIE DE PÁGINA
   ========================================================================== */

.main-footer {
    background-color: #2c3e50;
    color: var(--white-color);
    padding-top: 4rem;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding-bottom: 4rem;
}

.footer-logo {
    height: 40px;
    margin-bottom: 1rem;
}

.footer-about p { color: #bdc3c7; }
.footer-sponsors p { font-weight: 700; margin-bottom: 1rem; }
.sponsor-logos { display: flex; align-items: center; gap: 1.5rem; }
.sponsor-logo {
    height: 50px;
    background-color: transparent;
}
.footer-nav h4, .footer-social h4 { font-size: 1.2rem; margin-bottom: 1rem; }
.footer-nav ul li { margin-bottom: 0.5rem; }
.footer-nav a, .footer-social a { color: #bdc3c7; transition: color var(--transition-speed); }
.footer-nav a:hover, .footer-social a:hover { color: var(--white-color); }

.footer-social { display: flex; gap: 1rem; }
.footer-social img { height: 24px; width: 24px; }
.footer-bottom { border-top: 1px solid #34495e; text-align: center; padding: 1.5rem 0; }
.footer-bottom p { color: #bdc3c7; font-size: 0.9rem; }

/* ==========================================================================
   5. ESTILOS PÁGINA DE INICIO Y GENÉRICOS
   ========================================================================== */

.hero-section {
    background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('hero-background.jpg');
    background-size: cover;
    background-position: center;
    height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white-color);
}
.hero-content { max-width: 800px; animation: fadeIn 1.5s ease-in-out; }
.hero-title { font-size: 3.5rem; margin-bottom: 1.5rem; }
.hero-subtitle { font-size: 1.25rem; margin-bottom: 2.5rem; font-weight: 400; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.problem-section { background-color: var(--light-gray); }
.problem-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
    text-align: center;
}
.feature-item {
    background-color: var(--white-color);
    padding: 2.5rem 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}
.feature-item:hover { transform: translateY(-10px); box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15); }
.feature-icon {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin: 0 auto 1.5rem;
}
.feature-item h3 { font-size: 1.5rem; margin-bottom: 1rem; color: var(--dark-green); }

.product-showcase-section { padding: 6rem 0; }
.product-showcase-container { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 4rem; }
.product-showcase-image { border-radius: var(--border-radius); box-shadow: var(--box-shadow); }
.section-subtitle { font-size: 1rem; color: var(--accent-color); text-transform: uppercase; font-weight: 700; margin-bottom: 0.5rem; }
.section-main-title { font-size: 2.5rem; margin-bottom: 1.5rem; }
.product-showcase-content p { margin-bottom: 1.5rem; color: var(--light-text); }


/* ==========================================================================
   6. ESTILOS PÁGINAS INTERNAS (NOSOTROS, PRODUCTO)
   ========================================================================== */

.page-header {
    background-color: var(--primary-green);
    color: var(--white-color);
    padding: 4rem 2rem;
    text-align: center;
}
.page-header h1 { font-size: 3rem; }

.our-story-section { background-color: var(--white-color); }
.story-content { display: grid; grid-template-columns: 2fr 1fr; gap: 3rem; align-items: center; }
.story-image img { border-radius: var(--border-radius); box-shadow: var(--box-shadow); }
.story-text h2 { color: var(--dark-green); font-size: 2.5rem; margin-bottom: 1.5rem; }
.story-text p { margin-bottom: 1rem; color: var(--light-text); }

.mission-values-section { background-color: var(--light-gray); }
.values-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; text-align: center; }
.value-card { padding: 2rem; }
.value-icon {
    height: 50px;
    margin: 0 auto 1rem;
}
.value-card h3 { font-size: 1.5rem; margin-bottom: 0.5rem; color: var(--dark-green); }

.product-hero-section { background-color: var(--white-color); }
.product-hero-container { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.product-hero-image img { border-radius: var(--border-radius); box-shadow: var(--box-shadow); }
.product-title { font-size: 2.8rem; color: var(--dark-green); margin-bottom: 0.5rem; }
.product-tagline { font-size: 1.25rem; font-weight: 700; color: var(--primary-green); margin-bottom: 1.5rem; }
.product-description { color: var(--light-text); margin-bottom: 1.5rem; }
.product-price { font-size: 1.5rem; font-weight: 700; color: var(--dark-green); margin-bottom: 1.5rem; }

.features-section { background-color: var(--light-gray); }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; }
.feature-card {
    background-color: var(--white-color);
    padding: 2.5rem 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}
.feature-card:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0,0,0,0.1); }
.feature-card h3 { margin-top: 1.5rem; margin-bottom: 0.5rem; font-size: 1.3rem; color: var(--dark-green); }


/* ==========================================================================
   7. ESTILOS DEL CARRITO Y CHECKOUT
   ========================================================================== */

.cart-icon-wrapper {
    position: relative;
}

.cart-icon {
    height: 28px;
    cursor: pointer;
}

.cart-item-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background-color: var(--accent-color);
    color: var(--white-color);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    display: none; /* Se muestra con JS si hay items */
    align-items: center;
    justify-content: center;
    border: 2px solid var(--white-color);
}

.cart-section h2 { margin-bottom: 2rem; border-bottom: 2px solid var(--light-gray); padding-bottom: 1rem; }
.cart-section #cart-items-container { margin-bottom: 2rem; }
.cart-item {
    display: grid;
    grid-template-columns: 100px 1fr auto 1fr auto; /* Columna extra para el botón de eliminar */
    gap: 1rem;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}
.cart-item-image { width: 100px; height: 100px; object-fit: cover; border-radius: var(--border-radius); }
.cart-item-details h4 { margin-bottom: 0.5rem; }
.cart-item-subtotal { text-align: right; font-weight: 700; }

.remove-from-cart-btn {
    background: none;
    border: none;
    color: #cc0000;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s ease;
    grid-column: 5 / 6; /* Colocar en la nueva quinta columna */
    justify-self: center;
    padding: 0 1rem;
}

.remove-from-cart-btn:hover {
    transform: scale(1.2);
}

.cart-summary { text-align: right; margin-top: 2rem; border-top: 2px solid var(--dark-green); padding-top: 2rem; }
.cart-summary h3 { font-size: 1.8rem; margin-bottom: 1rem; }

.purchase-controls { display: flex; align-items: center; gap: 1rem; margin-top: 2rem; }
.quantity-selector { display: flex; align-items: center; border: 1px solid #ccc; border-radius: var(--border-radius); }
.quantity-input { width: 50px; text-align: center; border: none; font-size: 1.2rem; font-weight: 700; -moz-appearance: textfield; }
.quantity-input::-webkit-outer-spin-button, .quantity-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.quantity-btn { background-color: var(--light-gray); border: none; cursor: pointer; font-size: 1.5rem; padding: 0.5rem 1rem; transition: background-color var(--transition-speed); }
.quantity-btn:hover { background-color: #ddd; }

.checkout-container { display: grid; grid-template-columns: 2fr 1fr; gap: 3rem; }
.customer-details h2, .order-summary h2 { font-size: 1.8rem; margin-bottom: 1.5rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--light-gray); }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 700; }
.form-group input { width: 100%; padding: 0.8rem; border: 1px solid #ccc; border-radius: var(--border-radius); font-size: 1rem; }
.shipping-options { margin-top: 1rem; }
.shipping-option { display: flex; align-items: center; padding: 1rem; border: 1px solid #ccc; border-radius: var(--border-radius); margin-bottom: 0.5rem; cursor: pointer; }
.shipping-option input[type="radio"] { margin-right: 1rem; }
.order-summary { background-color: var(--light-gray); padding: 2rem; border-radius: var(--border-radius); }
.summary-totals p { display: flex; justify-content: space-between; font-size: 1.1rem; margin-bottom: 0.5rem; }
.summary-final-total { font-size: 1.5rem !important; font-weight: 700; margin-top: 1rem; }

#paypal-button-container {
    margin-top: 2rem; 
}

.error-message {
    color: #cc0000;
    font-size: 0.8rem;
    font-weight: bold;
    margin-top: 4px;
}


/* ==========================================================================
   8. ESTILOS PÁGINAS DE ESTADO (GRACIAS/ERROR)
   ========================================================================== */

.status-page-section .container {
    text-align: center;
    max-width: 700px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.status-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 2rem;
}
.status-page-section h1 {
    font-size: 2.8rem;
    color: var(--dark-green);
    margin-bottom: 1rem;
}
.status-page-section p {
    font-size: 1.1rem;
    color: var(--light-text);
    line-height: 1.7;
}

/* ==========================================================================
   9. RESPONSIVE DESIGN (MEDIA QUERIES)
   ========================================================================== */

@media (max-width: 992px) {
    .section-padding { padding: 4rem 0; }
    .hero-title { font-size: 2.8rem; }
    .product-showcase-container, .story-content, .product-hero-container, .checkout-container {
        grid-template-columns: 1fr;
    }
    .product-image-container { margin-bottom: 3rem; }
}

@media (max-width: 768px) {
    /* --- Diseño del Header en Móvil --- */
    .navigation-wrapper {
        gap: 1rem;
        margin-left: 0;
    }
    .main-header .container {
        display: grid;
        grid-template-columns: auto 1fr auto; /* Logo | Espacio | Grupo Nav/Carrito */
    }
    .navigation-wrapper {
        grid-column: 2 / 3;
        justify-self: end;
    }
    .mobile-nav-toggle {
        display: block;
        grid-column: 3 / 4;
        justify-self: end;
        background: transparent;
        border: 0;
        cursor: pointer;
        padding: 0.5rem;
    }
    .main-nav {
        display: none; /* Oculta el menú de escritorio */
        position: absolute;
        top: 80px; /* Justo debajo del header */
        left: 0;
        width: 100%;
        background-color: var(--white-color);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        z-index: 999;
    }
    .main-nav.nav-active {
        display: block; /* Se muestra cuando JS añade la clase */
    }
    .main-nav.nav-active .nav-list {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 1rem 0;
        gap: 0;
    }
    .main-nav.nav-active .nav-list a {
        display: block;
        padding: 1rem 0;
        width: 100%;
        text-align: center;
    }
    
    /* --- Otros ajustes móviles --- */
    .hero-title { font-size: 2.2rem; }
    .hero-subtitle { font-size: 1.1rem; }
    .section-title h2 { font-size: 2rem; }
    .footer-container { text-align: center; }
    .sponsor-logos { justify-content: center; }
    .footer-social { justify-content: center; }

    /* --- Carrito en Móvil (NUEVA ESTRUCTURA) --- */
    .cart-item {
        grid-template-columns: 1fr 1fr; /* Creamos una base de dos columnas */
        grid-template-areas:
            "image image"
            "details details"
            "quantity subtotal"
            "remove remove";
        gap: 1rem; /* Espacio entre los elementos */
        text-align: center;
    }

    .cart-item-image {
        grid-area: image; /* Asignamos el área */
        margin: 0 auto;
    }

    .cart-item-details {
        grid-area: details; /* Asignamos el área */
    }

    .quantity-selector {
        grid-area: quantity; /* Asignamos el área */
        justify-self: center; /* Centramos el selector en su celda */
    }

    .cart-item-subtotal {
        grid-area: subtotal; /* Asignamos el área */
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .remove-from-cart-btn {
        grid-area: remove; /* Asignamos el área */
        justify-self: center;
        margin-top: 1rem;
        padding: 0.5rem;
    }
}
