﻿/* ==========================================================
   BUSCAR LUGARES â€” Yelp-Inspired UI
   css/lugares/buscar.css
   ========================================================== */

/* ---- CSS Variables ---- */
:root {
    --yelp-red: #d32323;
    --yelp-red-hover: #af1c1c;
    --yelp-dark: #2b2b2b;
    --yelp-text: #333;
    --yelp-text-light: #666;
    --yelp-text-muted: #999;
    --yelp-border: #e6e6e6;
    --yelp-bg: #f5f5f5;
    --yelp-card-bg: #fff;
    --yelp-blue: #0073bb;
    --yelp-green: #41a700;
    --yelp-star: #ff8c00;
    --yelp-radius: 4px;
    --yelp-radius-lg: 8px;
}
.lugares-clear {
    clear: both;
}

.lugares-main {
    min-height: 400px;
    background: #fff;
}

.lugares-icon-warning {
    color: #f59e0b;
}

.lugares-icon-danger {
    color: #dc2626;
}

.google-attribution-logo {
    height: 18px;
}

/* ---- Search Hero ---- */
.lugares-hero {
    background: url('../../img/invitaciones.webp') center/cover no-repeat, linear-gradient(135deg, var(--yelp-dark) 0%, #000 100%);
    padding: 100px 0 50px;
    color: #fff;
    text-align: center;
    position: relative;
    clear: both;
}

.lugares-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1;
}

.lugares-hero::after {
    display: none;
}

.lugares-hero .container {
    position: relative;
    z-index: 2;
}

.lugares-hero h1 {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
    display: block !important;
}

.lugares-hero .lead {
    color: rgba(255,255,255,.55);
    font-size: .92rem;
    margin-bottom: 18px;
    display: block !important;
}

/* ---- Yelp-Style Search Bar ---- */
.lugares-search-bar {
    max-width: 100%;
    margin: 0;
    background: transparent;
    backdrop-filter: none;
    border: none;
    border-radius: 0;
    padding: 14px 0;
}

.search-field-group {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 0;
    align-items: stretch;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-radius: var(--yelp-radius);
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,.25);
}

.search-field {
    display: flex;
    align-items: center;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0 14px;
    min-height: 48px;
    border-right: 1px solid rgba(0,0,0,0.1);
}

.search-field i {
    color: var(--yelp-text-muted);
    font-size: .9rem;
    margin-right: 8px;
    flex-shrink: 0;
}

.search-field-city {
    width: 220px;
    min-width: 180px;
    flex-shrink: 0;
}

.search-field-cat {
    width: 220px;
    min-width: 180px;
    flex-shrink: 0;
}

.search-field-name {
    flex: 1 1 auto;
    min-width: 0;
    border-right: none;
}

.search-field select,
.search-field input {
    background: transparent;
    border: none;
    color: var(--yelp-text);
    font-size: .95rem;
    padding: 12px 4px;
    outline: none;
    width: 100%;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}

.search-field select {
    cursor: pointer;
    padding-right: 22px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%23999' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 01.753 1.659l-4.796 5.48a1 1 0 01-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 4px center;
    background-size: 10px;
}

.search-field select option {
    background: #fff;
    color: var(--yelp-text);
}

.search-field input::placeholder {
    color: var(--yelp-text-muted);
}

.btn-buscar {
    border-radius: 0 var(--yelp-radius) var(--yelp-radius) 0 !important;
    padding: 12px 22px;
    font-weight: 600;
    font-size: 1.15rem;
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 48px;
    background: var(--yelp-red) !important;
    border: none !important;
    color: #fff !important;
    transition: background .15s;
}

.btn-buscar:hover {
    background: var(--yelp-red-hover) !important;
}

/* ---- Category Chips Bar ---- */
.yelp-categories-bar {
    background: #fff;
    border-bottom: 1px solid var(--yelp-border);
    padding: 0;
    overflow: hidden;
}

