/*
 Theme Name:   Astra Child
 Theme URI:    https://solvitu.com/
 Description:  Tema hijo personalizado para TM Capacitación
 Author:       Solvitu
 Author URI:   https://solvitu.com/sobre-nosotros
 Template:     astra
 Version:      1.1.0
 */

/* ============================================================
   1. FUENTES Y VARIABLES (TOKENS)
   ============================================================ */
@font-face {
    font-family: 'Stolzl';
    src: url('assets/fonts/stolzl_thin.otf') format('opentype');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Stolzl';
    src: url('assets/fonts/stolzl_light.otf') format('opentype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Stolzl';
    src: url('assets/fonts/stolzl_regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Stolzl';
    src: url('assets/fonts/stolzl_medium.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Stolzl';
    src: url('assets/fonts/stolzl_bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary-color: #002A8C;
    --accent-color: #6A1B9A;
    --offer-color: #FF5722;
    --text-main: #2d3436;
    --text-muted: #636e72;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.5);
    --gradient-brand: linear-gradient(45deg, #002A8C, #6A1B9A);
    --header-height: 100px;

    --tm-nav-bg: rgba(255, 255, 255, 0.94);
    --tm-nav-border: rgba(30, 41, 59, 0.10);
    --tm-nav-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    --tm-nav-link: #1e3a8a;
    --tm-nav-link-hover: #162d6b;
    --tm-nav-text-dark: #111827;
    --tm-nav-pill: #6b21a8;
    --tm-nav-pill-hover: #7e2bc1;
    --tm-nav-mobile-bg: rgba(23, 31, 56, 0.96);
    --tm-nav-mobile-hover: rgba(255, 255, 255, 0.10);
    --tm-nav-mobile-hover-strong: rgba(255, 255, 255, 0.14);
    --tm-sidebar-w: 260px;
    --tm-font-main: 'Stolzl', sans-serif;
}

/* ============================================================
   2. NAVEGACIÓN ISLA GLOBAL - Protegida contra layouts de página
   ============================================================ */

/* 1. Hacer transparentes los contenedores principales de Astra */
.site-header,
.ast-main-header-wrap,
.ast-mobile-header-wrap {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}

/* 2. Aplicar el diseño "Isla" directamente a las barras internas de Astra (Escritorio y Móvil) */
#ast-desktop-header .ast-primary-header-bar.main-header-bar,
#ast-mobile-header .ast-primary-header-bar.main-header-bar {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 999px !important;
    max-height: 80px !important;
    margin: 15px auto !important;
    width: min(95%, 1200px) !important;
    /* Limita el ancho para mantener forma de cápsula */
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 8px 32px rgba(0, 42, 140, 0.1);
    position: relative;
    /* Cambiado de absolute para evitar que flote sobre el contenido si no hay padding */
    z-index: 9999 !important;
    display: flex;
    align-items: center;
}

/* Forzar que el contenido de la isla no se desborde */
.ast-builder-grid-row {
    width: 100%;
    align-items: center !important;
}

/* Ajuste de anchos por contenido */
.site-header-primary-section-left {
    flex: 0 0 auto !important;
    width: auto !important;
}

.site-header-primary-section-right {
    flex: 0 0 auto !important;
    width: auto !important;
}

.site-header-primary-section-center {
    flex: 1 1 auto !important;
    /* El menú central absorbe el espacio sobrante */
}

/* Reset de Widgets en Header (Limpieza de Párrafos inyectados) */
.header-widget-area section#block-8 p {
    margin: 0 !important;
    padding: 0 !important;
    display: contents;
}

/* FIX URGENTE: Evitar que el botón "Aula Virtual" se aplaste verticalmente */
.ast-header-button-1,
.ast-builder-button-wrap,
.ast-custom-button {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    min-width: max-content !important;
}

/* Ajuste para que la barra de administración de WP no tape el menú */
body.admin-bar #ast-desktop-header .ast-primary-header-bar.main-header-bar {
    margin-top: 50px !important;
}

.site-header-primary-section-right-center {
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
}

/* Limpieza del Widget personalizado para que no herede márgenes de Astra */
.header-widget-area-inner {
    display: flex;
    align-items: center;
}

/* Control de altura y forma de Isla */
@media (max-width: 921px) {

    #ast-desktop-header .ast-primary-header-bar.main-header-bar,
    #ast-mobile-header .ast-primary-header-bar.main-header-bar {
        border-radius: 20px !important;
        /* Pasamos de cápsula a tarjeta redondeada */
        margin: 10px auto !important;
        padding: 10px 0 !important;
        height: auto !important;
        max-height: none !important;
    }

    .ast-builder-grid-row {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    /* Forzamos que el logo y el toggle del menú mantengan una sola fila superior */
    .site-header-primary-section-left,
    .site-header-primary-section-right {
        width: 50% !important;
    }

    /* Botón Hamburguesa Flotante (Regla 4) */
    .ast-mobile-header-wrap .menu-toggle {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        color: var(--primary-color) !important;
        border-radius: 12px !important;
    }

    .ast-mobile-header-wrap .menu-toggle:hover {
        background: rgba(0, 42, 140, 0.05) !important;
    }
}

/* Widget Usuario y Carrito en Cabecera */
.tm-header-user-actions {
    display: flex !important;
    align-items: center !important;
    gap: 15px;
}

.tm-welcome {
    display: inline-flex;
    align-items: center;
    white-space: nowrap !important;
    vertical-align: middle;
}

.tm-welcome strong {
    display: inline-block;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
}

.tm-user-links {
    white-space: nowrap !important;
    vertical-align: middle;
}

/* ============================================================
   FIN DE CABECERA
   ============================================================ */

/* ============================================================
   3. NOTIFICACIONES Y MENSAJES (WOOCOMMERCE)
   ============================================================ */
.woocommerce-notices-wrapper {
    /* margin-top: 90px; */
    margin-bottom: 20px;
    width: 100%;
    max-width: min(95%, 1200px);
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 99;
}

.woocommerce-notices-wrapper:empty {
    margin: 0;
    padding: 0;
    height: 0;
}

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    border: none !important;
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px !important;
    box-shadow: var(--tm-nav-shadow);
    padding: 20px 25px;
    color: #2c3e50;
    margin-bottom: 2em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    font-family: var(--tm-font-main);
    transition: opacity 0.8s ease, transform 0.8s ease, margin 0.8s ease;
    opacity: 1;
    transform: translateY(0);
}

/* Específicos para Checkout para evitar huecos gigantes */
.woocommerce-checkout .woocommerce-info,
.woocommerce-checkout .woocommerce-message,
.woocommerce-checkout .woocommerce-error {
    margin-top: 15px;
    margin-bottom: 15px;
    width: min(95%, 1200px);
    margin-left: auto;
    margin-right: auto;
    padding-left: 60px;
}

.woocommerce-checkout .woocommerce-info::before,
.woocommerce-checkout .woocommerce-message::before,
.woocommerce-checkout .woocommerce-error::before {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.woocommerce-checkout .woocommerce-info {
    border-left: 5px solid var(--primary-color);
}

.woocommerce-checkout .woocommerce-message {
    border-left: 5px solid #22c55e;
}

.woocommerce-checkout .woocommerce-info a,
.woocommerce-checkout .woocommerce-message a {
    color: var(--primary-color);
    font-weight: 700;
    text-decoration: underline;
}

.woocommerce-notices-wrapper> :first-child,
.woocommerce-checkout> :first-child.woocommerce-info {
    /* margin-top: 130px; */
}

.woocommerce-message a.button {
    background-color: var(--accent-color);
    color: #fff;
    border-radius: 999px;
    padding: 8px 20px;
    transition: transform 0.2s ease;
}

.woocommerce-message a.button:hover {
    transform: scale(1.05);
}

.single-product .woocommerce-message {
    display: none;
}

/* Ribbon diagonal de OFERTA */
.tm-sale-ribbon,
.onsale-custom {
    position: absolute;
    top: 14px;
    left: -28px;
    width: 110px;
    background: var(--offer-color, #FF5722);
    color: #fff;
    font-size: .65rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-align: center;
    padding: 5px 0;
    transform: rotate(-45deg);
    box-shadow: 0 2px 8px rgba(239, 68, 68, .45);
    pointer-events: none;
    z-index: 5;
}

/* Clase de desvanecimiento activa */
.tm-notice-fade-out {
    opacity: 0 !important;
    transform: translateY(-20px) !important;
    margin-top: -40px !important;
    /* Colapsa el espacio ocupado */
    pointer-events: none;
}

/* Iconos de las notificaciones */
.woocommerce-message::before,
.woocommerce-info::before {
    color: var(--primary-color) !important;
    /* Azul TM */
}

/* ============================================================
   4. FORMULARIOS DE CUENTA Y REGISTRO
   ============================================================ */

/* Contenedor Principal Mi Cuenta */
.woocommerce-account .woocommerce-MyAccount-content,
.woocommerce-account .u-columns.col2-set {
    background: #ffffff;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

/* --- REORDENAMIENTO AVANZADO "MI CUENTA" (TM CAPACITACIÓN) --- */

/* 1. Convertir el formulario en un contenedor Flex para reordenar */
.edit-account .woocommerce-EditAccountForm {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 40px;
    border: 1px solid var(--tm-nav-border);
    box-shadow: var(--tm-nav-shadow);
}

.edit-account .woocommerce-EditAccountForm .form-row-wide,
.edit-account .woocommerce-EditAccountForm fieldset,
.edit-account .woocommerce-EditAccountForm p:last-of-type {
    grid-column: 1 / -1;
}

/* 2. Definir el nuevo Orden Jerárquico */

.woocommerce-EditAccountForm .form-row:has(#account_display_name) {
    display: none !important;
}

/* Ocultar Nombre Visible solicitado */

.woocommerce-EditAccountForm .form-row:has(#billing_rut) {
    margin: 10px 0;
}

/* RUT como bloque integrado */

/* Email sigue el flujo natural */

.woocommerce-EditAccountForm fieldset {
    margin-top: 20px;
    border: none;
    background: rgba(255, 255, 255, 0.5);
    padding: 20px;
    border-radius: 16px;
}

/* Bloque contraseña al final */

/* Botón Guardar al final */

/* Estilos de Inputs y Labels en Mi Cuenta */
.woocommerce-EditAccountForm label,
.woocommerce-edit-account label {
    display: block !important;
    visibility: visible !important;
    color: var(--primary-color) !important;
    font-weight: 600 !important;
    margin-bottom: 8px !important;
}

/* 3. Ajuste de inputs Island-style (Regla 4) */
.woocommerce-EditAccountForm input.input-text {
    border-radius: 12px !important;
    border: 1px solid rgba(0, 42, 140, 0.1) !important;
    padding: 12px !important;
}

.woocommerce-EditAccountForm input.input-text:focus,
.woocommerce-edit-account .input-text:focus {
    border-color: var(--accent-color) !important;
    box-shadow: 0 0 0 3px rgba(106, 27, 154, 0.15) !important;
    outline: 2px solid transparent !important;
    outline-offset: 2px !important;
}

/* Limpieza de elementos innecesarios */
.woocommerce-EditAccountForm span+em,
.woocommerce-EditAccountForm fieldset+p+span+em,
.woocommerce-edit-account em,
.woocommerce-account .woocommerce-MyAccount-content>p:first-of-type:not(.form-row) {
    display: none !important;
}

/* Registro y Login */
.woocommerce-form-register,
.woocommerce-form-login {
    border: none;
    padding: 0;
}

.woocommerce-form-row input.input-text {
    border-radius: 10px;
    padding: 12px 15px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.woocommerce-form-register__submit,
.woocommerce-form-login__submit {
    width: 100%;
    border-radius: 999px;
    padding: 15px;
    background: var(--gradient-brand);
    color: white;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    box-shadow: 0 8px 20px rgba(106, 27, 154, 0.2);
    margin-top: 20px;
}

/* ============================================================
   5. COMPONENTES TM (ISLAND STYLE)
   ============================================================ */

/* Tarjetas "Island" de Perfil */
.tm-profile-island {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px !important;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid rgba(0, 42, 140, 0.1);
    box-shadow: 0 4px 20px rgba(0, 42, 140, 0.05);
}

.tm-profile-island h3 {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.tm-profile-island label {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
}

.tm-profile-island input[readonly],
.tm-profile-island input[disabled] {
    background-color: #f8fafc !important;
    border: 2px solid #e2e8f0 !important;
    color: #64748b !important;
    cursor: not-allowed;
    border-radius: 12px;
    box-shadow: none !important;
}

.tm-field-note {
    display: block;
    font-size: 0.85em;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

/* Forzar que las descripciones de los campos siempre sean visibles */
.woocommerce-input-wrapper .description,
.woocommerce-EditAccountForm .description,
.woocommerce-form-register .description {
    display: block !important;
    visibility: visible !important;
    height: auto !important;
    opacity: 1 !important;
    margin-top: 4px !important;
    padding: 0 !important;
}

/* Asegurar que el span interno tm-field-note también se vea bien */
.description .tm-field-note {
    display: block !important;
    margin-top: 2px !important;
}



/* Otros Componentes de Layout */
.tm-row-grid {
    display: flex;
    gap: 4%;
}

/* Removido por limpieza de Grid */

.tm-island-selector,
.tm-rut-field,
#billing_rut_field,
.tm-factura-container {
    clear: both !important;
    width: 100% !important;
    display: block !important;
}

/* Alineación de Campos Identidad (Checkout/Registro) */
#billing_first_name_field,
#billing_last_name_field {}

#billing_last_name_field,
.woocommerce-form-row--last {
    margin-left: 4% !important;
}

#billing_rut_field,
#billing_email_field,
#reg_billing_rut_field,
#reg_email_field {
    width: 100% !important;
    clear: both !important;
}

/* ============================================================
   6. CARRITO Y TOAST
   ============================================================ */
.tm-cart-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    vertical-align: middle;
}

.tm-cart-link {
    position: relative;
    color: #1e3a8a;
    display: flex;
    align-items: center;
}

.tm-cart-icon svg {
    width: 22px;
    height: 22px;
}

.ast-icon-account svg {
    width: 22px;
    height: 22px;
}

.tm-cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 50%;
    min-width: 16px;
    text-align: center;
}

.tm-cart-toast {
    position: fixed;
    z-index: 999999;
    pointer-events: none;
    top: 80px;
    right: 20px;
    background: #1e293b;
    color: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.12);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.5) translateY(-12px);
    transform-origin: top right;
    transition: opacity 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
        transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
        visibility 0s linear 0.35s;
}

.tm-cart-toast.is-active {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
    transition: opacity 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
        transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
        visibility 0s linear 0s;
}

.tm-toast-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 18px 11px 14px;
}

.tm-cart-toast::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: linear-gradient(90deg, #00c2b3, #0d6efd);
    transform-origin: left center;
    transform: scaleX(1);
}

.tm-cart-toast.is-active::after {
    animation: tm-progress-drain 4.5s linear forwards;
}

@keyframes tm-progress-drain {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

@keyframes tm-cart-bounce {
    0% {
        transform: scale(1) rotate(0deg);
    }

    20% {
        transform: scale(1.35) rotate(-8deg);
    }

    40% {
        transform: scale(1.2) rotate(6deg);
    }

    60% {
        transform: scale(1.1) rotate(-3deg);
    }

    80% {
        transform: scale(1.05) rotate(1deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
    }
}

#tm-cart-trigger.tm-cart-bounce svg,
#tm-cart-trigger.tm-cart-bounce .tm-cart-icon {
    animation: tm-cart-bounce 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* ============================================================
   7. BOTONES Y ELEMENTOS GLOBALES
   ============================================================ */
.single_add_to_cart_button,
.wi_btn_buy_now,
.btn-aula-pro {
    background: var(--gradient-brand);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    font-weight: 700;
    text-transform: uppercase;
    transition: all 0.3s ease;
    display: inline-flex;
    justify-content: center;
    border: none;
}

.single_add_to_cart_button:hover,
.wi_btn_buy_now:hover {
    opacity: 0.95;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 42, 140, 0.25);
}

body.woocommerce-checkout #content,
body.woocommerce-cart #content,
body.archive #content,
body.woocommerce-shop #content {
    padding-top: 130px;
}

/* ============================================================
   8. MEDIA QUERIES (RESPONSIVE)
   ============================================================ */

/* TABLETS Y MÓVILES (Basado en Breakpoint de Astra) */

/* TABLETS PEQUEÑAS ( < 768px ) */
@media (max-width: 768px) {

    /* Removido para evitar interferencia con Grid */
}

/* MÓVILES PEQUEÑOS ( < 540px ) */
@media (max-width: 540px) {
    .tm-divider-vertical {
        display: none;
    }

    .tm-header-user-actions {
        gap: 8px;
    }

    .tm-user-links span.tm-dot,
    .tm-user-links a.logout {
        display: none;
    }
}

.woocommerce-registration-active .u-column2,
#customer_details {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 30px;
    border: 1px solid var(--tm-nav-border);
    box-shadow: var(--tm-nav-shadow);
}

