/* ── Layout: sidebar + contenido fullwidth ── */
@media (min-width: 1200px) {
    .map-content { display: none !important; }
    .items-content { width: calc(100% - 300px) !important; margin-left: 0 !important; }
}
@media (min-width: 1400px) {
    .sidebar-filters { width: 320px; }
    .items-content { width: calc(100% - 320px) !important; }
}

/* ── Sidebar ── */
@media (max-width: 1199px) {
    .js-sidebar-filters-mobile {
        display: flex; flex-direction: column;
        height: 100vh;
        height: 100dvh;
    }
}
.sidebar-filters-body { overflow-y: auto; flex: 1; min-height: 0; }
.sidebar-filters-apply { padding: 12px 16px; border-top: 1px solid var(--bs-border-color); background: var(--bs-body-bg); flex-shrink: 0; }
.dir-filter-section { padding-bottom: 1.1rem; margin-bottom: 1.1rem; border-bottom: 1px solid var(--bs-border-color); }
.dir-filter-section:last-child { border-bottom: none; margin-bottom: 0; }
.dir-filter-label { font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: var(--bs-secondary-color); margin-bottom: 10px; }

/* ── Category pills ── */
.cat-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-pill {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 11px; border-radius: 20px; font-size: 12px; font-weight: 500;
    border: 1px solid var(--bs-border-color); background: var(--bs-body-bg);
    color: var(--bs-body-color); cursor: pointer; transition: all .15s;
    white-space: nowrap; line-height: 1;
}
.cat-pill:hover { border-color: var(--bs-primary); color: var(--bs-primary); }
.cat-pill.active {
    background: var(--bs-primary); border-color: var(--bs-primary);
    color: #fff; box-shadow: 0 2px 8px rgba(var(--bs-primary-rgb),.3);
}
.cat-pill .cat-count { opacity: .65; font-size: 10px; }

/* ── Items content ── */
.items-content { background: var(--bs-body-bg) !important; }
.dir-toolbar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 12px 16px; border-bottom: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg); position: sticky; top: 0; z-index: 50;
}
.dir-count { font-size: 13px; color: var(--bs-secondary-color); flex: 1 1 auto; }
.dir-count strong { color: var(--bs-body-color); font-size: 15px; }
.dir-sort { font-size: 13px; border: 1px solid var(--bs-border-color); border-radius: 8px; padding: 5px 10px; background: var(--bs-body-bg); color: var(--bs-body-color); }

/* ── View toggle ── */
.dir-view-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg); color: var(--bs-secondary-color); display: flex; align-items: center;
    justify-content: center; cursor: pointer; transition: all .15s; font-size: 13px; }
.dir-view-btn.active, .dir-view-btn:hover { background: var(--bs-primary); border-color: var(--bs-primary); color: #fff; }

/* ── Cards grid ── */
.dir-grid { padding: 16px; }
.dir-cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.dir-cards.view-list { grid-template-columns: 1fr; }

/* ── Card ── */
.est-card {
    border-radius: 14px; overflow: hidden;
    border: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
    transition: transform .18s, box-shadow .18s;
    text-decoration: none; color: inherit;
    display: flex; flex-direction: column;
}
.est-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0,0,0,.1); color: inherit; }

