/* ==========================================
   INTERFAZ APP: OCULTAR ELEMENTOS DEL TEMA NATIVO Y ELIMINAR HUECOS
   ========================================== */
body.chili-wizard-immersive-mode .site-header,
body.chili-wizard-immersive-mode #header,
body.chili-wizard-immersive-mode #masthead,
body.chili-wizard-immersive-mode #site-header,
body.chili-wizard-immersive-mode .elementor-location-header,
body.chili-wizard-immersive-mode .main-header-bar,
body.chili-wizard-immersive-mode .header-main,
body.chili-wizard-immersive-mode .header-wrapper,
body.chili-wizard-immersive-mode #main-header,
body.chili-wizard-immersive-mode .whb-header,
body.chili-wizard-immersive-mode .fusion-header-wrapper,
body.chili-wizard-immersive-mode .ast-main-header-wrap,
body.chili-wizard-immersive-mode .main-navigation,
body.chili-wizard-immersive-mode .site-footer,
body.chili-wizard-immersive-mode #footer,
body.chili-wizard-immersive-mode #colophon,
body.chili-wizard-immersive-mode .elementor-location-footer {
    display: none !important;
}

/* Resetear márgenes y paddings residuales del tema (0 huecos blancos globales) */
html.chili-wizard-immersive-mode {
    padding: 0 !important;
    margin: 0 !important;
    overflow-x: hidden !important;
}
body.chili-wizard-immersive-mode {
    padding: 0 !important; /* Volvemos a cero para evitar los márgenes blancos en la app */
    margin: 0 !important;
    overflow-x: hidden !important;
}

/* Aplicar relleno para cabecera/footer fijos ÚNICAMENTE en la tienda (WooCommerce) */
body.chili-wizard-immersive-mode.woocommerce-page,
body.chili-wizard-immersive-mode.woocommerce {
    padding: 70px 0 80px 0 !important; /* Ajuste exclusivo para que la tienda respire */
}

body.chili-wizard-immersive-mode html,
body.chili-wizard-immersive-mode #page,
body.chili-wizard-immersive-mode .site,
body.chili-wizard-immersive-mode #main-container,
body.chili-wizard-immersive-mode #content,
body.chili-wizard-immersive-mode .site-content,
body.chili-wizard-immersive-mode main#main {
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
    height: auto !important;
}

/* ==========================================
   BARRA SUPERIOR GLOBAL APP (TOPBAR)
   ========================================== */
