/* ==========================================================
   MODAL (BOTTOM SHEET) - SILICON VALLEY UI (RAPPI STYLE REBRAND)
   ========================================================== */

:root {
    --primary-brand: #FF4500;
    --bg-pure: #FFFFFF;
    --bg-surface: #F7F7F7;
    --text-strong: #090909;
    --text-soft: #717171;
    --border-subtle: #F0F0F0;
    --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.08);
    --radius-sheet: 32px;
    --radius-btn: 18px;
    --spring-curve: cubic-bezier(0.32, 0.72, 0, 1);
}

#modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: flex-end;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease-out;
    z-index: 99999;
}

#modal.active {
    display: flex;
    opacity: 1;
}

#modal .content {
    width: 100%;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-pure);
    border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.12);
    transform: translateY(100%);
    transition: transform 0.5s var(--spring-curve);
    position: relative;
}

/* Indicador visual de arrastre superior */
#modal .content::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 44px;
    height: 5px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 100px;
    z-index: 30;
}

#modal.active .content {
    transform: translateY(0);
}

/* --- Cabecera de Imagen --- */
.modal-header-img {
    position: relative;
    width: 100%;
    height: 260px;
    flex-shrink: 0;
}

.modal-header-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: var(--bg-surface);
}

/* Sombreado superior para dar visibilidad a los botones flotantes */
.modal-header-img::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 90px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, transparent 100%);
    pointer-events: none;
}

/* --- Contenedor del Cuerpo con Curva Solapada --- */
.modal-body-wrapper {
    position: relative;
    background: var(--bg-pure);
    border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
    margin-top: -30px; /* Sube el cuerpo para solapar la imagen y crear la curva */
    z-index: 10;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-body {
    padding: 28px 24px 48px;
}

.modal-body h2 {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.8px;
    color: var(--text-strong);
    display: flex;
    align-items: center;
    gap: 6px;
}

.modal-body h2 .verified-badge {
    color: #1DA1F2;
    font-size: 20px;
}

.desc {
    margin-bottom: 24px;
    color: var(--text-soft);
    font-size: 15px;
    line-height: 1.5;
    font-weight: 400;
}

/* --- Fila de Estado de Apertura --- */
.status-row {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 700;
}

.status-badge.b-open {
    background: #E8F8F0;
    color: #107C41;
}

.status-badge.b-closed {
    background: #FDF0F0;
    color: #A80000;
}

/* --- Rejilla de Información (Distancia, Domicilio, Precios) --- */
.info-columns-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    text-align: center;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.info-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.info-col .val {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-strong);
}

.info-col .lbl {
    font-size: 11px;
    color: var(--text-soft);
    font-weight: 500;
}

/* --- Rejilla de Acciones Principales --- */
.action-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 8px;
    background: var(--bg-surface);
    border-radius: var(--radius-btn);
    color: var(--text-strong);
    text-decoration: none;
    font-size: 14px;
    font-weight: 800;
    transition: transform 0.2s, background 0.2s;
}

.action-btn:active {
    transform: scale(0.95);
    background: var(--border-subtle);
}

.action-btn span {
    font-size: 26px;
}

.action-btn.primary {
    background: var(--primary-brand);
    color: var(--bg-pure);
    box-shadow: 0 8px 24px rgba(255, 69, 0, 0.2);
}

.action-btn.primary:active {
    background: #E63E00;
}

/* --- Menú Destacado (Cards Estilo Rappi) --- */
.menu-destacado-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.menu-destacado-header h3 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-strong);
    margin: 0;
}

.menu-destacado-header .ver-todo-link {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-brand);
    cursor: pointer;
}

/* Cambiamos el grid de 2 columnas por una columna vertical */
.menu-cards-grid {
    display: flex;
    flex-direction: column; /* Apila los elementos hacia abajo */
    gap: 12px; /* Espaciado entre tarjetas */
    margin-bottom: 24px;
    width: 100%;
}

/* Rediseño de la tarjeta para formato horizontal compacto */
.menu-card {
    background: var(--bg-pure);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: row; /* Imagen a la izquierda, texto a la derecha */
    align-items: center;
    position: relative;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    width: 100%;
}

.menu-card-img-box {
    position: relative;
    width: 100px; /* Ancho fijo para la imagen */
    height: 100px;
    flex-shrink: 0; /* Evita que la imagen se encoja */
    background: var(--bg-surface);
}

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

.menu-card-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: var(--primary-brand);
    color: var(--bg-pure);
    font-size: 9px;
    font-weight: 800;
    padding: 3px 6px;
    border-radius: 100px;
    text-transform: uppercase;
}

.menu-card-body {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    min-width: 0; /* Crucial para que el texto no desborde el flexbox */
}

.menu-card-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-strong);
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu-card-desc {
    font-size: 12px;
    color: var(--text-soft);
    margin: 0 0 8px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Limita a 2 líneas */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.menu-card-price {
    font-size: 14px;
    font-weight: 800;
    color: var(--primary-brand);
}
/* --- Botón "Ver todo el menú" de Respaldo --- */
.btn-full-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-btn);
    color: var(--primary-brand);
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    margin-bottom: 32px;
}

.btn-full-menu:active {
    background: #EDEDED;
    transform: scale(0.98);
}

.btn-reportar {
    display: block;
    text-align: center;
    color: var(--text-soft);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding-bottom: 26px;
}

