/* ===== AIL LAB - DISEÑO MODERNO LABORATORIO ===== */

/* Variables CSS para consistencia */
:root {
    /* Colores principales - Laboratorio */
    --lab-white: #FFFFFF;
    --lab-gray-50: #F8FAFC;
    --lab-gray-100: #F1F5F9;
    --lab-gray-200: #E2E8F0;
    --lab-gray-300: #CBD5E1;
    --lab-gray-400: #94A3B8;
    --lab-gray-500: #64748B;
    --lab-gray-600: #475569;
    --lab-gray-700: #334155;
    --lab-gray-800: #1E293B;
    --lab-gray-900: #0F172A;
    
    /* Colores minimalistas - Solo negro, blanco y grises */
    --lab-black: #000000;
    --lab-white-pure: #FFFFFF;
    --lab-blue: #2c5aa0;
    --lab-blue-dark: #1e3d72;
    --lab-purple: #6d5bd0;
    --lab-red: #dc2626;
    --lab-red-dark: #991b1b;
    --lab-green: #15803d;
    --lab-orange: #ea580c;
    
    /* Sombras - Laboratorio */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    
    /* Bordes rectos - esquinas de 90 grados */
    --radius-sm: 0;
    --radius-md: 0;
    --radius-lg: 0;
    --radius-xl: 0;
    --radius-2xl: 0;
    
    /* Transiciones */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Tipografía */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

    /* Mantener render consistente entre navegadores */
    color-scheme: light;
}

/* Reset y base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    /* scroll-behavior: smooth; — no soportado en Safari, se maneja via JS */
}

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--lab-gray-800);
    background: var(--lab-gray-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Safe-area por notch / barras del sistema en iPhone/iPad */
body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* Contenedor principal */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ===== HEADER MODERNO ===== */
.header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-sm);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: calc(1rem + env(safe-area-inset-top));
    padding-bottom: 1rem;
    padding-left: calc(1.5rem + env(safe-area-inset-left));
    padding-right: calc(1.5rem + env(safe-area-inset-right));
}

/* iOS / touch: notch + contenido detrás status bar suele pegarse si no hay padding superior */
.is-ios .header .container {
    padding-top: calc(1rem + env(safe-area-inset-top));
}

.logo h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--lab-black);
    letter-spacing: -0.025em;
}

.logo .brand-logo {
    display: block;
    height: 48px;
    width: auto;
    object-fit: contain;
}

.nav ul {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    list-style: none;
    gap: 2rem;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
}

/* Fallback gap para Safari < 14.1 */
.nav ul li + li {
    margin-left: 2rem;
}

.nav a {
    color: #f8fafc;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: var(--transition-fast);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
}

.nav a:hover {
    color: #ffffff;
    background: rgba(148, 163, 184, 0.2);
}

/* Usuario section moderna */
.user-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.125rem;
}

.user-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: #f8fafc;
}

.user-role {
    font-size: 0.75rem;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}



/* Botones modernos */
.btn-modern {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-primary {
    background: transparent;
    color: #000000;
    border-color: #000000;
}

.btn-primary:hover {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
}

.btn-secondary {
    background: transparent;
    color: #000000;
    border-color: #000000;
}

.btn-secondary:hover {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
}

.btn-success {
    background: transparent;
    color: #000000;
    border-color: #000000;
}

.btn-success:hover {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
}

.btn-danger {
    background: transparent;
    color: #000000;
    border-color: #000000;
}

.btn-danger:hover {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
}

/* ===== HERO SECTION LABORATORIO ===== */
.hero {
    background: linear-gradient(135deg, var(--lab-white) 0%, var(--lab-gray-50) 100%);
    padding: 8rem 0 4rem;
    margin-top: 4rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 25% 25%, var(--lab-blue) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, var(--lab-purple) 0%, transparent 50%);
    opacity: 0.03;
    z-index: 1;
}

.hero .container {
    position: relative;
    z-index: 2;
    text-align: center;
}

.hero h1,
.hero h2,
.hero .hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--lab-gray-900);
    margin-bottom: 1.5rem;
    letter-spacing: -0.025em;
    line-height: 1.1;
}

.hero-kicker {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--lab-gray-500);
    margin-bottom: 0.75rem;
}

.hero-lead {
    font-size: 1.25rem;
    color: var(--lab-gray-600);
    margin-bottom: 0;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.55;
}

.hero p:not(.hero-kicker):not(.hero-lead) {
    font-size: 1.25rem;
    color: var(--lab-gray-600);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== SECCIONES MODERNAS ===== */
.section-modern {
    padding: 5rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--lab-gray-900);
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
}

.section-title p {
    font-size: 1.125rem;
    color: var(--lab-gray-600);
    max-width: 600px;
    margin: 0 auto;
}

/* ===== CARDS MODERNAS ===== */
.card-modern {
    background: var(--lab-white);
    border: 1px solid var(--lab-gray-200);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--lab-blue), var(--lab-purple));
    opacity: 0;
    transition: var(--transition-normal);
}

.card-modern:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--lab-gray-300);
}

.card-modern:hover::before {
    opacity: 1;
}

/* ===== GRID LAYOUTS ===== */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .user-section {
        width: 100%;
        justify-content: center;
    }
    
    .hero h1,
    .hero h2,
    .hero .hero-title {
        font-size: 2.5rem;
    }
    
    .hero p {
        font-size: 1.125rem;
    }
    
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .section-title h2 {
        font-size: 2rem;
    }
    
    .card-modern {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    .hero {
        padding: 6rem 0 3rem;
    }
    
    .hero h1,
    .hero h2,
    .hero .hero-title {
        font-size: 2rem;
    }
    
    .section-modern {
        padding: 3rem 0;
    }
    
    .section-title h2 {
        font-size: 1.75rem;
    }
    
    .card-modern {
        padding: 1rem;
    }
}

/* ===== UTILIDADES ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }

.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }

.shadow { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

/* ===== ANIMACIONES ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeIn {
    animation: fadeIn 0.5s ease-out;
}

.animate-slideUp {
    animation: slideUp 0.5s ease-out;
}

.animate-slideDown {
    animation: slideDown 0.5s ease-out;
}

/* ===== SISTEMA DE PEDIDOS MODERNO ===== */

/* Botones de tipos de cristal - Diseño laboratorio */
.crystal-type-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.btn-crystal-type {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    border: 2px solid transparent;
    border-radius: var(--radius-xl);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.btn-crystal-type::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: var(--transition-slow);
}

.btn-crystal-type:hover::before {
    left: 100%;
}

.btn-monofocal {
    background: transparent;
    color: #000000;
    border-color: #000000;
}

.btn-monofocal:hover {
    background: #000000;
    color: #ffffff;
}

.btn-multifocal {
    background: transparent;
    color: #000000;
    border-color: #000000;
}

.btn-multifocal:hover {
    background: #000000;
    color: #ffffff;
}

.btn-bifocal {
    background: transparent;
    color: #000000;
    border-color: #000000;
}

.btn-bifocal:hover {
    background: #000000;
    color: #ffffff;
}

/* Modal moderno */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.modal-content {
    position: relative;
    background: var(--lab-white);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl);
    max-width: 1000px;
    width: 95%;
    max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid var(--lab-gray-200);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem 0.75rem;
    background: linear-gradient(135deg, var(--lab-gray-50), var(--lab-white));
    border-bottom: 1px solid var(--lab-gray-200);
    position: relative;
}

.modal-header h3 {
    color: var(--lab-gray-900);
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.modal-header.editing {
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    border-bottom-color: #F59E0B;
}

.modal-header.editing h3 {
    color: #92400E;
}

.btn-close {
    background: var(--lab-gray-100);
    color: var(--lab-gray-600);
    border: 1px solid var(--lab-gray-300);
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    cursor: pointer;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.btn-close:hover {
    background: var(--lab-red);
    color: var(--lab-white);
    border-color: var(--lab-red);
    transform: scale(1.1);
}

.modal-body {
    padding: 1.25rem 2rem;
    background: var(--lab-white);
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

.is-ios .modal-footer {
    padding-bottom: calc(2rem + env(safe-area-inset-bottom));
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem 2.5rem 2rem;
    background: var(--lab-gray-50);
    border-top: 1px solid var(--lab-gray-200);
}

/* Formularios modernos */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--lab-gray-800);
    font-size: 0.875rem;
    letter-spacing: 0.025em;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--lab-gray-300);
    border-radius: var(--radius-md);
    font-size: 1rem;
    background: var(--lab-white);
    transition: var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--lab-black);
    background: var(--lab-white);
}

.form-group input:hover,
.form-group select:hover {
    border-color: var(--lab-gray-400);
}

.crystal-stock-hint {
    margin: 0.35rem 0 0;
    font-size: 0.8125rem;
    color: var(--lab-gray-600, #5a6570);
    line-height: 1.35;
}

.ail-ui-upgrade-notice {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    line-height: 1.45;
    color: #0c4a6e;
    background: #e0f2fe;
    border: 1px solid #7dd3fc;
    border-radius: var(--radius-md, 8px);
}

.ail-ui-upgrade-notice .ail-ui-build {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #0369a1;
}

.fotocromatico-variant-row .fotocromatico-variant-group {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--lab-gray-200);
    border-radius: var(--radius-md);
    background: var(--lab-gray-50, #f8fafc);
}

.fotocromatico-variant-label {
    display: block;
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--lab-gray-700);
    margin-bottom: 0.5rem;
}