#chili-store-wizard-topbar { 
    position: fixed; top: 0; left: 0; width: 100%; background: #000; 
    z-index: 999999; padding: 15px 15px; border-bottom: 2px solid #e8363c; box-sizing: border-box;
}
.chili-store-topbar-inner { 
    max-width: 800px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.chili-topbar-main-row { 
    display: flex; justify-content: center; align-items: center; width: 100%; position: relative;
}
.chili-topbar-text { 
    color: #fff; font-size: 16px; font-weight: 600; text-align: center; letter-spacing: 0.5px;
}
.chili-topbar-exit { 
    position: absolute; right: 0; background: transparent; color: #fff; 
    border: none; padding: 0; cursor: pointer; font-size: 14px; font-weight: 400; transition: all 0.2s ease;
}
.chili-topbar-exit:hover { 
    font-size: 15.5px; font-weight: 800; color: #fff; transform: scale(1.05);
}

/* Círculos de progreso en la Topbar */
.chili-wizard-progress { display: flex; align-items: center; justify-content: center; width: 100%; max-width: 350px; }
.step-circle { width: 22px; height: 22px; border-radius: 50%; background: #333; color: #fff; font-size: 11px; font-weight: bold; display: flex; align-items: center; justify-content: center; transition: 0.3s; }
.step-circle.active { background: #e8363c; transform: scale(1.1); box-shadow: 0 0 10px rgba(232,54,60,0.5); }
.step-line { flex-grow: 1; height: 2px; background: #333; margin: 0 4px; }

/* Ocultar progreso en Paso 1 */
#chili-store-wizard-topbar.no-progress .chili-wizard-progress { display: none !important; }

/* ==========================================
   PIE DE PÁGINA GLOBAL APP (FOOTER NAVEGACIÓN)
   ========================================== */
#chili-wizard-footer {
    position: fixed; bottom: 0; left: 0; width: 100%; background: #000;
    z-index: 999999; padding: 15px; border-top: 2px solid #e8363c; box-sizing: border-box;
}
.chili-wizard-footer-inner {
    max-width: 800px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 15px;
}
.chili-footer-btn-back, .chili-footer-btn-next, .chili-footer-btn-finish {
    border: none; padding: 14px 20px; border-radius: 8px; font-size: 15px; font-weight: 700; cursor: pointer; transition: 0.2s; min-height: 48px; display: flex; align-items: center; justify-content: center;
}
.chili-footer-btn-back { background: #333; color: #fff; flex: 1; }
.chili-footer-btn-back:hover { background: #555; }
.chili-footer-btn-next { background: #e8363c; color: #fff; flex: 1; }
.chili-footer-btn-next:disabled { background: #555; color: #888; cursor: not-allowed; }
.chili-footer-btn-finish { background: #16a34a; color: #fff; flex: 1; box-shadow: 0 4px 14px rgba(22, 163, 74, 0.4); }
.chili-footer-btn-finish:hover { background: #15803d; }

/* ==========================================
   ESTILOS GENERALES DEL ASISTENTE
   ========================================== */
.chili-wizard-wrapper {
    width: 100%; max-width: 750px; margin: 15px auto; padding: 0 15px;
    font-family: var(--theme-font-family), system-ui, sans-serif; box-sizing: border-box;
}
.chili-wizard-card {
    background: transparent; padding: 15px 0;
    box-shadow: none; border: none; box-sizing: border-box;
}

.chili-wizard-step-content { display: none; text-align: center; }
.chili-wizard-step-content.active { display: block; }
.chili-wizard-step-content h2 { font-size: 26px; color: #111111; margin-bottom: 8px; font-weight: 700; }
.chili-wizard-step-content p { font-size: 15px; color: #666666; margin-bottom: 30px; }

/* BOTONES INTERNOS */
.chili-actions-vertical { display: flex; flex-direction: column; gap: 14px; max-width: 380px; margin: 0 auto 20px; }
.chili-btn-main { background: #111111; color: #ffffff; border: none; padding: 16px 24px; border-radius: 8px; font-size: 16px; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.chili-btn-main:hover { background: #e8363c; }
.chili-btn-alt { background: #ffffff; color: #111111; border: 2px solid #111111; padding: 15px 24px; border-radius: 8px; font-size: 16px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.chili-btn-alt:hover { background: #fafafa; border-color: #e8363c; color: #e8363c; }

/* TARJETAS ESTAMPADOS (Paso 3) */
.chili-print-configuration-card { background: transparent; border: none; padding: 15px 0; margin-bottom: 20px; text-align: left; position: relative; border-bottom: 1px dashed #cbd5e1; }
.chili-card-remove-btn { position: absolute; top: 15px; right: 15px; background: none; border: none; color: #94a3b8; font-size: 18px; cursor: pointer; }
.chili-card-remove-btn:hover { color: #ef4444; }
.chili-print-card-title { font-size: 16px; font-weight: 700; color: #1e293b; margin-bottom: 15px; border-bottom: 1px dashed #cbd5e1; padding-bottom: 5px; }
.chili-grid-form { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 15px; margin-bottom: 15px; }
.chili-input-field-group label { display: block; font-size: 13px; font-weight: 600; color: #475569; margin-bottom: 5px; }
.chili-input-field-group select, .chili-input-field-group input { width: 100%; padding: 10px; border: 1px solid #cbd5e1; border-radius: 6px; background-color: #fff; font-size: 14px; box-sizing: border-box; }
.chili-print-comentario { width: 100%; padding: 10px; border: 1px solid #cbd5e1; border-radius: 6px; background-color: #fff; font-size: 14px; font-family: inherit; resize: vertical; min-height: 60px; box-sizing: border-box; }
.chili-btn-add-extra { width: 100%; border: 2px dashed #000; background: #f8fafc; color: #000; padding: 16px; border-radius: 8px; cursor: pointer; font-weight: 700; font-size: 15px; margin-bottom: 15px; transition: 0.2s; }
.chili-btn-add-extra:hover { background: #f1f5f9; border-color: #e8363c; color: #e8363c; }
.chili-print-card-pricing-feedback { font-size: 13px; font-weight: 600; text-align: right; margin-top: 10px; }

/* SUBIDA DE ARCHIVOS (Paso 4) */
.chili-upload-wrapper { border: 2px dashed #cbd5e1; border-radius: 10px; padding: 30px 20px; background: #f8fafc; position: relative; margin-bottom: 20px; }
.chili-upload-dropzone { position: relative; cursor: pointer; }
.chili-upload-dropzone input[type="file"] { position: absolute; width: 100%; height: 100%; top:0; left:0; opacity: 0; cursor: pointer; }
.chili-upload-text strong { display: block; font-size: 15px; color: #334155; margin-bottom: 5px; }
.chili-upload-text span { font-size: 12px; color: #64748b; }
#chili-file-list-preview { text-align: left; margin-top: 15px; font-size: 13px; color: #334155; }
.chili-file-item { background: #e2e8f0; padding: 5px 10px; border-radius: 4px; display: inline-block; margin: 3px; }

/* DESGLOSE FACTURA (Paso 5) */
.chili-final-invoice-card { text-align: left; background: transparent; border: none; padding: 10px 0; margin-bottom: 25px; }
.chili-invoice-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px dashed #e2e8f0; font-size: 14px; gap: 10px; }
.chili-invoice-row span { min-width: 0; flex: 1; }
.chili-invoice-row span:last-child { flex: 0 0 auto; text-align: right; }
.chili-invoice-row.invoice-total { font-weight: bold; border-top: 2px solid #111111; border-bottom: none; padding-top: 20px; margin-top: 10px; align-items: center; }
.chili-invoice-item-meta .chili-meta-val { font-weight: 600; color: #334155; }

/* ==========================================
   CABECERA Y FOOTER - (VISTA EN PC)
   ========================================== */

@media (min-width: 768px) {
    /* Ajustes de tamaño y espaciados optimizados */
    #chili-store-wizard-topbar { padding: 15px 15px !important; }
    .chili-wizard-footer-inner { padding: 0px 15px !important; }
    #chili-wizard-footer button { padding: 10px 20px !important; line-height: 1 !important; min-height: 0 !important; height: auto !important; }

    /* Reestructuración de la Cabecera en PC */
    .chili-store-topbar-inner {
        max-width: 1200px !important;
    }

    .chili-topbar-main-row {
        min-height: 24px; /* Evita que la altura colapse si no hay pasos mostrados */
    }

    .chili-topbar-text {
        position: absolute !important;
        left: 20px !important;
    }

    .chili-topbar-exit {
        right: 20px !important;
    }
}


/* ==========================================
   CABECERA Y FOOTER - RESPONSIVE MÓVIL
   ========================================== */
@media (max-width: 768px) {
    .chili-wizard-wrapper { margin: 10px auto !important; padding: 0 15px !important; }
    .chili-wizard-card { border-radius: 0 !important; padding: 10px 0 !important; }
    .chili-grid-form { grid-template-columns: 1fr; }
    .chili-topbar-text { font-size: 14px; }
    .chili-wizard-footer-inner { gap: 8px; }
    .chili-footer-btn-back, .chili-footer-btn-next, .chili-footer-btn-finish { font-size: 13px; padding: 12px 5px; }
}

/* ==========================================
   Correción de COMPATIBILIDAD CON ELEMENTOS FLOTANTES EXTERNOS [Plugin COOKIES]
   ========================================== */
/* 1. Botón flotante de cookies */
body.chili-wizard-immersive-mode #cw-floating-btn {
    bottom: 95px !important; /* Lo eleva por encima del footer de la app */
    z-index: 999999 !important; /* Asegura que se quede por encima de otros elementos */
    transition: bottom 0.3s ease !important; /* Le da un efecto suave al subir */
}

/* 4. Banner de cookies adaptativo */
body.chili-wizard-immersive-mode #cw-cookies-banner {
    z-index: 999998 !important; /* Mantiene el banner un nivel por detrás del footer por si se cruzan */
    transition: bottom 0.3s ease-in-out !important; /* Efecto deslizante para que parezca salir de la superficie */
}

/* 2. Panel de Ajustes de Cookies - Centrado y con restricción estricta */
body.chili-wizard-immersive-mode .cw-panel-content {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 9999999 !important;
    width: 90% !important;
    max-width: 500px !important;
    /* Limitamos la altura al 75% de la pantalla para evitar colisiones */
    max-height: 75vh !important; 
    display: flex !important;
    flex-direction: column !important;
    /* Aseguramos que tenga un tamaño mínimo por si acaso */
    min-height: 300px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

/* 3. El cuerpo es el ÚNICO que debe hacer scroll */
body.chili-wizard-immersive-mode .cw-panel-body {
    flex: 1 1 auto !important;
    overflow-y: auto !important; /* Scroll interno obligatorio */
    padding: 15px !important;
    scrollbar-width: thin; /* Estilo de scroll para navegadores modernos */
}

/* Forzamos que las acciones siempre se mantengan al final del panel */
body.chili-wizard-immersive-mode .cw-panel-actions {
    flex-shrink: 0 !important; /* Evita que los botones se encojan */
    border-top: 1px solid #eee !important;
    padding: 10px !important;
}

/* Contenedor principal adaptativo para scroll único exterior */
#chili-wizard-app {
    position: relative !important;
    width: 100% !important;
    max-width: 750px !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    transition: margin 0.3s ease; /* Transición suave al añadir barras */
}

/* Márgenes dinámicos ajustados sin huecos excesivos */
#chili-wizard-app.chili-has-topbar {
    margin-top: 70px !important; 
}

#chili-wizard-app.chili-has-footer {
    margin-bottom: 80px !important;
}

/* La tarjeta se expande libremente según su contenido, sin scroll interno */
body.chili-wizard-immersive-mode .chili-wizard-card {
    max-height: none !important; /* Desactivamos cualquier límite de altura */
    overflow-y: visible !important; /* Eliminamos el scroll interno de la caja */
    box-sizing: border-box !important;
}


/* ==========================================
   UTILIDADES Y ESTILOS EXTRAÍDOS DEL JS/PHP
   ========================================== */
.chili-hidden-default { display: none; }
.chili-font-bold { font-weight: bold; }
.chili-mt-15 { margin-top: 15px; }
.chili-mt-20 { margin-top: 20px; }
.chili-mb-25 { margin-bottom: 25px; }
.chili-text-left { text-align: left; }
.chili-relative { position: relative; }
.chili-w-full { width: 100%; }
.chili-flex-col-center { display: flex; flex-direction: column; align-items: center; }
.chili-shrink-0 { flex-shrink: 0; }
.chili-text-sm { font-size: 14px; }
.chili-text-xs { font-size: 12px; }
.chili-opacity-80 { opacity: 0.8; }
.chili-mt-3 { margin-top: 3px; }

/* Tooltip nativo reubicado desde JS */
.single_add_to_cart_button.chili-disabled {
    opacity: 0.45 !important;
    cursor: not-allowed !important;
    filter: grayscale(100%) !important;
}
.chili-tooltip-box {
    position: absolute;
    background-color: #222222;
    color: #ffffff;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
    z-index: 999999;
    box-shadow: 0px 4px 12px rgba(0,0,0,0.25);
    display: none;
    pointer-events: none;
}
.chili-tooltip-box::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -6px;
    border-width: 6px;
    border-style: solid;
    border-color: #222222 transparent transparent transparent;
}

/* Modales y Popups Universales */
.chili-overlay-active {
    display: flex !important;
    position: fixed !important;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 999999999 !important;
    align-items: center; justify-content: center;
}
.chili-popup-box {
    background: #fff; padding: 25px; border-radius: 10px;
    max-width: 400px; width: 90%; text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2); box-sizing: border-box;
}
.chili-popup-icon-success { font-size: 45px; color: #10b981; margin-bottom: 10px; line-height: 1; }
.chili-popup-title { font-size: 20px; font-weight: bold; margin-bottom: 10px; color: #000; }
.chili-popup-title-md { font-size: 18px; font-weight: bold; margin-bottom: 15px; color: #000; }
.chili-popup-text { font-size: 14px; color: #64748b; margin-bottom: 20px; line-height: 1.4; }
.chili-popup-actions { display: flex; gap: 10px; justify-content: center; }
.chili-popup-actions-col { display: flex; flex-direction: column; gap: 12px; }
.chili-popup-actions .chili-btn-main, .chili-popup-actions .chili-btn-alt, .chili-popup-actions button {
    flex: 1; padding: 10px; border-radius: 8px; cursor: pointer;
}
.chili-btn-cancel { background: #f1f5f9; border: none; }
.chili-btn-danger { background: #e8363c; color: #fff; border: none; font-weight: bold; }
.chili-btn-full { width: 100%; padding: 12px 25px; border-radius: 5px; }

/* Modales Específicos: Mínimos */
.chili-min-wizard-popup-box { max-width: 500px; max-height: 90vh; display: flex; flex-direction: column; position: relative; }
.chili-popup-close-btn { position: absolute; top: 15px; right: 15px; cursor: pointer; font-size: 24px; font-weight: bold; z-index: 10; }
.chili-min-title { color: #AD001B; margin-bottom: 10px; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 24px; font-weight: bold; }
.chili-min-text { font-size: 16px; color: #333; margin-bottom: 20px; }
.chili-min-list { text-align: left; background: #f9f9f9; padding: 15px; border-radius: 10px; margin-bottom: 20px; overflow-y: auto; flex-grow: 1; max-height: 40vh; }
.chili-min-item { margin-bottom: 10px; border-bottom: 1px solid #ddd; padding-bottom: 10px; }
.chili-min-link { color: #0071a1; text-decoration: none; font-weight: bold; }
.chili-min-note { font-size: 14px; font-style: italic; color: #666; margin-bottom: 20px; }

/* Formularios de Popups (Prendas Propias) */
.chili-input-label { font-size: 14px; color: #64748b; margin-bottom: 5px; text-align: left; font-weight: bold; }
.chili-input-field { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 5px; text-align: left; font-size: 15px; margin-bottom: 15px; box-sizing: border-box; }
.chili-input-field.center-text { text-align: center; font-size: 18px; }
.chili-input-error-msg { color: #ef4444; font-size: 13px; font-weight: bold; margin-bottom: 15px; display: none; text-align: left; }
.chili-input-error-border { border-color: #ef4444 !important; }

/* Layout Resumen Paso 1 */
.chili-summary-title { font-size: 22px; margin-bottom: 15px; border-bottom: 2px solid #000; padding-bottom: 10px; }
.chili-grid-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 15px; width: 100%; }
.chili-btn-grid-option { width: 100%; height: 100%; box-sizing: border-box; display: flex; align-items: center; justify-content: center; margin: 0; }
#chili-choose-catalog-more { background: #333; }

.chili-summary-list-item { border-bottom: 1px dashed #e2e8f0; padding: 12px 0; font-size: 14px; color: #334155; display: flex; justify-content: space-between !important; align-items: center; gap: 15px; text-align: left !important; }
.chili-summary-item-info { flex-grow: 1; text-align: left !important; }
.chili-summary-item-info strong { color: #000; font-size: 15px; font-weight: 900; }
.chili-summary-item-info small { color: #64748b; }
.chili-summary-item-info small .chili-meta-val { font-weight: 600; color: #334155; }
.chili-summary-item-price { text-align: right; line-height: 1.2; }
.chili-summary-item-price strong { color: #000; font-size: 15px; }
.chili-summary-item-actions { display: flex; gap: 8px; flex-shrink: 0; }
.chili-btn-icon-edit { background: #f1f5f9; border: 1px solid #cbd5e1; border-radius: 4px; padding: 6px 10px; cursor: pointer; font-size: 14px; transition: 0.2s; }
.chili-btn-icon-delete { background: #fee2e2; border: 1px solid #fca5a5; color: #ef4444; border-radius: 4px; padding: 6px 10px; cursor: pointer; font-size: 14px; transition: 0.2s; }
.chili-summary-totals-box { border-top: 2px solid #000; margin-top: 25px; padding-top: 15px; display: flex; justify-content: space-between; align-items: flex-start; }
.chili-summary-totals-label { font-size: 15px; font-weight: 900; color: #000; padding-top: 2px; }
.chili-summary-totals-price-box { text-align: right; line-height: 1; }
.chili-summary-totals-price { font-weight: 900; font-size: 18px; }
.chili-text-success { color: #10b981; }
.chili-text-neutral { color: #64748b; }
.chili-summary-totals-tax { font-size: 11px; color: #000; font-weight: 300; margin-top: 2px; }

/* Estilos de la zona Q&A */
.chili-qa-subtitle { font-size: 13px; font-weight: bold; color: #64748b; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 15px; }
.chili-qa-notice { font-size: 13px; font-weight: bold; color: #AD001B; margin-bottom: 10px; }
.chili-qa-title { font-size: 24px; font-weight: bold; margin-bottom: 25px; color: #111; }
.chili-qa-title-md { font-size: 24px; font-weight: bold; margin-bottom: 10px; color: #111; }
.chili-qa-title-alt { font-size: 22px; font-weight: bold; margin-bottom: 25px; color: #111; }
.chili-qa-desc { font-size: 15px; color: #666; margin-bottom: 25px; }
.chili-qa-btn-group { display: flex; flex-direction: column; gap: 12px; max-width: 350px; margin: 0 auto; }
.chili-mw-400 { max-width: 400px; }
.chili-btn-wrap { white-space: normal; line-height: 1.3; }
.chili-qa-warning-msg1 { font-size: 18px; font-weight: bold; color: #AD001B; margin-bottom: 10px; }
.chili-qa-warning-box { color: #AD001B; font-weight: bold; font-size: 13px; background: #fef2f2; padding: 15px; border-radius: 8px; border: 1px solid #fecaca; margin-bottom: 15px; }
.chili-qa-force-box { text-align: left; background: #f8fafc; padding: 15px; border-radius: 8px; border: 1px solid #cbd5e1; }
.chili-label-checkbox { cursor: pointer; display: flex; align-items: center; gap: 8px; }
.chili-checkbox-lg { width: 18px; height: 18px; }
.chili-checkbox-text { font-weight: 600; color: #000; font-size: 14px; }
.chili-input-file-overlay { position: absolute; width: 100%; height: 100%; top: 0; left: 0; opacity: 0; cursor: pointer; z-index: 10; }
.chili-file-preview-list { margin-top: 15px; position: relative; z-index: 20; }
.chili-file-item { display: flex; justify-content: space-between; align-items: center; background: #e2e8f0; padding: 8px 12px; border-radius: 6px; margin-bottom: 8px; font-size: 13px; color: #334155; }
.chili-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-right: 10px; }
.chili-remove-file-btn { background: none; border: none; color: #ef4444; cursor: pointer; font-weight: bold; font-size: 14px; padding: 0; }
.chili-finished-icon { margin-bottom: 20px; font-size: 50px; color: #10b981; }
.chili-finished-title { color: #10b981; font-weight: bold; font-size: 26px; margin-bottom: 15px; }
.chili-finished-desc { font-size: 16px; color: #333; }

/* Estilos de la Factura */
.chili-invoice-main-title { font-size: 18px; font-weight: bold; margin-bottom: 20px; border-bottom: 2px solid #000; padding-bottom: 10px; }
.chili-invoice-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed #e2e8f0; font-size: 14px; color: #334155; text-align: left; }
.chili-invoice-row:last-child { border-bottom: none; }
.chili-invoice-item-qty { color: #000; font-size: 15px; font-weight: 900; }
.chili-invoice-item-meta { color: #64748b; }
.chili-invoice-item-free { color: #000; font-weight: bold; }
.chili-invoice-price { color: #000; }
.chili-invoice-loading { text-align: center; padding: 15px; }
.chili-invoice-min-note { color: #e8363c; font-size: 11px; font-weight: bold; }
.chili-invoice-taxes-row { margin-top: 15px; padding-top: 15px; border-top: 2px solid #000; }
.chili-invoice-taxes { text-align: right; width: 100%; color: #64748b; font-size: 13px; }
.chili-invoice-total { padding-top: 5px; border-top: none; font-weight: bold; font-size: 18px; align-items: center; }
.chili-invoice-total-label { font-size: 18px; }
.chili-invoice-total-price { color: #10b981; font-size: 22px; }
.chili-invoice-error { color: red; text-align: center; }

.chili-input-label { font-size: 14px; color: #64748b; margin-bottom: 5px; text-align: left; font-weight: bold; display: block; }
.chili-input-field { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 5px; font-size: 15px; margin-bottom: 15px; box-sizing: border-box; }
.center-text { text-align: center; }
.chili-input-error-msg { color: #ef4444; font-size: 13px; font-weight: bold; margin-bottom: 15px; display: none; text-align: left; }
.chili-input-error-border { border-color: #ef4444 !important; }
.chili-text-black { color: #000; }
.chili-btn-dark { background: #000 !important; color: #fff !important; border: none !important; }
.chili-popup-text-sm { font-size: 13px; color: #64748b; margin-bottom: 15px; }
.chili-mb-15 { margin-bottom: 15px; }
.chili-popup-box-lg { max-width: 450px !important; max-height: 85vh; display: flex; flex-direction: column; }
.chili-qa-items-list { overflow-y: auto; margin-bottom: 15px; text-align: left; background: #f8fafc; padding: 15px; border-radius: 8px; }
.chili-qa-item-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px dashed #cbd5e1; }
.chili-qa-item-info { font-size: 14px; line-height: 1.3; padding-right: 10px; }
.chili-text-slate { color: #64748b; }
.chili-text-red { color: #e8363c; font-weight: bold; }
.chili-input-sm { width: 70px; padding: 10px; border: 1px solid #cbd5e1; border-radius: 6px; text-align: center; font-size: 16px; box-sizing: border-box; }
.chili-p-12 { padding: 12px !important; }

/* ==========================================
   BOTÓN VOLVER A LA TIENDA (PRODUCTO INDIVIDUAL)
   ========================================== */
.chili-volver-tienda-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 50px 0 30px 0;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 15px;
}

#chili-volver-tienda-btn {
    border-radius: 30px;
    padding: 12px 28px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

#chili-volver-tienda-btn:hover {
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

/* ==========================================
   CONTENEDOR DE BOTONES SUPERIORES (TIENDA)
   ========================================== */
.contenedor-boton-favoritos-global {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    flex-wrap: wrap !important;
    margin: 10px 0 30px 0;
    text-align: left;
}

/* Estilo base idéntico para ambos botones */
.btn-global-favoritos {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    padding: 11px 24px !important;
    height: 48px !important; /* Altura unificada exacta */
    min-height: 48px !important;
    border-radius: 50px !important;
    text-decoration: none !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    line-height: 1 !important;
    transition: all 0.3s ease !important;
    background: #ffffff !important;
    box-sizing: border-box !important;
}

/* --- 1. BOTÓN SERIGRAFÍA (A LA IZQUIERDA - NEGRO) --- */
.btn-global-favoritos.btn-global-serigrafia {
    order: 1 !important; /* Posición izquierda */
    border: 2px solid #222222 !important;
    color: #222222 !important;
}

.btn-global-favoritos.btn-global-serigrafia:hover {
    background-color: #222222 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
}

.btn-global-serigrafia .icono-btn-serigrafia {
    width: 22px !important;
    height: 22px !important;
    object-fit: contain !important;
    display: inline-block !important;
    vertical-align: middle !important;
    transition: filter 0.3s ease !important;
    margin: 0 !important;
}

.btn-global-favoritos.btn-global-serigrafia:hover .icono-btn-serigrafia {
    filter: brightness(0) invert(1) !important; /* Convierte el icono a blanco en hover */
}

/* --- 2. BOTÓN FAVORITOS (A LA DERECHA - ROJO) --- */
.btn-global-favoritos:not(.btn-global-serigrafia) {
    order: 2 !important; /* Posición derecha */
    border: 2px solid #E8363C !important;
    color: #E8363C !important;
}

.btn-global-favoritos:not(.btn-global-serigrafia):hover {
    background-color: #E8363C !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(232, 54, 60, 0.3) !important;
}

.corazon-icono-contorno {
    font-size: 22px !important;
    line-height: 1 !important;
    display: inline-block !important;
}

/* Adaptación Responsive en móviles (Botones centrados y a ancho completo) */
@media (max-width: 768px) {
    .chili-volver-tienda-wrapper {
        flex-direction: column;
        gap: 12px;
        padding: 0 10px;
        margin-top: 50px;
    }
    
    .chili-volver-tienda-wrapper .chili-btn-alt {
        width: 100%; 
        justify-content: center; 
    }

    /* Apilar, centrar y expandir los botones de Favoritos y Serigrafía en móvil */
    .contenedor-boton-favoritos-global {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
        padding: 0 10px !important;
        box-sizing: border-box !important;
        gap: 12px !important;
    }

    .contenedor-boton-favoritos-global .btn-global-favoritos {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        box-sizing: border-box !important;
        text-align: center !important;
    }
}

/* Ocultar título principal en el asistente */
body.chili-wizard-immersive-mode h1.page-title {
    display: none !important;
}

/* Ocultar el botón de serigrafía de forma absoluta en el modo inmersivo del asistente */
body.chili-wizard-immersive-mode .btn-global-serigrafia {
    display: none !important;
}

/* ==========================================
   MODIFICADORES SERIGRAFÍA DASHBOARD
   ========================================== */
.chili-print-disabled {
    opacity: 0.45 !important;
    filter: grayscale(100%) !important;
    pointer-events: none !important; /* Desactiva clics, no podrán borrar si la casilla está marcada */
}

/* ==========================================
   ESTILOS ESTAMPADOS COMPLEMENTARIOS
   ========================================== */
.chili-qa-subtitle-comp {
    font-size: 15px;
    color: #475569;
    margin-bottom: 8px !important;
}

.chili-qa-red-notice {
    font-size: 13px;
    font-weight: 700;
    color: #ca0000 !important;
    margin-bottom: 20px !important;
}

.chili-qa-title-comp-sub {
    font-size: 18px;
    font-weight: 700;
    color: #111111;
    margin-bottom: 15px;
}

.chili-flex-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 450px;
    margin: 0 auto;
}

/* ==========================================
   ESTILOS PARA EDICIÓN Y MINIATURAS DE ESTAMPADO
   ========================================== */
.chili-summary-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.chili-print-thumb, .chili-print-thumb-empty {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid #cbd5e1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    font-size: 18px;
    transition: transform 0.2s, border-color 0.2s;
}
.chili-print-thumb:hover, .chili-print-thumb-empty:hover {
    transform: scale(1.08);
    border-color: #e8363c;
}
.chili-design-preview-lg {
    max-width: 220px;
    max-height: 220px;
    width: auto;
    height: auto;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin: 15px auto;
    display: block;
    object-fit: contain;
    background: #f8fafc;
    padding: 5px;
}
.chili-popup-select-group {
    margin-bottom: 12px;
    text-align: left;
}
.chili-popup-select-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 4px;
}
.chili-popup-select-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    background-color: #fff;
}

/* Estilos para desplegables y campos deshabilitados en modal de edición */
.chili-popup-select-group {
    display: flex;
    flex-direction: column;
    text-align: left;
    margin-bottom: 12px;
}

.chili-popup-select-group label {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
    color: #333;
}

.chili-popup-select-group select {
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 14px;
    background-color: #fff;
    transition: all 0.2s ease;
}

select.chili-disabled-input {
    background-color: #e9ecef !important;
    color: #6c757d !important;
    cursor: not-allowed !important;
    border-color: #ced4da !important;
    opacity: 0.7;
}

/* ==========================================
   ESTILOS PARA POPUP DE EDICIÓN DE ESTAMPADOS
   ========================================== */
.chili-popup-select-group {
    display: flex;
    flex-direction: column;
    text-align: left;
    margin-bottom: 12px;
}

.chili-popup-select-group label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.chili-popup-select-group select {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: #fff;
    color: #333;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.chili-popup-select-group select:focus {
    border-color: #0073aa;
}

/* Estado apático/apagado en gris cuando una opción no procede */
.chili-popup-select-group select.chili-disabled-input,
.chili-popup-select-group select:disabled {
    background-color: #e9ecef !important;
    color: #6c757d !important;
    border-color: #ced4da !important;
    cursor: not-allowed !important;
    opacity: 0.65 !important;
}

/* ==========================================
   ESTILOS PARA BOTÓN EDITAR Y ELEMENTOS EN EL CARRITO
   ========================================== */
/* ==========================================
   BOTÓN EDITAR PROYECTO (CARRITO)
   ========================================== */
.chili-cart-edit-btn {
    display: inline-block !important;
    background-color: #000000 !important;
    color: #ffffff !important;
    padding: 5px 12px !important;
    border-radius: 4px !important;
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
    transition: background-color 0.2s ease, transform 0.1s ease !important;
    cursor: pointer !important;
    line-height: 1.2 !important;
    vertical-align: middle !important;
}

.chili-cart-edit-btn:hover {
    background-color: #646464 !important;
    color: #ffffff !important;
    text-decoration: none !important;
    transform: scale(1.03);
}

/* Icono de papelera (Estilo gris nativo y tamaño idéntico al de la tienda) */
a.chili-cart-delete-project-btn,
a.chili-cart-delete-project-btn.remove {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #666666 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: color 0.2s ease, transform 0.2s ease !important;
    vertical-align: middle !important;
}

a.chili-cart-delete-project-btn:hover,
a.chili-cart-delete-project-btn.remove:hover {
    color: #ef4444 !important;
    transform: scale(1.1);
}

a.chili-cart-delete-project-btn svg,
a.chili-cart-delete-project-btn.remove svg {
    fill: currentColor !important;
    width: 14px !important;
    height: 14px !important;
    display: inline-block !important;
}

.chili-cart-qty-readonly {
    font-weight: 700;
    font-size: 0.95rem;
    color: #222222;
    display: inline-block;
    padding: 4px 10px;
    background-color: #f4f4f4;
    border-radius: 4px;
    border: 1px solid #dcdcdc;
}

/* ==========================================================================
   AJUSTE DE VARIACIONES E IMAGEN EN MINI-CARRITO (PEDIDO GUIADO)
   ========================================================================== */

/* Aplanar los detalles de la prenda (Talla/Color) para eliminar el salto de línea gigante */
[data-id="cart"] .woocommerce-mini-cart-item dl.variation {
    margin: 2px 0 4px 0 !important;
    font-size: 11px !important;
    display: block !important;
}

/* Ocultar el título nativo de variaciones en TODA la web (Carrito principal, Checkout y Minicarrito) */
dl.variation dt.variation-Detallesdelaprenda,
dl.variation dt.variation-Detallesdeestampado,
dl.variation dt.variation-Detalles,
[data-id="cart"] .woocommerce-mini-cart-item dl.variation dt {
    display: none !important;
}

/* Poner en negrita los detalles en el carrito principal y checkout (para las prendas nativas) */
dl.variation dd.variation-Detallesdelaprenda p,
dl.variation dd.variation-Detallesdeestampado p,
dl.variation dd.variation-Detalles p {
    font-weight: bold !important;
}

/* Ajustes del minicarrito: mantener diseño inline y añadir la negrita */
[data-id="cart"] .woocommerce-mini-cart-item dl.variation dd,
[data-id="cart"] .woocommerce-mini-cart-item dl.variation p {
    display: inline !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 11px !important;
    font-weight: bold !important;
    color: #333333 !important;
}

/* Formato de seguridad para la imagen dentro del mini-carrito */
[data-id="cart"] .woocommerce-mini-cart-item > img {
    width: 60px !important;
    height: 60px !important;
    object-fit: cover !important;
    border-radius: 4px !important;
    flex-shrink: 0 !important;
}

/* ========================================== */
/* PROYECTO DE SERIGRAFÍA (CARRITO DESPLEGABLE)*/
/* ========================================== */

/* Fila Maestra - Ajustes sobre estilo nativo */
tr.chili-proyecto-master td {
    background-color: #f8f9fa !important;
    border-top: 2px solid #222 !important;
    border-bottom: 2px solid #222 !important;
    padding-top: 20px !important;
    padding-bottom: 20px !important;
    vertical-align: middle !important;
    transition: background 0.3s ease;
}

/* Forzar color negro solo en el título "Proyecto de Serigrafía" (sin afectar al botón EDITAR) */
tr.chili-proyecto-master td.product-name > a:not(.chili-cart-edit-btn) {
    color: #000000 !important;
}
tr.chili-proyecto-master:hover td {
    background-color: #ececec !important;
}

/* Ocultar acciones de móvil en la vista de escritorio para evitar duplicación */
tr.chili-proyecto-master .product-mobile-actions {
    display: none !important;
}

/* Alineación general de celdas en la fila maestra */
tr.chili-proyecto-master td.product-thumbnail,
tr.chili-proyecto-master td.product-quantity,
tr.chili-proyecto-master td.product-remove {
    text-align: center !important;
    vertical-align: middle !important;
}

/* Centrado exacto de la Imagen */
tr.chili-proyecto-master td.product-thumbnail .ct-media-container {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    margin: 0 auto !important;
}
tr.chili-proyecto-master td.product-thumbnail img {
    width: 70px !important;
    max-width: 70px !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    margin: 0 auto !important;
    display: block !important;
}

/* Centrado del Botón EDITAR (Celda Cantidad en PC) */
tr.chili-proyecto-master td.product-quantity {
    text-align: center !important;
}
tr.chili-proyecto-master td.product-quantity a.chili-cart-edit-btn {
    display: inline-block !important;
    text-align: center !important;
}

/* Centrado del Botón/Flecha Desplegable en PC */
tr.chili-proyecto-master td.product-remove .chili-master-toggle {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    margin: 0 auto !important;
}
tr.chili-proyecto-master .chili-chevron {
    width: 28px !important;
    height: 28px !important;
    stroke-width: 2px !important;
    transition: transform 0.3s ease;
    display: block !important;
}
tr.chili-proyecto-master.is-open .chili-chevron {
    transform: rotate(180deg);
}

/* Color de la cabecera al estar desplegado */
tr.chili-proyecto-master.is-open td {
    background-color: #e5e5e5 !important;
}

/* Ocultar el botón EDITAR en los productos e ítems individuales dentro del desplegable */
tr.chili-wizard-child .chili-cart-edit-btn {
    display: none !important;
}

/* Filas Hijas (Desplegadas) */
tr.chili-wizard-child {
    background-color: #f2f2f2 !important;
}
tr.chili-wizard-child:hover {
    background-color: #eaeaea !important;
}
tr.chili-wizard-child td:first-child {
    border-left: 4px solid #222 !important; 
    padding-left: 15px !important;
}
tr.chili-wizard-child td.product-name {
    padding-left: 30px !important;
}
tr.chili-wizard-child td {
    border-top: 1px dashed #e0e0e0 !important;
    border-bottom: none !important;
}
tr.chili-wizard-child:last-of-type td {
    border-bottom: 2px solid #222 !important;
}

/* Ocultar producto técnico dummy en Carrito, Minicarrito y Checkout */
.chili-dummy-cart-item,
tr:has(a[href*="chili-wizard-placeholder"]),
li:has(a[href*="chili-wizard-placeholder"]) {
    display: none !important;
}

/* ==== CONTROL DE VISIBILIDAD PARA SOBREESCRIBIR TEMA EN MÓVIL === */

/* Forzar que se oculten siempre, importando más que el CSS del tema */
tr.chili-wizard-child.chili-is-closed {
    display: none !important;
}

/* Al abrir en vista de escritorio, forzamos comportamiento nativo de tabla */
tr.chili-wizard-child.chili-is-open {
    display: table-row !important;
}

/* Adaptación del contenido desplegable solo en móviles */
@media (max-width: 768px) {
    tr.chili-wizard-child.chili-is-open {
        display: block !important; 
    }
}

/* Adaptación de la cabecera maestra y subtotales en móvil (Sincronizado a 997px) */
@media (max-width: 997px) {
    /* Expande la celda del texto para ocupar todo el ancho */
    tr.chili-proyecto-master td.product-name {
        width: 100% !important;
    }

    /* Ocultamos las celdas sueltas de escritorio en la fila maestra */
    tr.chili-proyecto-master > td.product-quantity,
    tr.chili-proyecto-master > td.product-subtotal,
    tr.chili-proyecto-master > td.product-remove:not(.product-mobile-actions) {
        display: none !important;
    }

    /* Muestra y distribuye la barra de acciones usando Flexbox para ordenar */
    .shop_table.cart .product-mobile-actions {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        width: 100% !important;
        margin-top: 8px !important;
        gap: 6px !important;
        flex-wrap: nowrap !important;
    }

    /* 1. Precio Unitario primero */
    .shop_table.cart .product-mobile-actions > .woocommerce-Price-amount {
        order: 1 !important;
    }

    /* 2. Símbolo de multiplicar */
    .shop_table.cart .product-mobile-actions > .ct-product-multiply-symbol {
        order: 2 !important;
    }

    /* 3. Cantidad */
    .shop_table.cart .product-mobile-actions > .chili-cart-qty-readonly,
    .shop_table.cart .product-mobile-actions > .quantity {
        order: 3 !important;
    }

    /* 4. Subtotal total calculado (para productos nativos) */
    .shop_table.cart tr.cart_item:not(.chili-proyecto-master):not(.chili-serigrafia-item) td.product-name .product-mobile-actions::after {
        content: attr(data-subtotal-mobile);
        order: 4 !important;
        font-weight: 700 !important;
        color: #222 !important;
        font-size: 1em !important;
    }

    /* 4. Subtotal total calculado (para serigrafía y prendas aportadas) */
    .shop_table.cart .product-mobile-actions .chili-mobile-subtotal-val {
        display: inline-block !important;
        order: 4 !important;
        font-weight: 700 !important;
        color: #222 !important;
        font-size: 1em !important;
    }

    /* 5. Botón EDITAR o papelera al final alineado a la derecha */
            .shop_table.cart .product-mobile-actions > .remove,
            .shop_table.cart .product-mobile-actions > .chili-cart-edit-btn {
                order: 5 !important;
                margin-left: auto !important;
            }
        }

/* Restaurar comportamiento exacto para escritorio (> 997px) */
@media (min-width: 998px) {
    tr.chili-proyecto-master > td.product-quantity,
    tr.chili-proyecto-master > td.product-subtotal,
    tr.chili-proyecto-master > td.product-remove:not(.product-mobile-actions) {
        display: table-cell !important;
    }
    tr.chili-proyecto-master .product-mobile-actions {
        display: none !important;
    }
}

/* ==========================================================================
   Estabilización y tamaño de imágenes en productos del carrito desplegados (Wizard)
   ========================================================================== */

/* 1. Celda contenedora de la miniatura en productos hijos */
tr.chili-wizard-child td.product-thumbnail {
    width: 95px !important;
    min-width: 95px !important;
    max-width: 95px !important;
    text-align: center !important;
    vertical-align: middle !important;
    padding: 8px 4px !important;
}

/* 2. Imagen y contenedor multimedia del producto hijo */
tr.chili-wizard-child td.product-thumbnail img,
tr.chili-wizard-child td.product-thumbnail .ct-media-container {
    width: 80px !important;
    max-width: 80px !important;
    height: 80px !important;
    aspect-ratio: 1 / 1 !important;
    object-fit: contain !important;
    margin: 0 auto !important;
    display: block !important;
}

/* ==========================================
   ESTILOS BOTÓN RESETEAR SECCIONES (REDONDO Y ROJO SIN RELLENO)
   ========================================== */
.chili-reset-section-wrapper {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    margin-top: 15px;
    margin-bottom: 10px;
    box-sizing: border-box;
}

.chili-btn-reset-section {
    background: transparent !important;
    color: #bd4446 !important;
    border: 2px solid #FF7779 !important;
    padding: 5px 30px !important;
    border-radius: 50px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.25s ease !important;
    outline: none !important;
    line-height: 1.2 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: none !important;
}

.chili-btn-reset-section:hover {
    background-color: #e8363c !important;
    color: #ffffff !important;
    border-color: #e8363c !important;
    box-shadow: 0 4px 10px rgba(232, 54, 60, 0.25) !important;
    transform: translateY(-1px);
}