/* =========================
   CARDS EXISTENTES
   ========================= */

/* Contenedor principal en grid */
.gh-cards-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    align-items: stretch; /* fuerza que las cards de la fila tengan misma altura */
}

/* Cada card */
.gh-card {
    display: flex;
    flex-direction: column;
    height: 100%; /* permite que todas las cards de la fila tengan la misma altura */
    border-radius: 12px; /* <-- Bordes redondos */
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    overflow: hidden;
    background: white;
}

/* Link dentro de la card */
.gh-card-link {
    display: flex;
    flex: 1;
    text-decoration: none;
    color: inherit;
    flex-direction: column;
}

/* Imagen ocupa el ancho completo */
.gh-card-image {
    width: 100%;
    aspect-ratio: 16/9; /* todas las imágenes misma proporción */
    overflow: hidden;
}

.gh-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Cuerpo flexible */
.gh-card-body {
    padding: 16px;
    flex: 1; /* ocupa todo el espacio disponible */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.gh-card-body h3 {
    font-size: 1.1rem;
    margin: 0 0 8px;
    font-weight: 600;
}

.gh-card-body h4 {
    font-size: 1rem;
    margin: 0;
    color: #444;
    font-weight: 500;
}

/* Footer fijo al fondo */
.gh-card-footer {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between; /* reparte los iconos equitativamente */
    align-items: center;
}

/* Iconos */
.gh-prop-icons {
    display: flex;
    flex: 1;
    justify-content: space-between; /* distribución uniforme */
}

.gh-prop-icon {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.9rem;
    color: #555;
}

.gh-prop-icon .material-symbols-outlined {
    font-size: 18px;
    line-height: 1;
}

.gh-card a p {
    margin: 0;
    padding: 0;
}

/* =========================
   FILTROS NUEVO ESTILO
   ========================= */

/* Contenedor de filtros */
.gh-filters {
    background-color: #f9fafb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 40px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    color: #333;
}

/* Layout de columnas */
.gh-filters-main {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
}

.gh-filters-main .div-column {
    flex: 1 1 220px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Labels */
.gh-filters-main .div-column label {
    font-weight: 500;
    font-size: 0.95rem;
    color: #333;
    margin-bottom: 4px;
}

/* Inputs y selects */
.gh-filters-main .div-column select,
.gh-filters-main .div-column input[type="text"],
.gh-filters-main .div-column input[type="number"],
.gh-filters-main .div-column input[type="email"],
.gh-filters-main .div-column input[type="tel"] {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #333;
    background-color: #fff;
    outline: none;
    transition: all 0.2s ease;
}

.gh-filters-main .div-column select:focus,
.gh-filters-main .div-column input:focus {
    border-color: #219bec;
    box-shadow: 0 0 5px rgba(33,155,236,0.3);
}

.gh-filters-main .div-column input::placeholder {
    color: #999;
    font-style: italic;
}

/* Botones */
.gh-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.gh-buttons button {
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.gh-btn-primary {
    background-color: #219bec;
    color: #fff;
}

.gh-btn-primary:hover {
    background-color: #1976d2;
}

.gh-btn-secondary {
    background-color: #f3f4f6;
    color: #333;
}

.gh-btn-secondary:hover {
    background-color: #e5e7eb;
}

/* =========================
   BARRA DE PRECIO (NO TOCAR)
   ========================= */

#precio-range-container {
    position: relative;
    height: 6px;
    width: 100%;
    background: #e5e5e5;
    border-radius: 4px;
}

.range-track {
    position: absolute;
    top: 0;
    left: 0;
    height: 6px;
    width: 100%;
    background: #e5e5e5;
    border-radius: 4px;
}

.range-selected {
    position: absolute;
    top: 0;
    height: 6px;
    background: #219bec;
    border-radius: 4px;
}

.thumb {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: #fff;
    border: 2px solid #219bec;
    border-radius: 50%;
    cursor: pointer;
    z-index: 3;
    transition: background 0.2s ease, border 0.2s ease;
}

.thumb:hover {
    background: #219bec;
    border-color: #1976d2;
}

/* =========================
   RESPONSIVE
   ========================= */

/* TABLET - 2 columnas */
@media (max-width: 1024px) {
    .gh-cards-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .gh-filters {
        padding: 15px;
    }

    .gh-filters-main {
        gap: 10px;
        justify-content: flex-start;
    }

    .gh-price-bar {
        width: 100%;
    }
}

/* MÓVIL – 1 columna */
@media (max-width: 768px) {
    .gh-cards-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .gh-card-body h3 {
        font-size: 1rem;
    }

    .gh-card-body h4 {
        font-size: 0.9rem;
    }

    /* Filtros: menos espacio entre columnas en móvil */
    .gh-filters {
        padding: 15px 12px;
    }

    .gh-filters-main {
        flex-direction: column;
        gap: 8px; /* menos espacio que antes */
    }

    .gh-filters-main .div-column {
        flex: 1 1 100%;         /* ocupan todo el ancho del contenedor */
        width: 100%;            /* redundante pero seguro */
        margin-bottom: 0;       /* elimina márgenes extra */
    }

    .gh-price-bar {
        width: 100%;
    }

    #precio-range-container {
        width: 100%; /* asegurar que ocupa todo el ancho del contenedor */
    }

    /* Botones en columna */
    .gh-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .gh-buttons button {
        width: 100%;
    }
}

/* =========================
   PAGINACIÓN
   ========================= */

.gh-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 20px 0;
}

.gh-pagination a {
    display: inline-block;
    padding: 8px 12px;
    text-decoration: none;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.gh-pagination a:hover {
    background-color: #219bec;
    color: #fff;
    border-color: #219bec;
}

.gh-pagination a.current {
    background-color: #219bec;
    color: #fff;
    border-color: #219bec;
    pointer-events: none;
    font-weight: 700;
}

@media (max-width: 480px){
    .gh-pagination a {
        padding: 6px 10px;
        font-size: 14px;
    }
}