.fotocromatico-tone-options {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.fotocromatico-tone-option {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    font-size: 0.9375rem;
    color: var(--lab-gray-800);
}

.fotocromatico-tone-option input {
    width: auto;
    margin: 0;
}

/* Leyenda de advertencia Corte Slim */
.slim-warning-row {
    width: 100%;
}

.slim-warning-legend {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #f59e0b;
    border-left: 4px solid #d97706;
    border-radius: 10px;
    padding: 0.85rem 1.1rem;
    width: 100%;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.12);
    animation: slimWarnFadeIn 0.35s ease-out;
}

.slim-warning-dismiss {
    flex-shrink: 0;
    margin-left: auto;
    border: 1px solid #d97706;
    background: #fff7ed;
    color: #92400e;
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
}

.slim-warning-dismiss:hover {
    background: #fed7aa;
}

@keyframes slimWarnFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.slim-warning-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    margin-top: 1px;
    line-height: 1;
}

.slim-warning-legend p {
    margin: 0;
    font-size: 0.84rem;
    color: #92400e;
    line-height: 1.5;
    font-weight: 500;
}

/* Toggle checkbox Corte Slim (multifocal) */
.slim-cut-group {
    margin-bottom: 0.5rem !important;
}

.slim-cut-toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--lab-gray-800);
    padding: 0.65rem 1rem;
    border: 1px solid var(--lab-gray-300);
    border-radius: var(--radius-md);
    background: var(--lab-gray-50);
    transition: var(--transition-fast);
    user-select: none;
}

.slim-cut-toggle-label:hover {
    border-color: #d97706;
    background: #fffbeb;
}

.slim-cut-toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #d97706;
}

.design-choice-options {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    grid-template-columns: none;
    gap: 0.55rem;
    margin-top: 0.4rem;
    overflow-x: auto;
    padding-bottom: 0.15rem;
}

.design-choice-option {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.65rem 0.8rem;
    border: 1.5px solid var(--lab-gray-300);
    border-radius: 10px;
    background: var(--lab-white);
    color: var(--lab-gray-700);
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s;
}

.design-choice-option:hover {
    border-color: var(--lab-blue-dark, #1e3a5c);
    background: #f8fafc;
}

.design-choice-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--lab-blue-dark, #1e3a5c);
    cursor: pointer;
}

.design-choice-option:has(input:checked) {
    border-color: var(--lab-blue-dark, #1e3a5c);
    background: #eff6ff;
    color: var(--lab-blue-dark, #1e3a5c);
    box-shadow: 0 0 0 3px rgba(30, 58, 92, 0.08);
}

.design-choice-option--slim {
    border-color: #f59e0b;
    background: #fffbeb;
    color: #92400e;
}

.design-choice-option--slim:hover,
.design-choice-option--slim:has(input:checked) {
    border-color: #d97706;
    background: #fef3c7;
    color: #92400e;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.12);
}

.design-choice-option--slim input[type="checkbox"] {
    accent-color: #d97706;
}

.design-choice-option.is-disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.design-choice-option.is-disabled input {
    cursor: not-allowed;
}

/* Selector de ojos moderno */
.radio-group {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    background: var(--lab-gray-50);
    padding: 0.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--lab-gray-200);
}

.radio-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.875rem 1.5rem;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    -webkit-transition: var(--transition-fast);
    transition: var(--transition-fast);
    background: var(--lab-white);
    font-weight: 500;
    color: var(--lab-gray-700);
}

.radio-option:hover {
    border-color: var(--lab-black);
    background: var(--lab-gray-100);
    color: var(--lab-black);
}

.radio-option input[type="radio"] {
    display: none;
}

/* Reemplaza :has() — se controla via JS con clase .selected */
.radio-option.selected {
    background: var(--lab-black);
    border-color: var(--lab-black);
    color: var(--lab-white);
}

/* Modalidad: par de cristales / cristal suelto (segmented) */
.eye-mode-group {
    margin-bottom: 0.5rem;
}

.eye-mode-group__label {
    display: block;
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--lab-gray-800);
    margin-bottom: 0.5rem;
}

.eye-mode-segmented {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 4px;
    margin-top: 0.35rem;
    background: linear-gradient(180deg, #e8edf5 0%, #dce4f0 100%);
    border: 1px solid var(--lab-gray-300);
    border-radius: 14px;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.75);
    overflow: hidden;
}

/* Pastilla que se desliza detrás del texto (estado en data-eye-mode + syncEyeModeSlider) */
.eye-mode-slider {
    position: absolute;
    z-index: 0;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: calc((100% - 8px) / 2);
    border-radius: 11px;
    background: #0f172a;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.22);
    pointer-events: none;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.eye-mode-segmented[data-eye-mode='single'] .eye-mode-slider {
    transform: translateX(100%);
}

.eye-mode-segmented.eye-mode--pair-only .eye-mode-slider {
    width: calc(100% - 8px);
    transform: translateX(0);
}

@media (prefers-reduced-motion: reduce) {
    .eye-mode-slider {
        transition-duration: 0.01ms;
    }
}

.eye-mode-segmented .radio-option.eye-mode-btn {
    position: relative;
    z-index: 1;
    flex: 1;
    margin: 0;
    padding: 0.7rem 0.85rem;
    border: none;
    border-radius: 11px;
    background: transparent;
    font-weight: 600;
    font-size: 0.9375rem;
    text-align: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.2s ease;
}

.eye-mode-segmented .radio-option.eye-mode-btn:hover:not(.selected) {
    background: rgba(255, 255, 255, 0.35);
    color: var(--lab-gray-900);
}

/* El “relleno” oscuro lo pinta .eye-mode-slider; las etiquetas solo cambian color de texto */

/* Solo par disponible (multifocal/bifocal): primera etiqueta label (no el span .eye-mode-slider) */
.eye-mode-segmented.eye-mode--pair-only label.eye-mode-btn:first-of-type {
    flex: 1 1 100%;
}

/* Formularios de ojos en paralelo */
.eyes-parallel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.eye-section {
    background: var(--lab-gray-50);
    padding: 2rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--lab-gray-200);
    position: relative;
    transition: var(--transition-normal);
}

.eye-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--lab-blue), var(--lab-blue-dark));
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.eye-section:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--lab-gray-300);
}

.eye-section h4 {
    color: var(--lab-gray-900);
    margin-bottom: 1.5rem;
    font-size: 1.125rem;
    text-align: center;
    font-weight: 600;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--lab-gray-200);
}

/* Formulario de un solo ojo centrado */
.single-eye-centered {
    grid-column: 1 / -1;
    max-width: 500px;
    margin: 0 auto;
    background: var(--lab-gray-50);
    border-radius: var(--radius-2xl);
    padding: 2.5rem;
    border: 1px solid var(--lab-gray-200);
    position: relative;
}

.single-eye-centered::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--lab-red), var(--lab-red-dark));
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
}

.single-eye-centered h4 {
    text-align: center;
    color: var(--lab-gray-900);
    margin-bottom: 2rem;
    font-size: 1.25rem;
    font-weight: 600;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--lab-gray-200);
}

/* Selectores de índice modernos */
.index-options {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    justify-content: center;
    padding: 1.5rem;
    background: var(--lab-gray-50);
    border-radius: var(--radius-xl);
    border: 1px solid var(--lab-gray-200);
}

.index-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    position: relative;
    transition: var(--transition-normal);
}

.index-option input[type="radio"] {
    display: none;
}

.index-circle {
    width: 4rem;
    height: 4rem;
    border-radius: 0;
    border: 2px solid var(--lab-gray-300);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--lab-gray-600);
    background: var(--lab-white);
    transition: var(--transition-normal);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.index-circle::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(14, 165, 233, 0.1), transparent);
    transform: rotate(45deg);
    transition: var(--transition-slow);
    opacity: 0;
}

.index-option:hover .index-circle {
    border-color: var(--lab-black);
    color: var(--lab-black);
}

.index-option:hover .index-circle::before {
    opacity: 1;
    transform: rotate(45deg) translate(50%, 50%);
}

.index-option input[type="radio"]:checked + .index-circle {
    border-color: var(--lab-black);
    background: var(--lab-black);
    color: var(--lab-white);
}

/* Tipo de cristal compartido */
.crystal-type-shared {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    padding: 1.5rem;
    border-radius: var(--radius-2xl);
    text-align: center;
    margin-top: 2rem;
    position: relative;
    border: 1px solid #dbe4ef;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.crystal-type-shared label {
    color: #0f172a;
    font-weight: 600;
    font-size: 1rem;
    position: relative;
    display: block;
    margin-bottom: 0.6rem;
}

.crystal-type-shared select {
    margin-top: 0;
    font-size: 1rem;
    font-weight: 500;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-lg);
    transition: var(--transition-fast);
    width: 100%;
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: none;
}

.crystal-type-shared select:focus {
    background: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Campos de adición para multifocales */
.addition-field {
    transition: var(--transition-fast);
}

.addition-field label {
    color: var(--lab-orange) !important;
    font-weight: 600;
}

.addition-field input {
    border: 2px solid var(--lab-orange) !important;
    background-color: #FEF3E2 !important;
}

.addition-field input:focus {
    border-color: var(--lab-orange) !important;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1) !important;
    background-color: var(--lab-white) !important;
}

