/* ──────────────────────────────────────────────────────────────
   Wikpis Filter - Directorio de Beneficios
   ────────────────────────────────────────────────────────────── */

.wfd-container {
    width: 100%;
}

/* Filtros */
.wfd-filters {
    background-color: #f3f4f6;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.wfd-filters__wrapper {
    max-width: 80rem;
    margin: 0 auto;
    padding: 2.5rem 1rem;
}

.wfd-filters__wrapper h2 {
    font-size: 1.25rem;
    font-weight: bold;
    color: #111827;
    margin-bottom: 1.5rem;
}

/* Grid de filtros */
.wfd-filters__wrapper > div {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

/* Inputs */
.wfd-filters__wrapper input[type="text"] {
    flex: 1;
    min-width: 220px;
    height: 2.5rem;
    padding: 0 1rem;
    border-radius: 0.375rem;
    border: 1px solid #d1d5db;
    background-color: white;
    font-size: 0.875rem;
    color: #374151;
}

.wfd-filters__wrapper input[type="text"]::placeholder {
    color: #9ca3af;
}

.wfd-filters__wrapper input[type="text"]:focus {
    outline: none;
    ring: 2px;
    ring-color: rgba(34, 197, 94, 0.5);
    border-color: transparent;
}

/* Botones */
.wfd-filters__wrapper button {
    display: inline-flex;
    align-items: center;
    height: 2.5rem;
    padding: 0 1rem;
    border-radius: 0.375rem;
    border: 1px solid #d1d5db;
    background-color: white;
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wfd-filters__wrapper button:hover {
    border-color: #9ca3af;
    background-color: #f9fafb;
}

/* Dropdowns */
.wfd-filters__wrapper .relative {
    position: relative;
}

.wfd-filters__wrapper ul {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.25rem;
    width: 100%;
    min-width: 200px;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-height: 240px;
    overflow-y: auto;
    padding: 0.25rem 0;
    z-index: 50;
}

.wfd-filters__wrapper ul.hidden {
    display: none;
}

.wfd-filters__wrapper li {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.wfd-filters__wrapper li:hover {
    background-color: #f3f4f6;
}

.wfd-filters__wrapper li.bg-green-50 {
    background-color: #f0fdf4;
    color: #047857;
    font-weight: 500;
}

/* Resultados */
.wfd-results {
    padding: 3rem 1rem;
}

.wfd-results__wrapper {
    max-width: 80rem;
    margin: 0 auto;
}

/* Grid de tarjetas */
#wfd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

@media (min-width: 640px) {
    #wfd-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    #wfd-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tarjetas */
.wfd-card {
    background-color: white;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.wfd-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.wfd-card__image {
    height: 160px;
    overflow: hidden;
    background-color: #f3f4f6;
}

.wfd-card__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.wfd-card__content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}

.wfd-card__content h3 {
    font-weight: 600;
    color: #111827;
    font-size: 0.875rem;
    line-height: 1.25;
}

.wfd-card__content .space-y-2 {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wfd-card__content a {
    font-size: 0.75rem;
    color: #16a34a;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    word-break: break-all;
    transition: color 0.2s ease;
}

.wfd-card__content a:hover {
    color: #15803d;
}

.wfd-card__content svg {
    width: 0.875rem;
    height: 0.875rem;
    flex-shrink: 0;
}

/* Botón de beneficios */
.wfd-beneficios-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    background-color: #f0fdf4;
    color: #16a34a;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.wfd-beneficios-btn:hover {
    background-color: #dcfce7;
}

/* Paginación */
#wfd-pagination {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
}

.wfd-pagination-list {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.wfd-pag-btn {
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid #d1d5db;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    text-decoration: none;
    cursor: pointer;
    background-color: white;
    color: #374151;
    display: inline-block;
}

.wfd-pag-btn:hover {
    background-color: #f9fafb;
}

.wfd-pag-btn.active {
    background-color: #f0fdf4;
    color: #16a34a;
    border-color: #22c55e;
    font-weight: 500;
}

/* Modal */
#wfd-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.5);
}

#wfd-modal-overlay.hidden {
    display: none !important;
}

#wfd-modal {
    position: relative;
    background-color: white;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 28rem;
    padding: 1.5rem;
    max-height: 90vh;
    overflow-y: auto;
}

#wfd-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

#wfd-modal-close:hover {
    opacity: 1;
}

#wfd-modal-close svg {
    width: 1.25rem;
    height: 1.25rem;
}

#wfd-modal-content {
    display: block;
}

#wfd-modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
}

#wfd-modal-image {
    height: 2rem;
    width: auto;
    object-fit: contain;
    margin-right: 0.75rem;
}

.wfd-modal-beneficio {
    font-size: 0.875rem;
    color: #374151;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.wfd-modal-beneficio svg {
    width: 1rem;
    height: 1rem;
    color: #16a34a;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

#wfd-modal-phone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 2.25rem;
    padding: 0 1rem;
    border-radius: 0.375rem;
    background-color: #16a34a;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease;
    border: none;
    cursor: pointer;
}

#wfd-modal-phone:hover {
    background-color: #15803d;
}

/* Skeleton loader */
.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Responsive */
@media (max-width: 768px) {
    #wfd-grid {
        grid-template-columns: 1fr;
    }

    .wfd-filters__wrapper {
        padding: 1.5rem 1rem;
    }

    .wfd-filters__wrapper h2 {
        font-size: 1.125rem;
    }

    .wfd-filters__wrapper button {
        min-width: auto;
    }
}
