/* ================================
   PALETA DE COLORES ECOVIDA
================================ */
:root {
    --verde-oscuro: #2C5F2D;
    --verde-principal: #4A7C4E;
    --verde-medio: #5E9C5E;
    --verde-claro: #7CB976;
    --verde-menta: #9FD6A1;
    --verde-suave: #D7F0D8;
    --verde-background: #F1F9F1;
    --amarillo-acento: #F9A825;
    --naranja-acento: #F57C00;
    --gris-texto: #2C3E50;
    --gris-medio: #6C757D;
    --gris-claro: #CED4DA;
    --gris-suave: #F8F9FA;
    --blanco: #FFFFFF;
    --rojo-error: #DC3545;
    --azul-info: #0D6EFD;
    --sombra-suave: rgba(44, 95, 45, 0.08);
    --sombra-media: rgba(44, 95, 45, 0.15);
}

/* ================================
   ESTILO GLOBAL
================================ */
body {
    font-family: "Poppins", Arial, sans-serif;
    background-color: var(--verde-background);
    color: var(--gris-texto);
    margin: 0;
    padding: 0;
}

/* Links */
a {
    color: var(--verde-principal);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--verde-oscuro);
}

/* ================================
   TARJETAS (cont/box)
================================ */
.card-eco {
    background: var(--blanco);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 12px var(--sombra-suave);
    border-left: 4px solid var(--verde-principal);
    transition: box-shadow 0.3s ease;
}

.card-eco:hover {
    box-shadow: 0 4px 20px var(--sombra-media);
}

.card-title-eco {
    font-size: 24px;
    font-weight: 600;
    color: var(--verde-oscuro);
    margin-bottom: 15px;
}

/* ================================
   FORMULARIOS
================================ */
label {
    font-weight: 600;
    color: var(--verde-oscuro);
}

input, select, textarea {
    border-radius: 10px !important;
    border: 2px solid var(--verde-menta) !important;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--verde-principal) !important;
    box-shadow: 0 0 6px rgba(76,175,80,0.6);
}

/* ================================
   BOTONES
================================ */
.btn-eco {
    background: var(--verde-principal);
    color: white;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    padding: 10px 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 8px var(--sombra-suave);
    text-transform: none;
    letter-spacing: 0.3px;
    font-size: 14px;
}

.btn-eco:hover {
    background: var(--verde-oscuro);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--sombra-media);
}

.btn-eco:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px var(--sombra-suave);
}

.btn-red {
    background: var(--rojo-error);
    color: white;
    border-radius: 8px;
    padding: 10px 20px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.2);
}

.btn-red:hover {
    background: #C82333;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* Botón secundario (suave) */
.btn-eco-light {
    background: var(--blanco);
    color: var(--verde-principal);
    border-radius: 8px;
    font-weight: 600;
    padding: 10px 20px;
    border: 2px solid var(--verde-menta);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-eco-light:hover {
    background: var(--verde-suave);
    color: var(--verde-oscuro);
    border-color: var(--verde-principal);
    transform: translateY(-1px);
}

/* ================================
   TABLAS
================================ */
.table-eco {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
}

.table-eco thead {
    background: var(--verde-oscuro);
    color: white;
    text-transform: uppercase;
    font-weight: 600;
}

.table-eco th, .table-eco td {
    padding: 12px 15px;
}

.table-eco tbody tr {
    background: white;
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.12);
}

.table-eco tbody tr:hover {
    background: var(--verde-menta);
    color: white;
}

/* ================================
   ALERTAS
================================ */
.alert-eco {
    padding: 15px;
    border-radius: 10px;
    background: var(--verde-claro);
    color: white;
    border-left: 7px solid var(--verde-oscuro);
    font-weight: 600;
}

.alert-error {
    background: var(--rojo-error);
    color: white;
    border-left: 7px solid #b71c1c;
}

/* ================================
   BARRA DE NAVEGACIÓN
================================ */
.nav-eco {
    background: var(--verde-principal);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    color: white;
    align-items: center;
    box-shadow: 0 2px 8px var(--sombra-media);
}

.nav-eco a {
    color: white;
    margin-right: 25px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.nav-eco a:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

/* ================================
   FOOTER
================================ */
.footer-eco {
    background: var(--verde-principal);
    color: white;
    padding: 20px;
    text-align: center;
    margin-top: 50px;
    font-weight: 500;
    box-shadow: 0 -2px 8px var(--sombra-suave);
}

/* ================================
   CATÁLOGO - BÚSQUEDA Y FILTROS
================================ */
.catalog-top-section {
    background: var(--blanco);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 12px var(--sombra-suave);
    margin-bottom: 25px;
}

.search-and-filters-wrapper {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    flex-wrap: wrap;
}

/* Búsqueda */
.search-container {
    flex: 1;
    min-width: 300px;
}

.search-bar {
    position: relative;
    width: 100%;
}

.search-bar input {
    width: 100%;
    padding: 12px 50px 12px 20px;
    border: 2px solid var(--gris-claro);
    border-radius: 25px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: var(--gris-suave);
}

.search-bar input:focus {
    border-color: var(--verde-principal);
    background: var(--blanco);
    box-shadow: 0 0 0 3px rgba(74, 124, 78, 0.1);
    outline: none;
}

.search-bar button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--verde-principal);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-bar button:hover {
    background: var(--verde-oscuro);
}

/* Contenedor de filtros horizontales */
.filters-horizontal {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* Acordeón de filtros */
.filter-accordion {
    position: relative;
}

.filter-toggle-btn {
    background: var(--blanco);
    border: 2px solid var(--gris-claro);
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--gris-texto);
    transition: all 0.3s ease;
    font-size: 14px;
    white-space: nowrap;
}

.filter-toggle-btn:hover {
    border-color: var(--verde-principal);
    background: var(--verde-suave);
    color: var(--verde-oscuro);
}

.filter-toggle-btn.active {
    background: var(--verde-principal);
    color: white;
    border-color: var(--verde-principal);
}

.filter-toggle-btn i {
    font-size: 16px;
}

.filter-toggle-btn .arrow {
    margin-left: 5px;
    transition: transform 0.3s ease;
    font-size: 12px;
}

.filter-toggle-btn.active .arrow {
    transform: rotate(180deg);
}

/* Dropdown del filtro */
.filter-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: var(--blanco);
    border: 2px solid var(--gris-claro);
    border-radius: 10px;
    padding: 20px;
    min-width: 280px;
    max-width: 350px;
    box-shadow: 0 8px 24px var(--sombra-media);
    z-index: 1000;
    display: none;
}

