/* ==========================================================================
   NSC DAILY — nsc-daily.css
   Estilos del shortcode [nsc_menu_diario] — Mobile First
   ========================================================================== */

/* ── Variables (hereda la paleta naranja de Nápoles) ── */
:root {
    --nsc-orange:        #F27E03;
    --nsc-orange-light:  #fffaf5;
    --nsc-orange-hover:  #d36e02;
    --nsc-orange-shadow: rgba(242, 126, 3, 0.25);
    --nsc-text:          #2c3e50;
    --nsc-text-soft:     #7f8c8d;
    --nsc-border:        #eaeaea;
    --nsc-card-shadow:   0 4px 14px rgba(0, 0, 0, 0.07);
    --nsc-radius:        12px;
    --nsc-radius-pill:   50px;
}

/* ==========================================================================
   1. CONTENEDOR PRINCIPAL
   ========================================================================== */
.nsc-daily-container {
    max-width: 600px;
    margin: 16px auto;
    padding: 0 14px 130px;   /* padding-bottom: espacio para la barra sticky */
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: var(--nsc-text);
    background: transparent;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   2. HEADER — INDICADORES DE STEP
   ========================================================================== */
.nsc-daily-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 28px;
    padding: 14px 18px;
    background: #fff;
    border-radius: var(--nsc-radius);
    box-shadow: var(--nsc-card-shadow);
}

.nsc-daily-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    flex: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.nsc-step-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #ecf0f1;
    color: var(--nsc-text-soft);
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s, color 0.25s;
}

.nsc-step-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--nsc-text-soft);
    transition: color 0.25s;
}

.nsc-daily-step.active .nsc-step-circle {
    background: var(--nsc-orange);
    color: #fff;
}

.nsc-daily-step.active .nsc-step-label {
    color: var(--nsc-orange);
}

.nsc-daily-step.done .nsc-step-circle {
    background: #e8f5e9;
    color: #43a047;
}

.nsc-daily-step.done .nsc-step-label {
    color: #43a047;
}

.nsc-daily-step-line {
    width: 40px;
    height: 2px;
    background: var(--nsc-border);
    flex-shrink: 0;
    margin: 0 4px 14px;
}

/* ==========================================================================
   3. TÍTULOS
   ========================================================================== */
.nsc-daily-titles {
    margin-bottom: 20px;
    padding-left: 2px;
}

.nsc-daily-titles h2 {
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 6px;
    color: var(--nsc-text);
    letter-spacing: -0.3px;
}

.nsc-daily-titles p {
    font-size: 14px;
    margin: 0;
    color: var(--nsc-text-soft);
    line-height: 1.45;
}

/* ==========================================================================
   4. GRID DE PLATOS — 2 COLUMNAS (COMPACTAS)
   ========================================================================== */
.nsc-daily-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.nsc-daily-empty,
.nsc-daily-loading {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--nsc-text-soft);
    padding: 40px 20px;
    font-size: 15px;
    font-weight: 600;
}

/* ==========================================================================
   5. CARD DE PLATO
   ========================================================================== */
.nsc-daily-card {
    background: #fff;
    border-radius: var(--nsc-radius);
    box-shadow: var(--nsc-card-shadow);
    border: 2px solid transparent;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.nsc-daily-card:active {
    transform: scale(0.97);
}

.nsc-daily-card.nsc-card-selected {
    border-color: var(--nsc-orange);
    background: var(--nsc-orange-light);
}

/* ── Agotado ── */
.nsc-daily-card.nsc-card-agotado {
    pointer-events: auto; /* Sigue siendo clicable para ver ficha */
}

.nsc-daily-card.nsc-card-agotado .nsc-daily-card-img img,
.nsc-daily-card.nsc-card-agotado .nsc-img-placeholder {
    filter: grayscale(100%) opacity(0.5);
}

.nsc-daily-card.nsc-card-agotado .nsc-daily-card-body {
    opacity: 0.55;
}

/* Overlay "AGOTADO" sobre la imagen */
.nsc-agotado-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    /* Cubre solo la zona de imagen: alineado al alto de .nsc-daily-card-img */
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    pointer-events: none;
}

.nsc-agotado-overlay span {
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.2px;
    padding: 4px 10px;
    border-radius: 30px;
    text-transform: uppercase;
}

/* ── Imagen de la card ── */
.nsc-daily-card-img {
    width: 100%;
    height: 80px;
    overflow: hidden;
    background: #f1f3f4;
    position: relative;
}

