/* Plano de sala público — reservar.php / pedidos.php (Pro, responsive) */
@import url('floor-zone-theme.css');

:root {

    --pfp-num-available: #047857;

    --pfp-num-reserved: #b45309;

    --pfp-num-occupied: #b91c1c;

    --pfp-num-soon: #4338ca;

    --pfp-num-off: #334155;

    --pfp-cap-color: #64748b;

    --pfp-accent: #D4AF37;

    --pfp-accent-ring: rgba(212, 175, 55, 0.42);

    --pfp-surface: #ffffff;

    --pfp-radius: 14px;

    /* Texto interior: auto-fit por tamaño de caja (Resy / OpenTable / resmio) */
    --pfp-legend-fs: clamp(0.58rem, 1.85vw, 0.65rem);
    --pfp-legend-py: 3px;
    --pfp-legend-px: 8px;
    --pfp-legend-fw: 600;
    --pfp-legend-lh: 1.15;
    --pfp-legend-gap: 4px 6px;

    /* Botones de zona (Salón, Terraza…) — acción principal */
    --pfp-zone-fs: clamp(0.65rem, 2.2vw, 0.72rem);
    --pfp-zone-py: 5px;
    --pfp-zone-px: 10px;
    --pfp-zone-fw: 700;
    --pfp-zone-lh: 1.2;
    --pfp-zone-gap: 6px 8px;
    --pfp-chip-r: 999px;

}



.pfp-wrap {

    margin: 12px 0 16px;

    width: 100%;

    max-width: 100%;

    min-width: 0;

    box-sizing: border-box;

    overflow: hidden;

    contain: layout style;

}



#pedidos-floor-plan,
#reservation-floor-plan,
#emp-floor-plan,
#manual-floor-plan {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
}

#pedidos-floor-plan-wrap,
#reservation-floor-plan-wrap,
#emp-floor-plan-wrap,
#manual-floor-plan-wrap {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}



.pfp-shell {

    border: 1px solid #e2e8f0;

    border-radius: var(--pfp-radius);

    background: var(--pfp-surface);

    overflow: hidden;

    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);

    max-width: 100%;

    min-width: 0;

    box-sizing: border-box;

}



.pfp-legend {

    display: flex;

    flex-wrap: wrap;

    gap: var(--pfp-legend-gap);

    padding: 10px 12px;

    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);

    border-bottom: 1px solid #e2e8f0;

}

.pfp-legend--below {
    border-bottom: none;
    border-top: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}



.pfp-leg {

    font-size: var(--pfp-legend-fs);

    font-weight: var(--pfp-legend-fw);

    padding: var(--pfp-legend-py) var(--pfp-legend-px);

    border-radius: var(--pfp-chip-r);

    border: 1px solid transparent;

    line-height: var(--pfp-legend-lh);

    display: inline-flex;

    align-items: center;

    justify-content: center;

    box-sizing: border-box;

    letter-spacing: 0.01em;

}



.pfp-floor-tabs {

    display: grid;

    grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.75rem), 1fr));

    gap: var(--pfp-zone-gap);

    align-items: stretch;

    padding: 10px 12px 12px;

    max-width: 100%;

    min-width: 0;

    box-sizing: border-box;

    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);

    border-bottom: 1px solid #e2e8f0;

    overflow: visible;

}



.pfp-floor-tabs[data-floor-count="2"],
.pfp-floor-tabs[data-floor-count="3"],
.pfp-floor-tabs[data-floor-count="4"] {

    grid-template-columns: repeat(2, minmax(0, 1fr));

}



.pfp-floor-tabs[data-floor-count="5"],
.pfp-floor-tabs[data-floor-count="6"] {

    grid-template-columns: repeat(3, minmax(0, 1fr));

}



.pfp-floor-tabs[data-floor-count="7"],
.pfp-floor-tabs[data-floor-count="8"] {

    grid-template-columns: repeat(4, minmax(0, 1fr));

}



.pfp-floor-tabs[data-floor-count="1"] {

    grid-template-columns: 1fr;

}