.filter-dropdown.active {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-dropdown-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--verde-oscuro);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--verde-suave);
}

.filter-option {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.filter-option input[type="checkbox"],
.filter-option input[type="radio"] {
    margin-right: 10px;
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--verde-principal);
}

.filter-option label {
    cursor: pointer;
    color: var(--gris-texto);
    font-size: 14px;
    flex: 1;
    user-select: none;
}

.filter-option label:hover {
    color: var(--verde-principal);
}

/* Filtro de precio */
.price-range-container {
    padding: 10px 0;
}

.price-range input[type="range"] {
    width: 100%;
    accent-color: var(--verde-principal);
    cursor: pointer;
}

.price-values {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--gris-medio);
    margin-top: 8px;
    font-weight: 600;
}

/* Botones de filtro */
.filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--gris-claro);
}

.btn-filter-apply {
    flex: 1;
    background: var(--verde-principal);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 13px;
}

.btn-filter-apply:hover {
    background: var(--verde-oscuro);
}

.btn-filter-clear {
    background: var(--gris-suave);
    color: var(--gris-texto);
    border: 1px solid var(--gris-claro);
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

.btn-filter-clear:hover {
    background: var(--gris-claro);
}

/* Badge de filtros activos */
.filter-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--rojo-error);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
}

/* Layout del catálogo (sin sidebar) */
.catalog-layout {
    display: block;
}

.catalog-main {
    width: 100%;
}