/* Forzar que Nombre y Apellido compartan fila (Removido por Grid) */

/* El RUT y Email ocupan el ancho completo */
.woocommerce-form-register .form-row-wide {
    clear: both !important;
    width: 100% !important;
}

/* Inputs con tokens de diseño (Regla 4) */
.woocommerce-form-register input.input-text {
    border-radius: 16px !important;
    padding: 12px 15px !important;
    border: 1px solid rgba(0, 42, 140, 0.2) !important;
    background: rgba(255, 255, 255, 0.5) !important;
}

/* Limpieza de floats para que el botón no suba */
.woocommerce-form-register::after {
    content: "";
    display: table;
    clear: both;
}

/* Contenedor de Botón Flotante */
.tm-edit-action-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 15px;
}

.tm-button-island {
    background: var(--accent-color);
    color: white !important;
    padding: 12px 24px;
    border-radius: 999px;
    font-family: 'Stolzl', sans-serif;
    font-weight: 500;
    font-size: 14px;
    box-shadow: var(--tm-nav-shadow);
    transition: all 0.3s ease;
}

/* ESTADO: SOLO LECTURA (Vista Default) */
body.woocommerce-edit-account:not(.woocommerce-endpoint--editar-datos) .woocommerce-EditAccountForm {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    border-radius: 16px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    pointer-events: none;
    /* Bloquea clics en inputs */
    opacity: 0.9;
}