.nsc-daily-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nsc-img-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f1f3f4 0%, #e8eaed 100%);
}

/* ── Cuerpo de la card ── */
.nsc-daily-card-body {
    padding: 10px 10px 8px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Badges de categoría y tipo */
.nsc-daily-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 5px;
}

.nsc-badge-cat,
.nsc-badge-tipo {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 20px;
    line-height: 1.4;
}

.nsc-badge-cat {
    background: #e3f2fd;
    color: #1565c0;
}

.nsc-badge-tipo {
    background: #f3e5f5;
    color: #6a1b9a;
}

/* Nombre del plato */
.nsc-daily-card-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--nsc-text);
    margin: 0 0 3px;
    line-height: 1.3;

    /* Limitar a 2 líneas para mantener la card compacta */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Descripción corta */
.nsc-daily-card-desc {
    font-size: 11px;
    color: var(--nsc-text-soft);
    margin: 0 0 8px;
    line-height: 1.35;
}

/* Footer: precio + qty */
.nsc-daily-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    gap: 6px;
}

.nsc-daily-card-price {
    font-size: 15px;
    font-weight: 800;
    color: var(--nsc-orange);
    white-space: nowrap;
}

/* Controles +/- (heredados y ajustados para tamaño compacto) */
.nsc-pack-qty {
    display: flex;
    align-items: center;
    background: #f1f3f4;
    border-radius: var(--nsc-radius-pill);
    padding: 1px;
    flex-shrink: 0;
}

.nsc-qty-btn {
    background: none;
    border: none;
    width: 26px;
    height: 26px;
    font-size: 18px;
    font-weight: 700;
    color: var(--nsc-orange);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.nsc-qty-btn:hover {
    background: var(--nsc-orange-shadow);
}

.nsc-qty-btn:disabled {
    color: #ccc;
    cursor: not-allowed;
}

.nsc-qty-input {
    width: 26px;
    border: none;
    background: none;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--nsc-text);
    padding: 0;
    margin: 0;
}

.nsc-qty-input:focus {
    outline: none;
}

/* ==========================================================================
   5b. FILTROS POR TIPO DE PRODUCTO
   ========================================================================== */
#nsc-daily-filtros {
    display: flex;
    flex-wrap: wrap;          /* en móvil fluyen a la siguiente fila si no caben */
    gap: 6px 4px;
    padding: 4px 2px 12px;
    margin-bottom: 16px;
}

.nsc-filtro-btn {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    outline: none;
    background: none;
    font-family: inherit;

    /* Flexible: se reparten el espacio disponible y se adaptan a la pantalla.
       En móvil, si no caben todos en una fila, fluyen a la siguiente. */
    flex: 1 1 60px;
    min-width: 52px;
    max-width: 90px;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 4px;
    cursor: pointer;
    transition: transform 0.15s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.nsc-filtro-btn:hover {
    background: none;
}

.nsc-filtro-btn.active {
    background: none;
}

.nsc-filtro-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #244928;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: background 0.18s, color 0.18s;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.10));
}

.nsc-filtro-icon svg {
    width: 22px;
    height: 22px;
    display: block;
}

.nsc-filtro-btn.active .nsc-filtro-icon {
    background: var(--nsc-orange);
    color: #fff;
    filter: drop-shadow(0 3px 8px var(--nsc-orange-shadow));
}

.nsc-filtro-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--nsc-text-soft);
    text-align: center;
    line-height: 1.2;
    transition: color 0.18s;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.nsc-filtro-btn.active .nsc-filtro-label {
    color: var(--nsc-orange);
}

/* ==========================================================================
   6. STEP 2 — FORMULARIO DE DATOS
   ========================================================================== */

/* Resumen del pedido en el step 2 */
.nsc-daily-order-summary {
    background: var(--nsc-orange-light);
    border: 1.5px solid #fde8c8;
    border-radius: var(--nsc-radius);
    padding: 14px 16px;
    margin-bottom: 20px;
}

