/* ==================== KIOSKO MESERO STYLES ==================== */

/* Lock Screen */
.kiosko-lock-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #fff;
    padding: 2rem;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.lock-header {
    text-align: center;
    margin-bottom: 2rem;
}

.lock-header i {
    font-size: 3rem;
    color: #F54927;
    margin-bottom: 0.5rem;
    display: block;
}

.lock-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.lock-header p {
    font-size: 1.1rem;
    opacity: 0.7;
    margin: 0.25rem 0 0;
}

/* Code Display (dots) */
.code-display {
    display: flex;
    gap: 12px;
    margin-bottom: 1.5rem;
    min-height: 28px;
}

.code-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.15s ease;
}

.code-dot.filled {
    background: #F54927;
    border-color: #F54927;
    box-shadow: 0 0 10px rgba(245, 73, 39, 0.4);
}

/* Error message */
.lock-error {
    color: #ff6b6b;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 8px;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

/* Numeric Keypad */
.numeric-keypad {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 1.5rem;
}

.keypad-row {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.keypad-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 1.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.keypad-btn:active {
    background: rgba(245, 73, 39, 0.3);
    border-color: #F54927;
    transform: scale(0.95);
}

.keypad-btn.keypad-action {
    font-size: 1.3rem;
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
}

.keypad-btn.keypad-action:active {
    background: rgba(255, 255, 255, 0.15);
}

/* Primary Action Button */
.kiosko-btn-primary {
    width: 100%;
    max-width: 280px;
    padding: 1rem 2rem;
    border-radius: 12px;
    border: none;
    background: #F54927;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.kiosko-btn-primary:active {
    transform: scale(0.97);
    background: #d93d1f;
}

.kiosko-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ==================== KIOSKO APP LAYOUT ==================== */

.kiosko-app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    width: 100%;
    overflow: hidden;
    background: var(--bg-primary, #f8f9fa);
    color: var(--text-primary, #212529);
    touch-action: manipulation;
}

/* Kiosko Top Bar */
.kiosko-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: var(--bg-card, #fff);
    border-bottom: 1px solid var(--border-color, #dee2e6);
    min-height: 56px;
    flex-shrink: 0;
    z-index: 100;
}

.kiosko-top-bar .bar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.kiosko-top-bar .bar-center {
    font-size: 1.1rem;
    font-weight: 600;
}

.kiosko-top-bar .bar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.kiosko-top-bar .mesero-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.kiosko-top-bar .sucursal-name {
    font-size: 0.8rem;
    opacity: 0.6;
}

.kiosko-top-bar .clock-display {
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
    opacity: 0.7;
}

.kiosko-top-bar .connection-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.kiosko-top-bar .connection-dot.connected {
    background: #28a745;
    box-shadow: 0 0 6px rgba(40, 167, 69, 0.5);
}

.kiosko-top-bar .connection-dot.disconnected {
    background: #dc3545;
}

.kiosko-top-bar .btn-lock {
    background: none;
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 8px;
    padding: 0.4rem 0.75rem;
    color: var(--text-primary, #212529);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    -webkit-tap-highlight-color: transparent;
}

.kiosko-top-bar .btn-lock:active {
    background: var(--bg-hover, #e9ecef);
}

/* Kiosko Content Area */
.kiosko-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.kiosko-content > .kiosko-mesas-page {
    overflow: hidden;
}

/* Kiosko Bottom Nav */
.kiosko-bottom-nav {
    display: flex;
    align-items: stretch;
    background: var(--bg-card, #fff);
    border-top: 1px solid var(--border-color, #dee2e6);
    min-height: 60px;
    flex-shrink: 0;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
}

.kiosko-bottom-nav .nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0;
    text-decoration: none;
    color: var(--text-secondary, #6c757d);
    font-size: 0.72rem;
    font-weight: 500;
    position: relative;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.15s ease;
}

.kiosko-bottom-nav .nav-item i {
    font-size: 1.3rem;
    margin-bottom: 2px;
}

.kiosko-bottom-nav .nav-item.active {
    color: #F54927;
}

.kiosko-bottom-nav .nav-item .badge-count {
    position: absolute;
    top: 4px;
    right: calc(50% - 18px);
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: #dc3545;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ==================== INACTIVITY OVERLAY ==================== */

.kiosko-inactivity-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.kiosko-inactivity-overlay .countdown-number {
    font-size: 5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 1rem;
    color: #F54927;
}

.kiosko-inactivity-overlay .countdown-message {
    font-size: 1.2rem;
    opacity: 0.8;
    margin-bottom: 2rem;
    text-align: center;
}

.kiosko-inactivity-overlay .btn-continue {
    padding: 1rem 3rem;
    border-radius: 12px;
    border: 2px solid #fff;
    background: transparent;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.2s ease;
}

.kiosko-inactivity-overlay .btn-continue:active {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(0.97);
}

/* ==================== KIOSKO LAYOUT CANVAS ==================== */

.kiosko-mesas-page {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.kiosko-layout-container {
    width: 100%;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    position: relative;
    touch-action: pan-x pan-y;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kiosko-layout-canvas {
    position: relative;
}

.kiosko-layout-canvas .layout-area {
    position: absolute;
    border-radius: 4px;
    overflow: visible;
}

.kiosko-layout-canvas .layout-area .area-label {
    position: absolute;
    top: 4px;
    left: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0.7;
    pointer-events: none;
}

.kiosko-layout-canvas .layout-mesa {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.kiosko-layout-canvas .layout-mesa:active {
    transform: scale(0.95);
}

.kiosko-layout-canvas .layout-mesa.mesa-assigned {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.kiosko-layout-canvas .layout-mesa.mesa-unassigned {
    opacity: 0.3;
    pointer-events: none;
    cursor: default;
}

/* Table shapes */
.kiosko-layout-canvas .layout-mesa.mesa-circular,
.kiosko-layout-canvas .layout-mesa.mesa-ovalada {
    border-radius: 50%;
}

.kiosko-layout-canvas .layout-mesa.mesa-cuadrada {
    border-radius: 4px;
}

.kiosko-layout-canvas .layout-mesa.mesa-rectangular {
    border-radius: 4px;
}

.kiosko-layout-canvas .layout-mesa.mesa-hexagonal {
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
}

/* Table states */
.kiosko-layout-canvas .layout-mesa.mesa-estado-disponible {
    background: var(--color-disponible, #28a745);
    border: 2px solid var(--mesa-border-color, #333);
}

.kiosko-layout-canvas .layout-mesa.mesa-estado-ocupada {
    background: var(--color-ocupada, #dc3545);
    border: 2px solid var(--mesa-border-color, #333);
}

.kiosko-layout-canvas .layout-mesa.mesa-estado-reservada {
    background: var(--color-reservada, #ffc107);
    border: 2px solid var(--mesa-border-color, #333);
}

.kiosko-layout-canvas .layout-mesa.mesa-estado-enservicio {
    background: var(--color-ocupada, #dc3545);
    border: 2px solid var(--mesa-border-color, #333);
}

.kiosko-layout-canvas .layout-mesa.mesa-estado-enlimpieza {
    background: #6c757d;
    border: 2px solid var(--mesa-border-color, #333);
}

.kiosko-layout-canvas .layout-mesa .mesa-numero {
    font-weight: 700;
    font-size: 0.85rem;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.kiosko-layout-canvas .layout-mesa .mesa-capacidad {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.8);
}

/* Decorative elements */
.kiosko-layout-canvas .layout-elemento {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.kiosko-layout-canvas .layout-elemento .elemento-icono {
    opacity: 0.7;
}

.kiosko-layout-canvas .layout-elemento .elemento-texto {
    opacity: 0.7;
}

.kiosko-layout-canvas .layout-elemento .elemento-imagen {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

/* Mesa popover */
.kiosko-mesa-popover {
    position: absolute;
    z-index: 200;
    background: var(--bg-card, #fff);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    padding: 1rem;
    min-width: 200px;
    animation: popoverIn 0.2s ease;
}

@keyframes popoverIn {
    from { opacity: 0; transform: translateY(8px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.kiosko-mesa-popover .popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color, #dee2e6);
}

.kiosko-mesa-popover .popover-header h6 {
    margin: 0;
    font-weight: 700;
}

.kiosko-mesa-popover .popover-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.kiosko-mesa-popover .popover-actions .action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border-color, #dee2e6);
    background: var(--bg-primary, #f8f9fa);
    color: var(--text-primary, #212529);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease;
}

.kiosko-mesa-popover .popover-actions .action-btn:active {
    background: var(--bg-hover, #e9ecef);
}

.kiosko-mesa-popover .popover-actions .action-btn.primary {
    background: #F54927;
    color: #fff;
    border-color: #F54927;
}

.kiosko-mesa-popover .popover-actions .action-btn.primary:active {
    background: #d93d1f;
}

/* ==================== KIOSKO LAYOUT (100dvh) ==================== */

.kiosko-mesero-layout {
    height: 100vh;
    height: 100dvh;
    width: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body:has(.kiosko-mesero-layout) {
    overflow: hidden;
    margin: 0;
    padding: 0;
}

/* ==================== TOUCH FRIENDLY OVERRIDES ==================== */

.kiosko-app .btn {
    min-height: 48px;
    font-size: 0.95rem;
}

.kiosko-app .form-control,
.kiosko-app .form-select {
    min-height: 48px;
    font-size: 1rem;
}

/* Kiosko loading state */
.kiosko-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 1rem;
    color: var(--text-secondary, #6c757d);
}

.kiosko-loading .spinner-border {
    width: 3rem;
    height: 3rem;
}