/* Card — imagen */
.est-card-media { position: relative; aspect-ratio: 1 / 1; overflow: hidden; flex-shrink: 0; }
.est-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.est-card-media-ph {
    width: 100%; height: 100%;
    background: linear-gradient(135deg, #e0e7ff, #ede9fe);
    display: flex; align-items: center; justify-content: center; font-size: 2.8rem;
}
.est-card-media::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(to bottom, transparent 45%, rgba(0,0,0,.45) 100%);
}
.est-card-cat-badge {
    position: absolute; bottom: 10px; left: 12px; z-index: 2;
    background: rgba(255,255,255,.2); backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,.3); color: #fff;
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .05em; padding: 3px 9px; border-radius: 20px;
}
.est-card-featured-badge {
    position: absolute; top: 10px; right: 10px; z-index: 2;
    background: #f59e0b; color: #fff;
    font-size: 11px; width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
}
.est-card-logo {
    position: absolute; top: 10px; left: 10px; z-index: 3;
    width: 50px; height: 50px; border-radius: 50%;
    background: rgba(255,255,255,.9); border: 2px solid rgba(255,255,255,.6);
    overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.est-card-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Loyalty badges en el body */
.est-card-loyalty-row { display: flex; gap: 4px; flex-wrap: wrap; }
.est-card-loyalty {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 6px; font-size: 10px;
}
.est-card-loyalty.birthday { background: rgba(251,146,60,.12); color: #fb923c; }
.est-card-loyalty.points   { background: rgba(202,138,4,.12);  color: #ca8a04; }
.est-card-loyalty.stamps   { background: rgba(99,102,241,.12); color: #6366f1; }
.est-card-loyalty.coupons  { background: rgba(13,148,136,.12); color: #0d9488; }

/* Card — cuerpo */
.est-card-body { padding: 13px 14px 6px; flex: 1; }
.est-card-name {
    font-size: 14px; font-weight: 800; color: var(--bs-body-color);
    line-height: 1.3; margin-bottom: 5px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.est-card-addr {
    display: flex; align-items: flex-start; gap: 5px;
    font-size: 11px; color: var(--bs-secondary-color); line-height: 1.4;
}
.est-card-addr i { margin-top: 2px; flex-shrink: 0; font-size: 10px; }

/* Card — footer */
.est-card-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px 13px; gap: 8px;
}
.est-card-rating { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; }
.est-card-rating i { color: #f59e0b; font-size: 11px; }
.est-card-rating .cnt { font-size: 11px; font-weight: 400; color: var(--bs-secondary-color); }
.est-card-no-rating { font-size: 11px; color: var(--bs-secondary-color); }
.est-card-btn {
    font-size: 11px; font-weight: 700; padding: 6px 13px; border-radius: 8px;
    background: var(--bs-primary); color: #fff; text-decoration: none;
    transition: opacity .15s; white-space: nowrap; flex-shrink: 0;
}
.est-card-btn:hover { opacity: .85; color: #fff; }

/* ── Vista lista ── */
.dir-cards.view-list .est-card { flex-direction: row; height: 100px; }
.dir-cards.view-list .est-card-media { width: 120px; height: 100%; border-radius: 0; flex-shrink: 0; }
.dir-cards.view-list .est-card-media::after { display: none; }
.dir-cards.view-list .est-card-cat-badge { display: none; }
.dir-cards.view-list .est-card-body { padding: 10px 12px; display: flex; flex-direction: column; justify-content: center; }
.dir-cards.view-list .est-card-name { -webkit-line-clamp: 1; margin-bottom: 3px; }
.dir-cards.view-list .est-card-footer { padding: 0 12px 10px; }

/* ── Paginación ── */
.dir-pagination .page-link { border-radius: 8px !important; margin: 0 2px; font-size: 13px; }
.dir-pagination .page-item.active .page-link { background: var(--bs-primary); border-color: var(--bs-primary); }

/* ── Skeleton loader ── */
.skel { background: var(--bs-border-color); border-radius: 8px; animation: skel-pulse 1.4s ease-in-out infinite; }
@keyframes skel-pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }
.skel-card { border-radius: 14px; overflow: hidden; border: 1px solid var(--bs-border-color); }

/* ── Empty state ── */
.dir-empty { text-align: center; padding: 60px 20px; color: var(--bs-secondary-color); }
.dir-empty-icon { font-size: 3rem; opacity: .3; margin-bottom: 12px; }

/* ── Loyalty filter pills ── */
.loyalty-filter-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.loyalty-pill {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px; border-radius: 10px; font-size: 12px; font-weight: 500;
    border: 1.5px solid var(--bs-border-color); background: var(--bs-body-bg);
    color: var(--bs-body-color); cursor: pointer; transition: all .15s;
    text-align: left; line-height: 1.3;
}
.loyalty-pill-icon {
    width: 30px; height: 30px; border-radius: 8px; display: flex;
    align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0;
}
.loyalty-pill-label { font-size: 11px; font-weight: 700; }
.loyalty-pill:hover { border-color: var(--bs-primary); transform: translateY(-1px); }
.loyalty-pill.active { border-width: 2px; box-shadow: 0 2px 8px rgba(0,0,0,.12); }

/* Loyalty pill: Cumpleaños */
#filter-birthday .loyalty-pill-icon { background: #fb923c; color: #fff; }
#filter-birthday.active { border-color: #fb923c; background: rgba(251,146,60,.1); color: #c2410c; }

/* Loyalty pill: Puntos */
#filter-points .loyalty-pill-icon { background: #ca8a04; color: #fff; }
#filter-points.active { border-color: #ca8a04; background: rgba(202,138,4,.1); color: #92400e; }

/* Loyalty pill: Tiqueteras */
#filter-stamps .loyalty-pill-icon { background: #6366f1; color: #fff; }
#filter-stamps.active { border-color: #6366f1; background: rgba(99,102,241,.1); color: #4338ca; }

/* Loyalty pill: Cupones */
#filter-coupons .loyalty-pill-icon { background: #0d9488; color: #fff; }
#filter-coupons.active { border-color: #0d9488; background: rgba(13,148,136,.1); color: #0f766e; }

/* ── Rating pills ── */
.rating-pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 5px 11px; border-radius: 20px; font-size: 12px; font-weight: 500;
    border: 1px solid var(--bs-border-color); background: var(--bs-body-bg);
    color: var(--bs-body-color); cursor: pointer; transition: all .15s; line-height: 1;
}
.rating-pill i { color: #f59e0b; font-size: 10px; }
.rating-pill:hover { border-color: #f59e0b; color: #b45309; }
.rating-pill.active { background: #f59e0b; border-color: #f59e0b; color: #fff; }
.rating-pill.active i { color: #fff; }

/* ── Quick filter toggles ── */
.quick-toggle {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 0; border-bottom: 1px solid var(--bs-border-color); cursor: pointer;
}
.quick-toggle:last-child { border-bottom: none; padding-bottom: 0; }
.quick-toggle-left { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.quick-toggle-icon { width: 28px; height: 28px; border-radius: 8px; display: flex;
    align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
.form-check-input:checked { background-color: var(--bs-primary); border-color: var(--bs-primary); }

/* ── Zona pills ── */
.zone-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.zone-pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 500;
    border: 1px solid var(--bs-border-color); background: var(--bs-body-bg);
    color: var(--bs-body-color); cursor: pointer; transition: all .15s; line-height: 1;
}
.zone-pill:hover { border-color: var(--bs-primary); color: var(--bs-primary); }
.zone-pill.active { background: var(--bs-primary); border-color: var(--bs-primary); color: #fff; }

/* ── Sección: salir de la ciudad ── */
.outside-city-wrap {
    background: linear-gradient(180deg, rgba(202,138,4,.07) 0%, transparent 100%);
    border-bottom: 1px solid rgba(202,138,4,.2);
    padding: 14px 16px 0;
}
.outside-city-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px; gap: 8px; flex-wrap: wrap;
}
.outside-city-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 700;
}
.outside-city-title i { color: #ca8a04; font-size: 15px; }
.outside-city-badge {
    background: rgba(202,138,4,.15); color: #92400e;
    font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px;
}
.btn-outside-ver-todos {
    font-size: 12px; font-weight: 600; color: #a16207;
    background: rgba(202,138,4,.1); border: 1px solid rgba(202,138,4,.3);
    padding: 5px 12px; border-radius: 20px; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    transition: all .15s; white-space: nowrap;
}
.btn-outside-ver-todos:hover { background: rgba(202,138,4,.2); }

/* ── Sección: sin sede física ── */
.no-location-wrap {
    background: linear-gradient(180deg, rgba(139,92,246,.06) 0%, transparent 100%);
    border-bottom: 1px solid rgba(139,92,246,.18);
    padding: 14px 16px 0;
}
.no-location-badge {
    background: rgba(139,92,246,.12); color: #6d28d9;
    font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px;
}
.btn-no-location-ver-todos {
    font-size: 12px; font-weight: 600; color: #6d28d9;
    background: rgba(139,92,246,.1); border: 1px solid rgba(139,92,246,.3);
    padding: 5px 12px; border-radius: 20px; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    transition: all .15s; white-space: nowrap;
}
.btn-no-location-ver-todos:hover { background: rgba(139,92,246,.18); }

/* ── Carrusel ── */
.outside-carousel-container { position: relative; margin: 0 -4px; }
.outside-carousel {
    display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
    padding: 4px 4px 16px; scrollbar-width: none; -ms-overflow-style: none;
    cursor: grab;
}
.outside-carousel::-webkit-scrollbar { display: none; }
.outside-carousel.is-dragging { cursor: grabbing; user-select: none; }
.outside-carousel .est-card { flex: 0 0 200px; scroll-snap-align: start; }
.carousel-arrow {
    position: absolute; top: calc(50% - 10px); transform: translateY(-50%);
    width: 30px; height: 30px; border-radius: 50%; padding: 0;
    background: var(--bs-body-bg); border: 1px solid var(--bs-border-color);
    color: var(--bs-body-color); display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 10; font-size: 10px; transition: all .15s;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.carousel-arrow:hover:not(:disabled) { background: var(--bs-primary); color: #fff; border-color: var(--bs-primary); }
.carousel-arrow:disabled { opacity: 0; pointer-events: none; }
.carousel-arrow.carousel-prev { left: -6px; }
.carousel-arrow.carousel-next { right: -6px; }

/* Grid expandido */
.outside-expanded-grid {
    padding: 12px 0 16px; border-top: 1px dashed rgba(202,138,4,.3); margin-top: 4px;
}

/* ── Botón limpiar filtros ── */
.btn-clear-all {
    font-size: 12px; color: var(--bs-secondary-color); background: none; border: none;
    padding: 0; cursor: pointer; display: none; text-decoration: underline;
}
.btn-clear-all.show { display: inline; }

/* ── Badges internos de card ── */
.est-card-city-badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 10px; font-weight: 600; color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), 0.08);
    padding: 2px 8px; border-radius: 10px; margin-bottom: 4px;
}
.est-card-zone {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 10px; color: var(--bs-secondary-color);
    background: var(--bs-tertiary-bg, #f1f5f9); padding: 2px 7px; border-radius: 10px;
}
.est-card-outside-badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11px; font-weight: 600; color: #92400e;
    background: rgba(202,138,4,.12); padding: 3px 9px; border-radius: 8px;
}
.est-card-no-location {
    display: flex; align-items: center; gap: 5px;
    font-size: 11px; color: var(--bs-secondary-color); margin-top: 2px;
}

/* ── Destacados: resaltar card ── */
.est-card.is-featured {
    border-color: #f59e0b;
    box-shadow: 0 0 0 1px rgba(245,158,11,.4), 0 4px 18px rgba(245,158,11,.2);
}
.est-card.is-featured:hover {
    box-shadow: 0 0 0 1px rgba(245,158,11,.6), 0 12px 30px rgba(245,158,11,.25);
}
