/* =========================================
   VARIABLES GLOBALES
   ========================================= */
html, body {
    background-color: #ffffff !important; /* Fuerza el fondo blanco siempre */
    color-scheme: light only; /* Refuerza la instrucción de modo claro */
}
:root {
    --primary-teal: #005d5d;
    --text-dark: #1a1a1a;
    --text-gray: #666666;
    --bg-light: #f6f6f6;
    --white: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden; 
}

/* =========================================
   BARRA DE NAVEGACIÓN (HEADER)
   ========================================= */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 8%;
    background-color: var(--white);
    max-width: 1600px;
    margin: 0 auto;
    position: relative; /* Para el menú hamburguesa */
}

.logo-svg {
    height: 65px;
    width: auto;
    display: block;
}

/* Enlaces de navegación Desktop */
.nav-links {
    display: flex;
    list-style: none;
    gap: 40px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-gray);
    font-weight: 500;
    font-size: 1rem;
    padding-bottom: 5px;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-teal);
}

.nav-links a.active {
    color: var(--primary-teal);
    border-bottom: 2px solid var(--primary-teal);
}

/* Botón Hamburguesa (Oculto en desktop) */
.hamburger {
    display: none;
    cursor: pointer;
    border: none;
    background: transparent;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    transition: all 0.3s ease-in-out;
    background-color: var(--primary-teal);
}

/* =========================================
   SECCIÓN HERO
   ========================================= */
.hero-section {
    background-color: var(--bg-light);
    width: 100%;
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 80px 8% 120px 8%;
    max-width: 1600px;
    margin: 0 auto;
    gap: 50px;
}

.hero-content {
    flex: 1;
    max-width: 650px;
}

.hero-content h1 {
    font-size: 5.5rem;
    font-weight: 900;
    line-height: 1.05;
    margin-bottom: 25px;
    letter-spacing: -2px;
}

.text-teal { color: var(--primary-teal); }

.hero-content p {
    font-size: 1.15rem;
    line-height: 1.6;
    color: #333;
    margin-bottom: 40px;
    font-weight: 400;
}