/* LIBERACIÓN TOTAL para el nuevo endpoint "Editar Perfil" */
.woocommerce-endpoint--editar-datos .woocommerce-EditAccountForm {
    pointer-events: auto !important;
    opacity: 1 !important;
    display: block !important;
}

/* Ocultar elementos de edición en vista de lectura nativa */
body.woocommerce-edit-account:not(.woocommerce-endpoint--editar-datos) .woocommerce-EditAccountForm fieldset,
body.woocommerce-edit-account:not(.woocommerce-endpoint--editar-datos) .woocommerce-EditAccountForm button[type="submit"],
body.woocommerce-edit-account:not(.woocommerce-endpoint--editar-datos) .woocommerce-EditAccountForm em {
    display: none !important;
}

/* Mostrar explícitamente en el endpoint de edición */
.woocommerce-endpoint--editar-datos .woocommerce-EditAccountForm button[type="submit"],
.woocommerce-endpoint--editar-datos .woocommerce-EditAccountForm em {
    display: block !important;
}

/* Estilización de campos bloqueados (Solo vista lectura) */
body.woocommerce-edit-account:not(.woocommerce-endpoint--editar-datos) .woocommerce-EditAccountForm input {
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid rgba(0, 42, 140, 0.1) !important;
    color: #002A8C !important;
    font-weight: 500;
    padding-left: 0;
}