@media (max-width: 720px) {

    .pfp-floor-tabs[data-floor-count="5"],
    .pfp-floor-tabs[data-floor-count="6"],
    .pfp-floor-tabs[data-floor-count="7"],
    .pfp-floor-tabs[data-floor-count="8"] {

        grid-template-columns: repeat(2, minmax(0, 1fr));

    }

}



.pfp-floor-tab {

    order: var(--pfp-grid-order, 50);

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 6px;

    flex: unset;

    width: 100%;

    min-width: 0;

    min-height: 44px;

    padding: 8px 10px;

    font-size: clamp(0.66rem, 2.2vw, 0.82rem);

    font-weight: var(--pfp-zone-fw);

    line-height: var(--pfp-zone-lh);

    border: 1px solid #cbd5e1;

    background: #fff;

    border-radius: 10px;

    color: #1e293b;

    text-align: center;

    white-space: normal;

    overflow-wrap: break-word;

    word-break: break-word;

    cursor: pointer;

    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);

    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;

}



.pfp-floor-tab-icon {

    flex-shrink: 0;

    font-size: 0.88em;

    opacity: 0.88;

}



.pfp-floor-tab-label {

    min-width: 0;

}



.pfp-floor-tab-label--short {

    display: none;

}



@media (max-width: 900px) {

    .pfp-floor-tabs[data-floor-count="7"] .pfp-floor-tab-label--full,
    .pfp-floor-tabs[data-floor-count="8"] .pfp-floor-tab-label--full {

        display: none;

    }

    .pfp-floor-tabs[data-floor-count="7"] .pfp-floor-tab-label--short,
    .pfp-floor-tabs[data-floor-count="8"] .pfp-floor-tab-label--short {

        display: inline;

    }

}



@media (max-width: 540px) {

    .pfp-floor-tab-label--full {

        display: none;

    }

    .pfp-floor-tab-label--short {

        display: inline;

    }

    .pfp-floor-tab {

        flex-direction: column;

        gap: 3px;

        padding: 6px 4px;

        font-size: clamp(0.58rem, 2.4vw, 0.68rem);

    }

    .pfp-floor-tab-icon {

        font-size: 1.05em;

    }

}



.pfp-floor-tab.active {

    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);

    border-color: var(--pfp-accent);

    color: #92400e;

    font-weight: 800;

    box-shadow: 0 2px 10px rgba(212, 175, 55, 0.28);

    animation: pfp-tab-activate 0.34s cubic-bezier(0.22, 1, 0.36, 1);

}



@keyframes pfp-tab-activate {

    0% { transform: scale(0.96); }

    100% { transform: scale(1); }

}



.pfp-canvas-wrap.pfp-zone-enter {

    animation: pfp-zone-enter 0.34s cubic-bezier(0.22, 1, 0.36, 1);

}



@keyframes pfp-zone-enter {

    from {

        opacity: 0;

        transform: translateY(8px) scale(0.992);

    }

    to {

        opacity: 1;

        transform: none;

    }

}



.pfp-floor-tab:active {

    transform: scale(0.98);

}



.pfp-canvas-wrap {

    padding: 10px 12px 6px;

    max-width: 100%;

    box-sizing: border-box;

    overflow: hidden;

}



.pfp-canvas-wrap[data-floor-type="terrace"],

