/* Variables y Reset */
:root {
    --primary: #166434;
    --primary-light: #22c55e;
    --primary-dark: #14532d;
    --text-dark: #1f2937;
    --text-gray: #4b5563;
    --bg-light: #f9fafb;
    --border: #e5e7eb;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    color: var(--text-dark);
    background-color: var(--bg-light);
    line-height: 1.6;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }

/* Navbar */
.navbar {
    background-color: #ffffff; 
    padding: 1rem 2rem;
    display: flex; justify-content: space-between; align-items: center;
    position: sticky; top: 0; z-index: 1000; box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}
.navbar .logo a { text-decoration: none; }
.nav-links { display: flex; list-style: none; gap: 2rem; align-items: center; }
.nav-links a {
    color: var(--text-dark); text-decoration: none;
    font-weight: 600; transition: color 0.2s;
}
.nav-links a:hover { color: var(--primary); }

/* Hero */
.hero {
    background: linear-gradient(rgba(22, 101, 52, 0.9), rgba(20, 83, 45, 0.9)), url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><rect width="100" height="100" fill="%23166534"/></svg>');
    background-size: cover; color: white; padding: 8rem 2rem; text-align: center;
}
.hero h1 { font-size: 3.5rem; font-weight: 800; margin-bottom: 1.5rem; }
.hero p { font-size: 1.25rem; max-width: 700px; margin: 0 auto 2.5rem; color: #dcfce7; }
.hero-buttons { display: flex; gap: 1rem; justify-content: center; }

/* Botones */
.btn {
    display: inline-block; padding: 0.8rem 1.8rem; border-radius: 0.5rem;
    font-weight: 600; text-decoration: none; transition: all 0.3s;
    cursor: pointer; border: none; text-align: center;
}
.btn-primary { background-color: var(--primary-light); color: white; }
.btn-primary:hover { background-color: #16a34a; }
.btn-outline { background-color: transparent; color: white; border: 2px solid white; }
.btn-outline:hover { background-color: white; color: var(--primary); }

.btn-outline-small {
    background-color: white; color: var(--primary);
    border: 2px solid var(--primary); padding: 0.6rem 1rem;
    border-radius: 0.25rem; width: 100%; display: block;
    margin-top: auto; font-weight: bold; transition: 0.3s ease;
}
.btn-outline-small:hover { background-color: var(--primary); color: white; }

/* Features */
.features { padding: 5rem 0; }
.feature-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem; margin-top: -8rem;
}
.feature-card {
    background: white; padding: 2.5rem; border-radius: 0.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1); text-align: center;
    border-top: 4px solid var(--primary);
}
.feature-card i { font-size: 2.5rem; margin-bottom: 1rem; color: var(--primary); }

/* Catálogo y Filtros */
.page-section { padding: 4rem 0; }
.bg-light { background-color: #eef2ef; }

.filters-section {
    display: flex; flex-direction: column; gap: 1.5rem;
    margin-bottom: 3rem; align-items: center;
}
.search-bar { width: 100%; max-width: 500px; }
.search-bar input {
    width: 100%; padding: 1rem 1.5rem; border-radius: 99px;
    border: 2px solid var(--primary-light); font-size: 1rem; outline: none;
}
.filter-buttons { display: flex; gap: 0.75rem; flex-wrap: wrap; justify-content: center; }
.filter-btn {
    padding: 0.5rem 1.25rem; border-radius: 99px;
    border: 1px solid var(--primary); background: white;
    color: var(--primary); cursor: pointer; font-weight: 600; transition: 0.3s;
}
.filter-btn.active, .filter-btn:hover { background: var(--primary); color: white; }

/* Carrusel Cobertera */
.cobertera-container {
    margin-bottom: 4rem; background: white; border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08); overflow: hidden;
}
.swiper { width: 100%; height: 350px; background-color: #e5e7eb; }
.swiper-slide img { width: 100%; height: 100%; object-fit: cover; }
.resumen-cobertera { padding: 2rem; background-color: #f0fdf4; border-top: 4px solid var(--primary-light); }
.resumen-cobertera h3 { color: var(--primary-dark); margin-bottom: 0.5rem; }

/* Tarjetas de Producto Mejoradas */
.products-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 2rem;
}
.product-card {
    background: white; border-radius: 10px; overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.06); transition: transform 0.3s ease;
    display: flex; flex-direction: column; border: 1px solid var(--border);
}
.product-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(22, 100, 52, 0.15); }

.product-image-container { width: 100%; height: 200px; overflow: hidden; border-bottom: 1px solid var(--border); }
.product-image-container img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.product-card:hover .product-image-container img { transform: scale(1.05); }

.product-info { padding: 1.5rem; display: flex; flex-direction: column; flex-grow: 1; }
.product-info h3 { font-size: 1.3rem; color: var(--primary-dark); margin-bottom: 0.5rem; }
.product-info h4 { font-size: 1.0rem; color: var(--primary-dark); margin-bottom: 0.5rem; }
.product-info .desc { color: var(--text-gray); font-size: 0.95rem; margin-bottom: 1.5rem; flex-grow: 1; }

/* Formulario Contacto */
.contact-container { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; margin-top: 2rem; }
.contact-info h3 { color: var(--primary); margin-bottom: 1rem; }
.info-block { margin-top: 1.5rem; padding-left: 1rem; border-left: 3px solid var(--primary-light); }
.contact-form { background: white; padding: 2.5rem; border-radius: 0.5rem; box-shadow: 0 4px 15px rgba(0,0,0,0.05); }
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 600; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 0.75rem; border: 1px solid var(--border); border-radius: 0.25rem; font-family: inherit;
}

/* Modal del Carrito NATIVO */
.cart-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); z-index: 2000; justify-content: center; align-items: center;
}
.cart-box {
    background: white; width: 90%; max-width: 500px; border-radius: 12px;
    display: flex; flex-direction: column; max-height: 80vh; overflow: hidden;
}
.cart-header {
    padding: 1.5rem; background: var(--primary); color: white;
    display: flex; justify-content: space-between; align-items: center;
}
.close-btn { background: none; border: none; color: white; font-size: 1.5rem; cursor: pointer; }
.cart-items-container { padding: 1.5rem; overflow-y: auto; flex-grow: 1; }
.cart-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 0; border-bottom: 1px solid var(--border);
}
.cart-item h4 { color: var(--primary-dark); margin-bottom: 0.2rem; }
.remove-btn { background: #fee2e2; color: #dc2626; border: none; border-radius: 4px; padding: 0.3rem 0.6rem; cursor: pointer; font-weight: bold; }
.cart-footer { padding: 1.5rem; background: #f9fafb; border-top: 1px solid var(--border); }

/* Footer */
.footer { background-color: #111827; color: #9ca3af; padding: 2rem 0; text-align: center; }

/* Responsive */
@media (max-width: 768px) {
    .navbar { flex-direction: column; gap: 1rem; }
    .contact-container { grid-template-columns: 1fr; }
    .feature-grid { margin-top: 2rem; }
}

/* =========================================
   MENSAJE TEMPORAL (TOAST)
   ========================================= */
.toast {
    visibility: hidden;
    min-width: 250px;
    background-color: var(--primary);
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 16px;
    position: fixed;
    z-index: 3000;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    opacity: 0;
    transition: opacity 0.5s, bottom 0.5s;
}

.toast.show {
    visibility: visible;
    opacity: 1;
    bottom: 50px;
}