/* ==========================================================
   VISTA: EXPLORAR / LISTA DE RESTAURANTES Y PLATOS (BARRANCAFOOD)
   ========================================================== */

:root {
    --primary: #FF7A00;
    --primary-hover: #FF8F1F;
    --dark: #1F2937;
    --bg-secondary: #F3F4F6;
    --border-light: #E5E7EB;
    --text-dark: #111827;
    --text-light: #6B7280;
    --success: #22C55E;
    --error: #EF4444;
}

.explore-header {
    padding: 20px 20px 15px;
    background: #ffffff;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 4px 20px rgba(0,0,0,0.02);
}

.saludo-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.saludo {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 600;
    letter-spacing: 0.2px;
}

h1 {
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 16px;
    color: var(--text-dark);
    letter-spacing: -0.6px;
}

/* --- EXPLORER TABS (SEGMENTED CONTROL PREMIUM) --- */
.explore-tabs {
    display: flex;
    background: var(--bg-secondary);
    border-radius: 14px;
    padding: 4px;
    margin-bottom: 16px;
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border: none;
    background: transparent;
    border-radius: 11px;
    font-weight: 700;
    color: var(--text-light);
    font-size: 14px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.tab-btn.active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: 0 4px 12px rgba(255, 122, 0, 0.08), 0 2px 4px rgba(0,0,0,0.04);
}

/* --- BARRA DE BÚSQUEDA AVANZADA --- */
.search-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

#buscador {
    flex: 1;
    padding: 14px 15px 14px 44px;
    border-radius: 16px;
    border: 1px solid transparent;
    background: var(--bg-secondary);
    font-size: 15px;
    font-weight: 500;
    color: var(--text-dark);
    outline: none;
    transition: all 0.25s ease;
}

#buscador:focus {
    background: #ffffff;
    border-color: rgba(255, 122, 0, 0.3);
    box-shadow: 0 0 0 4px rgba(255, 122, 0, 0.12);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    opacity: 0.6;
    pointer-events: none;
}

.btn-filter-trigger {
    width: 48px;
    height: 48px;
    background: var(--bg-secondary);
    border: none;
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: var(--text-dark);
    transition: all 0.2s;
}

.btn-filter-trigger:active, .btn-filter-trigger.active {
    background: rgba(255, 122, 0, 0.1);
    color: var(--primary);
    transform: scale(0.95);
}

/* --- DRAWER DE FILTROS AVANZADOS COLAPSABLE --- */
.advanced-filters-drawer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s;
    background: #ffffff;
    border-radius: 16px;
    margin-top: 0;
}

.advanced-filters-drawer.open {
    max-height: 250px;
    padding: 16px 4px 8px;
    border-bottom: 1px solid var(--border-light);
}

.filter-group {
    margin-bottom: 16px;
}

.filter-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

/* --- Slider de Precio Premium --- */
.price-range-selector {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.price-indicator {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
}

.price-range-selector input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 5px;
    background: var(--border-light);
    outline: none;
}

.price-range-selector input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(255, 122, 0, 0.4);
    transition: transform 0.1s;
}

.price-range-selector input[type="range"]::-webkit-slider-thumb:active {
    transform: scale(1.2);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-light);
    font-weight: 600;
}

/* --- Selectores de Ordenamiento --- */
.sort-selector-grid {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}
.sort-selector-grid::-webkit-scrollbar { display: none; }

.sort-option {
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    background: #ffffff;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}

.sort-option.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(255, 122, 0, 0.25);
}

/* --- CATEGORÍAS HORIZONTALES --- */
.cat-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 15px 20px;
    scrollbar-width: none;
}
.cat-scroll::-webkit-scrollbar { display: none; }

.cat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 68px;
    cursor: pointer;
    opacity: 0.65;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.cat-item.active {
    opacity: 1;
    transform: translateY(-2px);
}

.cat-icon {
    width: 56px;
    height: 56px;
    background: var(--bg-secondary);
    border-radius: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 22px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
    margin-bottom: 6px;
    transition: all 0.25s;
}

.cat-item.active .cat-icon {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(255, 122, 0, 0.3);
}

.cat-item span {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-dark);
}

/* --- CHIPS DE FILTRO RÁPIDO --- */
.chips-container {
    display: flex;
    gap: 8px;
    padding: 0 20px 15px;
    overflow-x: auto;
    scrollbar-width: none;
}
.chips-container::-webkit-scrollbar { display: none; }

.chip {
    padding: 10px 18px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid var(--border-light);
    color: var(--text-light);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    transition: all 0.2s;
    cursor: pointer;
}

.chip.active {
    background: var(--text-dark);
    color: #ffffff;
    border-color: var(--text-dark);
}

.results-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 20px 15px;
}

.results-title {
    font-size: 19px;
    font-weight: 800;
    color: var(--text-dark);
}

.results-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
}

/* ==========================================================
   DISEÑO PREMIUM DE TARJETAS DE RESTAURANTES
   ========================================================== */
.card {
    background: #ffffff;
    margin: 0 20px 16px;
    border-radius: 24px;
    padding: 14px;
    display: flex;
    gap: 16px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.04);
    position: relative;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.06);
}

.card:active {
    transform: scale(0.97);
}

