:root {
    --fab-gap: 12px;
    --fab-size: 54px;
    --fab-main-size: 60px;
}

/* CONTENEDOR ANCLA */
.user-menu-container {
    position: relative;
    display: inline-block;
}

/* BOTÓN DE USUARIO (Reset de estilos por si acaso) */
.btn-user {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.btn-user:hover {
    transform: scale(1.1);
}

/* MENU WRAPPER */
.sub-menu-wrap {
    position: absolute;
    right: 0;
    top: 100%;
    width: 280px; /* Un poco más compacto se ve mejor */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-15px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Efecto elástico */
    z-index: 1000;
}

.sub-menu-wrap.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* EL MENÚ (Estilo Glassmorphism) */
.sub-menu {
    background: var(--bg-card);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 2px solid var(--primary);
    box-shadow: var(--shadow);
    color: var(--text);
    margin-top: 10px; /* Espacio para el triángulo */
}

/* TRIANGULITO (Posicionado exacto) */
.sub-menu-wrap::before {
    content: "";
    position: absolute;
    top: 3px; /* Justo encima del menú */
    right: 12px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid var(--primary);
    pointer-events: none;
}



.login-footer {
    font-size: 0.8rem;
    text-align: center;
    margin-top: 15px;
}

.login-footer a {
    color: var(--primary);
    font-weight: bold;
    text-decoration: none;
}

/* ==========================================================================
   MÓDULO 7: COMPONENTES DE SELECCIÓN (Premium)
   ========================================================================== */

.selection-control {
    display: inline-flex; /* Mejor que flex para que no ocupe todo el ancho */
    align-items: center;
    gap: 12px;
    cursor: pointer;
    margin-bottom: 12px;
    user-select: none;
    font-size: 0.95rem;
    color: var(--text-main);
    transition: opacity 0.2s;
}

.selection-control:hover {
    opacity: 0.85;
}

/* Ocultar input manteniendo accesibilidad */
.selection-control input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* --- CHECKBOX CUSTOM --- */
.checkbox-box {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: var(--input-bg);
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Anillo de enfoque para accesibilidad */
.selection-control input:focus-visible + .checkbox-box,
.selection-control input:focus-visible + .radio-circle {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

.selection-control input:checked + .checkbox-box {
    background: var(--primary);
    border-color: var(--primary);
    transform: scale(1.05);
}

.checkbox-box::after {
    content: '';
    position: absolute;
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.selection-control input:checked + .checkbox-box::after {
    transform: rotate(45deg) scale(1);
}

/* --- RADIO CUSTOM --- */
.radio-circle {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border);
    border-radius: 50%;
    background: var(--input-bg);
    position: relative;
    transition: all 0.3s ease;
}

.selection-control input:checked + .radio-circle {
    border-color: var(--primary);
    border-width: 6px; /* Efecto Donut Material */
    background: white;
}

/* --- SWITCH (TOGGLE) PREMIUM --- */
.switch-track {
    width: 44px;
    height: 24px;
    background: var(--border);
    border-radius: 20px;
    position: relative;
    transition: background 0.3s ease;
}

.switch-thumb {
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 3px;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.selection-control input:checked + .switch-track {
    background: var(--primary);
}

.selection-control input:checked + .switch-track .switch-thumb {
    transform: translateX(20px);
} /* ==========================================================================
   BOTONES ULTRA PRO (SaaS / Stripe Style)
   ========================================================================== */

.btn-theme {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 8px 12px;
    border-radius: 50%;
    cursor: pointer;
    margin-left: 10px;
}

.btn{
    position:relative;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:10px;
    padding:12px 26px;
    font-size:.9rem;
    font-weight:600;
    border-radius:10px;
    border:none;
    cursor:pointer;
    overflow:hidden;
    transition:all .35s cubic-bezier(.4,0,.2,1);
    text-decoration:none;
}

/* ICONO MICRO ANIMACIÓN */

.btn i{
    transition:transform .3s ease;
}

.btn:hover i{
    transform:translateX(3px);
}

/* ======================================================
   PRIMARY PREMIUM
====================================================== */

.btn-primary{

    background:linear-gradient(
        135deg,
        #3b82f6,
        #6366f1,
        #2563eb
        );

    background-size:200% 200%;

    color:white;

    box-shadow:
        0 6px 16px rgba(37,99,235,.35),
        0 2px 6px rgba(0,0,0,.1);
}

/* gradiente animado */

.btn-primary:hover{

    background-position:right center;

    transform:translateY(-3px);

    box-shadow:
        0 14px 28px rgba(37,99,235,.45),
        0 6px 10px rgba(0,0,0,.15);
}

/* ======================================================
   BOTON SOFT
====================================================== */

.btn-soft{

    background:rgba(59,130,246,.12);

    color:var(--primary);

    backdrop-filter:blur(6px);
}

.btn-soft:hover{

    background:rgba(59,130,246,.2);

    transform:translateY(-2px);
}

/* ======================================================
   BOTON GLASS PRO
====================================================== */

.btn-glass{

    background:rgba(255,255,255,.06);

    backdrop-filter:blur(12px);

    border:1px solid rgba(255,255,255,.15);

    color:var(--text-main);

    box-shadow:0 4px 10px rgba(0,0,0,.1);
}

.btn-glass:hover{

    background:rgba(255,255,255,.15);

    transform:translateY(-2px);

    box-shadow:0 8px 20px rgba(0,0,0,.15);
}

/* ======================================================
   BOTON DESTRUCTIVO
====================================================== */

.btn-danger{

    background:linear-gradient(
        135deg,
        #ef4444,
        #dc2626
        );

    color:white;

    box-shadow:0 6px 16px rgba(239,68,68,.35);
}

.btn-danger:hover{

    transform:translateY(-3px);

    box-shadow:0 14px 26px rgba(239,68,68,.45);
}

/* ======================================================
   SHINE PRO
====================================================== */

.btn-shine::before{

    content:"";

    position:absolute;

    top:0;
    left:-120%;

    width:60%;
    height:100%;

    background:linear-gradient(
        120deg,
        transparent,
        rgba(255,255,255,.35),
        transparent
        );

    transform:skewX(-20deg);

    transition:.7s;
}

.btn-shine:hover::before{

    left:140%;
}

/* ======================================================
   BOTON CIRCULAR
====================================================== */

.btn-circle{

    width:46px;
    height:46px;
    padding:0;

    border-radius:50%;
}

/* ======================================================
   BOTON LARGE
====================================================== */

.btn-lg{

    padding:16px 34px;

    font-size:1rem;
}

/* ======================================================
   EFECTO PRESIÓN
====================================================== */

.btn:active{

    transform:scale(.95);
}

/* ======================================================
   GRUPO BOTONES
====================================================== */

.btn-group{

    display:flex;

    gap:14px;

    flex-wrap:wrap;

    margin-top:20px;
}

  /* ===================================================
       BUBBLE GLOBAL PRO (SUCCESS / ERROR / WARNING)
       =================================================== */
 /* 1. Contenedor Base */
  /* Contenedor del buscador */
.tooltip-input {
    position: relative; /* Importante para anclar la burbuja */
    display: inline-flex;
    align-items: center;
}

/* 2. Estilo del Input (Expandible) */
    .tooltip-input input {
        position: absolute;
        right: 0;
        width: 42px;
        height: 42px;
        border-radius: 999px;
        border: 1px solid var(--glass-border, #ccc);
        background: var(--bg-tooltips, #fff);
        backdrop-filter: blur(8px);
        transition: width .4s cubic-bezier(0.4, 0, 0.2, 1), background .3s, border-color .3s;
        cursor: pointer;
        box-shadow: var(--shadow);
        color: var(--text-color, #333);
        outline: none;
        padding: 0;
        text-align: center;
        z-index: 1;
    }
    
    .tooltip-input input:focus {
        width: 220px;
        padding: 0 40px 0 15px; /* Espacio para la lupa a la derecha */
        background: var(--bg-input, #fff);
        cursor: text;
        text-align: left;
        border-color: var(--primary, #2196f3);
    }
    
    



/* BASE */
.status-bubble {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;

    min-width: 240px;
    padding: 12px 16px;
    border-radius: 10px;

    color: #fff;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.3px;

    display: flex;
    align-items: center;
    gap: 10px;

    z-index: 100;

    opacity: 0;
    transform: translateY(-8px) scale(0.95);
    transition: all 0.25s ease;

    pointer-events: none;
}



/* TEXTO MÁS LEGIBLE */
.status-bubble span {
    flex: 1;
    line-height: 1.4;
}

/* ICONO */
.status-bubble i {
    font-size: 16px;
    flex-shrink: 0;
}

/* SHOW */
.status-bubble.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* =========================
   ESTADOS
========================= */

/* ✅ SUCCESS */
.status-bubble.success {
    background: linear-gradient(135deg, #27ae60, #1e8449);
    border: 1px solid #1e8449;
    box-shadow: 0 8px 20px rgba(39, 174, 96, 0.25);
}

/* ❌ ERROR */
.status-bubble.error {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border: 1px solid #c0392b;
    box-shadow: 0 8px 20px rgba(231, 76, 60, 0.25);
}

/* ⚠ WARNING */
.status-bubble.warning {
    background: linear-gradient(135deg, #f39c12, #d68910);
    border: 1px solid #d68910;
    box-shadow: 0 8px 20px rgba(243, 156, 18, 0.25);
}

/* =========================
   FLECHA DINÁMICA
========================= */

.status-bubble::after {
    content: '';
    position: absolute;
    top: -6px;
    right: 15px;

    width: 10px;
    height: 10px;

    transform: rotate(45deg);
    background: inherit; /* 🔥 hereda el color automáticamente */
}

/* sombra sutil de la flecha */
.status-bubble::before {
    content: '';
    position: absolute;
    top: -7px;
    right: 15px;

    width: 10px;
    height: 10px;

    transform: rotate(45deg);
    background: rgba(0,0,0,0.15);
    z-index: -1;
}

/* =========================================
   FAB MENU PRO
========================================= */

.fab-container {
    position: fixed;
    z-index: 999;
    display: flex;
}

/* Ubicación en la pantalla */
.fab-right {
    right: 30px;
}
.fab-left {
    left: 30px;
}
.fab-bottom {
    bottom: 30px;
}
.fab-top {
    top: 30px;
}

.fab-menu {
    display: flex;
    align-items: center;
    gap: var(--fab-gap);
}

/* Lógica de Dirección de Despliegue */
.fab-up .fab-menu    {
    flex-direction: column-reverse;
} /* Sube */
.fab-down .fab-menu  {
    flex-direction: column;
}         /* Baja */
.fab-left .fab-menu  {
    flex-direction: row-reverse;
}    /* Hacia la izq */
.fab-right .fab-menu {
    flex-direction: row;
}            /* Hacia la der */

/* Botones Base */
.fab-btn {
    width: var(--fab-size);
    height: var(--fab-size);
    border-radius: 50%;
    border: none;
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .3s cubic-bezier(.4,0,.2,1);
}

.fab-main {
    width: var(--fab-main-size);
    height: var(--fab-main-size);
    background:  var(--primary); /* Tu color accent */
    color: white;
    z-index: 2;
}

/* Estado Oculto (Items) */
.fab-item {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.7);
}

/* Animación cuando está abierto */
.fab-container.open .fab-item {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

/* Rotación del icono principal */
.fab-container.open .fab-main {
    transform: rotate(45deg);
    background: #ff4757; /* Color de cierre */
}

/* Tooltips Inteligentes */
.fab-btn[data-label]::after {
    content: attr(data-label);
    position: absolute;
    padding: 5px 10px;
    background: #333;
    color: white;
    font-size: 12px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: .2s;
}

/* Posición de Tooltips según la dirección del menú */
/* Si el menú es vertical (up/down), tooltip a la izquierda (o derecha si prefieres) */
.fab-up .fab-btn::after, .fab-down .fab-btn::after {
    right: calc(100% + 15px);
}
/* Si el menú es horizontal (left/right), tooltip arriba */
.fab-left .fab-btn::after, .fab-right .fab-btn::after {
    bottom: calc(100% + 15px);
}

.fab-btn:hover::after {
    opacity: 1;
}

 /* ===== TOTAL FAB ANIMADO ===== */
  /* ===== CONTENEDOR GENERAL (opcional para agrupar) ===== */
.fab-wrapper {
    position: fixed;
    bottom: 155px;
    right: 29px;
    display: flex;
    flex-direction: column; /* Mantiene la columna */
    align-items: flex-end;
    gap: 10px; /* Un poco más de espacio para la flecha */
    z-index: 1;
}

/* ===== TOTAL (AHORA ARRIBA) ===== */
.fab-total {
    background: linear-gradient(135deg, #ffffff, #f1f3f5);
    color: #1e1e1e;
    padding: 8px 16px;
    border-radius: 18px;
    font-size: 16px;
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(0,0,0,.25);
    letter-spacing: 0.5px;
    transition: all .25s ease;
}

/* ===== DESCUENTO (AHORA ABAJO) ===== */
.fab-descuento {
    position: relative;
    background: linear-gradient(135deg, #ffe8e8, #ffd6d6);
    color: #b42318;
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 6px 16px rgba(0,0,0,.15);
    transition: all .25s ease;
    
}

/* 🔺 Flecha ajustada para apuntar HACIA ARRIBA */
.fab-descuento::after {
    content: "";
    position: absolute;
    top: -8px; /* Cambiado de bottom a top */
    right: 18px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 8px solid #ffe8e8; /* Cambiado border-top por border-bottom */
    filter: drop-shadow(0 -2px 2px rgba(0,0,0,.05));
}
.fab-total::after {
    content: "";
    position: absolute;
    top: -8px; /* Cambiado de bottom a top */
    right: 18px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 8px solid #ffe8e8; /* Cambiado border-top por border-bottom */
    filter: drop-shadow(0 -2px 2px rgba(0,0,0,.05));
}

/* Mantén tus animaciones y estados (pulse, descuento, vacio) igual que antes */
.fab-total.pulse { transform: scale(1.1); }
.fab-total.descuento { background: linear-gradient(135deg, #fff3cd, #ffe69c); color: #856404; }
.fab-total.vacio { background: #f1f3f5; color: #999; }
.fab-descuento:hover, .fab-total:hover { transform: translateY(-2px) scale(1.03); }

/* ===== BOTÓN CENTRAL ===== */
.tooltip-container {
    position: fixed;
    bottom: 237px; /* Ajustado para visibilidad */
    right: 100px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 12px 25px rgba(0,0,0,.3);
    transition: .4s cubic-bezier(.4,0,.2,1);
    z-index: 1000;
}
/* La flecha al lado derecho */
.tooltip-container::after {
    content: "";
    position: absolute;
    right: -10px; /* Ajusta qué tanto sobresale */
    top: 50%;
    transform: translateY(-50%);
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 12px solid var(--primary); /* El color de tu fondo */
}

.tooltip-container:hover {
    transform: scale(1.05);
}

.tooltip-container svg {
    fill: #fff;
    transition: .3s;
}

/* ===== TOOLTIPS CIRCULARES ===== */
.tooltip-container span[class^="tooltip"] {
    position: absolute;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--bg-tooltips);
    backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: .4s cubic-bezier(.4,0,.2,1);
    z-index: -1;
}

.tooltip-container span i {
    font-size: 25px;
    color: var(--text-secondary);
    transition: .25s;
}

/* Estados abiertos */
.tooltip-container.open span[class^="tooltip"] {
    opacity: 1;
    visibility: visible;
}

/* 🔵 Distribución radial equilibrada */
.tooltip-container.open .tooltip1 {
    /* Arriba */
    transform: rotate(90deg) translate(-70px) rotate(-90deg);
}

.tooltip-container.open .tooltip2 {
    /* Arriba-centro */
    transform: rotate(30deg) translate(-70px) rotate(-30deg);
}

.tooltip-container.open .tooltip3 {
    /* Abajo-centro */
    transform: rotate(-30deg) translate(-70px) rotate(30deg);
}

.tooltip-container.open .tooltip4 {
    /* Abajo */
    transform: rotate(-90deg) translate(-70px) rotate(90deg);
}



/* Efectos Hover Individuales */
.tooltip1:hover {
    background: #03a9f4;
    border-color: #03a9f4;
}
.tooltip2:hover {
    background: #1db954;
    border-color: #1db954;
}
.tooltip3:hover {
    background: #ff9800;
    border-color: #ff9800;
}
.tooltip4:hover {
    background: #e91e63;
    border-color: #e91e63;
}


.tooltip-container span:hover i {
    color: var(--primary);
}

/* Estilo Base para Paneles (Radio y Check) */
/* Estilo General para todas las ventanas */
.tooltip-radio, .tooltip-check {
    position: absolute;
    /* Esto lo posiciona a la IZQUIERDA del botón circular */
    right: 111%;
    top: 50%;
    transform: translateY(-50%) scale(0.8);

    width: 140px;
    background: var(--bg-glass, rgba(255,255,255,0.95));
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);

    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(.4,0,.2,1);
    z-index: 3000;
}
.tooltip-radio::after,
.tooltip-check::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -12px; /* La mitad del tamaño de la flecha para que sobresalga */
    transform: translateY(-50%);

    /* Dibujo del triángulo con bordes */
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent transparent var(--bg-glass, rgba(255,255,255,0.1));

    /* Para que el desenfoque no afecte la flecha */
    pointer-events: none;
}


/* Estado Abierto (común para todos) */
.tooltip-radio.open, .tooltip-check.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) scale(1);
}


/* Estilos de Control Internos */
.tooltip-check label, .tooltip-radio label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    margin-bottom: 8px;
    cursor: pointer;
    color: #333;
    transition: opacity 0.2s;
}

.tooltip-check label:hover, .tooltip-radio label:hover {
    opacity: 0.7;
}

.tooltip-check input, .tooltip-radio input {
    cursor: pointer;
    accent-color: #3f51b5; /* Color corporativo */
}



.uiverse {
    position: relative;
    display: inline-block;
}

.tooltip-box {
    position: relative;
    display: inline-block;
}

/* BASE TOOLTIP */
.tooltip-box .tooltip {
    position: absolute;
    background: #333;
    color: #fff;
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 999;
    /* Quitamos el transform de aquí para manejarlo por posición */
}

/* BASE FLECHA */
.tooltip-box .tooltip::after {
    content: "";
    position: absolute;
    width: 8px;
    height: 8px;
    background: inherit;
    /* La rotación se mantiene fija, la posición varía según el padre */
}

/* ESTADO HOVER */
.tooltip-box:hover .tooltip {
    opacity: 1;
}

/* =====================
    POSICIONES (AJUSTADAS)
===================== */

/* TOP */
.tooltip-box[data-pos="top"] .tooltip {
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) scale(0.9);
}
.tooltip-box[data-pos="top"]:hover .tooltip { transform: translateX(-50%) scale(1); }

.tooltip-box[data-pos="top"] .tooltip::after {
    top: 100%; /* Abajo del tooltip */
    left: 50%;
    margin-top: -4px; /* Mitad del tamaño para que encaje */
    transform: translateX(-50%) rotate(45deg);
}

/* BOTTOM */
.tooltip-box[data-pos="bottom"] .tooltip {
    top: 125%;
    left: 50%;
    transform: translateX(-50%) scale(0.9);
}
.tooltip-box[data-pos="bottom"]:hover .tooltip { transform: translateX(-50%) scale(1); }

.tooltip-box[data-pos="bottom"] .tooltip::after {
    bottom: 100%; /* Arriba del tooltip */
    left: 50%;
    margin-bottom: -4px;
    transform: translateX(-50%) rotate(45deg);
}

/* LEFT */
.tooltip-box[data-pos="left"] .tooltip {
    right: 125%;
    top: 50%;
    transform: translateY(-50%) scale(0.9);
}
.tooltip-box[data-pos="left"]:hover .tooltip { transform: translateY(-50%) scale(1); }

.tooltip-box[data-pos="left"] .tooltip::after {
    left: 100%; /* A la derecha del tooltip */
    top: 50%;
    margin-left: -4px;
    transform: translateY(-50%) rotate(45deg);
}

/* RIGHT */
.tooltip-box[data-pos="right"] .tooltip {
    left: 125%;
    top: 50%;
    transform: translateY(-50%) scale(0.9);
}
.tooltip-box[data-pos="right"]:hover .tooltip { transform: translateY(-50%) scale(1); }

.tooltip-box[data-pos="right"] .tooltip::after {
    right: 100%; /* A la izquierda del tooltip */
    top: 50%;
    margin-right: -4px;
    transform: translateY(-50%) rotate(45deg);
}
/* BADGE */
.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: bold;
    display: none;
    z-index: 10;
}
/* ==========================================================================
   FORMULARIOS ADAPTADOS
   ========================================================================== */

.form-control {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.form-control label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Contenedor relativo para que nada "vuele" fuera del input */
.validate-container {
    position: relative;
    width: 100%;
}

.form-control input {
    width: 100%;
    padding: 12px 35px 12px 15px; /* Espacio para el icono a la derecha */
    background-color: var(--input-bg);
    border: 1px solid var(--border);
    color: var(--text-main);
    border-radius: var(--radius-md);
    outline: none;
    transition: all 0.3s ease;
}

.form-control input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Íconos centrados verticalmente */
.validate-container i {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    display: none; /* Cambiamos visibility por display para mejor control */
    pointer-events: none;
}

/* Tooltip de error flotante */
.validate-container .error-text {
    position: absolute;
    bottom: 115%;
    right: 0;
    background: #e74c3c;
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    white-space: nowrap;
    display: none;
    z-index: 10;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Flecha del tooltip */
.validate-container .error-text::before {
    content: "";
    position: absolute;
    bottom: -5px;
    right: 14px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #e74c3c;
}

/* ========== ESTADOS DE VALIDACIÓN ========== */

/* Success */
.form-control.success input {
    border-color: #2ecc71 !important;
}
.form-control.success .success-icon {
    display: block;
    color: #2ecc71;
}

/* Error */
.form-control.error input {
    border-color: #e74c3c !important;
}
.form-control.error .error-icon {
    display: block;
    color: #e74c3c;
}
.form-control.error .error-text {
    display: block;
    animation: fadeInError 0.2s ease-out;
}

@keyframes fadeInError {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   MATERIAL CARDS PRO (DYNAMIC THEME) - REDUX
========================================= */

.mdl-card {
    width: 100%;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    /* Preparado para el brillo */
    z-index: 1;
}

/* Efecto Elevación y Brillo de Borde */
.mdl-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.25);
}

/* Brillo sutil de fondo al hacer hover (opcional) */
.mdl-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top right, rgba(var(--primary-rgb), 0.05), transparent);
    z-index: -1;
    opacity: 0;
    transition: var(--transition);
}

.mdl-card:hover::before {
    opacity: 1;
}

/* IMAGEN CON OVERLAY GRADIENTE */
.card-img {
    width: 100%;
    height: 200px; /* Un poco más alta */
    overflow: hidden;
    position: relative;
    background: #e2e8f0;
}

/* Gradiente para que el texto de arriba (si hubiera) sea legible */
.card-img::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to top, rgba(0,0,0,0.4), transparent);
    opacity: 0;
    transition: var(--transition);
}

.mdl-card:hover .card-img::after {
    opacity: 1;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.mdl-card:hover .card-img img {
    transform: scale(1.15) rotate(1deg); /* Ligera rotación para dinamismo */
}

/* HEADER CARD */
.mdl-card__title {
    padding: 24px 24px 10px 24px;
    border: none; /* Quitamos el borde para un look más "unificado" */
}

.mdl-card__title-text {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--primary); /* El título pequeño ahora es el color de marca */
    display: flex;
    align-items: center;
    gap: 8px;
}

/* CONTENIDO PRINCIPAL */
.mdl-card__supporting-text {
    padding: 0 24px 24px 24px;
    flex-grow: 1;
}

.mdl-card__supporting-text h2 {
    margin: 5px 0 12px 0;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.mdl-card__supporting-text p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* FOOTER / ACCIONES MEJORADO */
.mdl-card__actions {
    padding: 20px 24px;
    background: linear-gradient(to bottom, transparent, rgba(var(--primary-rgb), 0.03));
    border-top: 1px solid var(--border);
}

/* Botón estilizado dentro de la card */
.mdl-card__actions .btn-pro {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
    cursor: pointer;
}

.mdl-card__actions .btn-pro:hover {
    filter: brightness(1.1);
    box-shadow: 0 8px 15px -5px var(--primary);
}

/* =========================================
   GALERIA MINI CARD
========================================= */

.card-gallery{
    display:flex;
    gap:8px;
    padding:10px 24px 0 24px;
}

.card-gallery img{
    width:100%;
    height:55px;
    object-fit:cover;
    border-radius:var(--radius-md);
    cursor:pointer;
    border:1px solid var(--border);
    transition:var(--transition);
}

.card-gallery img:hover{
    transform:scale(1.05);
    border-color:var(--primary);
}

/* =========================
   CART CONTAINER
========================= */

/* Contenedor con scroll elegante */
.cart-container {
    max-height: 420px;
    overflow-y: auto;
    padding-right: 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: thin;
}

/* El Item/Card */
.cart-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 15px;
    align-items: center;
    padding: 16px;
    background: var(--bg-card);
    border-radius: 14px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    transition: var(--transition);
}

.cart-item:hover {
    transform: translateY(-2px);
    border-color: #cbd5e1;
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

/* Info del Producto */
.cart-info {
    display: flex;
    flex-direction: column;
}

.cart-info h4, .cart-info strong {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    display: block;
}

.cart-info span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Selector de Cantidad */
.cart-qty {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f1f5f9;
    padding: 6px 12px;
    border-radius: 10px;
}

[data-theme="dark"] .cart-qty {
    background: #1e293b;
}

.cart-qty button {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-main);
    padding: 0 5px;
    transition: color 0.2s;
}

.cart-qty button:hover {
    color: #3b82f6;
}

.cart-qty .cantidad {
    min-width: 24px;
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
}

/* Precio y Botón Eliminar */
.cart-price {
    text-align: right;
    min-width: 80px;
}

.cart-price strong {
    display: block;
    font-size: 1.05rem;
    font-weight: 800;
    color: #10b981; /* Verde esmeralda */
}


/* Media Query para Celulares */
@media (max-width: 600px) {
    .cart-item {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 12px;
    }
    .cart-price {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: left;
        border-top: 1px solid var(--border);
        padding-top: 8px;
    }
    .cart-qty {
        justify-content: center;
    }
}
/* =========================================
   MODAL UNIVERSAL PRO
========================================= */

.modal-overlay{

    position:fixed;

    top:0;
    left:0;

    width:100%;
    height:100%;

    background:rgba(0,0,0,.45);

    backdrop-filter:blur(4px);

    display:flex;

    align-items:center;
    justify-content:center;

    opacity:0;
    pointer-events:none;

    transition:.3s;

    z-index:2000;
}

.modal-overlay.active{

    opacity:1;
    pointer-events:auto;
}

.modal-box{

    background:var(--bg-card);

    width:90%;
    max-width:520px;

    border-radius:14px;

    padding:25px;

    box-shadow:0 20px 60px rgba(0,0,0,.2);

    transform:scale(.9);

    transition:.3s;
}

.modal-overlay.active .modal-box{

    transform:scale(1);
}

/* header */

.modal-header{

    display:flex;

    justify-content:space-between;

    align-items:center;

    margin-bottom:20px;
}

.modal-title{

    font-weight:700;

    font-size:18px;
}

.modal-close{

    border:none;

    background:none;

    font-size:22px;

    cursor:pointer;
}

/* body */

.modal-body{

    max-height:60vh;

    overflow:auto;
}

/* CONTENEDOR */
.skeleton-container{
    padding: 20px;
}

/* BASE */
.skeleton-container div{
    background: linear-gradient(
        100deg,
        #2b2b2b 40%,
        #3a3a3a 50%,
        #2b2b2b 60%
        );
    background-size: 200% 100%;
    animation: shimmer 1.2s infinite;
    border-radius: 8px;
}

/* ELEMENTOS */
.sk-header{
    height: 28px;
    width: 220px;
    margin-bottom: 20px;
}

.sk-form{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.sk-input{
    height: 45px;
}

.sk-table .sk-row{
    height: 38px;
    margin-bottom: 12px;
}

/* ANIMACIÓN */
@keyframes shimmer{
    0%{
        background-position: -200% 0;
    }
    100%{
        background-position: 200% 0;
    }
}