/* Espaciado entre Islas */
.tm-island-card {
    margin-bottom: 40px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 35px;
    border: 1px solid var(--tm-nav-border);
    box-shadow: var(--tm-nav-shadow);
}

/* --- COMENTADO POR PAUSA DE EMPRESA ---
.tm-grid-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.tm-grid-form .form-row {
    margin: 0;
}

.tm-company-island h3 {
    color: var(--primary-color);
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(0, 42, 140, 0.1);
    padding-bottom: 10px;
}

@media (max-width: 768px) {
    .tm-grid-form {
        grid-template-columns: 1fr;
    }
}
--------------------------------------- */

/* ============================================================
   5. CONTENEDOR DE CUPÓN EN CHECKOUT (ORDER REVIEW)
   ============================================================ */

/* Contenedor del cupón en la revisión */
.tm-checkout-coupon-review {
    margin-bottom: 20px;
    width: 100%;
}

/* Forzar que el aviso de cupón sea una "isla" sutil y centrada */
.tm-checkout-coupon-review .woocommerce-info {
    background: rgba(0, 42, 140, 0.05) !important;
    border: 1px dashed var(--tm-nav-border) !important;
    border-radius: 12px !important;
    padding: 15px !important;
    font-size: 14px;
    display: flex !important;
    justify-content: center !important;
    text-align: center !important;
    border-left: none !important;
    width: 100% !important;
    margin: 0 auto 20px auto !important;
}