.btn-primary {
    display: inline-block;
    background-color: var(--primary-teal);
    color: var(--white);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.3rem;
    padding: 18px 45px;
    border-radius: 6px;
    box-shadow: 0 10px 20px rgba(0, 93, 93, 0.2);
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn-primary:hover {
    background-color: #004a4a;
    transform: translateY(-3px);
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.hero-image img {
    width: 100%;
    max-width: 700px;
    height: auto;
    border-radius: 12px;
    object-fit: cover;
    aspect-ratio: 1 / 1; 
    background-color: #0c2b2b; 
}

/* =========================================
   SECCIÓN DE PRODUCTOS
   ========================================= */
.products-section {
    padding: 60px 8% 100px 8%;
    max-width: 1000px;
    margin: 0 auto;
    background-color: var(--white);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tabs-container {
    margin-bottom: 50px;
    width: 100%;
    text-align: center;
}

.tabs {
    display: inline-flex;
    background-color: #e8ecec;
    border-radius: 50px;
    padding: 5px;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 10px 25px;
    border-radius: 50px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-gray);
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn:hover { color: var(--primary-teal); }
.tab-btn.active {
    background-color: var(--primary-teal);
    color: var(--white);
}

.products-wrapper { width: 100%; }

.product-grid {
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.product-grid.active {
    display: grid;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.product-card {
    border: 1px solid #c4d4d4;
    border-radius: 12px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background-color: var(--white);
    transition: box-shadow 0.3s ease;
}

.product-card:hover { box-shadow: 0 10px 25px rgba(0, 93, 93, 0.1); }

.product-img-container {
    height: 200px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.product-img-container img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.product-card h3 {
    color: var(--primary-teal);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.product-card p {
    color: var(--text-gray);
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 25px;
    flex-grow: 1;
}

.btn-card {
    display: block;
    width: 100%;
    background-color: var(--primary-teal);
    color: var(--white);
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 15px 0;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.btn-card:hover { background-color: #004a4a; }
.see-all-container { margin-top: 60px; }

/* =========================================
   SECCIÓN DE SERVICIOS
   ========================================= */
.services-section {
    background-color: var(--bg-light); /* Fondo gris claro */
    padding: 100px 8%;
    text-align: center;
}

.services-header {
    margin-bottom: 60px;
}

.services-header h2 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 15px;
    letter-spacing: -0.5px;
}

.services-header p {
    font-size: 1.15rem;
    color: var(--primary-teal);
    font-weight: 400;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.service-card {
    background-color: var(--primary-teal);
    color: var(--white);
    padding: 40px 35px;
    border-radius: 8px;
    text-align: left;
    transition: transform 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
}

.service-icon {
    width: 35px; /* Tamaño del icono */
    height: auto;
    margin-bottom: 25px;
    display: block;
}

.service-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.service-card p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.75); /* Texto ligeramente transparente */
}

/* =========================================
   SECCIÓN CTA (CALL TO ACTION)
   ========================================= */
.cta-section {
    background-color: var(--primary-teal);
    padding: 80px 8%;
}

.cta-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    gap: 50px;
}

.cta-text {
    flex: 1;
    color: var(--white);
}

.cta-text h2 {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 25px;
    letter-spacing: -1px;
}

.cta-text p {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.8); /* Blanco transparente */
    line-height: 1.5;
}

.cta-button-container {
    flex-shrink: 0;
}

.btn-white {
    display: inline-block;
    background-color: var(--white);
    color: var(--primary-teal);
    font-weight: 800;
    font-size: 1rem;
    padding: 20px 45px;
    border-radius: 6px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn-white:hover {
    background-color: #e6e6e6; /* Gris muy claro al pasar el mouse */
    transform: translateY(-2px);
}

/* =========================================
   SECCIÓN DE CONTACTO
   ========================================= */
.contact-section {
    padding: 100px 8%;
    background-color: var(--white);
    display: flex;
    justify-content: center;
}

.contact-container {
    display: flex;
    max-width: 1200px;
    width: 100%;
    gap: 60px;
    align-items: stretch;
}

/* Tarjeta Verde (Izquierda) */
.contact-info {
    flex: 1;
    background-color: var(--primary-teal);
    color: var(--white);
    border-radius: 12px;
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.contact-info h2 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.contact-info p {
    font-size: 1.1rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
}

/* Formulario (Derecha) */
.contact-form-container {
    flex: 1.5; /* Ocupa un poco más de espacio que la tarjeta */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-size: 0.9rem;
    color: var(--text-gray);
    font-weight: 500;
    margin-bottom: 5px;
}

.input-group input {
    border: none;
    border-bottom: 1px solid #ccc;
    padding: 10px 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    color: var(--text-dark);
    background-color: transparent;
    transition: border-bottom-color 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-bottom: 2px solid var(--primary-teal);
}

.btn-submit {
    background-color: var(--primary-teal);
    color: var(--white);
    border: none;
    padding: 18px 40px;
    border-radius: 6px;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    align-self: flex-start; /* Alinea el botón a la izquierda */
    margin-top: 20px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn-submit:hover {
    background-color: #004a4a;
    transform: translateY(-2px);
}

/* Estado del botón mientras se envía */
.btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Estilos para el mensaje de éxito del formulario */
.success-message {
    /* Centramos el texto en el espacio que deja el formulario */
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%; 
    min-height: 250px; /* Asegura que mantenga la altura original del form */
    animation: fadeIn 0.5s ease;
}

.success-message h3 {
    color: var(--primary-teal); /* El color verde que venimos usando */
    font-weight: 600;           /* Peso Semibold */
    font-size: 1.4rem;          /* Tamaño un poco más grande para destacar */
    line-height: 1.5;
    text-align: center;
    margin-top: 15%;
}

/* =========================================
   FOOTER
   ========================================= */
.footer {
    background-color: var(--primary-teal);
    padding: 25px 8%;
    text-align: center;
}

/* CORRECCIÓN: Faltaban las llaves { } aquí */
.footer p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    font-weight: 400;
}
/* =========================================
   PÁGINA: MARKETPLACE (PRODUCTS.HTML)
   ========================================= */
.marketplace-section {
    padding: 40px 8% 120px 8%;
    background-color: var(--white);
    
}

.marketplace-container {
    max-width: 1400px; /* Un poco más ancho para albergar 4 columnas */
    margin: 0 auto;
}

.marketplace-header {
    block-size: auto;
    margin-bottom: 30px;
   
    
    
}

.marketplace-header h1 {
    font-size: 3rem;
    font-weight: 900;
    color: var(--primary-teal);
    margin-bottom: 20px;
}

.marketplace-header p {
    font-size: 1rem;
    line-height: 1.6;
    color: black;
}

/* Barra de Filtros */
.filters-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.filter-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-pill {
    background-color: #ebebeb;
    border: none;
    padding: 10px 25px;
    border-radius: 50px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-gray);
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-pill:hover {
    background-color: #d4d4d4;
}

.filter-pill.active {
    background-color: var(--primary-teal);
    color: var(--white);
}

/* Cuadrícula 4x4 (Desktop) */
.marketplace-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 Columnas forzadas */
    gap: 30px;
    margin-bottom: 60px;
}

/* Modificamos ligeramente la tarjeta para que se vea bien en 4 columnas */
.marketplace-grid .product-card {
    padding: 25px 20px;
}

.marketplace-grid .product-card h3 {
    font-size: 1.05rem;
}

.marketplace-grid .product-card p {
    font-size: 0.8rem;
}

.marketplace-grid .btn-card {
    font-size: 0.7rem;
    padding: 12px 0;
}

/* Paginación */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 50px;
   
}

.page-numbers {
    display: flex;
    gap: 10px;
}

.page-num {
    background: transparent;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-gray);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    
}

.page-num:hover {
    background-color: #f0f0f0;
}

.page-num.active {
    background-color: var(--primary-teal);
    color: var(--white);
}

.page-arrow {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-teal);
    cursor: pointer;
    padding: 0 10px;
}

.page-arrow:disabled {
    color: #ccc;
    cursor: not-allowed;
}

/* =========================================
   DISEÑO RESPONSIVO (MÓVILES Y TABLETS)
   ========================================= */

@media (max-width: 1024px) {
    .hero-container {
        flex-direction: column;
        padding: 50px 5%;
        text-align: center;
    }
    .hero-content {
        max-width: 100%;
        margin-bottom: 50px;
    }
    .hero-content h1 { font-size: 4rem; }
    .hero-image { justify-content: center; }

    /* Tableta: 2 columnas para servicios, apilar CTA */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cta-container {
        flex-direction: column;
        text-align: center;
    }
    
    .cta-text h2 {
        font-size: 2.2rem;
    }

    .cta-text h2 br, .cta-text p br {
        display: none; /* Quita los saltos de línea forzados en pantallas más chicas */
    }
    /* Tableta: Formulario 1 sola columna pero mantiene tarjeta y form lado a lado si cabe */
    .contact-container {
        flex-direction: column;
    }
    
    .contact-info {
        padding: 50px 20px;
    }
    /* En Tablet, pasamos de 4 a 3 columnas */
    .marketplace-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    
    /* CENTRAR EL LOGO EN MÓVIL */
    .navbar {
        justify-content: center; /* Centra el logo */
    }

    /* HAMBURGUESA Y MENÚ MÓVIL */
    .hamburger {
        display: block;
        z-index: 100;
        position: absolute; /* Saca la hamburguesa del flujo para no afectar el centrado del logo */
        right: 8%; /* Lo pega a la derecha respetando el padding */
        top: 50%;
        transform: translateY(-50%); /* Lo centra verticalmente */
    }
    
    .hamburger.active .bar:nth-child(2) { opacity: 0; }
    .hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 0;
        gap: 0;
        flex-direction: column;
        background-color: var(--white);
        width: 100%;
        height: 100vh;
        text-align: center;
        transition: 0.3s;
        z-index: 99;
        display: flex;
        justify-content: center;
        align-items: center;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-links {
        flex-direction: column;
        gap: 40px;
    }

    .nav-links a {
        font-size: 1.5rem;
        font-weight: 700;
    }

    .hero-content h1 { font-size: 3rem; }

   /* PESTAÑAS DE CATEGORÍAS (CENTRADAS EN MÓVIL) */
    .tabs-container {
        display: flex;
        justify-content: center;
        width: 100%;
        overflow: hidden; /* Quitamos el scroll */
    }

    .tabs {
        display: flex;
        flex-wrap: wrap; /* Permite que bajen a la siguiente línea si no caben */
        justify-content: center; /* Centra los botones perfectamente */
        gap: 10px; /* Separación entre los botones cuando están apilados */
        width: 100%;
        background-color: transparent; /* Quitamos el fondo gris general en móvil para que se vea más limpio */
    }

    .tab-btn {
        background-color: #e8ecec; /* Le damos el fondo gris individual a cada botón */
        padding: 10px 18px; 
        font-size: 0.75rem;
        border-radius: 50px;
    }

    .tab-btn.active {
        background-color: var(--primary-teal);
        color: var(--white);
    }
/* CORRECCIÓN: Paginación responsiva para que no se salga de la pantalla */
    .pagination-container {
        flex-wrap: wrap; /* Permite que todo el bloque baje de línea si es necesario */
        padding: 0 10px;
    }

    .page-numbers {
        flex-wrap: wrap; /* Permite que los números bajen de línea */
        justify-content: center;
        gap: 8px; /* Separación un poco menor en celular */
    }

    .page-num {
        width: 32px;  /* Hacemos los círculos un poquitito más pequeños en móvil */
        height: 32px;
        font-size: 0.9rem;
    }
    /* PRODUCTOS A 1 COLUMNA */
    .product-grid {
        grid-template-columns: 1fr; 
    }
    /* Móvil: 1 columna para todo */
    .services-header h2 {
        font-size: 2rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .cta-text h2 {
        font-size: 1.8rem;
    }

    .btn-white {
        display: block;
        width: 100%;
        text-align: center;
        padding: 18px 20px;
    }
    /* Móvil: Campos del formulario en 1 columna */
    .form-row {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .btn-submit {
        width: 100%; /* Botón ancho completo en móvil */
    }
    
    .contact-info h2 {
        font-size: 1.8rem;
    }

    .marketplace-header{
        text-align: center;
        
    }
    .marketplace-header h1{
        font-size: 35px;
        text-align: center;
        margin-bottom: 0;
        margin-top: 0;
    }
    /* REDUCE EL ESPACIO ENTRE NAVBAR Y MARKETPLACE EN MÓVIL */
    .marketplace-section {
        padding-top: 20px; /* Antes estaba en 80px */
    }
    /* En Móvil, el Marketplace pasa a 2 columnas exactas */
    .marketplace-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px; /* Reducimos el espacio para que quepan bien */
        font-size: 0.9rem; 
    }

    /* Reducimos el padding de las tarjetas en móvil para ganar espacio */
    .marketplace-grid .product-card {
        padding: 15px 10px;
    }

    .marketplace-grid .product-img-container {
        height: 120px; /* Imagen más pequeña en móvil */
    }

    .marketplace-grid .product-card h3 {
        font-size: 0.9rem;
    }

    .marketplace-grid .product-card p {
        font-size: 0.75rem;
        margin-bottom: 15px;
    }

    .marketplace-grid .btn-card {
        font-size: 0.4rem;
        padding: 10px 0;
    }
    
    .filters-wrapper {
        
        flex-direction: column;
        align-items:center flex-start;
        gap: 15px;
    }
    .filter-buttons {
        align-items: center;
        margin-left: 18px;
    }
    /* =========================================
   CORRECCIÓN DE DESPLAZAMIENTO LATERAL (ANTI-OVERFLOW)
   ========================================= */

/* 1. Bloqueo estricto del ancho de la página */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

/* 2. Permite que las tarjetas se encojan correctamente en el grid */
.product-card {
    min-width: 0; 
}

/* 3. Rompe palabras ultralargas si no caben en la columna de móvil */
.product-card h3, 
.product-card p,
.footer p {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* 4. Asegura que la caja de los botones de filtro no se estire de más */
.filter-buttons {
    max-width: 100%;
}

/* 5. Ajuste de emergencia para celulares de pantalla MUY pequeña (ej. iPhone SE) */
@media (max-width: 400px) {
    .marketplace-grid {
        gap: 8px !important; /* Reduce el hueco entre las 2 columnas */
    }
    
    .marketplace-section {
        padding-left: 5%;
        padding-right: 5%;
    }
    
    .marketplace-grid .product-card h3 {
        font-size: 0.8rem; /* Achica un poco más la letra si la pantalla es enana */
    }
}
   
}