.yelp-categories-scroll {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 15px 0;
}

.yelp-cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: .88rem;
    font-weight: 500;
    color: var(--yelp-text);
    text-decoration: none;
    white-space: nowrap;
    background: #fff;
    border: 1px solid var(--yelp-border);
    border-radius: 20px;
    transition: all .2s;
    cursor: pointer;
    font-family: inherit;
    margin-bottom: 0;
}

.yelp-cat-chip:hover {
    border-color: var(--yelp-red);
    color: var(--yelp-red);
}

.yelp-cat-chip.active {
    background: var(--yelp-red);
    color: #fff;
    border-color: var(--yelp-red);
}

.yelp-cat-chip i {
    font-size: .8rem;
    opacity: .7;
}

.yelp-cat-chip.active i {
    opacity: 1;
}

/* ---- Rate Limit Info ---- */
#rate-limit-info {
    font-size: .78rem !important;
}

/* Removed .rate-limit-strip */

/* ---- Results Area ---- */
.lugares-resultados-bar {
    background: transparent;
    border-bottom: none;
    padding: 0 0 10px;
    position: static;
    z-index: auto;
}

.lugares-resultados-count {
    font-weight: 600;
    color: var(--yelp-text);
    font-size: .95rem;
}

/* ---- Loader ---- */
.lugares-loader {
    padding: 60px 0;
    text-align: center;
}

.lugares-loader .spinner-border {
    width: 2.5rem;
    height: 2.5rem;
    border-width: 3px;
    color: var(--yelp-red);
}

/* ---- Mapa general ---- */
.mapa-general-wrapper {
    border: 1px solid var(--yelp-border);
    border-radius: var(--yelp-radius-lg);
    overflow: hidden;
    background: var(--yelp-card-bg);
    margin-bottom: 20px;
}

.mapa-general-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--yelp-card-bg);
    border: none;
    width: 100%;
    cursor: pointer;
    font-weight: 600;
    font-size: .9rem;
    color: var(--yelp-text);
    transition: background .15s;
}

.mapa-general-toggle:hover { background: var(--yelp-bg); }
.mapa-general-toggle i.chevron { transition: transform .3s ease; }
.mapa-general-toggle.collapsed i.chevron { transform: rotate(-90deg); }
.mapa-general-body { border-top: 1px solid var(--yelp-border); }
#mapa-general { height: 350px; width: 100%; }

/* ========================================
   YELP-STYLE RESULT CARDS
   ======================================== */
.lugar-item {
    background: var(--yelp-card-bg);
    border: none;
    border-bottom: 1px solid var(--yelp-border);
    border-radius: 0;
    margin-bottom: 0;
    overflow: hidden;
    transition: background .12s;
    padding: 20px 0;
}

.lugar-item:first-child {
    padding-top: 16px;
}

.lugar-item:hover {
    box-shadow: none;
    border-color: var(--yelp-border);
}

.lugar-item-header {
    display: flex;
    align-items: flex-start;
    padding: 0;
    gap: 14px;
}

/* Number index (Yelp style: 1. 2. 3.) */
.lugar-index {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--yelp-text);
    min-width: 22px;
    padding-top: 2px;
    flex-shrink: 0;
}