/* Tabla de pedidos moderna */
.order-table-container {
    background: var(--lab-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 1px solid var(--lab-gray-200);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 2.5rem;
    background: var(--lab-gray-50);
    border-bottom: 1px solid var(--lab-gray-200);
}

.table-header h3 {
    color: var(--lab-gray-900);
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.table-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.table-wrapper {
    overflow-x: auto;
}

#crystals-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

#crystals-table th {
    background: var(--lab-gray-800);
    color: var(--lab-white);
    padding: 1rem 0.875rem;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    font-size: 0.875rem;
    letter-spacing: 0.025em;
}

#crystals-table td {
    padding: 1rem 0.875rem;
    border-bottom: 1px solid var(--lab-gray-200);
    white-space: nowrap;
    color: var(--lab-gray-700);
}

#crystals-table tbody tr:hover {
    background: var(--lab-gray-50);
}

.empty-row td {
    text-align: center;
    color: var(--lab-gray-500);
    font-style: italic;
    padding: 3rem;
}

/* Botones de acción en tabla */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-edit, .btn-delete {
    padding: 0.375rem 0.75rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: var(--transition-fast);
}

.btn-edit {
    background: #3498db;
    color: white;
    border: 2px solid #3498db;
}

.btn-edit:hover {
    background: #2980b9;
    border-color: #2980b9;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-delete {
    background: #e74c3c;
    color: white;
    border: 2px solid #e74c3c;
}

.btn-delete:hover {
    background: #c0392b;
    border-color: #c0392b;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Badges y etiquetas modernas */
.order-id {
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-lg);
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
    transition: var(--transition-fast);
    letter-spacing: 0.025em;
}

.pair-badge {
    background: var(--lab-black);
    color: var(--lab-white);
}

.single-badge {
    background: var(--lab-gray-600);
    color: var(--lab-white);
}

.order-id:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.crystal-price {
    background: var(--lab-black);
    color: var(--lab-white);
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-block;
}

.crystal-price:hover {
    background: var(--lab-gray-800);
}

/* Resumen del pedido */
.order-summary {
    padding: 2rem 2.5rem;
    background: var(--lab-gray-50);
    border-top: 1px solid var(--lab-gray-200);
}

.summary-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-info p {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--lab-gray-800);
}

.summary-total-line {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.btn-summary-pay {
    border: 1px solid #0f9f4a;
    background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.45rem 1rem;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(22, 163, 74, 0.28);
}

.btn-summary-pay:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

/* Panel principal de pago (crédito empresa) */
.order-payment-panel {
    margin-top: 1.75rem;
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    background: var(--lab-white);
    border: 1px solid var(--lab-gray-200);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

.order-payment-panel--collapsed {
    display: none;
}

.payment-shipping-box {
    margin-bottom: 1rem;
    padding: 0.9rem;
    border: 1px solid var(--lab-gray-200);
    border-radius: 12px;
    background: #fff;
}

.payment-shipping-box__row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.6rem;
}

.payment-shipping-box__row:last-child {
    margin-bottom: 0;
}

.payment-shipping-box label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--lab-gray-700);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.payment-shipping-box select {
    border: 1px solid var(--lab-gray-300);
    border-radius: 10px;
    padding: 0.5rem 0.6rem;
    font-size: 0.88rem;
    background: #fff;
}

.payment-shipping-box__summary {
    margin: 0.4rem 0 0;
    font-size: 0.82rem;
    color: var(--lab-gray-700);
}

.payment-observation-box {
    margin-top: 0.65rem;
    border-color: #dbeafe;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.payment-observation-box__row {
    display: block;
}

.payment-observation-box__textarea {
    width: 100%;
    max-width: 100%;
    min-height: 88px;
    resize: vertical;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--lab-gray-800);
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.payment-observation-box__textarea:focus {
    outline: none;
    border-color: var(--lab-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.payment-observation-box__hint {
    display: block;
    margin-top: 0.45rem;
    font-size: 0.76rem;
    color: var(--lab-gray-600);
}

.order-status-steps {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
}

.order-status-step {
    border: 1px solid var(--lab-gray-200);
    border-radius: 10px;
    background: #fff;
    padding: 0.6rem 0.5rem;
    text-align: center;
}

.order-status-step__dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
    background: var(--lab-gray-300);
    margin-bottom: 0.35rem;
}

.order-status-step__label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--lab-gray-600);
}

.order-status-step.is-current {
    border-color: #0f9f4a;
    background: #eefbf3;
}

.order-status-step.is-current .order-status-step__dot {
    background: #16a34a;
}

.order-status-step.is-current .order-status-step__label {
    color: #14532d;
}

.order-payment-panel__main {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    min-width: min(100%, 240px);
}

.order-payment-panel__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    flex-shrink: 0;
    background: linear-gradient(145deg, var(--lab-blue), var(--lab-blue-dark));
    color: var(--lab-white);
    font-size: 1.25rem;
    font-weight: 700;
    border-radius: var(--radius-lg);
}

.order-payment-panel__text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.order-payment-panel__title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--lab-gray-900);
    letter-spacing: -0.02em;
}

.order-payment-panel__subtitle {
    font-size: 0.875rem;
    color: var(--lab-gray-600);
    line-height: 1.4;
}

.order-payment-panel__help {
    flex-basis: 100%;
    margin: -0.25rem 0 0;
    padding: 0;
    font-size: 0.8125rem;
    color: var(--lab-gray-500);
}

.order-payment-panel:not(.order-payment-panel--empty) .order-payment-panel__help {
    display: none;
}

.order-payment-panel__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: stretch;
    justify-content: flex-end;
}

.btn-payment-mp {
    display: none;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.125rem;
    padding: 0.875rem 1.75rem;
    min-width: 220px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    background: linear-gradient(135deg, #009ee3, #0077b6);
    color: var(--lab-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-payment-mp:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.btn-payment-mp:active:not(:disabled) {
    transform: translateY(0);
}

.btn-payment-mp:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-payment-primary {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.125rem;
    padding: 0.875rem 1.75rem;
    min-width: 220px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    background: linear-gradient(135deg, #059669, #047857);
    color: var(--lab-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-payment-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.btn-payment-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-payment-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-payment-primary__line {
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.btn-payment-primary__badge {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.92;
}

@media (max-width: 640px) {
    .order-payment-panel {
        flex-direction: column;
        align-items: stretch;
    }

    .order-payment-panel__actions {
        flex-direction: column;
        width: 100%;
    }

    .btn-payment-primary,
    .btn-payment-mp {
        align-items: center;
        width: 100%;
        min-width: 0;
    }
}

/* Modal confirmación de pago */
.payment-confirm-modal__content {
    max-width: 760px;
}

.payment-confirm-modal__lead {
    margin: 0 0 1.25rem;
    font-size: 0.9375rem;
    color: var(--lab-gray-600);
    line-height: 1.5;
}

.payment-confirm-modal__summary {
    margin: 0;
    padding: 1rem 1.25rem;
    background: var(--lab-gray-50);
    border: 1px solid var(--lab-gray-200);
    border-radius: var(--radius-lg);
}

.payment-confirm-modal__cuts-list {
    margin: 0 0 1rem;
    max-height: 240px;
    overflow: auto;
    border: 1px solid var(--lab-gray-200);
    border-radius: var(--radius-lg);
    background: #fff;
}

.payment-confirm-modal__cut-row {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.65rem 0.9rem;
    border-bottom: 1px solid var(--lab-gray-100);
}

.payment-confirm-modal__cut-row:last-child {
    border-bottom: none;
}

.payment-confirm-modal__cut-label {
    font-size: 0.85rem;
    color: var(--lab-gray-800);
    line-height: 1.3;
}

.payment-confirm-modal__cut-select {
    width: 100%;
    border: 1px solid var(--lab-gray-300);
    border-radius: 10px;
    padding: 0.45rem 0.55rem;
    background: #fff;
    font-size: 0.82rem;
}

.payment-confirm-modal__cut-price {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--lab-gray-800);
    white-space: nowrap;
}

.payment-confirm-modal__service-grid {
    grid-column: 2 / 4;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.payment-confirm-modal__service-grid--full {
    grid-column: 1 / -1;
}

.payment-confirm-modal__service-box {
    border: 1px solid var(--lab-gray-200);
    border-radius: 10px;
    padding: 0.45rem 0.55rem;
    background: #f8fafc;
}

.payment-confirm-modal__service-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #475569;
    margin-bottom: 0.25rem;
}

.payment-confirm-modal__prisma-wrap {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
}

.crystal-live-total {
    margin-right: auto;
    display: inline-flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--lab-gray-300);
    border-radius: 10px;
    background: var(--lab-gray-50);
}

.crystal-live-total__label {
    font-size: 0.72rem;
    color: var(--lab-gray-600);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.crystal-live-total__amount {
    font-size: 1rem;
    color: var(--lab-gray-900);
    line-height: 1;
}

.crystal-live-total__headline {
    display: inline-flex;
    align-items: baseline;
    gap: 0.38rem;
}

.crystal-live-total__iva {
    font-size: 0.68rem;
    color: var(--lab-gray-600);
    font-weight: 700;
    letter-spacing: 0.02em;
}

.crystal-live-total__meta {
    font-size: 0.72rem;
    color: #475569;
    font-weight: 600;
    max-width: min(100%, 26rem);
    line-height: 1.35;
    white-space: normal;
}

.crystal-live-total__discount {
    font-size: 0.72rem;
    color: #065f46;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 999px;
    padding: 0.12rem 0.5rem;
    width: fit-content;
    font-weight: 700;
}

.crystal-live-total__surcharge {
    display: block;
    font-size: 0.78rem;
    color: #9a3412;
    background: #fff7ed;
    border: 1px solid #fdba74;
    border-radius: 6px;
    padding: 0.25rem 0.55rem;
    width: fit-content;
    max-width: min(100%, 28rem);
    font-weight: 700;
    line-height: 1.35;
}

.summary-power-surcharge {
    margin: 0.35rem 0 0;
    color: #9a3412;
    font-size: 0.95rem;
}

.summary-power-surcharge small {
    font-weight: 500;
    color: #c2410c;
}

.payment-confirm-modal__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--lab-gray-200);
}

.payment-confirm-modal__row:last-child {
    border-bottom: none;
}

.payment-confirm-modal__row dt {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--lab-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.iva-badge-mini {
    display: inline;
    margin-left: 0.3rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--lab-gray-600);
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    vertical-align: middle;
    letter-spacing: 0.02em;
}

.payment-confirm-modal__row dd {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--lab-gray-900);
    text-align: right;
}

.payment-confirm-modal__row--total dd {
    font-size: 1.25rem;
    color: var(--lab-green);
}

.payment-confirm-modal__method-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.payment-confirm-modal__method-badge--credit {
    background: #e6f0ff;
    color: #184fa1;
    border: 1px solid #bfd7ff;
}

.payment-confirm-modal__method-badge--mp {
    background: #fff7dc;
    color: #8d5b00;
    border: 1px solid #ffd466;
}

.payment-confirm-modal__footer {
    flex-wrap: wrap;
}

.payment-confirm-modal__cta {
    min-width: 180px;
}

.is-ios .payment-confirm-modal__footer {
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
}

/* Modal "Otros servicios" — tarjetas por cristal, lista scrolleable */
#other-services-modal .payment-confirm-modal__content {
    max-width: 820px;
    width: min(100% - 1.5rem, 820px);
    max-height: min(92vh, 860px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#other-services-modal .payment-confirm-modal__body {
    max-height: none;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Evita que flex encoja la lista a 0px (antes no se veían teñido / montaje / prisma) */
#other-services-modal .payment-confirm-modal__lead {
    flex-shrink: 0;
}

#other-services-modal .payment-confirm-modal__cuts-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0 0 1rem;
    flex: 0 0 auto;
    min-height: 0;
    max-height: none;
    padding: 0.5rem 0.6rem 0.5rem 0.15rem;
    overflow: auto;
    overflow-x: hidden;
    border: 1px solid var(--lab-gray-200);
    border-radius: var(--radius-lg);
    background: var(--lab-gray-50);
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    overscroll-behavior: contain;
}

#other-services-modal .other-services-item {
    margin: 0;
    border-radius: var(--radius-lg);
    background: #fff;
    border: 1px solid var(--lab-gray-200);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.07);
    overflow: visible;
    min-width: 0;
}