.tm-checkout-coupon-review .woocommerce-info::before {
    display: none !important;
}

/* Asegurar visibilidad del contenedor de cupón TM */
.tm-custom-coupon-box {
    display: block !important;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid rgba(0, 42, 140, 0.1);
}

/* Evitar que el botón nativo de WC interfiera si llega a aparecer */
.woocommerce-form-coupon {
    display: none !important;
    /* Ocultamos el nativo para usar nuestra lógica */
}

/* Estilo para el input de cupón */
#tm_coupon_code {
    border-radius: 999px !important;
    /* Estilo píldora */
    border: 1px solid #002A8C;
    padding: 10px 20px;
}

/* Botón del cupón estilo Island */
.tm-custom-coupon-box .button {
    border-radius: 999px !important;
    background-color: var(--primary-color) !important;
    color: white !important;
    padding: 10px 25px !important;
}

/* --- Estética de Seguridad y Blindaje de RUT --- */

/* Estilo para el campo RUT bloqueado */
.tm-readonly-field input {
    background-color: rgba(0, 42, 140, 0.05) !important;
    /* Azul marca muy suave */
    border: 1px dashed #002A8C !important;
    cursor: not-allowed;
    color: #666;
}

/* Ocultar la sección de password en la pestaña principal de Detalles de la Cuenta */
/* Para que solo sea visible en nuestra nueva pestaña 'Seguridad' */
.woocommerce-account .woocommerce-edit-account fieldset {
    display: none;
}

