/* =========================================================================
   STYLE-MY - DISEÑO DE SISTEMA Y ESTILOS DE INTERFAZ (PREMIUM DARK)
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,600;1,400&display=swap');

:root {
    --bg-main: #0a0a0c;
    --bg-surface: rgba(20, 20, 25, 0.7);
    --bg-surface-hover: rgba(30, 30, 38, 0.85);
    --border-color: rgba(217, 180, 143, 0.15);
    --border-color-active: rgba(217, 180, 143, 0.5);
    
    /* Luxury Palette */
    --accent-gold: #d9b48f;
    --accent-gold-hover: #e6c5a3;
    --accent-rose: #e8a7a1;
    --text-primary: #f3f4f6;
    --text-muted: #cbd5e1;
    --text-gold: #e2c09c;
    
    --shadow-premium: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
    --shadow-gold-glow: 0 0 20px rgba(217, 180, 143, 0.15);
    
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Outfit', sans-serif;
    
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset y Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(217, 180, 143, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(232, 167, 161, 0.05) 0%, transparent 45%);
    background-attachment: fixed;
}

/* Scrollbar Personalizado */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-gold);
}

/* Contenedor Principal */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Encabezado */
header {
    text-align: center;
    margin-bottom: 3.5rem;
    position: relative;
    padding-bottom: 1.5rem;
}

header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
}

header h1 {
    font-family: var(--font-serif);
    font-size: 3rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

header h1 span {
    color: var(--text-gold);
    font-style: italic;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 300;
}

/* Layout del Reservador */
.booking-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
}

@media (min-width: 992px) {
    .booking-grid {
        grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    }
}

/* Tarjetas Glass */
.glass-card {
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--shadow-premium);
    transition: var(--transition-smooth);
}

.glass-card:hover {
    border-color: rgba(217, 180, 143, 0.25);
    box-shadow: var(--shadow-premium), var(--shadow-gold-glow);
}

/* Títulos de Sección */
.section-title {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-gold);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Categorías y Filtros */
.category-tabs {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
    scrollbar-width: thin;
}

.category-tab {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.6rem 1.2rem;
    border-radius: 30px;
    cursor: pointer;
    font-family: var(--font-sans);
    font-weight: 500;
    white-space: nowrap;
    transition: var(--transition-smooth);
}

.category-tab:hover {
    color: var(--text-primary);
    border-color: rgba(217, 180, 143, 0.3);
    background: rgba(217, 180, 143, 0.05);
}

.category-tab.active {
    background: var(--accent-gold);
    color: #1a1a24;
    border-color: var(--accent-gold);
    box-shadow: 0 4px 15px rgba(217, 180, 143, 0.25);
}

/* Lista de Servicios */
.services-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.service-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.service-item:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-color-active);
    transform: translateY(-2px);
}

.service-item.selected {
    background: rgba(217, 180, 143, 0.08);
    border-color: var(--accent-gold);
    box-shadow: var(--shadow-gold-glow);
}

.service-info {
    flex: 1;
}

.service-name {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.service-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    gap: 1rem;
}

.service-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.service-price-box {
    text-align: right;
    margin-left: 1.5rem;
}

.service-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-gold);
}

/* Selector de Tallas */
.size-selector {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.size-btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.size-btn.active {
    background: var(--accent-gold);
    color: #1a1a24;
    border-color: var(--accent-gold);
}

/* Selector de Fecha y Hora (Calendario) */
.calendar-container {
    margin-bottom: 2rem;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.calendar-month {
    font-size: 1.1rem;
    font-weight: 600;
}

.calendar-nav {
    display: flex;
    gap: 0.5rem;
}

.calendar-nav-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.calendar-nav-btn:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    text-align: center;
}

.calendar-day-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0.5rem 0;
}

.calendar-day {
    padding: 0.75rem 0;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.calendar-day:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(217, 180, 143, 0.2);
}

.calendar-day.selected {
    background: var(--accent-gold);
    color: #1a1a24;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(217, 180, 143, 0.25);
}

.calendar-day.disabled {
    color: rgba(255, 255, 255, 0.15);
    cursor: not-allowed;
}

/* Selector de Horarios */
.slots-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.slot-item {
    padding: 0.6rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
    font-family: var(--font-sans);
    transition: var(--transition-smooth);
}

.slot-item:hover:not(.disabled) {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    background: rgba(217, 180, 143, 0.05);
}

.slot-item.selected {
    background: var(--accent-gold);
    color: #1a1a24;
    border-color: var(--accent-gold);
    font-weight: 600;
}

.slot-item.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: transparent;
}

/* Formulario del Cliente */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 1rem;
    transition: var(--transition-smooth);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: var(--shadow-gold-glow);
    background: rgba(255, 255, 255, 0.05);
}

.form-control option {
    background-color: #121214;
    color: var(--text-primary);
}

.radio-group {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-primary);
}

/* Resumen del Checkout Lateral */
.summary-box {
    border-top: 1px solid var(--border-color);
    margin-top: 2rem;
    padding-top: 1.5rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.summary-row.total {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-gold);
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border-color);
}