.card-img-box {
    width: 105px;
    height: 105px;
    flex-shrink: 0;
    border-radius: 18px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.card-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: var(--bg-secondary);
}

.card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}

.card-title {
    font-size: 17px;
    font-weight: 800;
    margin: 0;
    color: var(--text-dark);
    line-height: 1.25;
}

.fav-btn-card {
    background: transparent;
    border: none;
    color: var(--primary);
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s;
}

.fav-btn-card:active {
    transform: scale(0.75);
}

.card-categories {
    font-size: 12px;
    color: var(--text-light);
    margin: 0 0 8px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.badges-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.badge {
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-open {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.badge-open .dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: var(--success);
}

.badge-closed {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.badge-closed .dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: var(--error);
}

.badge-delivery {
    background: var(--bg-secondary);
    color: var(--text-dark);
}

.match-plato {
    font-size: 11px;
    color: #E65100;
    background: #FFE0B2;
    padding: 4px 8px;
    border-radius: 8px;
    margin-bottom: 8px;
    display: inline-block;
    font-weight: 700;
}

.card-divider {
    height: 1px;
    background: var(--border-light);
    margin: auto 0 8px 0;
    width: 100%;
}

.card-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-distance {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-light);
    font-weight: 600;
}

.price-range {
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
}

/* ==========================================================
   NUEVO: TARJETAS DE PLATOS (DISEÑO TEXTUAL PREMIUM - OPTIMIZADO)
   ========================================================== */
.plato-card {
    background: #ffffff;
    margin: 0 20px 16px;
    border-radius: 20px;
    padding: 18px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.03);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.plato-card:active {
    transform: scale(0.98);
    background: #FAFAFA;
}

.plato-title {
    font-size: 19px;
    font-weight: 800;
    color: #1a1a1a;
    margin: 0 0 6px 0;
    line-height: 1.25;
}

.plato-desc {
    font-size: 15px;
    color: #6b7280;
    line-height: 1.45;
    margin: 0 0 12px 0;
}

/* Contenedor flexible por si la categoría no existe, no deje espacios vacíos */
.plato-category-wrapper {
    margin-bottom: 12px;
}

.plato-category {
    display: inline-block;
    background: #FFF3E0; /* Naranja muy claro */
    color: #D84315; /* Naranja oscuro */
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

.plato-price {
    font-size: 22px;
    font-weight: 800;
    color: #FF3D00; /* Naranja primario */
    margin-bottom: 12px;
}

.plato-divider {
    height: 1px;
    background: #F3F4F6;
    width: 100%;
    margin: 0 0 12px 0;
}

.plato-restaurant-name {
    font-size: 16px;
    font-weight: 700;
    color: #4B5563;
    margin: 0 0 10px 0;
}

.plato-footer-badges {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.plato-delivery-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #F3F4F6;
    color: #374151;
    padding: 6px 12px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 700;
}

.plato-distance {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: #6B7280;
    font-weight: 600;
}
/* ==========================================================
   POPUP TOAST FLOTANTE Y DISMISSIBLE
   ========================================================== */
.plates-popup-toast {
    position: fixed;
    bottom: -30px;
    left: 20px;
    right: 20px;
    background: rgb(129, 54, 18);
    color: #ffffff;
    border-radius: 20px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 99;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
    opacity: 0;
    pointer-events: none;
}

.plates-popup-toast.active {
    transform: translateY(-95px);
    opacity: 1;
    pointer-events: auto;
}

.popup-toast-content {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.popup-toast-icon {
    font-size: 20px;
    animation: pulseIcon 1.5s infinite alternate;
}

.popup-toast-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.popup-toast-text strong {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
}

.popup-toast-text span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.858);
    line-height: 1.35;
}

.popup-toast-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 120px;
}

.btn-toast-action {
    background: var(--primary);
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-toast-action:active {
    background: var(--primary-hover);
}

.btn-toast-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.921);
    font-size: 50px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

.btn-toast-close:active {
    color: #ffffff;
}

/* ==========================================================
   DISEÑO MEJORADO DE LOS MODALES DE MENÚ (CUADRÍCULA INTERACTIVA)
   ========================================================== */
.horizontal-product-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 10px;
    display: flex;
    gap: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 12px;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.product-img-box {
    width: 85px;
    height: 85px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.product-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 122, 0, 0.95);
    color: #ffffff;
    font-size: 9px;
    font-weight: 800;
    text-align: center;
    padding: 2px 0;
    text-transform: uppercase;
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.product-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-dark);
    margin: 0 0 2px 0;
    line-height: 1.2;
}

.product-price {
    font-size: 14px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 4px;
}

.product-desc {
    font-size: 11px;
    color: var(--text-light);
    line-height: 1.4;
    margin: 0 0 8px 0;
}

.btn-order-product {
    align-self: flex-start;
    background: var(--bg-secondary);
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-order-product svg {
    fill: currentColor;
    transition: transform 0.2s;
}

.btn-order-product:active {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
    transform: scale(0.95);
}

@keyframes pulseIcon {
    0% { transform: scale(1); }
    100% { transform: scale(1.15); }
}

@keyframes heartJump {
    0% { transform: scale(1); }
    40% { transform: scale(1.35); }
    60% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.jump-anim svg {
    animation: heartJump 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}