#other-services-modal .payment-confirm-modal__cut-row {
    border-bottom: none;
    padding: 0.75rem 0.9rem 0.85rem;
    background: #fff;
    align-items: start;
}

/* Por encima de .payment-confirm-modal__service-grid { grid-column: 2 / 4 } */
#other-services-modal .payment-confirm-modal__service-grid.payment-confirm-modal__service-grid--full {
    grid-column: 1 / -1 !important;
    width: 100%;
    min-width: 0;
}

#other-services-modal .other-services-cell {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}

#other-services-modal .other-services-mini-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475569;
}

#other-services-modal .payment-confirm-modal__cut-select,
#other-services-modal .payment-confirm-modal__service-box select {
    color: #0f172a !important;
    background-color: #ffffff !important;
}

#other-services-modal .payment-confirm-modal__summary {
    flex-shrink: 0;
}

/* Mantener siempre visibles los botones Omitir/Guardar */
#other-services-modal .payment-confirm-modal__footer {
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 2;
    background: var(--lab-gray-50);
}

@media (max-width: 720px) {
    #other-services-modal .payment-confirm-modal__cut-row {
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 0.55rem;
    }

    #other-services-modal .payment-confirm-modal__cut-label {
        font-weight: 700;
        font-size: 0.9rem;
        padding-bottom: 0.15rem;
        border-bottom: 1px solid var(--lab-gray-100);
        margin-bottom: 0.15rem;
    }

    #other-services-modal .payment-confirm-modal__cut-price {
        justify-self: stretch;
        text-align: left;
        padding-top: 0.25rem;
        font-size: 1rem;
        color: var(--lab-green);
    }

    #other-services-modal .payment-confirm-modal__service-grid {
        grid-column: 1 / -1;
    }

    #other-services-modal .payment-confirm-modal__prisma-wrap {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    #other-services-modal .payment-confirm-modal__cuts-list {
        scroll-behavior: auto;
    }
}

/* Notificaciones modernas */
.success-notification {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    background: var(--lab-black);
    color: var(--lab-white);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    z-index: 1000;
    max-width: 350px;
    font-size: 0.875rem;
    line-height: 1.5;
    border: 1px solid var(--lab-black);
}

.error-message {
    background: var(--lab-black);
    color: var(--lab-white);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    border: 1px solid var(--lab-black);
}

.info-message {
    background: var(--lab-black);
    color: var(--lab-white);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    margin-top: 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border: 1px solid var(--lab-black);
}

/* Estados de filas */
.fabricable {
    background: var(--lab-gray-50);
    border-left: 4px solid var(--lab-black);
}

.not-fabricable {
    background: var(--lab-gray-100);
    border-left: 4px solid var(--lab-gray-600);
}

.paired-crystal {
    border-left: 4px solid var(--lab-black);
}

.single-crystal {
    border-left: 4px solid var(--lab-gray-600);
}

/* Responsive para sistema de pedidos */
@media (max-width: 768px) {
    .crystal-type-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-crystal-type {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1.5rem;
    }
    
    .eyes-parallel {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .eye-section {
        padding: 1.5rem;
    }
    
    .index-options {
        gap: 0.75rem;
        padding: 1rem;
    }
    
    .index-circle {
        width: 3rem;
        height: 3rem;
        font-size: 0.75rem;
    }
    
    .crystal-type-shared select {
        min-width: auto;
        width: 100%;
    }
    
    .table-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 1.5rem;
    }
    
    .table-actions {
        justify-content: center;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer button {
        width: 100%;
    }
    
    #crystals-table {
        font-size: 0.75rem;
    }
    
    #crystals-table th,
    #crystals-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .success-notification {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .single-eye-centered {
        padding: 1.5rem;
    }
    
    .crystal-type-shared {
        padding: 1.5rem;
    }
    
    .index-circle {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 0.7rem;
    }
    
    .order-id {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }
    
    .crystal-price {
        padding: 0.375rem 0.625rem;
        font-size: 0.75rem;
    }
}
/* ===== SISTEMA DE DESCUENTOS MODERNO ===== */

.price-with-discount {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    position: relative;
}

.original-price {
    font-size: 0.75rem;
    color: var(--lab-gray-500);
    text-decoration: line-through;
}

.discount-badge {
    background: linear-gradient(135deg, var(--lab-red), var(--lab-red-dark));
    color: var(--lab-white);
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-lg);
    text-transform: uppercase;
    letter-spacing: 0.025em;
    box-shadow: var(--shadow-sm);
}

.final-price {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--lab-green);
}

/* ===== ADMIN PANEL MODERNO ===== */

.admin-info-message {
    max-width: 800px;
    margin: 0 auto 3rem;
    padding: 0;
}

.admin-card {
    background: linear-gradient(135deg, var(--lab-orange), #EA580C);
    color: var(--lab-white);
    padding: 3rem;
    border-radius: var(--radius-2xl);
    text-align: center;
    box-shadow: var(--shadow-2xl);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="admin-pattern" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1.5" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23admin-pattern)"/></svg>');
    opacity: 0.3;
}

.admin-card h3 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
    font-weight: 700;
}

.admin-card p {
    font-size: 1.125rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
    opacity: 0.9;
}

.admin-card ul {
    list-style: none;
    padding: 0;
    margin: 2rem 0;
    position: relative;
    z-index: 1;
}

.admin-card li {
    background: rgba(255, 255, 255, 0.1);
    margin: 1rem 0;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    text-align: left;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition-fast);
}

.admin-card li:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

.btn-admin-panel {
    background: rgba(255, 255, 255, 0.2);
    color: var(--lab-white);
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 1rem 2rem;
    border-radius: var(--radius-lg);
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
    margin-top: 2rem;
    box-shadow: var(--shadow-md);
}

.btn-admin-panel:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ===== LOADING STATES ===== */

.loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    width: 1rem;
    height: 1rem;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Overlay al confirmar pago / registrar pedido */
.order-processing-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}

