/* Variables CSS para Crear Mesa */
:root {
    --crear-mesa-bg: #f8f9fa;
    --card-bg: #ffffff;
    --text-primary: #0056A4;
    --text-secondary: #6c757d;
    --border-color: #e0e0e0;
    --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.1);
    --primary-color: #0056A4;
    --success-color: #28a745;
    --success-dark: #1e7e34;
    --success-light: #d4edda;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --accent-color: #e3f2fd;
    --hover-color: #f8f9fa;
    --bg-color: #ffffff;
    --text-color: #0056A4;
    --text-muted: #6c757d;
    --border-radius: 8px;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Tema oscuro */
[data-theme="dark"] .crear-mesa-header {
    background: linear-gradient(135deg, #0056A4 0%, #003E78 45%, #0f172a 100%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 28px rgba(0, 86, 164, 0.45), 0 2px 8px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .crear-mesa-header .mesero-info {
    color: #ffffff !important;
}

[data-theme="dark"] .crear-mesa-container .crear-mesa-header .crear-mesa-title {
    color: #f8fafc !important;
}

/* Color del atrás: usar variable global (--app-header-title-color cambia en app.css con el tema) */

[data-theme="dark"] {
    --crear-mesa-bg: #1a1a1a;
    --card-bg: #333333;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --border-color: #555555;
    --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.3);
    --primary-color: #4a90e2;
    --success-color: #28a745;
    --success-dark: #1e7e34;
    --success-light: #155724;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --accent-color: #2c3e50;
    --hover-color: #2d2d2d;
    --bg-color: #333333;
    --text-color: #ffffff;
    --text-muted: #cccccc;
    --border-radius: 8px;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.4);
}

