/* ==========================================================================
   1. VARIABLES Y REINICIO BÁSICO (RESET)
   ========================================================================== */
:root {
    --primary-color: #e67e22; 
    --primary-hover: #d35400;
    --secondary-color: #2c3e50; 
    --text-color: #333;
    --text-light: #666;
    --bg-light: #f8f9fa;
    --white: #ffffff;
    --transition: all 0.3s ease;
    --shadow: 0 5px 15px rgba(0,0,0,0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--white);
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* ==========================================================================
   2. CLASES GLOBALES Y UTILIDADES
   ========================================================================== */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.section-padding { padding: 80px 0; }
.bg-light { background-color: var(--bg-light); }
.text-center { text-align: center; }
.section-title { margin-bottom: 50px; }
.section-title h2 { font-size: 2.5rem; color: var(--secondary-color); margin-bottom: 10px; }
.section-title p { color: var(--text-light); font-size: 1.1rem; }

/* Botones */
.btn {
    display: inline-block;
    padding: 10px 25px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}
.btn-primary { background-color: var(--primary-color); color: var(--white); }
.btn-primary:hover { background-color: var(--primary-hover); transform: translateY(-2px); }
.btn-large { padding: 15px 35px; font-size: 1.1rem; }
.btn-outline { background-color: transparent; border-color: var(--white); color: var(--white); }
.btn-outline:hover { background-color: var(--white); color: var(--secondary-color); }
.mt-3 { margin-top: 1.5rem; }

/* ==========================================================================
   3. ENCABEZADO Y NAVEGACIÓN (HEADER)
   ========================================================================== */
.main-header {
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative; /* Importante para el menú móvil */
}

.logo h2 {
    color: var(--secondary-color);
    font-weight: 700;
    font-size: 1.8rem;
}

.logo h2::after {
    content: '.';
    color: var(--primary-color);
}

.main-nav ul {
    display: flex;
    gap: 25px;
}

.main-nav a {
    font-weight: 600;
    color: var(--text-color);
    transition: var(--transition);
}

.main-nav a:hover, .main-nav a.active {
    color: var(--primary-color);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-bar, .mobile-search {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 20px;
    overflow: hidden;
}

.search-bar input, .mobile-search input {
    border: none;
    padding: 8px 15px;
    outline: none;
    font-family: 'Poppins', sans-serif;
    width: 200px;
}

.search-bar button, .mobile-search button {
    background: var(--bg-light);
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    color: var(--secondary-color);
    transition: var(--transition);
}

.search-bar button:hover, .mobile-search button:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* Ocultar elementos móviles en PC */
.menu-toggle { display: none; }
.mobile-search { display: none; }

/* ==========================================================================
   4. SLIDER PRINCIPAL
   ========================================================================== */
.hero-slider { position: relative; background-color: var(--secondary-color); }
.slider-container { position: relative; height: 600px; overflow: hidden; }
.slide {
    display: none; height: 100%; position: relative;
    background: linear-gradient(rgba(44, 62, 80, 0.7), rgba(44, 62, 80, 0.7));
}
.slide:nth-child(1) {
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('https://images.unsplash.com/photo-1581092160562-40aa08e78837?auto=format&fit=crop&q=80&w=1920');
    background-size: cover; background-position: center;
}
.slide:nth-child(2) {
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('https://images.unsplash.com/photo-1518770660439-4636190af475?auto=format&fit=crop&q=80&w=1920');
    background-size: cover; background-position: center;
}
.slide-content {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    text-align: center; color: var(--white); width: 80%; max-width: 800px;
}
.badge {
    background-color: var(--primary-color); color: var(--white);
    padding: 5px 15px; border-radius: 20px; font-size: 0.9rem;
    font-weight: 600; text-transform: uppercase; letter-spacing: 1px;
    display: inline-block; margin-bottom: 20px;
}
.slide-content h1 { font-size: 3.5rem; font-weight: 700; margin-bottom: 20px; line-height: 1.2; }
.slide-content p { font-size: 1.2rem; margin-bottom: 30px; }

.prev, .next {
    cursor: pointer; position: absolute; top: 50%; width: 50px; height: 50px;
    margin-top: -25px; color: white; font-weight: bold; font-size: 24px;
    transition: var(--transition); border-radius: 50%;
    background-color: rgba(255,255,255,0.2); display: flex;
    align-items: center; justify-content: center; user-select: none;
}
.next { right: 30px; }
.prev { left: 30px; }
.prev:hover, .next:hover { background-color: var(--primary-color); }

.slider-dots { text-align: center; position: absolute; bottom: 30px; width: 100%; }
.dot {
    cursor: pointer; height: 12px; width: 12px; margin: 0 5px;
    background-color: rgba(255,255,255,0.5); border-radius: 50%;
    display: inline-block; transition: var(--transition);
}
.dot.active, .dot:hover { background-color: var(--primary-color); transform: scale(1.3); }

.fade { animation-name: fade; animation-duration: 1.5s; }
@keyframes fade { from {opacity: .4} to {opacity: 1} }

/* ==========================================================================
   5. GRID Y TARJETAS
   ========================================================================== */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; }

.split-layout { display: flex; align-items: center; gap: 50px; }
.split-image, .split-text { flex: 1; }
.image-placeholder {
    width: 100%; height: 400px; background-color: #ddd; border-radius: 15px;
    display: flex; align-items: center; justify-content: center; color: #888;
    font-weight: bold; box-shadow: var(--shadow); overflow: hidden;
}
.split-text h2 { font-size: 2.2rem; color: var(--secondary-color); margin-bottom: 20px; }
.check-list { margin: 25px 0; }
.check-list li { margin-bottom: 15px; display: flex; align-items: center; gap: 10px; font-weight: 500; }
.check-list i { color: var(--primary-color); font-size: 1.2rem; }

/* Tarjetas de Productos */
.product-card {
    background: var(--white); border-radius: 10px; overflow: hidden;
    box-shadow: var(--shadow); transition: var(--transition);
}
.product-card:hover { transform: scale(1.03); }
.product-image { height: 250px; background-color: #eee; display: flex; align-items: center; justify-content: center; color: #aaa; }
.product-info { padding: 20px; text-align: center; border-top: 1px solid #eee; }
.product-info h4 { color: var(--secondary-color); margin-bottom: 5px; font-size: 1.1rem; }
.price { display: block; color: var(--primary-color); font-weight: 700; font-size: 1.3rem; }

/* ==========================================================================
   6. PIE DE PÁGINA (FOOTER)
   ========================================================================== */
.main-footer { background-color: var(--secondary-color); color: var(--white); padding: 60px 0 20px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 40px; margin-bottom: 40px; }
.brand-col h3 { font-size: 1.8rem; margin-bottom: 15px; color: var(--primary-color); }
.brand-col p { color: #bbb; margin-bottom: 20px; }
.social-links a {
    display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
    background-color: rgba(255,255,255,0.1); border-radius: 50%; margin-right: 10px; transition: var(--transition);
}
.social-links a:hover { background-color: var(--primary-color); transform: translateY(-3px); }
.footer-col h4 { font-size: 1.2rem; margin-bottom: 20px; position: relative; padding-bottom: 10px; }
.footer-col h4::after { content: ''; position: absolute; left: 0; bottom: 0; width: 30px; height: 2px; background-color: var(--primary-color); }
.footer-col ul li { margin-bottom: 12px; }
.footer-col ul a { color: #bbb; transition: var(--transition); }
.footer-col ul a:hover { color: var(--primary-color); padding-left: 5px; }
.contact-col p { display: flex; align-items: center; gap: 10px; color: #bbb; margin-bottom: 15px; }
.contact-col i { color: var(--primary-color); }
.footer-bottom { text-align: center; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.1); color: #888; font-size: 0.9rem; }

/* ==========================================================================
   7. DISEÑO RESPONSIVO (MÓVILES Y TABLETS) - CORREGIDO
   ========================================================================== */
@media (max-width: 992px) {
    .split-layout { flex-direction: column; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    /* Mostrar botón hamburguesa */
    .menu-toggle {
        display: block;
        font-size: 1.8rem;
        cursor: pointer;
        color: var(--secondary-color);
    }

    /* Ocultar barra de búsqueda superior y CTA para limpiar el header */
    .header-actions { display: none; }

    /* Estilos del menú desplegable móvil */
    .main-nav {
        display: none; /* Oculto por defecto */
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--white);
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
        padding: 20px;
        z-index: 999;
    }

    /* Clase activa que inyecta JavaScript */
    .main-nav.active { display: block; }

    .main-nav ul {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        margin-bottom: 20px;
    }

    /* Mostrar barra de búsqueda dentro del menú móvil */
    .mobile-search { display: flex; justify-content: center; width: 100%; }
    .mobile-search input { width: 100%; max-width: 300px; }

    /* Ajustes generales móviles */
    .slide-content h1 { font-size: 2.5rem; }
    .footer-grid { grid-template-columns: 1fr; text-align: center; }
    
    /* Alinear íconos del footer al centro en móviles */
    .contact-col p { justify-content: center; }
    .footer-col h4::after { left: 50%; transform: translateX(-50%); }
    
    .prev, .next { width: 40px; height: 40px; font-size: 18px; }
}