.nsc-d-resumen-titulo {
    font-size: 13px;
    font-weight: 700;
    color: var(--nsc-orange);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nsc-d-resumen-lista {
    list-style: none;
    margin: 0 0 10px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nsc-d-resumen-lista li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.nsc-d-res-qty {
    font-weight: 800;
    color: var(--nsc-orange);
    min-width: 20px;
}

.nsc-d-res-name {
    flex: 1;
    color: var(--nsc-text);
}

.nsc-d-res-price {
    font-weight: 700;
    color: var(--nsc-text);
    white-space: nowrap;
}

.nsc-d-resumen-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #fde8c8;
    padding-top: 10px;
    font-size: 15px;
    color: var(--nsc-text);
}

.nsc-d-resumen-total strong {
    font-size: 18px;
    font-weight: 800;
    color: var(--nsc-orange);
}

/* Grupos de formulario (reutiliza estilo del sistema de packs) */
.nsc-pwa-form-group {
    margin-bottom: 16px;
    background: #fff;
    padding: 18px;
    border-radius: var(--nsc-radius);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #f1f5f9;
}

.nsc-pwa-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--nsc-text);
}

.nsc-pwa-input {
    width: 100%;
    padding: 13px 14px;
    border: 2px solid var(--nsc-border);
    border-radius: 10px;
    font-size: 16px;   /* 16px evita el zoom automático en iOS */
    background: #fff;
    font-family: inherit;
    color: var(--nsc-text);
    transition: border-color 0.2s;
    box-sizing: border-box;
    -webkit-appearance: none;
}

.nsc-pwa-input:focus {
    outline: none;
    border-color: var(--nsc-orange);
}

.nsc-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a5568' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    padding-right: 40px;
    cursor: pointer;
}

/* Display de fecha calculada */
.nsc-disclaimer-text {
    font-size: 13px;
    color: #e67e22;
    font-weight: 600;
    margin: 0 0 8px;
}

.nsc-fecha-display {
    font-size: 17px;
    font-weight: 700;
    color: var(--nsc-text);
    padding: 12px 14px;
    background: #f8fafc;
    border-radius: 10px;
    border: 2px solid var(--nsc-border);
}

/* Mensajes de error / éxito */
.nsc-alert {
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    margin-top: 4px;
}

.nsc-alert.nsc-error {
    background: #fef2f2;
    color: #c0392b;
    border: 1.5px solid #fca5a5;
}

.nsc-alert.nsc-success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1.5px solid #86efac;
}

/* ==========================================================================
   7. BARRA INFERIOR STICKY
   ========================================================================== */
.nsc-pwa-bottom-bar-wrapper {
    position: fixed;
    bottom: 16px;
    left: 0;
    width: 100%;
    pointer-events: none;
    display: flex;
    justify-content: center;
    z-index: 900;
}

.nsc-pwa-bottom-bar {
    pointer-events: auto;
    width: 92%;
    max-width: 420px;
    background: #fff;
    padding: 10px 20px 10px 22px;
    border-radius: var(--nsc-radius-pill);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
    border: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.nsc-pwa-summary {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

#nsc-d-summary-text {
    font-size: 12px;
    color: var(--nsc-text-soft);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#nsc-d-summary-total {
    font-size: 21px;
    font-weight: 800;
    color: var(--nsc-text);
    line-height: 1.1;
}

.nsc-btn {
    background: var(--nsc-orange);
    color: #fff;
    border: none;
    padding: 13px 22px;
    border-radius: var(--nsc-radius-pill);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, opacity 0.2s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    flex-shrink: 0;
}

.nsc-btn:disabled {
    opacity: 0.45;
    background: #b0bec5;
    cursor: not-allowed;
}

.nsc-btn:not(:disabled):active {
    background: var(--nsc-orange-hover);
}

/* ==========================================================================
   8. MODAL — FICHA NUTRICIONAL (BOTTOM SHEET EN MÓVIL)
   ========================================================================== */

/* Bloquea el scroll del body mientras el modal está abierto */
body.nsc-modal-open {
    overflow: hidden;
}

.nsc-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9999;
    display: flex;
    align-items: flex-end;   /* Ancla el sheet al fondo */
    justify-content: center;
}

.nsc-modal-sheet {
    background: #fff;
    width: 100%;
    max-width: 540px;
    border-radius: 20px 20px 0 0;
    max-height: 88vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
    padding-bottom: env(safe-area-inset-bottom, 16px);
}

/* Botón cerrar */
.nsc-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: #f1f3f4;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 14px;
    color: var(--nsc-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    -webkit-tap-highlight-color: transparent;
}

/* Imagen del modal */
.nsc-modal-img-wrap {
    width: 100%;
    height: 190px;
    overflow: hidden;
    background: #f1f3f4;
}