.pfp-canvas-wrap[data-floor-type="exterior"] {

    background: linear-gradient(180deg, #ecfdf5 0%, #fff 100%);

}



.pfp-canvas-wrap[data-floor-type="bar"] {

    background: linear-gradient(180deg, #fffbeb 0%, #fff 100%);

}



.pfp-canvas-scroll {

    width: 100%;

    max-width: 100%;

    overflow: hidden;

    -webkit-overflow-scrolling: touch;

    overscroll-behavior: contain;

    border-radius: 12px;

    border: 1px dashed #cbd5e1;

    background: #fafafa;

    box-sizing: border-box;

    touch-action: manipulation;

}



.pfp-canvas-viewport {

    width: 100%;

    max-width: 100%;

    min-width: 0;

    overflow: hidden;

    position: relative;

    box-sizing: border-box;

}



.pfp-canvas-scaler {

    transform-origin: top left;

    will-change: transform;

}



.pfp-canvas {

    position: relative;

    background: #fafafa;

    overflow: hidden;

    box-sizing: border-box;

}



.pfp-table {

    position: absolute;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    gap: 1px;

    border: 2px solid #64748b;

    background: #fff;

    padding: 0;

    cursor: default;

    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.14);

    transition: transform 0.14s ease, box-shadow 0.32s ease, background 0.45s ease, border-color 0.45s ease, filter 0.35s ease;

    container-type: size;

    box-sizing: border-box;

    overflow: hidden;

}



.pfp-table-body {

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    line-height: 1.05;

    pointer-events: none;

    gap: 2px;

    width: 100%;

    height: 100%;

    position: relative;

    z-index: 1;

    max-width: 90%;

    max-height: 90%;

}



.pfp-table.pfp-clickable {

    cursor: pointer;

    -webkit-tap-highlight-color: rgba(30, 61, 115, 0.12);

    touch-action: manipulation;

    user-select: none;

}



.pfp-table.pfp-clickable:hover { transform: scale(1.04) translateY(-1px); z-index: 3; }

.pfp-table.pfp-clickable:active { transform: scale(0.99) translateY(0); }



.pfp-table.pfp-selected {

    border-color: var(--pfp-accent) !important;

    box-shadow: 0 0 0 3px var(--pfp-accent-ring), 0 10px 26px rgba(212, 175, 55, 0.22) !important;

    z-index: 4;

}



/* ── Pro Premium: mesas como botón sin heredar estilos globales del admin ── */
button.pfp-table,
#reservations-manager-section button.pfp-table {
    font: inherit;
    color: inherit;
    -webkit-appearance: none;
    appearance: none;
    background-image: none !important;
    border-style: solid;
}

button.pfp-table:hover,
button.pfp-table:focus,
button.pfp-table:focus-visible,
button.pfp-table:active,
#reservations-manager-section button.pfp-table:hover,
#reservations-manager-section button.pfp-table:focus,
#reservations-manager-section button.pfp-table:focus-visible,
#reservations-manager-section button.pfp-table:active {
    color: inherit !important;
    background-image: none !important;
}

button.pfp-floor-tab,
#reservations-manager-section button.pfp-floor-tab {
    background-image: none !important;
    color: inherit !important;
}

.pfp-table.pfp-clickable.pfp-st-available:hover,
.pfp-table.pfp-clickable.pfp-st-available:focus-visible {
    background: linear-gradient(165deg, #d1fae5 0%, #a7f3d0 100%) !important;
    border-color: #059669 !important;
    box-shadow: 0 8px 22px rgba(5, 150, 105, 0.26), 0 0 0 1px rgba(5, 150, 105, 0.18) !important;
}

.pfp-table.pfp-clickable.pfp-st-available:hover .pfp-num,
.pfp-table.pfp-clickable.pfp-st-available:focus-visible .pfp-num {
    color: #065f46 !important;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
}

.pfp-table.pfp-clickable.pfp-st-available:hover .pfp-cap,
.pfp-table.pfp-clickable.pfp-st-available:focus-visible .pfp-cap {
    color: #047857 !important;
}

.pfp-table.pfp-clickable.pfp-st-available:hover .pfp-cap-row,
.pfp-table.pfp-clickable.pfp-st-available:focus-visible .pfp-cap-row {
    background: rgba(5, 150, 105, 0.16) !important;
    box-shadow: inset 0 0 0 1px rgba(5, 150, 105, 0.2) !important;
}

.pfp-table.pfp-selected.pfp-st-available {
    background: linear-gradient(165deg, #ecfdf5 0%, #bbf7d0 100%) !important;
    border-color: var(--pfp-accent) !important;
}

.pfp-table.pfp-selected.pfp-st-available .pfp-num {
    color: #065f46 !important;
}

.pfp-table.pfp-selected.pfp-st-available .pfp-cap {
    color: #047857 !important;
}

.pfp-table.pfp-clickable:focus-visible {
    outline: none;
}

.pfp-table.pfp-clickable:not(.pfp-selected):focus-visible {
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.35), 0 6px 18px rgba(5, 150, 105, 0.18) !important;
}



.pfp-shape-round { border-radius: 50%; }

.pfp-shape-square { border-radius: 10px; }

.pfp-shape-rect { border-radius: 8px; }

.pfp-shape-booth {

    border-radius: 14px 14px 6px 6px;

    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);

}