/* Contenedor principal - altura fija 100vh para que el footer quede siempre visible */
.crear-mesa-container {
    width: 100vw;
    max-width: 100%;
    min-height: 100vh;
    background: var(--crear-mesa-bg);
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Header a todo ancho — mismo estándar global (--app-header-*) */
.crear-mesa-header {
    flex-shrink: 0;
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding-left: var(--app-header-pad-x);
    padding-right: var(--app-header-pad-x);
    padding-top: var(--app-header-pad-top);
    padding-bottom: var(--app-header-pad-bottom);
    box-sizing: border-box;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: var(--app-header-row-gap);
    border-radius: 0;
    background: var(--app-header-surface-bg) !important;
    box-shadow: var(--app-header-surface-shadow) !important;
    border-bottom: var(--app-header-surface-border);
    min-height: calc(var(--app-header-title-size) * 1.25 + var(--app-header-pad-top) + var(--app-header-pad-bottom));
}

.crear-mesa-header .crear-mesa-title {
    color: var(--primary-color);
    text-shadow: none;
}

/* Botón atrás idéntico al de Settings (.back-button) — vidrio blanco sobre azul,
   pill 999px, padding asimétrico 0.5rem 0.55rem, font 1.5rem. */
.crear-mesa-header .btn-back {
    background: transparent;
    border: none;
    color: var(--primary-color);
    font-size: 1.5rem;
    padding: 0.5rem 0.55rem;
    margin-left: 0;
    border-radius: 999px;
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.crear-mesa-header .btn-back:hover {
    background: rgba(0, 86, 164, 0.08);
    transform: translateX(-1px) scale(1.05);
    box-shadow: none;
}

.crear-mesa-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

/* "Mesero: 01" — en móvil aparece inline tras el título con un separador "· ".
   En tablet/escritorio se empuja a la derecha con margin-left:auto y sin separador
   (espejo visual del bloque home-header-actions de Home). */
.crear-mesa-header .mesero-info {
    color: #3a4f66 !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.6rem !important;
    font-weight: 600;
    white-space: nowrap;
    text-shadow: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    line-height: 1.2;
}

.btn-back {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    margin-left: -0.25rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-back:hover {
    background: rgba(22, 22, 94, 0.1);
    transform: scale(1.1);
}

.crear-mesa-title-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    position: relative;
}

/* Título igual que Home (1.7rem / 800 / letter-spacing 0.02em) */
.crear-mesa-title {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.crear-mesa-container .crear-mesa-header .crear-mesa-title {
    color: var(--app-header-title-color) !important;
    text-shadow: none !important;
    font-size: var(--app-header-title-size) !important;
    font-weight: var(--app-header-title-weight);
    line-height: 1.25;
}

.crear-mesa-container .crear-mesa-header .btn-back {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    color: var(--app-header-title-color) !important;
    padding: 0.2rem 0.35rem 0.2rem 0 !important;
    min-width: 0 !important;
    width: auto !important;
    height: auto !important;
    font-size: 1.2rem !important;
    line-height: 1 !important;
    align-self: center !important;
}

.crear-mesa-container .crear-mesa-header .btn-back:hover {
    background: rgba(0, 0, 0, 0.05) !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
}

[data-theme="dark"] .crear-mesa-container .crear-mesa-header .btn-back:hover {
    background: rgba(255, 255, 255, 0.12) !important;
}

.mesero-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Content */
.crear-mesa-form {
    flex: 1;
    width: 100%;
    padding: 1rem;
    box-sizing: border-box;
}

.form-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
    width: 100%;
    box-sizing: border-box;
}

.section-title {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin: 0 0 1.5rem 0;
    font-weight: 600;
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--card-bg);
    color: var(--text-primary);
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(22, 22, 94, 0.1);
}

.form-input.error {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.form-input::placeholder {
    color: var(--text-secondary);
}

.error-message {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: block;
    font-weight: 500;
}

/* Footer fijo en la parte inferior de la ventana, centrado como el contenedor */
.crear-mesa-container .crear-mesa-footer {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: inherit;
    padding: 1rem;
    background: var(--crear-mesa-bg);
    border: none;
    border-top: none;
    box-shadow: none;
    z-index: 200;
    box-sizing: border-box;
}

/* Espacio inferior para que el contenido no quede tapado por el footer fijo */
.crear-mesa-container {
    padding-bottom: 100px;
}

.btn-crear-primary {
    width: 100%;
    padding: 1rem 1.25rem;
    background: #0a3a72;
    color: #ffffff !important;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    box-shadow: 0 4px 14px rgba(10, 58, 114, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.btn-crear-primary:hover:not(:disabled) {
    background: #0c488a;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(10, 58, 114, 0.26);
}

.btn-crear-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-crear-primary:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

/* Botones (mantener para compatibilidad con modal) */
.crear-mesa-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
    margin-top: 1rem;
}

.btn-cancelar, .btn-crear {
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
/*    text-transform: uppercase;*/
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn-cancelar {
    background: linear-gradient(135deg, var(--danger-color) 0%, #c82333 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.btn-cancelar:hover {
    background: linear-gradient(135deg, #c82333 0%, #a71e2a 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

.btn-cancelar:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(220, 53, 69, 0.3);
}

.btn-crear {
    background: linear-gradient(135deg, var(--success-color) 0%, #20c997 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-crear:hover:not(:disabled) {
    background: linear-gradient(135deg, #20c997 0%, #1e7e34 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.btn-crear:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(40, 167, 69, 0.3);
}

.btn-crear:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

/* Efectos de botones */
.btn-cancelar::before, .btn-crear::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-cancelar:hover::before, .btn-crear:hover::before {
    left: 100%;
}

/* Modal de Alerta */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--card-bg);
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 1.5rem 2rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--primary-color) 0%, #4a90e2 100%);
    color: white;
    border-radius: 15px 15px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-body {
    padding: 2rem;
}

.modal-body p {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.5;
}

.alert-details {
    background: rgba(22, 22, 94, 0.05);
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    margin-top: 1rem;
}

.alert-details p {
    margin: 0 0 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.alert-details p:last-child {
    margin-bottom: 0;
}

.alert-details strong {
    color: var(--text-primary);
    font-weight: 600;
}

.modal-footer {
    padding: 1rem 2rem 2rem;
    text-align: center;
}

.btn-ok {
    background: linear-gradient(135deg, var(--primary-color) 0%, #4a90e2 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(22, 22, 94, 0.3);
}

.btn-ok:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(22, 22, 94, 0.4);
}

.btn-ok:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(22, 22, 94, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .crear-mesa-header {
        padding-left: var(--app-header-pad-x-page);
        padding-right: var(--app-header-pad-x-page);
        padding-top: var(--app-header-pad-top);
        padding-bottom: var(--app-header-pad-bottom);
    }

    .btn-back {
        font-size: 1.3rem;
        margin-left: -0.25rem;
    }

    .crear-mesa-title {
        font-size: 1.1rem;
    }

    .mesero-info {
        font-size: 0.85rem;
    }
    
    .crear-mesa-form {
        padding: 0.75rem;
    }
    
    .form-section {
        padding: 1rem;
    }
    
    .crear-mesa-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .btn-cancelar, .btn-crear {
      /*  width: 100%;*/
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
    }
}

@media (max-width: 480px) {
    /* Móvil estrecho — hereda el header de ≤768 (padding 0.75rem, título 1.3rem como Home).
       "· Mesero: …" se trunca con ellipsis si no cabe. */
    .crear-mesa-header-left {
        justify-content: flex-start;
    }

    .btn-back {
        font-size: 1.2rem;
        min-width: 32px;
        height: 32px;
        margin-left: -0.25rem;
    }

    .crear-mesa-form {
        padding: 0.5rem;
    }

    .crear-mesa-title {
        font-size: 1rem;
    }

    .mesero-info {
        font-size: 0.6rem !important;
        letter-spacing: 0.06em !important;
        margin-top: 0.05rem;
    }
    
    .form-section {
        padding: 0.75rem;
    }
    
    .section-title {
        font-size: 1.1rem;
    }
    
    .form-input {
        padding: 0.625rem 0.875rem;
        font-size: 0.9rem;
    }
    
    .btn-cancelar, .btn-crear {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
        min-width: 120px;
    }
}

/* Tablet Landscape - optimizar para tabletas horizontales */
@media (min-width: 769px) and (max-width: 1180px) and (orientation: landscape) {
    .crear-mesa-container {
        max-width: 750px;
        margin: 0 auto;
        padding: 0 1.5rem 100px 1.5rem;
    }

    .crear-mesa-container .crear-mesa-footer {
        max-width: 750px;
    }
    
    .crear-mesa-header {
        padding-top: var(--app-header-pad-top);
        padding-bottom: var(--app-header-pad-bottom);
        padding-left: var(--app-header-pad-x);
        padding-right: var(--app-header-pad-x);
        margin-bottom: 1.5rem;
    }

    .crear-mesa-title {
        font-size: 1.75rem;
    }

    .crear-mesa-form {
        padding: 1rem 1.5rem;
    }
    
    .form-section {
        padding: 1.25rem;
    }
    
    .section-title {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }
    
    .form-input, .form-select {
        height: 48px;
        font-size: 1.05rem;
    }
    
    .crear-mesa-buttons {
        gap: 1rem;
    }
    
    .btn-cancelar, .btn-crear {
        padding: 1rem 2rem;
        font-size: 1.05rem;
        height: 52px;
    }
    
    .modal-content {
        max-width: 500px;
    }
}

/* Estilos para escritorio */
@media (min-width: 769px) {
    .crear-mesa-container {
        max-width: 800px;
        margin: 0 auto;
        padding: 0 2rem 100px 2rem;
    }

    .crear-mesa-container .crear-mesa-footer {
        max-width: 800px;
    }
    
    .crear-mesa-header {
        padding-left: var(--app-header-pad-x);
        padding-right: var(--app-header-pad-x);
        padding-top: var(--app-header-pad-top);
        padding-bottom: var(--app-header-pad-bottom);
        margin-bottom: 2rem;
    }

    .crear-mesa-title {
        font-size: 2rem;
    }

    .mesero-info {
        font-size: 0.95rem;
    }
    
    .crear-mesa-form {
        padding: 0 2rem 2rem 2rem;
    }
    
    .form-section {
        padding: 2rem;
        border-radius: 16px;
        margin-bottom: 1.5rem;
    }
    
    .section-title {
        font-size: 1.4rem;
        margin-bottom: 2rem;
    }
    
    .form-group {
        margin-bottom: 2rem;
    }
    
    .form-group label {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    .form-input {
        padding: 1rem 1.25rem;
        font-size: 1.1rem;
        border-radius: 10px;
    }
    
    .crear-mesa-buttons {
        padding: 1.5rem;
        border-radius: 16px;
        margin-top: 1.5rem;
        gap: 1.5rem;
    }
    
    .btn-cancelar, .btn-crear {
        padding: 1.25rem 2.5rem;
        font-size: 1.1rem;
        min-width: 160px;
        border-radius: 10px;
    }
}

/* Estilos para pantallas muy grandes */
@media (min-width: 1200px) {
    .crear-mesa-container {
        max-width: 1400px;
    }

    .crear-mesa-container .crear-mesa-footer {
        max-width: 1400px;
    }
    
    .form-section {
        padding: 2.5rem;
    }
    
    .btn-cancelar, .btn-crear {
        padding: 1.5rem 3rem;
        font-size: 1.2rem;
        min-width: 180px;
    }
}

/* Estilos para búsqueda de clientes */
.cliente-search-container {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.search-input {
    flex: 1;
    padding-right: 3rem;
}

.btn-search-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1;
}

.btn-search-icon:hover:not(:disabled) {
    color: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
}

.btn-search-icon:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cliente-search-container {
    position: relative;
}

.cliente-search-container .form-input {
    flex: 1;
}

.btn-buscar {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    font-size: 1rem;
    min-width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-buscar:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-darker));
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-buscar:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn-buscar:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.clientes-lista {
    margin-top: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-color);
    max-height: 300px;
    overflow-y: auto;
    box-shadow: var(--shadow-sm);
}

.cliente-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cliente-item:last-child {
    border-bottom: none;
}

.cliente-item:hover {
    background-color: var(--hover-color);
}

.cliente-info {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.cliente-detalles {
    display: flex;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.cliente-detalles small {
    background: var(--accent-color);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    color: var(--text-color);
}

.cliente-seleccionado {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: #ffffff;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    border: 2px solid #28a745;
    position: relative;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.cliente-seleccionado::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.cliente-seleccionado:hover::before {
    left: 100%;
}

/* Estilos específicos para tema claro */
[data-theme="light"] .cliente-seleccionado {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    border: 2px solid #28a745;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .cliente-seleccionado::before {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

/* Estilos específicos para tema oscuro */
[data-theme="dark"] .cliente-seleccionado {
    background: linear-gradient(135deg, #28a745 0%, #155724 100%);
    border: 2px solid #28a745;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .cliente-seleccionado::before {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

[data-theme="dark"] .btn-back {
    color: var(--text-primary);
}

[data-theme="dark"] .btn-back:hover {
    background: rgba(74, 144, 226, 0.1);
}

.btn-limpiar {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    transition: background-color 0.2s ease;
}

.btn-limpiar:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Responsive para búsqueda de clientes */
@media (max-width: 768px) {
    .cliente-search-container {
        flex-direction: column;
        gap: 0.5rem;
    }

    .cliente-search-container .form-input {
        border-radius: var(--border-radius);
    }

    .btn-buscar {
        border-radius: var(--border-radius);
        width: 100%;
        padding: 0.75rem;
    }

    .clientes-lista {
        max-height: 200px;
    }

    .cliente-item {
        padding: 0.75rem;
    }

    .cliente-detalles {
        flex-direction: column;
        gap: 0.25rem;
    }
}

/* Botones incrementales para comensales */
.comensales-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 0.25rem;
    transition: all 0.3s ease;
}

.comensales-control:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(22, 22, 94, 0.1);
}

.btn-quantity {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.5rem;
    font-weight: 600;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(22, 22, 94, 0.2);
}

.btn-quantity:hover:not(:disabled) {
    background: #1a4d8c;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(22, 22, 94, 0.3);
}

.btn-quantity:active:not(:disabled) {
    transform: scale(0.95);
}

.btn-quantity.disabled,
.btn-quantity:disabled {
    background: var(--text-secondary);
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.comensales-input {
    flex: 1;
    text-align: center;
    border: none;
    background: transparent;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    padding: 0.5rem;
    outline: none;
    min-width: 60px;
}

.comensales-input.error {
    color: var(--danger-color);
}

/* Cliente seleccionado mejorado */
.cliente-seleccionado-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.check-icon {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
    flex-shrink: 0;
}

.cliente-seleccionado-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.cliente-seleccionado-info strong {
    font-size: 1rem;
    font-weight: 700;
}

.cliente-seleccionado-info span {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Spinner pequeño */
.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Input con teclado personalizado */
.input-with-keyboard {
    position: relative;
    width: 100%;
}

.keyboard-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
    pointer-events: none;
    opacity: 0.6;
}

.input-with-keyboard .form-input {
    padding-right: 3rem;
    cursor: pointer;
}

.input-with-keyboard .form-input.has-value {
    background: rgba(22, 22, 94, 0.05);
}

/* Estilos modo oscuro para inputs con teclado */
[data-theme="dark"] .input-with-keyboard .form-input.has-value {
    background: rgba(74, 144, 226, 0.1);
    border-color: #555555;
}

[data-theme="dark"] .keyboard-icon {
    opacity: 0.8;
    filter: brightness(1.2);
}

/* Teclado numérico */
.keyboard-overlay {
    align-items: flex-end;
    padding: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.keyboard-container {
    width: 100%;
    max-width: 500px;
    background: var(--card-bg);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    animation: slideUpKeyboard 0.3s ease-out;
    overflow: hidden;
}

@keyframes slideUpKeyboard {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.keyboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, #4a90e2 100%);
    color: white;
}

.keyboard-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.keyboard-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

.keyboard-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.keyboard-display {
    padding: 1.5rem;
    background: var(--crear-mesa-bg);
}

.keyboard-display-input {
    width: 100%;
    padding: 1.25rem;
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    border: 3px solid var(--primary-color);
    border-radius: 12px;
    background: var(--card-bg);
    color: var(--text-primary);
    box-shadow: 0 2px 10px rgba(22, 22, 94, 0.2);
    outline: none;
}

.keyboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    padding: 1.5rem;
    background: var(--card-bg);
}

.keyboard-btn {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 70px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.keyboard-btn:active {
    transform: scale(0.95);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.keyboard-btn:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-color: var(--primary-color);
}

.keyboard-btn-clear {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: white;
    border-color: #ff9800;
}

.keyboard-btn-clear:hover {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
}

.keyboard-btn-backspace {
    color: var(--text-primary);
/*    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border-color: #c82333;*/
    font-size: 1.5rem;
}

.keyboard-btn-backspace:hover {
    background: linear-gradient(135deg, #c82333 0%, #a71e2a 100%);
}

.keyboard-footer {
    padding: 1rem 1.5rem 1.5rem;
    background: var(--card-bg);
}

.keyboard-btn-confirm {
    width: 100%;
    padding: 1.25rem;
    background: linear-gradient(135deg, var(--success-color) 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.keyboard-btn-confirm:active {
    transform: scale(0.98);
    box-shadow: 0 2px 10px rgba(40, 167, 69, 0.3);
}

.keyboard-btn-confirm:hover {
    background: linear-gradient(135deg, #20c997 0%, #1e7e34 100%);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

/* Responsive para teclado */
@media (max-width: 480px) {
    .keyboard-container {
        border-radius: 15px 15px 0 0;
    }

    .keyboard-display {
        padding: 1rem;
    }

    .keyboard-display-input {
        font-size: 1rem;
        padding: 1rem;
    }

    .keyboard-grid {
        gap: 0.5rem;
        padding: 1rem;
    }

    .keyboard-btn {
        padding: 1.25rem;
        font-size: 1.5rem;
        min-height: 60px;
    }

    .keyboard-header {
        padding: 0.875rem 1rem;
    }

    .keyboard-header h3 {
        font-size: 1rem;
    }

    .keyboard-footer {
        padding: 0.875rem 1rem 1rem;
    }

    .keyboard-btn-confirm {
        padding: 1rem;
        font-size: 1.1rem;
    }
}

/* Para pantallas grandes, centrar el teclado */
@media (min-width: 769px) {
    .keyboard-overlay {
        align-items: center;
        padding: 2rem;
    }

    .keyboard-container {
        border-radius: 20px;
        max-width: 400px;
        margin: 0 auto;
    }
}

/* Estilos para modo oscuro del teclado */
[data-theme="dark"] .keyboard-overlay {
    background: rgba(0, 0, 0, 0.85);
}

[data-theme="dark"] .keyboard-container {
    background: #2d2d2d;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .keyboard-display {
    background: #1a1a1a;
}

[data-theme="dark"] .keyboard-display-input {
    background: #333333;
    border-color: #4a90e2;
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(74, 144, 226, 0.3);
}

[data-theme="dark"] .keyboard-grid {
    background: #2d2d2d;
}

[data-theme="dark"] .keyboard-btn {
    background: linear-gradient(135deg, #404040 0%, #333333 100%);
    border-color: #555555;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .keyboard-btn:hover {
    background: linear-gradient(135deg, #4a4a4a 0%, #404040 100%);
    border-color: #4a90e2;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

[data-theme="dark"] .keyboard-btn:active {
    background: linear-gradient(135deg, #333333 0%, #2d2d2d 100%);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .keyboard-btn-clear {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: #ffffff;
    border-color: #ff9800;
}

[data-theme="dark"] .keyboard-btn-clear:hover {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.4);
}

[data-theme="dark"] .keyboard-btn-backspace {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: #ffffff;
    border-color: #c82333;
}

[data-theme="dark"] .keyboard-btn-backspace:hover {
    background: linear-gradient(135deg, #c82333 0%, #a71e2a 100%);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

[data-theme="dark"] .keyboard-footer {
    background: #2d2d2d;
}

[data-theme="dark"] .input-with-keyboard .form-input.has-value {
    background: rgba(74, 144, 226, 0.1);
}

[data-theme="dark"] .keyboard-icon {
    opacity: 0.8;
}

