/* ========================================================
   GM PORTAL PLAYAS v5 — DESIGN SYSTEM
   ======================================================== */

:root {
    --bg-primary: hsl(220, 20%, 97%);
    --bg-secondary: hsl(0, 0%, 100%);
    --text-primary: hsl(222, 47%, 11%);
    --text-secondary: hsl(215, 16%, 47%);
    --brand-primary: hsl(216, 100%, 34%);
    --brand-secondary: hsl(158, 64%, 42%);
    --brand-accent: hsl(42, 100%, 50%);
    --danger: hsl(348, 83%, 47%);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.08);
    --shadow-lg: 0 24px 48px rgba(0,0,0,0.12);
    --glass-bg: rgba(255,255,255,0.9);
    --glass-border: rgba(255,255,255,0.5);
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
    --radius-md: 12px;
    --radius-lg: 24px;
    --transition-fast: 0.15s ease-out;
    --transition-smooth: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: hsl(222, 47%, 7%);
        --bg-secondary: hsl(222, 47%, 11%);
        --text-primary: hsl(210, 40%, 98%);
        --text-secondary: hsl(215, 20%, 65%);
        --glass-bg: rgba(15,23,42,0.7);
        --glass-border: rgba(255,255,255,0.05);
        --shadow-sm: 0 4px 12px rgba(0,0,0,0.3);
        --shadow-md: 0 12px 32px rgba(0,0,0,0.4);
        --shadow-lg: 0 32px 64px rgba(0,0,0,0.5);
    }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* ══════ NAVBAR ══════ */
.glass-nav {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
}

/* ══════ UTILITIES ══════ */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-lg);
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
}

.btn-primary {
    background-color: var(--brand-primary);
    color: white;
}
.btn-primary:hover {
    background-color: hsl(216, 100%, 28%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-action {
    background-color: var(--brand-secondary);
    color: white;
}
.btn-action:hover {
    background-color: hsl(158, 64%, 36%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ══════ PROPERTY CARD (legacy) ══════ */
.property-img {
    height: 200px;
    position: relative;
    overflow: hidden;
    background: #e9ecef;
    border-top-left-radius: var(--radius-md);
    border-top-right-radius: var(--radius-md);
}

.property-img-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-smooth);
}

.property-card {
    max-width: 340px;
    width: 100%;
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
    cursor: pointer;
}
.property-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.12) !important;
}
.property-card:hover .property-img-img {
    transform: scale(1.05);
}

/* ══════ SPLIT-VIEW LAYOUT ══════ */
.properties-split {
    display: flex;
    gap: 0;
    min-height: 600px;
    margin: 0 -24px;
}
.properties-list-panel {
    flex: 1;
    min-width: 0;
    padding: 20px 24px 40px;
    overflow-y: auto;
    max-height: calc(100vh - 180px);
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}
.properties-list-panel::-webkit-scrollbar { width: 6px; }
.properties-list-panel::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
.properties-list-panel::-webkit-scrollbar-track { background: transparent; }

.properties-map-panel {
    width: 45%;
    min-width: 380px;
    position: sticky;
    top: 80px;
    height: calc(100vh - 140px);
}
.properties-map-panel .map-inner {
    width: 100%;
    height: 100%;
    border-left: 1px solid var(--glass-border);
}

/* ══════ FILTER BAR ══════ */
.filter-bar-horizontal {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: visible;
    padding: 10px 0;
    margin-bottom: 4px;
    flex-wrap: wrap;
}
.filter-bar-horizontal::-webkit-scrollbar { display: none; }

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 50px;
    border: 1.5px solid #e8e8ed;
    background: #fff;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.22s cubic-bezier(0.33,1,0.68,1);
    color: var(--text-primary);
    text-decoration: none;
}
.filter-pill:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}
.filter-pill.active {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
}
.filter-pill .bi-chevron-down { font-size: 0.65rem; opacity: 0.6; }
.filter-divider { width: 1px; height: 20px; background: #e8e8ed; margin: 0 6px; flex-shrink: 0; }
.filter-clear {
    border-color: transparent !important;
    background: transparent !important;
    color: var(--danger) !important;
}

@media (prefers-color-scheme: dark) {
    .filter-pill {
        background: var(--bg-secondary);
        border-color: hsl(222, 47%, 18%);
    }
    .filter-pill:hover {
        border-color: var(--brand-primary);
        color: var(--brand-primary);
    }
    .filter-divider {
        background: hsl(222, 47%, 18%);
    }
}

/* ══════ 2-COLUMN GRID ══════ */
.prop-card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

/* ══════ HORIZONTAL PROPERTY CARD ══════ */
.prop-card-h {
    display: flex;
    gap: 16px;
    background: #fff;
    border-radius: 20px;
    padding: 12px;
    margin-bottom: 0;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.33,1,0.68,1);
    border: 1.5px solid transparent;
    position: relative;
    box-shadow: var(--shadow-sm);
}
.prop-card-h:hover {
    border-color: var(--brand-primary);
    box-shadow: 0 12px 40px rgba(0,0,0,0.10);
    transform: translateY(-1px);
}
.prop-card-h.highlighted {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 4px rgba(0,51,204,0.12);
}

.prop-card-h-img {
    width: 170px;
    min-width: 170px;
    height: 150px;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    background: #e8e8ed;
}
.prop-card-h-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.prop-card-h:hover .prop-card-h-img img {
    transform: scale(1.05);
}