.pfp-num {

    font-weight: 900;

    font-size: clamp(9px, 44cqmin, 64px);

    line-height: 1;

    letter-spacing: -0.03em;

    font-variant-numeric: tabular-nums;

    color: #0f172a;

    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.95), 0 0 8px rgba(255, 255, 255, 0.65);

    white-space: nowrap;

    max-width: 100%;

    overflow: hidden;

    text-overflow: ellipsis;

}

.pfp-table.pfp-table-md .pfp-num { font-size: clamp(10px, 43cqmin, 66px); }
.pfp-table.pfp-table-lg .pfp-num { font-size: clamp(10px, 42cqmin, 68px); }
.pfp-table.pfp-table-xl .pfp-num { font-size: clamp(11px, 41cqmin, 70px); }
.pfp-table.pfp-table-xxl .pfp-num { font-size: clamp(11px, 40cqmin, 72px); }

.pfp-cap {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    max-width: 100%;

    font-size: clamp(7px, 20cqmin, 26px);

    font-weight: 800;

    color: var(--pfp-cap-color);

    line-height: 1;

    white-space: nowrap;

    overflow: hidden;

}

.pfp-cap-row {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 0.14em;

    padding: 0.12em 0.42em;

    border-radius: 999px;

    background: rgba(15, 23, 42, 0.07);

    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);

    line-height: 1;

    max-width: 100%;

}

.pfp-cap-val {

    font-weight: 800;

    font-variant-numeric: tabular-nums;

    letter-spacing: -0.02em;

}

.pfp-cap-ico {

    display: inline-flex;

    align-items: center;

    flex-shrink: 0;

    opacity: 0.9;

}

.pfp-cap-svg {

    width: 1em;

    height: 1em;

    fill: currentColor;

    display: block;

}

.pfp-table.pfp-table-md .pfp-cap { font-size: clamp(7px, 19.5cqmin, 26px); }
.pfp-table.pfp-table-lg .pfp-cap { font-size: clamp(8px, 19cqmin, 27px); }
.pfp-table.pfp-table-xl .pfp-cap,
.pfp-table.pfp-table-xxl .pfp-cap { font-size: clamp(8px, 18.5cqmin, 28px); }

@media (max-width: 1024px) {
    .pfp-table-body { gap: 3px; }
    .pfp-cap-row {
        padding: 0.14em 0.48em;
        gap: 0.16em;
        background: rgba(15, 23, 42, 0.09);
    }
}

/* Solo móvil pequeño (vertical y horizontal) — capacidad más grande; tablet sin cambios */
@media (max-width: 600px), (max-height: 520px) and (orientation: landscape) and (max-width: 960px) {
    .pfp-table-body { gap: 2px; }
    .pfp-cap { font-size: clamp(10px, 28cqmin, 34px) !important; }
    .pfp-cap-row {
        padding: 0.18em 0.55em;
        gap: 0.2em;
        background: rgba(15, 23, 42, 0.11);
    }
    .pfp-cap-svg { width: 1.14em; height: 1.14em; }
    .pfp-cap-val { font-weight: 900; }
}

.msab-fp-small-phone .pfp-cap {
    font-size: clamp(10px, 28cqmin, 34px);
}
.msab-fp-small-phone .pfp-cap-row {
    padding: 0.18em 0.55em;
    gap: 0.2em;
}
.msab-fp-small-phone .pfp-cap-svg {
    width: 1.14em;
    height: 1.14em;
}