.catalog-toolbar {
    background: var(--blanco);
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px var(--sombra-suave);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.results-count {
    color: var(--gris-medio);
    font-size: 14px;
    font-weight: 600;
}

.results-count strong {
    color: var(--verde-principal);
}

/* ================================
   PAGINACIÓN
================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 30px;
    padding: 20px;
    background: var(--blanco);
    border-radius: 10px;
    box-shadow: 0 2px 10px var(--sombra-suave);
}

.pagination a,
.pagination span {
    min-width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 14px;
}

.pagination a {
    color: var(--gris-texto);
    border: 2px solid var(--gris-claro);
    background: var(--blanco);
}

.pagination a:hover {
    background: var(--verde-suave);
    border-color: var(--verde-principal);
    color: var(--verde-oscuro);
}

.pagination .current {
    background: var(--verde-principal);
    color: white;
    border: 2px solid var(--verde-principal);
}

.pagination .disabled {
    color: var(--gris-claro);
    border-color: var(--gris-suave);
    cursor: not-allowed;
    background: var(--gris-suave);
}

.pagination .dots {
    border: none;
    background: transparent;
    color: var(--gris-medio);
}

.pagination .prev-next {
    padding: 0 14px;
    font-weight: 700;
    min-width: auto;
}

/* ================================
   RESPONSIVE DESIGN - MOBILE FIRST
================================ */

/* Tablets y dispositivos medianos (768px - 1024px) */
@media (max-width: 1024px) {
    .nav-eco {
        flex-direction: column;
        padding: 15px;
    }
    
    .nav-eco a {
        margin-right: 10px;
        margin-bottom: 5px;
        font-size: 14px;
        padding: 6px 12px;
    }
    
    .card-eco {
        padding: 20px;
    }
    
    .table-eco {
        font-size: 14px;
    }
    
    .table-eco th, .table-eco td {
        padding: 10px;
    }
}

/* Dispositivos móviles y tablets pequeñas (max 768px) */
@media (max-width: 768px) {
    /* Navegación móvil */
    .nav-eco {
        flex-direction: column;
        padding: 10px;
        gap: 8px;
    }
    
    .nav-eco a {
        display: block;
        width: 100%;
        text-align: center;
        margin-right: 0;
        margin-bottom: 8px;
        padding: 12px;
        font-size: 15px;
    }
    
    /* Tarjetas responsive */
    .card-eco {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .card-title-eco {
        font-size: 20px;
    }
    
    /* Formularios móviles */
    input, select, textarea {
        font-size: 16px !important; /* Evita zoom en iOS */
        padding: 12px !important;
    }
    
    label {
        font-size: 14px;
    }
    
    /* Botones responsive */
    .btn-eco, .btn-red, .btn-eco-light {
        width: 100%;
        padding: 12px 20px;
        font-size: 15px;
        margin-bottom: 10px;
    }
    
    /* Tablas responsive - scroll horizontal */
    .table-eco-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table-eco {
        min-width: 600px;
        font-size: 13px;
    }
    
    .table-eco th, .table-eco td {
        padding: 8px;
        font-size: 12px;
    }
    
    /* Catálogo móvil */
    .search-and-filters-wrapper {
        flex-direction: column;
    }
    
    .search-container {
        width: 100%;
        min-width: auto;
    }
    
    .search-bar input {
        font-size: 15px;
        padding: 12px 45px 12px 15px;
    }
    
    .filters-horizontal {
        width: 100%;
        justify-content: flex-start;
    }
    
    .filter-toggle-btn {
        font-size: 13px;
        padding: 10px 14px;
    }
    
    .filter-dropdown {
        left: 0;
        right: 0;
        min-width: auto;
        max-width: none;
        width: calc(100vw - 40px);
    }
    
    .catalog-toolbar {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px 15px;
    }
    
    .results-count {
        font-size: 13px;
    }
    
    /* Paginación móvil */
    .pagination {
        flex-wrap: wrap;
        gap: 4px;
        padding: 15px;
    }
    
    .pagination a,
    .pagination span {
        min-width: 32px;
        height: 32px;
        font-size: 13px;
    }
    
    .pagination .prev-next {
        padding: 0 8px;
    }
    
    /* Grid de productos responsive */
    .product-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
    
    /* Alertas móviles */
    .alert-eco, .alert-error {
        padding: 12px;
        font-size: 14px;
    }
    
    /* Footer móvil */
    .footer-eco {
        padding: 15px;
        font-size: 14px;
    }
}

/* Dispositivos móviles pequeños (max 480px) */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    .card-eco {
        padding: 12px;
        border-radius: 10px;
    }
    
    .card-title-eco {
        font-size: 18px;
    }
    
    .btn-eco, .btn-red, .btn-eco-light {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .search-bar input {
        font-size: 14px;
        padding: 10px 40px 10px 12px;
    }
    
    .search-bar button {
        width: 35px;
        height: 35px;
    }
    
    .filter-toggle-btn {
        font-size: 12px;
        padding: 8px 12px;
    }
    
    .filter-dropdown {
        padding: 15px;
        font-size: 13px;
    }
    
    .pagination a,
    .pagination span {
        min-width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .table-eco {
        font-size: 11px;
    }
    
    .table-eco th, .table-eco td {
        padding: 6px;
    }
}

/* Landscape mode para móviles */
@media (max-height: 500px) and (orientation: landscape) {
    .nav-eco {
        padding: 8px;
    }
    
    .nav-eco a {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .card-eco {
        padding: 15px;
    }
}

/* Tablets en landscape */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    
    .table-eco {
        font-size: 13px;
    }
}

/* Ajustes para tablets portrait */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .search-and-filters-wrapper {
        flex-direction: row;
    }
    
    .nav-eco {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

/* Soporte para pantallas grandes (1920px+) */
@media (min-width: 1920px) {
    .container-eco {
        max-width: 1600px;
        margin: 0 auto;
    }
    
    .product-grid {
        grid-template-columns: repeat(5, 1fr) !important;
    }
}