.woocommerce-account.endpoint-seguridad .woocommerce-edit-account fieldset {
    display: block !important;
    border: none;
    padding: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 8px 24px rgba(0, 42, 140, 0.08);
}

.woocommerce-account.endpoint-seguridad .woocommerce-edit-account legend {
    font-family: 'Stolzl', sans-serif;
    font-weight: 500;
    color: #002A8C;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

/* Ocultar de inmediato los campos duplicados de Edwiser Bridge en el formulario de registro */
.woocommerce-form-register p:has(input[name="eb_first_name"]),
.woocommerce-form-register p:has(input[name="eb_last_name"]) {
    display: none !important;
}



/* 1. Evitar que el texto del usuario se rompa verticalmente */
@media (max-width: 1112px) {

    /* Contenedor derecho: solo mostrar el botón hamburguesa */
    .site-header-primary-section-right {
        width: auto !important;
        flex: 0 0 auto !important;
        overflow: visible !important;
    }

    /* Ocultar el widget de usuario (Hola, Guidop) en móvil dentro del header */
    .site-header-primary-section-right .header-widget-area,
    .ast-header-custom-widget {
        display: none !important;
    }

    /* Ocultar también el botón "Aula Virtual" en móvil si se rompe */
    .site-header-primary-section-right-center {
        display: none !important;
    }

    /* El logo ocupa más espacio ahora */
    .site-header-primary-section-left {
        width: auto !important;
        flex: 1 !important;
    }
}

/* 2. Dropdown de usuario: evitar que flote sobre el hero */
.header-widget-area {
    position: relative;
}

.header-widget-area .sub-menu,
.header-widget-area .dropdown-menu,
.ast-custom-widget .sub-menu {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    left: auto !important;
    z-index: 10000 !important;
    background: rgba(255, 255, 255, 0.97) !important;
    backdrop-filter: blur(16px);
    border-radius: 16px !important;
    box-shadow: 0 8px 32px rgba(0, 42, 140, 0.15) !important;
    min-width: 180px;
    padding: 10px 0 !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    margin-top: 8px;
}

/* 3. Panel del menú hamburguesa: limitar altura y hacer scroll */
.ast-mobile-popup-inner,
.ast-mobile-popup-content {
    max-height: 80vh !important;
    overflow-y: auto !important;
}

/* Asegurar que el fondo blanco del menú hamburguesa no tape todo */
.ast-mobile-popup-drawer {
    max-width: var(--tm-sidebar-w) !important;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.2) !important;
}