.pfp-st-available {

    background: linear-gradient(165deg, #ecfdf5 0%, #d1fae5 100%) !important;

    border-color: #10b981 !important;

}

.pfp-st-available .pfp-num { color: var(--pfp-num-available); }

.pfp-st-available .pfp-cap { color: #059669; }
.pfp-st-available .pfp-cap-row { background: rgba(5, 150, 105, 0.12); box-shadow: inset 0 0 0 1px rgba(5, 150, 105, 0.15); }



.pfp-st-reserved {

    background: linear-gradient(165deg, #fffbeb 0%, #fef3c7 100%) !important;

    border-color: #f59e0b !important;

}

.pfp-st-reserved .pfp-num { color: var(--pfp-num-reserved); transition: color 0.4s ease; }

.pfp-st-reserved .pfp-cap { color: #d97706; transition: color 0.4s ease; }
.pfp-st-reserved .pfp-cap-row { background: rgba(217, 119, 6, 0.12); box-shadow: inset 0 0 0 1px rgba(217, 119, 6, 0.14); }

.pfp-st-reserved-soon {

    background: linear-gradient(165deg, #fffbeb 0%, #fde68a 100%) !important;

    border-color: #f59e0b !important;

    animation: pfp-reserved-soon-pulse 2.4s ease-in-out infinite;

}

.pfp-st-reserved-soon .pfp-num { color: #b45309; transition: color 0.4s ease; }

.pfp-st-reserved-soon .pfp-cap { color: #d97706; transition: color 0.4s ease; }
.pfp-st-reserved-soon .pfp-cap-row { background: rgba(217, 119, 6, 0.1); box-shadow: inset 0 0 0 1px rgba(217, 119, 6, 0.12); }

@keyframes pfp-reserved-soon-pulse {

    0%, 100% { box-shadow: 0 4px 14px rgba(245, 158, 11, 0.22); }

    50% { box-shadow: 0 4px 22px rgba(245, 158, 11, 0.52); }

}



.pfp-st-occupied {

    background: linear-gradient(165deg, #fef2f2 0%, #fee2e2 100%) !important;

    border-color: #ef4444 !important;

}

.pfp-st-occupied .pfp-num { color: var(--pfp-num-occupied); }

.pfp-st-occupied .pfp-cap { color: #dc2626; }
.pfp-st-occupied .pfp-cap-row { background: rgba(220, 38, 38, 0.1); box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.12); }



.pfp-st-soon {

    background: linear-gradient(165deg, #eef2ff 0%, #e0e7ff 100%) !important;

    border-color: #6366f1 !important;

    animation: pfp-soon-pulse 2.2s ease-in-out infinite;

}

.pfp-st-soon .pfp-num { color: var(--pfp-num-soon); transition: color 0.4s ease; }

.pfp-st-soon .pfp-cap { color: #4f46e5; transition: color 0.4s ease; }
.pfp-st-soon .pfp-cap-row { background: rgba(79, 70, 229, 0.1); box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.12); }

@keyframes pfp-soon-pulse {

    0%, 100% { box-shadow: 0 4px 14px rgba(99, 102, 241, 0.22); }

    50% { box-shadow: 0 4px 22px rgba(99, 102, 241, 0.52); }

}

.pfp-st-available,
.pfp-st-reserved,
.pfp-st-occupied,
.pfp-st-off {
    transition: background 0.45s ease, border-color 0.45s ease, box-shadow 0.32s ease, opacity 0.35s ease;
}

.pfp-st-available .pfp-num,
.pfp-st-available .pfp-cap,
.pfp-st-reserved .pfp-num,
.pfp-st-reserved .pfp-cap,
.pfp-st-occupied .pfp-num,
.pfp-st-occupied .pfp-cap,
.pfp-st-off .pfp-num,
.pfp-st-off .pfp-cap {
    transition: color 0.4s ease;
}

.pfp-table.pfp-st-changed {
    animation: pfp-status-flash 0.7s ease;
}

@keyframes pfp-status-flash {

    0% { filter: brightness(1.28); transform: scale(1.04); }

    100% { filter: brightness(1); transform: scale(1); }

}



.pfp-st-off {

    background: linear-gradient(165deg, #f8fafc 0%, #f1f5f9 100%) !important;

    border-color: #94a3b8 !important;

    opacity: 0.92;

}

.pfp-st-off .pfp-num { color: var(--pfp-num-off); }

.pfp-st-off .pfp-cap { color: #94a3b8; }
.pfp-st-off .pfp-cap-row { background: rgba(148, 163, 184, 0.12); box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.14); }

.pfp-table.pfp-st-off[data-capacity-mismatch="1"] {
    border-style: dashed !important;
    border-color: #fcd34d !important;
    box-shadow: 0 2px 10px rgba(252, 211, 77, 0.18) !important;
}



.pfp-empty,

.pfp-canvas-empty,

.pfp-error {

    padding: 20px 16px;

    margin: 0;

    color: #64748b;

    font-size: clamp(0.82rem, 2.5vw, 0.9rem);

    text-align: center;

    line-height: 1.45;

}



.pfp-slot-context {
    margin: 0 0 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(212, 175, 55, 0.08) 100%);
    border: 1px solid rgba(16, 185, 129, 0.28);
    font-size: clamp(0.82rem, 2.2vw, 0.92rem);
    color: #334155;
    line-height: 1.45;
    text-align: center;
}

.pfp-slot-context i {
    color: #059669;
    margin-right: 4px;
}

.pfp-error { color: #b91c1c; }



.pfp-updated {

    margin: 0;

    padding: 8px 12px 12px;

    font-size: 0.72rem;

    color: #94a3b8;

    text-align: right;

}

.pfp-wrap--compact .pfp-updated {
    display: none !important;
}

#dine-in-mesa-block #dine-in-help,
#reservation-mesa-row #reservation-mesa-hint {
    margin-top: 8px;
    line-height: 1.4;
}

.reservas-mesa-group {
    min-width: 0;
    max-width: 100%;
    overflow-x: clip;
    box-sizing: border-box;
}

#manual-mesa-catalog-block {
    min-width: 0;
    max-width: 100%;
    overflow-x: clip;
    box-sizing: border-box;
}

#reservation-mesa-row #reservation-floor-plan-wrap {
    margin-bottom: 12px;
}

#manual-mesa-catalog-block #manual-floor-plan-wrap {
    margin-bottom: 12px;
}



@media (max-width: 768px) {

    .pfp-wrap { margin: 8px 0 12px; }

    .pfp-legend {
        padding: 8px 12px 6px;
        gap: var(--pfp-legend-gap);
    }

    .pfp-floor-tab { min-height: 44px; padding: 10px 16px; }

}



@media (max-width: 480px) {

    .pfp-shell { border-radius: 12px; }

    .pfp-canvas-wrap { padding: 8px 8px 4px; }

    /* Banda superior: leyenda compacta + zonas destacadas */
    .pfp-legend {
        padding: 6px 10px 2px;
        gap: 3px 5px;
        border-bottom: none;
    }

    .pfp-leg {
        font-size: clamp(0.54rem, 2vw, 0.6rem);
        font-weight: 600;
        padding: 2px 6px;
        line-height: 1.12;
        opacity: 0.94;
    }

    .pfp-wrap,
    .pfp-shell,
    #pedidos-floor-plan-wrap,
    #reservation-floor-plan-wrap,
    #emp-floor-plan-wrap,
    #manual-floor-plan-wrap {
        max-width: 100%;
        min-width: 0;
        overflow-x: clip;
        box-sizing: border-box;
    }

    .pfp-floor-tabs {
        padding: 6px 10px 10px;
        gap: 6px 8px;
    }

    .pfp-floor-tab {
        min-height: 42px;
        font-size: clamp(0.64rem, 2.5vw, 0.74rem);
        border-radius: 10px;
    }

}



@media (prefers-reduced-motion: reduce) {

    .pfp-table, .pfp-floor-tab { transition: none; }

    .pfp-floor-tab:active { transform: none; }

    .pfp-floor-tab.active,
    .pfp-canvas-wrap.pfp-zone-enter { animation: none; }

    .pfp-st-soon { animation: none; }

    .pfp-st-reserved-soon { animation: none; }

    .pfp-table.pfp-st-changed { animation: none; }

}



/* pedidos.php — bloque «Pedir en mesa» con plano premium */
.pedidos-dine-in-group {
    min-width: 0;
    max-width: 100%;
    overflow-x: clip;
    box-sizing: border-box;
}

/* ── Plano activo: select oculto; tarjeta «Mesa seleccionada» + Abandonar mesa ── */
.msab-mesa-select--plan-mode,
#reservation-mesa-row #reservation-table-name.msab-mesa-select--plan-mode,
#manual-mesa-catalog-block #manual-table-select.msab-mesa-select--plan-mode,
#emp-mesa-catalog-block #emp-table-name.msab-mesa-select--plan-mode {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.msab-mesa-section-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 700;
    color: #1e293b;
    font-size: 0.95rem;
}

.msab-mesa-selected-card,
.pedidos-mesa-selected-card {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 2px solid #c7d2fe;
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
    box-shadow: 0 4px 16px rgba(30, 61, 115, 0.08);
}

.msab-mesa-selected-card.is-visible,
.pedidos-mesa-selected-card.is-visible {
    display: block !important;
}

.msab-mesa-selected-card__head,
.pedidos-mesa-selected-card__head {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 8px;
}

.msab-mesa-selected-card__title,
.pedidos-mesa-selected-card__title {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #1e3d73;
}

.msab-mesa-selected-card__subtitle,
.pedidos-mesa-selected-card__subtitle {
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748b;
}

.msab-mesa-selected-card__value,
.pedidos-mesa-selected-card__value {
    font-size: 1.15rem;
    font-weight: 700;
    color: #475569;
    line-height: 1.35;
    min-height: 1.4em;
}

.msab-mesa-selected-card__value.is-set,
.pedidos-mesa-selected-card__value.is-set {
    color: #047857;
}

.msab-mesa-selected-card__clear,
.pedidos-mesa-selected-card__clear {
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #1e3d73;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
}

.msab-mesa-selected-card__clear:hover,
.pedidos-mesa-selected-card__clear:hover {
    border-color: #1e3d73;
    background: #f8fafc;
}

#reservation-mesa-row #reservation-table-name.reservas-mesa-select--fallback {
    margin-top: 4px;
    font-size: 0.88rem;
    border-color: #e2e8f0;
    background: #f8fafc;
}

#reservation-mesa-row #reservation-table-name.reservas-mesa-select--fallback:focus {
    border-color: #D4AF37;
    background: #fff;
}

.reservation-mesa-loading {
    display: none;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    color: #1e3d73;
    font-size: 0.86em;
}

#reservation-mesa-row .reservation-mesa-loading i {
    color: #0369a1;
}

.pfp-wrap--pedidos {
    margin-bottom: 12px;
}

#dine-in-mesa-block #pedidos-floor-plan-wrap {
    margin-bottom: 12px;
}