.order-processing-overlay__panel {
    background: #fff;
    border-radius: 12px;
    padding: 2rem 2.25rem;
    text-align: center;
    max-width: 22rem;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.order-processing-overlay__spinner {
    width: 2.5rem;
    height: 2.5rem;
    margin: 0 auto 1rem;
    border: 3px solid #e2e8f0;
    border-top-color: var(--lab-blue, #2563eb);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.order-processing-overlay__title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: #0f172a;
}

.order-processing-overlay__lead {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.45;
    color: #64748b;
}

body.order-processing-active {
    overflow: hidden;
}

/* ===== ESTADOS DE VALIDACIÓN ===== */

.form-group.error input,
.form-group.error select {
    border-color: var(--lab-red);
    background-color: rgba(239, 68, 68, 0.05);
}

.form-group.error input:focus,
.form-group.error select:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-group.success input,
.form-group.success select {
    border-color: var(--lab-green);
    background-color: rgba(16, 185, 129, 0.05);
}

.form-group.success input:focus,
.form-group.success select:focus {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.field-error {
    color: var(--lab-red);
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.field-success {
    color: var(--lab-green);
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* ===== TOOLTIPS MODERNOS ===== */

.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--lab-gray-900);
    color: var(--lab-white);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-fast);
    z-index: 1000;
    margin-bottom: 0.25rem;
    box-shadow: var(--shadow-lg);
}

.tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--lab-gray-900);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-fast);
    z-index: 1000;
}

.tooltip:hover::before,
.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* ===== BADGES Y ETIQUETAS ADICIONALES ===== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-primary {
    background: var(--lab-black);
    color: var(--lab-white);
}

.badge-success {
    background: var(--lab-black);
    color: var(--lab-white);
}

.badge-warning {
    background: var(--lab-gray-600);
    color: var(--lab-white);
}

.badge-danger {
    background: var(--lab-gray-800);
    color: var(--lab-white);
}

.badge-secondary {
    background: var(--lab-gray-500);
    color: var(--lab-white);
}

/* ===== MEJORAS RESPONSIVE ADICIONALES ===== */

@media (max-width: 640px) {
    .admin-card {
        padding: 2rem 1.5rem;
        margin: 0 1rem;
    }
    
    .admin-card h3 {
        font-size: 1.5rem;
    }
    
    .admin-card p {
        font-size: 1rem;
    }
    
    .admin-card li {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        text-align: center;
    }
    
    .admin-card li:hover {
        transform: none;
    }
    
    .btn-admin-panel {
        width: 100%;
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    .crystal-type-buttons {
        gap: 0.75rem;
    }
    
    .btn-crystal-type {
        padding: 0.875rem 1.5rem;
        font-size: 0.875rem;
    }
    
    .index-options {
        gap: 0.5rem;
        padding: 1rem;
    }
    
    .index-circle {
        width: 2.75rem;
        height: 2.75rem;
        font-size: 0.75rem;
    }
}

/* ===== ANIMACIONES ADICIONALES ===== */

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -30px, 0);
    }
    70% {
        transform: translate3d(0, -15px, 0);
    }
    90% {
        transform: translate3d(0, -4px, 0);
    }
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-bounce {
    animation: bounce 1s infinite;
}

/* ===== FOCUS VISIBLE PARA ACCESIBILIDAD ===== */

.btn-modern:focus-visible,
.btn-crystal-type:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--lab-black);
    outline-offset: 2px;
}

/* ===== MODO OSCURO =====
   Desactivado para evitar contraste inválido en macOS (Safari/Chrome).
   Forzamos paleta clara consistente en todos los navegadores. */
@media (prefers-color-scheme: dark) {
    :root {
        --lab-white: #FFFFFF;
        --lab-gray-50: #F8FAFC;
        --lab-gray-100: #F1F5F9;
        --lab-gray-200: #E2E8F0;
        --lab-gray-800: #1E293B;
    }

    body {
        background: var(--lab-gray-50);
        color: var(--lab-gray-800);
    }

    .header,
    .card-modern,
    .modal-content,
    .modal-body {
        background: var(--lab-white);
        color: var(--lab-gray-800);
        border-color: var(--lab-gray-200);
    }
}

/* Safari: mantener paleta clara para evitar cambios de color por tema del sistema */
.is-safari {
    color-scheme: light;
}

/* ===== PRINT STYLES ===== */

@media print {
    .header,
    .modal,
    .btn-crystal-type,
    .table-actions,
    .action-buttons {
        display: none !important;
    }
    
    .section-modern {
        padding: 1rem 0;
    }
    
    .card-modern {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* ===== ADVERTENCIA DE RESERVA ===== */
.reservation-warning {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #FFF3CD;
    border: 2px solid #000000;
    border-radius: 0;
}

.warning-content {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.warning-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.warning-text {
    flex: 1;
}

.warning-text p {
    margin: 0 0 0.75rem 0;
    color: #000000;
    font-size: 0.95rem;
    line-height: 1.5;
}

.warning-text strong {
    font-weight: 700;
}

.countdown-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #000000;
}

.countdown-timer {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 700;
    color: #DC2626;
    background: #FFFFFF;
    padding: 0.25rem 0.75rem;
    border: 2px solid #000000;
    border-radius: 0;
    min-width: 80px;
    text-align: center;
}

.countdown-timer.warning {
    color: #EA580C;
    animation: pulse 1s ease-in-out infinite;
}

.countdown-timer.critical {
    color: #DC2626;
    animation: pulse 0.5s ease-in-out infinite;
}

.jefe-losada-20h-hint {
    margin-top: 0.65rem;
    font-size: 0.9rem;
    line-height: 1.45;
    color: #1a1a1a;
    background: #fff8e6;
    padding: 0.5rem 0.75rem;
    border: 1px solid #c9a227;
}

.jefe-losada-20h-hint.jefe-losada-20h-hint--cerrado {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #374151;
}

.encargado-losada-hint {
    margin-top: 0.65rem;
    font-size: 0.9rem;
    line-height: 1.45;
    color: #1a1a1a;
    background: #eef6ff;
    padding: 0.5rem 0.75rem;
    border: 1px solid #2c5aa0;
}

.profile-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.profile-toolbar .back-btn {
    margin-bottom: 0;
}

.btn-encargado-pedido {
    padding: 10px 20px;
    border: 2px solid #2c5aa0;
    background: #2c5aa0;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: all 0.2s ease;
}

.btn-encargado-pedido:hover {
    background: #1e4078;
    border-color: #1e4078;
    color: #fff;
}

.status-pending_losada_review {
    background: #fde8e8;
    color: #9b1c1c;
    border-color: #c53030;
}

/* Encargado Losada: sin columna ni totales con precio en tabla de pedido */
body.encargado-losada-ui #crystals-th-price,
body.encargado-losada-ui #crystals-table .price-cell {
    display: none !important;
}

body.encargado-losada-ui #summary-total-price-wrap,
body.encargado-losada-ui #summary-total-crystals-row {
    display: none !important;
}

body.encargado-losada-ui .summary-info {
    justify-content: flex-end;
}

body.encargado-losada-ui .summary-total-line {
    display: flex;
    width: 100%;
    justify-content: flex-end;
    margin: 0;
}

/* Encargado Losada: panel de confirmación solo envío + observaciones (sin pago) */
.payment-method-modal--encargado #payment-charge-summary,
.payment-method-modal--encargado .modal-body > .payment-shipping-box__summary:not(#payment-shipping-summary):not(#payment-branch-address),
.payment-method-modal--encargado #payment-method-jefe-20h-hint,
.payment-method-modal--encargado .order-payment-panel__main,
.payment-method-modal--encargado #confirm-order-mp,
.payment-method-modal--encargado #payment-credit-availability,
.payment-method-modal--encargado #confirm-order-help {
    display: none !important;
}

.payment-method-modal--encargado .order-payment-panel__actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.payment-method-modal--encargado #confirm-order {
    min-width: 10rem;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}
/* Asegurar visibilidad de botones de acción */
.action-buttons .btn-edit,
.action-buttons .btn-delete {
    background: #3498db !important;
    color: white !important;
    border: 2px solid #3498db !important;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-buttons .btn-delete {
    background: #e74c3c !important;
    border-color: #e74c3c !important;
}

.action-buttons .btn-edit:hover {
    background: #2980b9 !important;
    border-color: #2980b9 !important;
}

.action-buttons .btn-delete:hover {
    background: #c0392b !important;
    border-color: #c0392b !important;
}
/* ===== ESTADOS DE RESERVA EN TABLA ===== */

/* Cristales con reserva expirada */
.reservation-expired {
    background-color: #FFF3CD !important;
    border-left: 4px solid #FFC107 !important;
}

.reservation-expired td {
    color: #856404 !important;
}

/* Cristales que necesitan verificación */
.needs-verification {
    background-color: #FFE6E6 !important;
    border-left: 4px solid #FF6B6B !important;
}

.needs-verification td {
    color: #721C24 !important;
}

/* Cristales que fallaron la verificación */
.verification-failed {
    background-color: #F8D7DA !important;
    border-left: 4px solid #DC3545 !important;
    animation: pulse-red 2s ease-in-out infinite;
}

.verification-failed td {
    color: #721C24 !important;
    font-weight: 600 !important;
}

/* Animación para cristales no disponibles */
@keyframes pulse-red {
    0%, 100% {
        background-color: #F8D7DA;
    }
    50% {
        background-color: #F5C6CB;
    }
}

/* Advertencia con reserva expirada */
.reservation-warning.expired {
    background: #FFE6E6 !important;
    border-color: #FF0000 !important;
}

.reservation-warning.expired .warning-text p {
    color: #721C24 !important;
    font-weight: 600 !important;
}

/* ===== SEGUIMIENTO DE PEDIDOS ===== */
.orders-tracking-container {
    max-width: 1200px;
    margin: 0 auto;
}