/* ============================================================
   ESTABILIZACIÓN DE CABECERA "ISLAND-STYLE" (TM CAPACITACIÓN)
   ============================================================ */

/* 1. Neutralización de Columnas de Astra para eliminar espacios blancos */
.site-header-primary-section-left {
    flex: 0 0 250px !important;
    /* Ancho exacto del logo */
    width: 250px !important;
}

.site-header-primary-section-right {
    flex: 0 0 auto !important;
    width: auto !important;
}

.site-header-primary-section-center {
    flex: 1 1 auto !important;
    /* El menú absorbe el espacio recuperado */
}

/* 2. Blindaje de la Isla (Evitar deformación) */
#ast-desktop-header .ast-primary-header-bar.main-header-bar {
    max-height: 80px !important;
    /* Bloquea el "engorde" vertical en desktop */
    display: flex !important;
    align-items: center !important;
}

/* 3. Estabilización del Widget de Usuario (Shortcode) */
.tm-header-user-actions {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    white-space: nowrap !important;
    /* Evita que el texto rompa en dos líneas */
}

.tm-user-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.2;
}

/* 4. Control Responsive: De Cápsula a Tarjeta (Previene el óvalo gigante) */
@media (max-width: 1100px) {

    #ast-desktop-header .ast-primary-header-bar.main-header-bar,
    #ast-mobile-header .ast-primary-header-bar.main-header-bar {
        border-radius: 20px !important;
        /* Token Regla 4: Bloques generales */
        max-height: none !important;
        height: auto !important;
        padding: 10px 20px !important;
        margin: 10px auto !important;
    }

    .ast-builder-grid-row {
        flex-wrap: wrap !important;
        justify-content: center !important;
    }
}

/* Ajuste para que el CSS coincida con el nuevo Breakpoint de functions.php */
@media (max-width: 1112px) {
    #ast-desktop-header {
        display: none !important;
    }

    #ast-mobile-header {
        display: block !important;
    }

    #ast-mobile-header .ast-primary-header-bar.main-header-bar {
        border-radius: 20px !important;
        /* Pasamos de cápsula a tarjeta según Regla 4 */
        width: 95% !important;
        margin: 10px auto !important;
        height: auto !important;
        max-height: none !important;
    }
}

@media (min-width: 1113px) {
    #ast-mobile-header {
        display: none !important;
    }

    #ast-desktop-header {
        display: block !important;
    }
}