#dine-in-mesa-block #dine_in_mesa.pedidos-mesa-select--fallback {
    margin-top: 4px;
    font-size: 0.88rem;
    border-color: #e2e8f0;
    background: #f8fafc;
}

#dine-in-mesa-block #dine_in_mesa.pedidos-mesa-select--fallback:focus {
    border-color: #D4AF37;
    background: #fff;
}

/* Pedidos: plano activo — select nativo oculto; resumen «Pedir mesa / Mesa seleccionada» */
#dine-in-mesa-block #dine_in_mesa.pedidos-mesa-select--plan-mode {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.pedidos-mesa-section-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 700;
    color: #1e293b;
    font-size: 0.95rem;
}

.pedidos-mesa-selected-card {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 2px solid #c7d2fe;
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
    box-shadow: 0 4px 16px rgba(30, 61, 115, 0.08);
}

.pedidos-mesa-selected-card.is-visible {
    display: block !important;
}

.pedidos-mesa-selected-card__head {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 8px;
}

.pedidos-mesa-selected-card__title {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #1e3d73;
}

.pedidos-mesa-selected-card__subtitle {
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748b;
}

.pedidos-mesa-selected-card__value {
    font-size: 1.15rem;
    font-weight: 700;
    color: #475569;
    line-height: 1.35;
    min-height: 1.4em;
}