.order-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid #000;
    background: #fff;
    color: #000;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: #f0f0f0;
}

.filter-btn.active {
    background: #000;
    color: #fff;
}

.orders-section {
    margin-bottom: 30px;
}

.orders-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #000;
}

.orders-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.refresh-btn {
    padding: 8px 15px;
    border: 1px solid #000;
    background: #fff;
    color: #000;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.refresh-btn:hover {
    background: #f0f0f0;
}

.orders-table-container {
    overflow-x: auto;
    border: 1px solid #000;
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.orders-table th,
.orders-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    border-right: 1px solid #ddd;
}

.orders-table th {
    background: #f8f9fa;
    font-weight: 600;
    border-bottom: 2px solid #000;
}

.orders-table th:last-child,
.orders-table td:last-child {
    border-right: none;
}

.orders-table tbody tr:hover {
    background: #f8f9fa;
}

/* Estados de pedidos */
.order-status {
    padding: 4px 8px;
    border-radius: 0;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid;
    display: inline-block;
    min-width: 100px;
    text-align: center;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
    border-color: #856404;
}

.status-fabrication {
    background: #d4edda;
    color: #155724;
    border-color: #155724;
}

.status-production {
    background: #cce5ff;
    color: #004085;
    border-color: #004085;
}

.status-shipping {
    background: #e2e3e5;
    color: #383d41;
    border-color: #383d41;
}

.status-delivered {
    background: #d1ecf1;
    color: #0c5460;
    border-color: #0c5460;
}

/* Acciones de pedidos */
.order-actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.order-action-btn {
    padding: 4px 8px;
    border: 1px solid #000;
    background: #fff;
    color: #000;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.order-action-btn:hover {
    background: #f0f0f0;
}

.order-action-btn.view-btn {
    border-color: #007bff;
    color: #007bff;
}

.order-action-btn.view-btn:hover {
    background: #007bff;
    color: #fff;
}

/* Información de cristales en pedidos */
.crystals-info {
    font-size: 0.9rem;
    line-height: 1.3;
}

.crystal-item {
    margin-bottom: 2px;
}

.crystal-eye {
    font-weight: 500;
    color: #666;
}

/* Responsive para seguimiento */
@media (max-width: 768px) {
    .order-filters {
        flex-direction: column;
        align-items: center;
    }
    
    .filter-btn {
        width: 200px;
        text-align: center;
    }
    
    .orders-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .orders-table {
        font-size: 0.85rem;
    }
    
    .orders-table th,
    .orders-table td {
        padding: 8px 4px;
    }
}
.btn-info {
    background: #17a2b8 !important;
    border-color: #17a2b8 !important;
    color: #fff !important;
}
/* ===== MEJORAS DE COLOR AZUL Y SOMBRAS AZUL-GRIS ===== */

/* Texto de bienvenida en azul */
.hero h1,
.hero h2,
.hero .hero-title {
    color: #2c5aa0 !important;
}

/* Sombras azul-gris para elementos principales */
.container {
    box-shadow: 0 4px 12px rgba(44, 90, 160, 0.1) !important;
}

.section-modern {
    box-shadow: 0 2px 8px rgba(44, 90, 160, 0.08) !important;
}

/* Sombras para tarjetas y elementos elevados */
.crystal-form,
.order-summary,
.modal-content {
    box-shadow: 0 8px 24px rgba(44, 90, 160, 0.15) !important;
}

/* Sombras para botones */
.btn-modern:hover {
    box-shadow: 0 4px 16px rgba(44, 90, 160, 0.2) !important;
}

/* Sombras para tablas */
.table-container,
.orders-table-container {
    box-shadow: 0 4px 12px rgba(44, 90, 160, 0.1) !important;
}

/* Sombras para elementos de navegación */
.header {
    box-shadow: 0 2px 12px rgba(44, 90, 160, 0.12) !important;
}

/* Sombras para modales */
.modal {
    backdrop-filter: blur(4px);
}

.modal-overlay {
    background: rgba(44, 90, 160, 0.1) !important;
}

/* Sombras para elementos de seguimiento */
.orders-tracking-container {
    box-shadow: 0 6px 20px rgba(44, 90, 160, 0.1) !important;
}

.order-filters .filter-btn {
    box-shadow: 0 2px 8px rgba(44, 90, 160, 0.08) !important;
}

.order-filters .filter-btn.active {
    box-shadow: 0 4px 12px rgba(44, 90, 160, 0.2) !important;
}

/* Sombras para elementos del perfil */
.profile-header {
    box-shadow: 0 4px 16px rgba(44, 90, 160, 0.12) !important;
}

.info-card {
    box-shadow: 0 3px 10px rgba(44, 90, 160, 0.1) !important;
}

/* Sombras para elementos de estado */
.order-status {
    box-shadow: 0 2px 6px rgba(44, 90, 160, 0.08) !important;
}

/* Sombras para elementos de acción */
.action-buttons button,
.order-action-btn {
    box-shadow: 0 2px 8px rgba(44, 90, 160, 0.1) !important;
}

.action-buttons button:hover,
.order-action-btn:hover {
    box-shadow: 0 4px 12px rgba(44, 90, 160, 0.2) !important;
}

/* Sombras para elementos de reserva */
.reservation-warning {
    box-shadow: 0 4px 16px rgba(44, 90, 160, 0.15) !important;
}

/* Sombras para elementos de descuento */
.test-discount-section {
    box-shadow: 0 3px 10px rgba(44, 90, 160, 0.1) !important;
}

/* Mejoras adicionales para el texto de bienvenida */
.hero h1,
.hero h2,
.hero .hero-title {
    text-shadow: 0 2px 4px rgba(44, 90, 160, 0.1) !important;
    font-weight: 600 !important;
}

/* Sombras suaves para inputs y selects */
input[type="text"],
input[type="number"],
select {
    box-shadow: inset 0 2px 4px rgba(44, 90, 160, 0.05) !important;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    box-shadow: inset 0 2px 4px rgba(44, 90, 160, 0.1), 0 0 0 2px rgba(44, 90, 160, 0.1) !important;
}

/* Sombras para elementos de radio y checkbox */
.radio-option {
    box-shadow: 0 2px 6px rgba(44, 90, 160, 0.08) !important;
}

.radio-option:hover {
    box-shadow: 0 3px 10px rgba(44, 90, 160, 0.12) !important;
}

/* Sombras para elementos de cristal en la tabla */
.fabricable {
    box-shadow: 0 1px 4px rgba(44, 90, 160, 0.08) !important;
}

/* Sombras para elementos de precio */
.price-with-discount {
    box-shadow: 0 2px 8px rgba(44, 90, 160, 0.1) !important;
}

/* Efecto de elevación para elementos interactivos */
.btn-modern,
.filter-btn,
.refresh-btn {
    transition: all 0.3s ease, box-shadow 0.3s ease !important;
}

/* Sombras específicas para el admin dashboard */
.admin-section {
    box-shadow: 0 4px 16px rgba(44, 90, 160, 0.1) !important;
}

.section-header {
    box-shadow: 0 2px 8px rgba(44, 90, 160, 0.08) !important;
}

/* Sombras para estadísticas */
.stat-item,
.orders-stats .stat-item,
.tracking-stats .stat-item {
    box-shadow: 0 3px 10px rgba(44, 90, 160, 0.1) !important;
}

/* Mejora visual para elementos destacados */
.warning-content {
    box-shadow: 0 4px 16px rgba(44, 90, 160, 0.12) !important;
}

/* Sombras para elementos de countdown */
.countdown-timer {
    text-shadow: 0 1px 2px rgba(44, 90, 160, 0.2) !important;
}

/* Sombras para elementos de navegación del perfil */
.back-btn {
    box-shadow: 0 3px 10px rgba(44, 90, 160, 0.1) !important;
}

.back-btn:hover {
    box-shadow: 0 4px 16px rgba(44, 90, 160, 0.2) !important;
}
/* ===== MEJORAS ADICIONALES DE DISEÑO AZUL-GRIS ===== */

/* Gradientes sutiles para elementos principales */
.hero {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    box-shadow: 0 8px 32px rgba(44, 90, 160, 0.1) !important;
}

/* Mejoras para el header */
.header {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
    border-bottom: 1px solid rgba(44, 90, 160, 0.1) !important;
}

/* Mejoras para botones principales (texto claro sobre gradiente azul) */
.btn-primary {
    background: linear-gradient(135deg, #2c5aa0 0%, #1e3d72 100%) !important;
    border-color: #2c5aa0 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 16px rgba(44, 90, 160, 0.3) !important;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1e3d72 0%, #2c5aa0 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 6px 20px rgba(44, 90, 160, 0.4) !important;
    transform: translateY(-2px) !important;
}

/* Mejoras para elementos de estado activo */
.filter-btn.active {
    background: linear-gradient(135deg, #2c5aa0 0%, #1e3d72 100%) !important;
    color: #fff !important;
    border-color: #2c5aa0 !important;
}

/* Mejoras para elementos de información */
.info-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
    border: 1px solid rgba(44, 90, 160, 0.1) !important;
}

/* Mejoras para elementos de seguimiento */
.orders-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    border-bottom: 2px solid rgba(44, 90, 160, 0.2) !important;
}

/* Mejoras para elementos de tabla */
.orders-table th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    border-bottom: 2px solid rgba(44, 90, 160, 0.2) !important;
}