/* Icon / avatar */
.lugar-icono {
    width: 90px;
    height: 90px;
    min-width: 90px;
    border-radius: var(--yelp-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #fff;
    flex-shrink: 0;
}

/* Color variants */
.lugar-icono.cat-salon { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.lugar-icono.cat-hotel { background: linear-gradient(135deg, #ec4899, #be185d); }
.lugar-icono.cat-jardin { background: linear-gradient(135deg, #22c55e, #15803d); }
.lugar-icono.cat-centro { background: linear-gradient(135deg, #f59e0b, #d97706); }
.lugar-icono.cat-conferencia { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.lugar-icono.cat-restaurante { background: linear-gradient(135deg, #ef4444, #dc2626); }
.lugar-icono.cat-foto { background: linear-gradient(135deg, #f97316, #ea580c); }
.lugar-icono.cat-musica { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.lugar-icono.cat-decoracion { background: linear-gradient(135deg, #ec4899, #db2777); }
.lugar-icono.cat-default { background: linear-gradient(135deg, #64748b, #475569); }

.lugar-info {
    flex: 1;
    min-width: 0;
}

.lugar-nombre {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--yelp-blue);
    margin: 0 0 4px;
    line-height: 1.3;
    cursor: pointer;
}

.lugar-nombre:hover {
    text-decoration: underline;
}


/* Category & price inline */
.lugar-cat-price {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .85rem;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.lugar-cat-tag {
    color: var(--yelp-text);
    font-weight: 400;
    background: var(--yelp-bg);
    padding: 1px 8px;
    border-radius: 3px;
    font-size: .8rem;
}

.lugar-price {
    color: var(--yelp-green);
    font-weight: 600;
    font-size: .85rem;
}

.lugar-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: .82rem;
    color: var(--yelp-text-light);
    margin-top: 2px;
}

.lugar-meta i {
    margin-right: 4px;
    font-size: .72rem;
    color: var(--yelp-text-muted);
}

/* Yelp-style action row */
.lugar-acciones {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.lugar-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: var(--yelp-radius);
    font-size: .78rem;
    font-weight: 500;
    border: 1px solid var(--yelp-border);
    background: var(--yelp-card-bg);
    color: var(--yelp-text);
    cursor: pointer;
    transition: all .12s;
    text-decoration: none;
    white-space: nowrap;
}

.lugar-action-btn:hover {
    background: var(--yelp-bg);
    color: var(--yelp-text);
    text-decoration: none;
}

.lugar-action-btn.primary {
    background: var(--yelp-red);
    border-color: var(--yelp-red);
    color: #fff;
}

.lugar-action-btn.primary:hover {
    background: var(--yelp-red-hover);
}

.lugar-action-btn.lugar-action-btn-destacar {
    background: linear-gradient(135deg, #b45309 0%, #d97706 100%);
    border-color: #92400e;
    color: #fff;
}

.lugar-action-btn.lugar-action-btn-destacar:hover {
    filter: brightness(1.06);
    color: #fff;
}

.lugar-action-btn i {
    font-size: .72rem;
}

.gallery-container-wrapper {
    overflow: hidden;
}

.custom-gallery-scroll {
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scroll-behavior: smooth;
}

.custom-gallery-scroll::-webkit-scrollbar {
    display: none;
}

.lugar-foto-thumbnail {
    flex: 0 0 auto;
    user-select: none;
    -webkit-user-drag: none;
}

.btn-gallery-nav {
    touch-action: manipulation;
}

/* Hide old badge */
.lugar-categoria-badge { display: none; }

/* ---- Details Panel ---- */
.lugar-detalles-panel {
    border-top: 1px solid var(--yelp-border);
    background: var(--yelp-bg);
    margin-top: 16px;
}

.lugar-detalles-body {
    padding: 20px;
}

.lugar-detalles-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.detalle-campo {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.detalle-campo i {
    width: 18px;
    text-align: center;
    color: var(--yelp-text-muted);
    margin-top: 2px;
    flex-shrink: 0;
    font-size: .85rem;
}

.detalle-campo .detalle-label {
    font-size: .72rem;
    color: var(--yelp-text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    font-weight: 600;
    margin-bottom: 1px;
}

.detalle-campo .detalle-valor {
    font-size: .88rem;
    color: var(--yelp-text);
    word-break: break-word;
}

.detalle-campo .detalle-valor a {
    color: var(--yelp-blue);
    text-decoration: none;
}

.detalle-campo .detalle-valor a:hover {
    text-decoration: underline;
}

/* Mini map */
.lugar-mini-mapa {
    height: 220px;
    width: 100%;
    border-radius: var(--yelp-radius);
    border: 1px solid var(--yelp-border);
    margin-top: 14px;
}

/* ---- CTA Banner ---- */
.lugares-cta-banner {
    background: var(--yelp-dark);
    border-radius: var(--yelp-radius-lg);
    padding: 36px 28px;
    text-align: center;
    margin-top: 28px;
    color: #fff;
}

.lugares-cta-banner h3 {
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 1.25rem;
}

.lugares-cta-banner p {
    opacity: .75;
    margin-bottom: 18px;
    font-size: .95rem;
}

.lugares-cta-banner .btn {
    border-radius: var(--yelp-radius);
    padding: 10px 30px;
    font-weight: 700;
    font-size: .95rem;
    background: var(--yelp-red);
    border: none;
    color: #fff;
}

.lugares-cta-banner .btn:hover {
    background: var(--yelp-red-hover);
}

/* ---- Empty state ---- */
.lugares-vacio {
    text-align: center;
    padding: 60px 20px;
}

.lugares-vacio i {
    font-size: 2.5rem;
    color: #ccc;
    margin-bottom: 14px;
}

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

@media (max-width: 992px) {
    .search-field-group {
        flex-wrap: wrap !important;
        border-radius: var(--yelp-radius-lg);
    }

    .search-field-name {
        flex: 1 1 100%;
        border-right: none;
        border-top: 1px solid var(--yelp-border);
    }

    .search-field-city,
    .search-field-cat {
        flex: 1 1 0;
        min-width: 140px;
    }

    .search-field-city {
        border-bottom: none;
    }

    .btn-buscar {
        border-radius: 0 0 var(--yelp-radius-lg) 0 !important;
        width: 65px;
        flex: 0 0 65px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .lugares-hero {
        padding: 90px 0 15px !important;
    }

    .search-field-group {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        border-radius: var(--yelp-radius-lg);
    }

    .search-field {
        border-right: none;
        border-bottom: 1px solid var(--yelp-border);
        min-height: 48px;
    }

    .search-field-cat,
    .search-field-name {
        width: 100% !important;
        min-width: 0 !important;
        flex: 1 1 100% !important;
    }

    .search-field-city {
        width: auto !important;
        min-width: 0 !important;
        flex: 1 1 0% !important;
        border-bottom: none !important;
    }

    .search-field-name {
        border-top: none;
    }

    .btn-buscar {
        border-radius: 0 0 var(--yelp-radius-lg) 0 !important;
        min-height: 48px;
        width: 65px;
        flex: 0 0 65px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.15rem;
    }

    .yelp-categories-scroll {
        padding: 0 8px;
    }

    .yelp-cat-chip {
        padding: 10px 14px;
        font-size: .82rem;
    }

    .lugar-item {
        padding: 16px 0;
    }

    .lugar-item-header {
        flex-wrap: wrap;
        gap: 10px;
    }

    .lugar-icono {
        width: 70px;
        height: 70px;
        min-width: 70px;
        font-size: 1.4rem;
    }

    .lugar-index {
        font-size: .95rem;
        min-width: 18px;
    }

    .lugar-nombre {
        font-size: .95rem;
    }

    .lugar-acciones {
        width: 100%;
        margin-top: 10px;
    }

    .lugar-detalles-grid {
        grid-template-columns: 1fr;
    }

    .lugar-detalles-body {
        padding: 16px;
    }

    #mapa-general {
        height: 250px;
    }

    .lugar-mini-mapa {
        height: 180px;
    }

    .lugares-cta-banner {
        padding: 28px 18px;
    }
}

@media (max-width: 380px) {
    .lugar-icono {
        width: 56px;
        height: 56px;
        min-width: 56px;
        font-size: 1.2rem;
    }

    .lugar-item-header {
        gap: 8px;
    }

    .lugar-index {
        display: none;
    }
}