.pedidos-mesa-selected-card__value.is-set {
    color: #047857;
}

.pedidos-mesa-selected-card__clear {
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #1e3d73;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
}

.pedidos-mesa-selected-card__clear:hover {
    border-color: #1e3d73;
    background: #f8fafc;
}

#dine-in-mesa-block #dine_in_mesa.pedidos-mesa-native-select:not(.pedidos-mesa-select--plan-mode) {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    margin-top: 10px;
}

/* ── Pro: móvil horizontal — plano completo (contain fit + chrome compacto) ── */
.pfp-wrap--landscape-fit {
    margin-top: 6px;
    margin-bottom: 8px;
}

.pfp-wrap--landscape-fit .pfp-shell {
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.07);
}

.pfp-wrap--landscape-fit .pfp-legend {
    padding: 4px 8px 2px;
    gap: 2px 4px;
    border-bottom-width: 1px;
}

.pfp-wrap--landscape-fit .pfp-leg {
    font-size: clamp(0.5rem, 1.6vh, 0.58rem);
    font-weight: 600;
    padding: 1px 5px;
    line-height: 1.1;
}

.pfp-wrap--landscape-fit .pfp-floor-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 7.5rem), 1fr));
    gap: 4px 6px;
    padding: 2px 8px 6px;
    overflow: visible;
    border-bottom: 1px solid #e2e8f0;
}