.nsc-modal-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Cuerpo del modal */
.nsc-modal-body {
    padding: 18px 20px 24px;
}

/* Badges del modal */
.nsc-modal-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.nsc-mbadge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 3px 9px;
    border-radius: 20px;
}

.nsc-mbadge-tipo {
    background: #f3e5f5;
    color: #6a1b9a;
}

.nsc-mbadge-cat {
    background: #e3f2fd;
    color: #1565c0;
}

/* Nombre en el modal */
.nsc-modal-body h3 {
    font-size: 20px;
    font-weight: 800;
    color: var(--nsc-text);
    margin: 0 0 8px;
    line-height: 1.25;
}

.nsc-modal-desc {
    font-size: 14px;
    color: var(--nsc-text-soft);
    margin: 0 0 18px;
    line-height: 1.5;
}

/* Sección nutricional */
.nsc-modal-nutrientes {
    background: #f8fafc;
    border-radius: 10px;
    padding: 14px 16px;
}

.nsc-modal-nutrientes h4 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--nsc-text-soft);
    margin: 0 0 12px;
}

/* Grid 3 columnas para los 6 nutrientes */
.nsc-nutrientes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.nsc-nut-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: #fff;
    border-radius: 8px;
    padding: 10px 6px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.nsc-nut-valor {
    font-size: 16px;
    font-weight: 800;
    color: var(--nsc-text);
    line-height: 1;
}

.nsc-nut-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--nsc-text-soft);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ==========================================================================
   9. RESPONSIVE — TABLETS / DESKTOP
   ========================================================================== */
@media (min-width: 480px) {
    .nsc-daily-card-img {
        height: 110px;
    }

    .nsc-agotado-overlay {
        height: 110px;
    }

    .nsc-daily-card-name {
        font-size: 14px;
    }

    .nsc-daily-card-price {
        font-size: 16px;
    }

    .nsc-modal-img-wrap {
        height: 220px;
    }
}

@media (min-width: 600px) {
    .nsc-modal-overlay {
        align-items: center;
    }

    .nsc-modal-sheet {
        border-radius: 16px;
        max-width: 460px;
        margin: 0 auto;
    }
}

/* ==========================================================================
   PICKER DE FECHA PERSONALIZADO — Todos los días disponibles
   ========================================================================== */

.nsc-date-picker {
    width: 100%;
    font-family: inherit;
    user-select: none;
}

.nsc-dp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.nsc-dp-nav {
    background: #fff;
    border: 2px solid #eaeaea;
    border-radius: 8px;
    width: 34px;
    height: 34px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, color 0.15s;
    padding: 0;
    font-family: inherit;
}

.nsc-dp-nav:hover:not(:disabled) {
    border-color: #F27E03;
    color: #F27E03;
}

.nsc-dp-nav:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

.nsc-dp-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #2c3e50;
    text-transform: capitalize;
    letter-spacing: 0.01em;
}

.nsc-dp-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.nsc-dp-dow {
    text-align: center;
    font-size: 0.68rem;
    font-weight: 700;
    color: #b0bec5;
    padding: 4px 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.nsc-dp-empty {
    background: none;
}

.nsc-dp-cell {
    text-align: center;
    font-size: 0.82rem;
    border-radius: 8px;
    padding: 7px 2px;
    cursor: default;
    font-weight: 600;
}

/* Días anteriores a la fecha mínima: deshabilitados */
.nsc-dp-disabled {
    color: #d5dbe0;
    background: #fafafa;
}

/* Días disponibles */
.nsc-dp-available {
    color: #F27E03;
    font-weight: 800;
    cursor: pointer;
    background: #fff8f0;
    border: 2px solid #fde0b8;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}

.nsc-dp-available:hover {
    background: #fde0b8;
    box-shadow: 0 2px 8px rgba(242, 126, 3, 0.2);
    transform: scale(1.08);
}

/* Día seleccionado */
.nsc-dp-selected {
    background: #F27E03 !important;
    color: #fff !important;
    border-color: #d36e02 !important;
    box-shadow: 0 4px 10px rgba(242, 126, 3, 0.35) !important;
    transform: none !important;
}

/* Separación entre picker y select de bloque horario */
.nsc-date-picker + select,
.nsc-date-picker + .nsc-pwa-input,
#nsc-d-hora {
    margin-top: 20px;
}