.prop-card-h-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 6px;
    z-index: 2;
}
.prop-card-h-badge {
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.prop-card-h-badge--venta { background: rgba(0,51,204,0.85); color: #fff; }
.prop-card-h-badge--arriendo { background: rgba(52,199,89,0.85); color: #fff; }
.prop-card-h-badge--temporada { background: rgba(255,149,0,0.85); color: #fff; }
.prop-card-h-badge--tipo { background: rgba(0,0,0,0.55); color: #fff; }

.prop-card-h-fav {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.22s ease;
    font-size: 0.95rem;
    color: var(--text-secondary);
    z-index: 2;
}
.prop-card-h-fav:hover { color: var(--danger); transform: scale(1.1); }
.prop-card-h-fav.fav-active { color: var(--danger) !important; }

.prop-card-h-arrow {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--brand-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(6px);
    transition: all 0.22s cubic-bezier(0.33,1,0.68,1);
    z-index: 2;
}
.prop-card-h:hover .prop-card-h-arrow {
    opacity: 1;
    transform: translateY(0);
}

.prop-card-h-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 6px 0;
}
.prop-card-h-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--brand-primary);
    margin-bottom: 4px;
}
.prop-card-h-price .currency {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 2px;
}
.prop-card-h-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.prop-card-h-address {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
}
.prop-card-h-features {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.prop-card-h-feat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}
.prop-card-h-feat i { font-size: 0.9rem; }

.prop-card-h-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}
.prop-card-h-date { font-size: 0.72rem; color: #aaa; }

.prop-card-h-contacts {
    display: flex;
    gap: 6px;
    align-items: center;
}
.prop-card-h-agent {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* ══════ PAGINATION (new style) ══════ */
.pagination-new {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}
.pagination-new .page-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1.5px solid #e8e8ed;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.22s cubic-bezier(0.33,1,0.68,1);
    color: var(--text-primary);
    text-decoration: none;
}
.pagination-new .page-btn:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}
.pagination-new .page-btn.active {
    background: var(--text-primary);
    color: #fff;
    border-color: var(--text-primary);
}
.pagination-new .page-btn.disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* ══════ RESPONSIVE SPLIT VIEW ══════ */
@media (max-width: 1100px) {
    .prop-card-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 992px) {
    .properties-split {
        flex-direction: column;
        margin: 0 -12px;
    }
    .properties-map-panel {
        width: 100%;
        min-width: 100%;
        position: relative;
        top: auto;
        height: 400px;
    }
    .properties-list-panel {
        max-height: none;
        overflow-y: visible;
        padding: 12px;
    }
    .prop-card-h { flex-direction: column; }
    .prop-card-h-img { width: 100%; min-width: 100%; height: 200px; }
}
@media (max-width: 640px) {
    .filter-bar-horizontal { gap: 6px; }
    .filter-pill { padding: 6px 12px; font-size: 0.76rem; }
}

/* ══════ HERO SECTION ══════ */
.hero-section {
    border-radius: var(--radius-lg) !important;
    transition: background-image 0.8s ease-in-out;
}

.text-shadow-sm {
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* ══════ SEARCH FORM ══════ */
.search-form .form-select-lg,
.search-form .form-control {
    font-size: 1rem;
    padding: 12px 16px;
    height: auto;
}
.search-form input[name="q"]::placeholder {
    font-size: 0.95rem;
}

/* ══════ FILTER SIDEBAR ══════ */
#formFiltros .form-label {
    font-size: 0.82rem;
}
#formFiltros .form-select,
#formFiltros .form-control {
    font-size: 0.85rem;
    padding: 8px 12px;
}

/* ══════ SORT BAR ══════ */
.sort-bar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* ══════ PAGINATION ══════ */
.page-item.active .page-link {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: white;
}
.page-link {
    padding: 0.5rem 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}
.page-link:hover {
    background: var(--brand-primary);
    color: white;
}

/* ══════ MAP ══════ */
.custom-marker { background: transparent !important; border: none !important; }
.leaflet-popup-content-wrapper { border-radius: 12px !important; box-shadow: 0 4px 20px rgba(0,0,0,0.15) !important; }
.leaflet-popup-close-button { top: 8px !important; right: 8px !important; }

/* ══════ BREADCRUMB ══════ */
.breadcrumb-item + .breadcrumb-item::before {
    content: "\203A";
    font-weight: 700;
    color: var(--text-secondary);
}

/* ══════ ACTIVE FILTER CHIPS ══════ */
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #f0f4ff;
    color: var(--brand-primary);
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(0,51,204,0.15);
}
.filter-chip .remove-chip {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.15s;
    font-size: 1.1rem;
    line-height: 1;
}
.filter-chip .remove-chip:hover { opacity: 1; }

/* ══════ FAVORITE BUTTON ══════ */
.fav-btn {
    transition: all 0.2s;
}
.fav-btn:hover {
    transform: scale(1.15);
}

/* ══════ WIDGET LIST ══════ */
.widget-list li {
    transition: transform 0.15s;
}
.widget-list li:hover {
    transform: translateX(4px);
}

/* ══════ RESPONSIVE ══════ */
@media (max-width: 991.98px) {
    .property-img { height: 180px; }
    .hero-section { min-height: 280px !important; }
}