/* Mejoras para elementos de modal */
.modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
    border: 1px solid rgba(44, 90, 160, 0.1) !important;
}

/* Mejoras para elementos de advertencia */
.reservation-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%) !important;
    border: 1px solid rgba(44, 90, 160, 0.2) !important;
}

/* Mejoras para elementos de perfil */
.profile-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    border: 2px solid rgba(44, 90, 160, 0.1) !important;
}

/* Efectos de hover mejorados */
.order-action-btn:hover,
.btn-modern:hover,
.refresh-btn:hover {
    transform: translateY(-1px) !important;
    transition: all 0.3s ease !important;
}

/* Mejoras para elementos de radio */
.radio-option {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
    border: 1px solid rgba(44, 90, 160, 0.1) !important;
}

.radio-option:hover {
    border-color: rgba(44, 90, 160, 0.3) !important;
}

/* Mejoras para inputs */
input[type="text"],
input[type="number"],
select {
    border: 1px solid rgba(44, 90, 160, 0.2) !important;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    border-color: rgba(44, 90, 160, 0.5) !important;
    background: #ffffff !important;
}

/* Mejoras para elementos de precio */
.price-with-discount {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
    border: 1px solid rgba(44, 90, 160, 0.1) !important;
    border-radius: 4px !important;
    padding: 4px 8px !important;
}

/* Mejoras para elementos de cristal */
.crystal-form {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
    border: 1px solid rgba(44, 90, 160, 0.1) !important;
}

/* Mejoras para elementos de resumen */
.order-summary {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    border: 1px solid rgba(44, 90, 160, 0.2) !important;
}

/* Animaciones suaves — con prefijos Safari */
* {
    -webkit-transition: box-shadow 0.3s ease, -webkit-transform 0.3s ease !important;
    transition: box-shadow 0.3s ease, transform 0.3s ease !important;
}

/* Mejoras para elementos de navegación */
.nav a:hover {
    color: #2c5aa0 !important;
    text-shadow: 0 1px 2px rgba(44, 90, 160, 0.2) !important;
}

/* Mejoras para elementos de usuario */
.user-info {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
    border: 1px solid rgba(44, 90, 160, 0.1) !important;
    border-radius: 4px !important;
    padding: 8px 12px !important;
    box-shadow: 0 2px 8px rgba(44, 90, 160, 0.1) !important;
}

/* ===== COMPATIBILIDAD SAFARI ===== */

/* Fallback para flexbox gap en Safari < 14.1 */
.no-flexbox-gap .user-section > * + * {
    margin-left: 1rem;
}

.no-flexbox-gap .crystal-type-buttons > * + * {
    margin-left: 1rem;
}

.no-flexbox-gap .table-actions > * + * {
    margin-left: 1rem;
}

.no-flexbox-gap .action-buttons > * + * {
    margin-left: 0.5rem;
}

.no-flexbox-gap .modal-footer > * + * {
    margin-left: 1rem;
}

.no-flexbox-gap .order-filters > * + * {
    margin-left: 10px;
}

.no-flexbox-gap .order-actions > * + * {
    margin-left: 5px;
}

/* Fix para inputs en Safari — evita zoom automático */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px !important; /* Evita zoom en iOS Safari */
    }
}

/* Fix para position: fixed en Safari iOS */
.is-safari .header {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* Fix para backdrop-filter en Safari */
.is-safari .modal-overlay {
    background: rgba(15, 23, 42, 0.85) !important;
}

/* Fix para animaciones en Safari */
@-webkit-keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@-webkit-keyframes slideUp {
    from {
        opacity: 0;
        -webkit-transform: translateY(20px);
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        -webkit-transform: translateY(0);
        transform: translateY(0);
    }
}

@-webkit-keyframes spin {
    to { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
}

@-webkit-keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@-webkit-keyframes pulse-red {
    0%, 100% { background-color: #F8D7DA; }
    50% { background-color: #F5C6CB; }
}

/* Fix para grid en Safari */
.eyes-parallel {
    display: -ms-grid;
    display: grid;
    -ms-grid-columns: 1fr 2rem 1fr;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

/* Fix para object-fit en Safari */
img {
    -o-object-fit: cover;
    object-fit: cover;
}

/* Fix para -webkit-appearance en inputs */
input[type="number"] {
    -webkit-appearance: none;
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Fix para select en Safari iOS */
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    /* Flecha visible para indicar menú desplegable, sin tapar el texto */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='9' viewBox='0 0 13 9'%3E%3Cpath d='M1 1.5l5.5 5 5.5-5' stroke='%232c5aa0' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 13px 9px !important;
    padding-right: 36px !important;
}

select option {
    color: #1f2937;
    background-color: #ffffff;
}

/* Fix para cursor en botones Safari */
button {
    cursor: pointer;
    -webkit-appearance: none;
}

/* Fix para overflow en modal Safari iOS */
.modal-body {
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
}

/* ===== AJUSTES ESPECIFICOS SAFARI MACOS ===== */
/* Safari en Mac puede renderizar blur/transparencias y tablas con artefactos visuales. */
.is-safari body {
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Desactivar blur costoso en Safari para evitar "ghosting" y fondos lavados */
.is-safari .header,
.is-safari .table-wrapper,
.is-safari .modal-content,
.is-safari .summary-card,
.is-safari .card,
.is-safari .user-info {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

/* Estabilizar tablas (Safari a veces recorta columnas o rompe sombras) */
.is-safari .table-wrapper {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
}

.is-safari table {
    border-collapse: separate;
    border-spacing: 0;
}

/* Evitar saltos de layout en botones y selects */
.is-safari button,
.is-safari .btn-modern,
.is-safari select,
.is-safari input {
    line-height: 1.2;
}

/* Modal mas estable en Safari Mac */
.is-safari .modal {
    transform: none !important;
    -webkit-transform: none !important;
}

/* Ocultar restos de Mercado Pago en HTML cacheado o antiguo (encargado / óptica) */
#btn-pay-mp,
#quick-payment-buttons,
#mp-pref-url,
#mp-link-url,
#mp-save-payment-config,
#mp-clear-payment-config {
    display: none !important;
}

/* Botones rápidos de prueba (openQuickPaymentPlan / montos $10.000–$30.000) */
#productos button[onclick*="openQuickPaymentPlan"],
#productos button[onclick*="startMercadoPagoCheckout"] {
    display: none !important;
}

details.mp-payment-settings,
.mp-payment-block {
    display: none !important;
}

/* ===== OVERRIDE FINAL HEADER OSCURO ===== */
.header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25) !important;
}

.nav a {
    color: #ffffff !important;
}

.nav a:hover {
    color: #ffffff !important;
    background: rgba(148, 163, 184, 0.2) !important;
    text-shadow: none !important;
}

.user-info {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.user-name {
    color: #ffffff !important;
}

.user-role {
    color: rgba(255, 255, 255, 0.88) !important;
}

/* Cabecera oscura: texto blanco (panel empresa y resto con .header) */
.header #user-name {
    color: #ffffff !important;
}

.header #empresa-nombre {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Botón secundario sobre header oscuro */
.header .btn-modern.btn-secondary {
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.85) !important;
    background: rgba(15, 23, 42, 0.25) !important;
}

.header .btn-modern.btn-secondary:hover {
    color: #0f172a !important;
    background: #f8fafc !important;
    border-color: #f8fafc !important;
}

/* Panel empresa: contraste explícito (evita herencias raras sobre tarjetas blancas) */
.empresa-dashboard-page main h2,
.empresa-dashboard-page main h3 {
    color: var(--lab-gray-900) !important;
}

.empresa-dashboard-page #credito-total,
.empresa-dashboard-page #credito-usado,
.empresa-dashboard-page #credito-disponible {
    color: var(--lab-gray-900) !important;
}

.empresa-dashboard-page table tbody td {
    color: var(--lab-gray-800) !important;
}

.empresa-dashboard-page #pedidos-container {
    color: var(--lab-gray-800) !important;
}

.empresa-dashboard-page #pedidos-container table tbody td {
    color: var(--lab-gray-800) !important;
}

.empresa-dashboard-page #modal-abono-credito h3,
.empresa-dashboard-page #modal-abono-credito label {
    color: var(--lab-gray-900) !important;
}

.empresa-dashboard-page #modal-abono-credito input {
    color: var(--lab-gray-900) !important;
    background: var(--lab-white) !important;
}

/* Modalidad par / cristal suelto: las reglas globales .radio-option (!important) dejaban texto ilegible */
.eye-mode-segmented .radio-option.eye-mode-btn {
    background: transparent !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
}

.eye-mode-segmented .radio-option.eye-mode-btn:not(.selected),
.eye-mode-segmented .radio-option.eye-mode-btn:not(.selected) span {
    color: #0f172a !important;
}

.eye-mode-segmented .radio-option.eye-mode-btn.selected {
    background-color: transparent !important;
    background-image: none !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: none !important;
}

.eye-mode-segmented .radio-option.eye-mode-btn.selected span {
    color: #ffffff !important;
}

/* ================================================================
   WIZARD — 3-step crystal order flow
   ================================================================ */

/* Progress bar */
.wizard-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0.65rem 2rem 0.5rem;
    background: var(--lab-white);
    border-bottom: 1px solid var(--lab-gray-200);
}

.wizard-step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    position: relative;
    z-index: 1;
    min-width: 5.5rem;
}