.pfp-wrap--landscape-fit .pfp-floor-tab {
    flex: unset;
    width: 100%;
    min-width: 0;
    min-height: 32px;
    max-height: none;
    padding: 4px 6px;
    font-size: clamp(0.54rem, 1.6vh, 0.64rem);
    line-height: 1.12;
}

.pfp-wrap--landscape-fit .pfp-floor-tab-icon {
    font-size: 0.75em;
}

.pfp-wrap--landscape-fit .pfp-canvas-wrap {
    padding: 4px 6px 2px;
}

.pfp-wrap--landscape-fit .pfp-canvas-scroll,
.pfp-wrap--landscape-fit .pfp-canvas-viewport {
    overflow: hidden !important;
}

.pfp-wrap--landscape-fit .pfp-updated {
    display: none !important;
}

/* Portal empleados (tema oscuro) */
.emp-pfp-wrap.pfp-wrap--landscape-fit .pfp-legend {
    background: rgba(15, 23, 42, 0.55);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.emp-pfp-wrap.pfp-wrap--landscape-fit .pfp-floor-tabs {
    background: rgba(15, 23, 42, 0.35);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.emp-pfp-wrap.pfp-wrap--landscape-fit .pfp-floor-tab {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.14);
    color: #e2e8f0;
    min-height: 32px;
}

.emp-pfp-wrap.pfp-wrap--landscape-fit .pfp-floor-tab.active {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.28), rgba(34, 211, 238, 0.18));
    border-color: rgba(52, 211, 153, 0.55);
    color: #ecfdf5;
}

@media (orientation: landscape) and (max-height: 520px) {
    .pfp-wrap .pfp-canvas-scroll {
        overscroll-behavior: contain;
    }

    #pedidos-floor-plan-wrap,
    #reservation-floor-plan-wrap,
    #emp-floor-plan-wrap,
    #manual-floor-plan-wrap {
        max-width: 100%;
        min-width: 0;
    }
}