/* ============================================================
   CORRECCIÓN DE TOKENS Y ERRORES DE CSS PERSONALIZADO
   ============================================================ */

/* Ajuste de tarjetas: height 10% colapsaba el contenido */
.tarjeta-fija,
.tarjeta-fija1 {
    height: auto !important;
    border-radius: 16px !important;
    /* Regla 4: Tarjetas */
}

/* Unificación de bordes WPForms a Tokens TM (16px) */
.wpforms-confirmation-container-full {
    border-radius: 16px !important;
}

/* Ajuste de Inputs para visibilidad y consistencia */
.woocommerce-form-login input.input-text,
.woocommerce-form-register input.input-text,
#wpforms-1112 .wpforms-field input {
    border-radius: 999px !important;
    /* Estética pill para coherencia con la isla */
    border-color: rgba(0, 42, 140, 0.1) !important;
    /* Borde sutil visible */
}

/* Corrección de alineación Login en móviles para no romper la barra */
@media (max-width: 921px) {
    .ast-header-break-point .tm-user-logged-in {
        padding: 5px 0 !important;
        border-top: none !important;
    }
}


/* --- ESTILOS DE PORTAL CORPORATIVO (DESHABILITADOS TEMPORALMENTE) ---
   Toda la lógica de gestión B2B ha sido movida a inc/legacy-bulk-portal.php

.tm-manager-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    border-radius: 16px;
    border: 1px solid rgba(0, 42, 140, 0.1);
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
}

.tm-cupos-badge {
    background: linear-gradient(45deg, #002A8C, #6A1B9A);
    color: white;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
}

.tm-portal-wrapper {
    max-width: 1200px;
    margin: 40px auto;
}

.tm-progress-container {
    background: #f0f2f5;
    height: 12px;
    border-radius: 999px;
    margin: 20px 0;
    position: relative;
    overflow: hidden;
}

.tm-progress-bar {
    background: linear-gradient(90deg, #002A8C, #6A1B9A);
    height: 100%;
    transition: width 0.5s ease;
}

.tm-enroll-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px dashed #ddd;
}

.tm-enroll-form input {
    border-radius: 12px;
    border: 1px solid #ddd;
    padding: 12px;
}

.tm-enrolled-island {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 24px;
    margin-top: 25px;
    border: 1px solid rgba(0, 42, 140, 0.08);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.02);
}

.tm-island-subtitle {
    font-family: 'Stolzl', sans-serif;
    font-weight: 600;
    color: #002A8C;
    margin-bottom: 18px;
    margin-top: 0;
    font-size: 1.1rem;
    border-left: 3px solid #6A1B9A;
    padding-left: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tm-table-responsive {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid rgba(0, 42, 140, 0.08);
    background: #ffffff;
}

.tm-audit-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Stolzl', sans-serif;
    font-size: 0.88rem;
    text-align: left;
    margin: 0;
}

.tm-audit-table th {
    background: rgba(0, 42, 140, 0.04);
    color: #002A8C;
    font-weight: 600;
    padding: 14px 16px;
    border-bottom: 2px solid rgba(0, 42, 140, 0.08);
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.5px;
}

.tm-audit-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(0, 42, 140, 0.05);
    color: #475569;
    vertical-align: middle;
}

.tm-audit-table tr:last-child td {
    border-bottom: none;
}

.tm-audit-table tr:hover td {
    background: rgba(0, 42, 140, 0.01);
    color: #0f172a;
}

.tm-audit-table code {
    font-family: 'Courier New', Courier, monospace;
    font-weight: 600;
    color: #6A1B9A;
    background: rgba(106, 27, 154, 0.06);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
}

.tm-date-badge {
    background: linear-gradient(135deg, rgba(0, 42, 140, 0.08), rgba(106, 27, 154, 0.08));
    color: #002A8C;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(0, 42, 140, 0.1);
    display: inline-block;
    white-space: nowrap;
}
------------------------------------------------------------------ */