.wizard-step-circle {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    border: 2.5px solid var(--lab-gray-300);
    background: var(--lab-white);
    color: var(--lab-gray-400);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.wizard-step-indicator.active .wizard-step-circle {
    border-color: var(--lab-blue-dark, #1e3a5c);
    background: var(--lab-blue-dark, #1e3a5c);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(30, 58, 92, 0.15);
    transform: scale(1.08);
}

.wizard-step-indicator.completed .wizard-step-circle {
    border-color: #059669;
    background: #059669;
    color: #fff;
}

.wizard-step-circle .wizard-check {
    display: none;
}

.wizard-step-indicator.completed .wizard-step-circle .wizard-check {
    display: inline;
}

.wizard-step-indicator.completed .wizard-step-circle .wizard-num {
    display: none;
}

.wizard-step-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--lab-gray-400);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: center;
    transition: color 0.3s;
    white-space: nowrap;
}

.wizard-step-indicator.active .wizard-step-label {
    color: var(--lab-blue-dark, #1e3a5c);
}

.wizard-step-indicator.completed .wizard-step-label {
    color: #059669;
}

.wizard-connector {
    flex: 1;
    height: 3px;
    background: var(--lab-gray-200);
    border-radius: 2px;
    position: relative;
    margin: 0 0.25rem;
    margin-bottom: 1.1rem;
    overflow: hidden;
}

.wizard-connector::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background: #059669;
    border-radius: 2px;
    transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.wizard-connector.filled::after {
    width: 100%;
}

/* Step panels */
.wizard-step-panel {
    display: none;
    animation: wizardFadeIn 0.35s ease-out;
}

.wizard-step-panel.active {
    display: block;
}

@keyframes wizardFadeIn {
    from { opacity: 0; transform: translateX(12px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Step 1 — Frame measurements */
.frame-section {
    margin-top: 1.5rem;
}

.frame-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--lab-gray-800);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.frame-section-title .frame-icon {
    font-size: 1.2rem;
}

/* Frame material selector — inline row */
.frame-material-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.4rem;
}

.frame-material-row__label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--lab-gray-700);
    white-space: nowrap;
}

.frame-material-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.frame-material-chip {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    padding: 0.3rem 0.7rem;
    border: 1.5px solid var(--lab-gray-300);
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--lab-gray-600);
    background: var(--lab-white);
    transition: all 0.2s;
    user-select: none;
}

.frame-material-chip input {
    display: none;
}

.frame-material-chip:hover {
    border-color: var(--lab-gray-500);
    color: var(--lab-gray-800);
}

.frame-material-chip:has(input:checked) {
    background: var(--lab-blue-dark, #1e3a5c);
    border-color: var(--lab-blue-dark, #1e3a5c);
    color: #fff;
}

/* Frame diagram container */
.frame-diagram-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid var(--lab-gray-200);
    border-radius: 12px;
    margin-bottom: 0.75rem;
}

.frame-diagram-svg-wrap {
    flex-shrink: 0;
    position: relative;
}

.frame-diagram-svg-wrap svg {
    display: block;
}

/* SVG interactive highlights */
.frame-dim-line {
    stroke: var(--lab-gray-400);
    stroke-width: 1.5;
    stroke-dasharray: 6 3;
    transition: stroke 0.25s, stroke-width 0.25s;
}

.frame-dim-line.highlight {
    stroke: var(--lab-red, #dc2626);
    stroke-width: 2.5;
    stroke-dasharray: none;
}

.frame-dim-label {
    font-size: 11px;
    font-weight: 700;
    fill: var(--lab-gray-500);
    transition: fill 0.25s;
}

.frame-dim-label.highlight {
    fill: var(--lab-red, #dc2626);
    font-size: 12px;
}

.frame-lens-shape {
    fill: rgba(59, 130, 246, 0.06);
    stroke: var(--lab-gray-400);
    stroke-width: 1.5;
    transition: fill 0.3s, stroke 0.3s;
}

.frame-bridge-shape {
    fill: none;
    stroke: var(--lab-gray-400);
    stroke-width: 2;
    transition: stroke 0.3s;
}

.frame-bridge-shape.highlight {
    stroke: var(--lab-red, #dc2626);
}

/* Frame measurement inputs */
.frame-inputs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
}

.frame-input-card {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.5rem 0.75rem;
    background: var(--lab-white);
    border: 1.5px solid var(--lab-gray-200);
    border-radius: 10px;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.frame-input-card:focus-within {
    border-color: var(--lab-blue-dark, #1e3a5c);
    box-shadow: 0 0 0 3px rgba(30, 58, 92, 0.1);
}

.frame-input-card label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--lab-gray-500);
    margin: 0;
}

.frame-input-card .frame-input-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.frame-input-card input {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--lab-gray-900);
    padding: 0;
    outline: none;
    box-shadow: none;
}

.frame-input-card input::placeholder {
    color: var(--lab-gray-300);
    font-weight: 400;
}

.frame-input-card .frame-input-unit {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--lab-gray-400);
    white-space: nowrap;
}

/* Wizard footer navigation */
.wizard-nav-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 2rem 1rem;
    background: var(--lab-gray-50);
    border-top: 1px solid var(--lab-gray-200);
}

.wizard-nav-footer .wizard-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.wizard-btn-back {
    background: var(--lab-white);
    color: var(--lab-gray-600);
    border: 1.5px solid var(--lab-gray-300) !important;
}

.wizard-btn-back:hover {
    background: var(--lab-gray-100);
    color: var(--lab-gray-800);
}

.wizard-btn-next {
    background: var(--lab-blue-dark, #1e3a5c);
    color: #fff;
}

.wizard-btn-next:hover {
    background: #162d4a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 58, 92, 0.3);
}

.wizard-btn-skip-frame {
    background: var(--lab-white);
    color: var(--lab-gray-600);
    border: 1.5px solid var(--lab-gray-300) !important;
}

.wizard-btn-skip-frame:hover {
    background: var(--lab-gray-100);
    color: var(--lab-gray-800);
}

.frame-omit-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-top: 0.85rem;
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    border: 1px solid #f59e0b;
    background: #fffbeb;
    color: #92400e;
}

.frame-omit-warning__icon {
    flex-shrink: 0;
    font-size: 1.1rem;
    line-height: 1.35;
}

.frame-omit-warning__text {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.45;
}

.frame-omit-warning__text strong {
    color: #b45309;
}

.wizard-btn-next:disabled {
    background: var(--lab-gray-300);
    color: var(--lab-gray-500);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.wizard-nav-spacer {
    flex: 1;
}

/* Responsive wizard */
@media (max-width: 768px) {
    .wizard-progress {
        padding: 1rem 1rem 0.75rem;
        gap: 0;
    }

    .wizard-step-indicator {
        min-width: 4rem;
    }

    .wizard-step-circle {
        width: 2rem;
        height: 2rem;
        font-size: 0.8rem;
    }

    .wizard-step-label {
        font-size: 0.6rem;
    }

    .frame-diagram-container {
        flex-direction: column;
        gap: 1.25rem;
        padding: 1rem;
    }

    .frame-inputs-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .wizard-nav-footer {
        padding: 1rem 1.25rem 1.25rem;
    }
}

@media (max-width: 480px) {
    .frame-inputs-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   WIZARD compact overrides — ensure no scroll on any step
   ============================================================ */

/* Step 2: Compact OD/OI forms */
.wizard-step-panel .eyes-parallel {
    gap: 0.5rem;
    margin-top: 0.35rem;
}

.wizard-step-panel .eye-section {
    padding: 0.5rem 0.75rem 0.35rem;
}

.wizard-step-panel .eye-section::before {
    height: 3px;
}

.wizard-step-panel .eye-section:hover {
    transform: none;
}

.wizard-step-panel .eye-section h4 {
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    padding-bottom: 0.3rem;
}

.wizard-step-panel .form-column {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.wizard-step-panel .form-group {
    margin-bottom: 0.25rem;
}

.wizard-step-panel .form-group label {
    margin-bottom: 0.15rem;
    font-size: 0.78rem;
}

.wizard-step-panel .form-group input,
.wizard-step-panel .form-group select {
    padding: 0.4rem 0.65rem;
    font-size: 0.88rem;
}

/* Step 2: Compact eye-mode selector */
.wizard-step-panel .eye-mode-group {
    margin-bottom: 0;
}

.wizard-step-panel .eye-mode-segmented {
    margin-top: 0.2rem;
}

.wizard-step-panel .eye-mode-segmented .radio-option.eye-mode-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

/* Step 3: Compact crystal options */
.wizard-step-panel .form-row {
    margin-bottom: 0;
}

.wizard-step-panel .crystal-type-shared {
    margin-bottom: 0.5rem;
}

.wizard-step-panel .fotocromatico-variant-row {
    margin-bottom: 0;
}

.wizard-step-panel .fotocromatico-variant-group {
    padding: 0.5rem 0.75rem;
}

/* Step 3: Compact modal footer */
#crystal-modal-footer {
    padding: 0.75rem 1.5rem 0.85rem;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

#crystal-modal-footer .crystal-live-total {
    flex: 1;
    min-width: 0;
}

#crystal-modal-footer .crystal-live-total__headline {
    font-size: 0.9rem;
}

#crystal-modal-footer .crystal-live-total__meta {
    font-size: 0.75rem;
}

#crystal-modal-footer .btn-modern {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

#crystal-modal-footer .wizard-btn-back {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}