.summary-row span:last-child {
    font-weight: 500;
}

/* Botones */
.btn-primary {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-rose));
    color: #1a1a24;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(217, 180, 143, 0.2);
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(217, 180, 143, 0.35);
    filter: brightness(1.05);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Mensajes de Alerta y Pantallas de Carga */
.alert {
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    display: none;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.loader {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(26, 26, 36, 0.2);
    border-top: 2px solid #1a1a24;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Indicador de Pasos */
.steps-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
}

.steps-indicator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border-color);
    z-index: 1;
    transform: translateY(-50%);
}

.step-node {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--bg-main);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    z-index: 2;
    transition: var(--transition-smooth);
}

.step-node.active {
    border-color: var(--accent-gold);
    color: var(--text-gold);
    box-shadow: var(--shadow-gold-glow);
}

.step-node.completed {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
    color: #1a1a24;
}

/* Responsive Design Adaptations */
@media (max-width: 768px) {
    .container {
        padding: 1rem 0.75rem;
    }
    
    header {
        margin-bottom: 2rem;
    }
    
    header h1 {
        font-size: 2.25rem;
    }
    
    .glass-card {
        padding: 1.25rem;
        border-radius: 16px;
    }
    
    .section-title {
        font-size: 1.4rem;
        margin-bottom: 1.25rem;
    }
    
    .category-tabs {
        margin-bottom: 1.5rem;
        padding-bottom: 0.75rem;
    }
    
    .services-list {
        gap: 1rem;
        max-height: 400px;
    }
    
    .service-item {
        padding: 1rem;
        border-radius: 12px;
    }
    
    .service-name {
        font-size: 1.05rem;
    }
    
    .service-price {
        font-size: 1.15rem;
    }
    
    .slots-container {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 0.5rem;
    }
    
    .slot-item {
        padding: 0.5rem 0.25rem;
        font-size: 0.85rem;
    }
    
    .btn-primary {
        padding: 0.85rem;
        font-size: 1rem;
    }
}

/* ==========================================================================
   BUSCADOR INTELIGENTE DE CLIENTE
   ========================================================================== */

/* Caja contenedora del buscador */
.client-lookup-box {
    position: relative;
    margin-bottom: 1.25rem;
}

.client-lookup-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.6rem;
    color: var(--text-gold);
    letter-spacing: 0.01em;
}

/* Fila de input con ícono */
.client-lookup-input-row {
    position: relative;
    display: flex;
    align-items: center;
}

.client-lookup-icon {
    position: absolute;
    left: 0.9rem;
    font-size: 1rem;
    z-index: 2;
    pointer-events: none;
    opacity: 0.7;
}

.client-lookup-input {
    padding-left: 2.6rem !important;
    padding-right: 2.4rem !important;
    border-color: rgba(217, 180, 143, 0.3) !important;
    background: rgba(217, 180, 143, 0.04) !important;
}

.client-lookup-input:focus {
    border-color: var(--accent-gold) !important;
    box-shadow: 0 0 0 3px rgba(217, 180, 143, 0.12) !important;
}

/* Botón limpiar (×) */
.client-lookup-clear {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 50%;
    transition: var(--transition-smooth);
    z-index: 2;
    line-height: 1;
}
.client-lookup-clear:hover {
    color: var(--accent-gold);
    background: rgba(217, 180, 143, 0.1);
}

/* Dropdown de resultados */
.client-lookup-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: rgba(18, 18, 24, 0.98);
    border: 1px solid rgba(217, 180, 143, 0.3);
    border-radius: 14px;
    box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.7), 0 0 20px rgba(217, 180, 143, 0.1);
    z-index: 200;
    overflow: hidden;
    animation: dropdownFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(20px);
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Ítem del dropdown */
.lookup-result-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1.1rem;
    cursor: pointer;
    transition: background 0.18s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.lookup-result-item:last-child {
    border-bottom: none;
}

.lookup-result-item:hover,
.lookup-result-item:focus {
    background: rgba(217, 180, 143, 0.09);
    outline: none;
}

/* Avatar inicial del nombre */
.lookup-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-rose));
    color: #1a1a24;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.lookup-result-info {
    flex: 1;
    min-width: 0;
}

.lookup-result-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lookup-result-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Estado vacío del dropdown */
.lookup-empty {
    padding: 1.1rem 1.25rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
}

/* Estado buscando */
.lookup-searching {
    padding: 1rem 1.25rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.lookup-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(217, 180, 143, 0.2);
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

/* Badge de cliente seleccionado */
.client-selected-badge {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 1rem;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 10px;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.badge-icon {
    color: #10b981;
    font-size: 1.1rem;
    font-weight: 700;
}

#client-selected-name {
    font-weight: 600;
    color: #10b981;
    flex: 1;
}

.badge-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.badge-deselect {
    background: none;
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
    font-size: 0.8rem;
    padding: 3px 10px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.badge-deselect:hover {
    background: rgba(16, 185, 129, 0.1);
}

/* Divisor "o ingresa manualmente" */
.lookup-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0 1.5rem;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.lookup-divider::before,
.lookup-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

