/* --- Variables --- */
:root {
    --vsc-primary: #007bff;
    --vsc-primary-dark: #0056b3; /* Nuevo para hover */
    --vsc-bg: #ffffff;
    --vsc-text: #333333;
    --vsc-border: #e6e6e6;
    --vsc-shadow: 0 4px 12px rgba(0,0,0,0.08);
    --vsc-radius: 12px;
}

/* --- Botón Flotante --- */
.vsc-floating-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: var(--vsc-primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 20px rgba(0, 123, 255, 0.4);
    z-index: 9990;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease; /* Transición elástica */
    border: none !important;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.vsc-floating-btn:hover {
    transform: scale(1.1) rotate(5deg); /* Pequeña rotación dinámica */
    box-shadow: 0 10px 30px rgba(0, 123, 255, 0.6); /* Glow más intenso */
}

/* FIX: Protección TOTAL del SVG contra Tailwind */
.vsc-floating-btn svg {
    width: 28px !important;
    height: 28px !important;
    stroke: #fff !important; 
    fill: none !important;   
    display: block !important;
    stroke-width: 2px !important;
    min-width: 28px !important;
}

/* Badge contador */
.vsc-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4d4f;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    min-width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    box-sizing: border-box;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); /* Sombra sutil al badge */
}

/* --- Overlay --- */
.vsc-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px); /* Efecto blur moderno */
}
.vsc-overlay.active { opacity: 1; visibility: visible; }

/* --- Panel Lateral (ZONA BLINDADA) --- */
body .vsc-panel {
    position: fixed;
    top: 0; right: -100%;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background: #f9f9f9;
    z-index: 9999;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1); /* Easing más suave estilo iOS */
    display: flex; flex-direction: column;
    box-shadow: -10px 0 40px rgba(0,0,0,0.15); /* Sombra más profunda */
    
    font-family: 'Plus Jakarta Sans', 'Poppins', sans-serif, Helvetica, Arial; 
    font-size: 14px;
    line-height: normal;
    text-align: left;
    color: var(--vsc-text);
    box-sizing: border-box;

    border-top-left-radius: 24px !important;
    border-bottom-left-radius: 24px !important;
    overflow: hidden !important; 
}

/* Reseteo interno recursivo */
body .vsc-panel * { 
    box-sizing: border-box !important; 
}

body .vsc-panel.active { right: 0; }

/* --- Header --- */
body .vsc-panel .vsc-header {
    background: #fff; padding: 24px;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid var(--vsc-border);
    flex-shrink: 0; 
}
body .vsc-panel .vsc-header h3 { 
    margin: 0; 
    font-size: 20px !important; 
    line-height: 1.2 !important;
    font-weight: 800 !important; 
    color: #0f172a; /* Slate 900 */
    letter-spacing: -0.5px;
}
body .vsc-close {
    background: transparent; 
    border: none; 
    font-size: 24px;
    color: #94a3b8; 
    padding: 8px; 
    line-height: 1;
    cursor: pointer !important;
    transition: all 0.3s ease;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px;
}
body .vsc-close:hover {
    background-color: #f1f5f9;
    color: #ef4444; /* Rojo al hover */
    transform: rotate(90deg); /* Animación de rotación */
}

/* --- Body --- */
body .vsc-panel .vsc-body {
    flex: 1; 
    overflow-y: auto; 
    padding: 24px;
    -webkit-overflow-scrolling: touch;
    display: block; 
}

/* --- LISTA DE PRODUCTOS --- */
body .vsc-panel .vsc-cart-list {
    display: block !important;
    width: 100% !important;
}

body .vsc-panel .vsc-cart-list ul,
body .vsc-panel .vsc-cart-list ul.woocommerce-mini-cart { 
    margin: 0 !important; 
    padding: 0 !important; 
    list-style: none !important;
    display: block !important; 
    width: 100% !important;
}

/* --- CARD DE PRODUCTO (UX MEJORADO) --- */
body .vsc-panel .vsc-cart-list li.mini_cart_item {
    background: #fff;
    border: 1px solid var(--vsc-border);
    border-radius: var(--vsc-radius);
    padding: 16px 65px 16px 20px !important; 
    margin-bottom: 12px !important;
    
    display: flex !important;
    flex-direction: column !important;
    position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    
    flex-shrink: 0 !important; 
    width: 100%;
    min-height: 90px; 
    justify-content: center; 
    
    float: none !important;
    clear: both !important;
    list-style-type: none !important;
    box-sizing: border-box !important;
    margin-left: 0 !important;

    /* Transición suave para el hover */
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease !important;
}

/* HOVER EFFECT EN ITEM */
body .vsc-panel .vsc-cart-list li.mini_cart_item:hover {
    transform: translateY(-2px) !important; /* Pequeña elevación */
    box-shadow: 0 10px 25px rgba(0,0,0,0.05) !important; /* Sombra más profunda */
    border-color: #bfdbfe !important; /* Borde azul muy suave (Tailwind blue-200) */
}

/* -------------------------------------------------------
   ANIQUILACIÓN DEL "TUBO" (FIX)
   -------------------------------------------------------
*/
body .vsc-panel .vsc-cart-list li img, 
body .vsc-panel .vsc-cart-list li picture,
body .vsc-panel .vsc-cart-list li source,
body .vsc-panel .vsc-cart-list li .attachment-woocommerce_thumbnail,
body .vsc-panel .vsc-cart-list li .wp-post-image { 
    display: none !important; 
    width: 0 !important;
    height: 0 !important;
    opacity: 0 !important;
    position: absolute !important;
    visibility: hidden !important;
    pointer-events: none !important;
    max-width: 0 !important;
}

body .vsc-panel .vsc-cart-list li svg:not(.remove svg) {
    display: none !important;
}

/* 3. Título del producto */
body .vsc-panel .vsc-cart-list li a:not(.remove) {
    font-family: 'Plus Jakarta Sans', 'Poppins', sans-serif !important; 
    font-weight: 700 !important;
    color: #1e293b !important; /* Slate 800 */
    text-decoration: none !important;
    font-size: 15px !important; 
    line-height: 1.4 !important; 
    display: block;
    margin-bottom: 6px;
    padding: 0 !important;
    width: 100% !important;
    background: none !important; 
    transition: color 0.2s ease !important;
}
/* Hover en el título */
body .vsc-panel .vsc-cart-list li:hover a:not(.remove) {
    color: var(--vsc-primary) !important;
}

/* 4. Precio */
body .vsc-panel .vsc-cart-list li .quantity {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #64748b !important; /* Slate 500 */
    display: block;
    margin-top: auto;
    border: none !important; 
    padding: 0 !important;
}
body .vsc-panel .vsc-cart-list li .quantity .amount {
    font-weight: 800 !important;
    color: #0f172a !important; /* Slate 900 */
}

/* 5. BOTÓN TRASH (Interacción Mejorada) */
body .vsc-panel .vsc-cart-list li a.remove {
    position: absolute !important;
    top: 50% !important;
    right: 20px !important;
    transform: translateY(-50%) !important;
    width: 36px !important;
    height: 36px !important;
    
    border-radius: 10px !important; /* Más redondeado */
    background-color: #f8fafc !important;
    border: 1px solid #f1f5f9 !important;
    
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    
    /* Transición elástica para el botón borrar */
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    
    font-size: 0 !important;
    line-height: 0 !important;
    color: transparent !important; 
    text-indent: -9999px !important; 
    overflow: hidden !important;
    
    z-index: 50 !important;
    opacity: 1 !important;
}

body .vsc-panel .vsc-cart-list li a.remove::before {
    content: '' !important;
    display: block !important;
    width: 18px !important;
    height: 18px !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath fill='%2394a3b8' d='M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z'/%3E%3C/svg%3E");
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: contain !important;
    background-color: transparent !important;
    transition: all 0.2s ease !important;
}

/* Hover Effect: Escala y cambio de color */
body .vsc-panel .vsc-cart-list li a.remove:hover { 
    background-color: #fee2e2 !important; 
    border-color: #fecaca !important;
    transform: translateY(-50%) scale(1.1) !important; /* Pop effect */
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2) !important;
}

body .vsc-panel .vsc-cart-list li a.remove:hover::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath fill='%23dc2626' d='M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z'/%3E%3C/svg%3E");
}

/* --- Footer --- */
body .vsc-panel .woocommerce-mini-cart__total {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 18px !important; font-weight: 800; color: #0f172a;
    margin-top: auto; padding-top: 20px; padding-bottom: 15px;
    border-top: 1px dashed #e2e8f0;
    flex-shrink: 0;
    line-height: normal !important;
}

body .vsc-panel .woocommerce-mini-cart__buttons { 
    display: flex; flex-direction: column; gap: 12px; flex-shrink: 0; 
    /* [FIX GUEST] Forzamos que el contenedor se vea si tiene contenido */
    display: flex !important; 
}

/* BOTÓN CHECKOUT (UX MEJORADO) */
body .vsc-panel .woocommerce-mini-cart__buttons .checkout {
    background-color: var(--vsc-primary) !important; 
    color: #fff !important;
    width: 100%; text-align: center; border-radius: 16px !important; /* Más moderno */
    padding: 16px !important; font-weight: 700; text-transform: none; font-size: 16px !important; 
    border: none !important;
    display: flex !important; align-items: center; justify-content: center; gap: 8px;
    line-height: normal !important;
    margin: 0 !important;
    
    /* Transiciones */
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 6px rgba(0, 123, 255, 0.2) !important;
}

/* Hover Effect Checkout */
body .vsc-panel .woocommerce-mini-cart__buttons .checkout:hover {
    background-color: var(--vsc-primary-dark) !important;
    transform: translateY(-2px) !important; /* Elevación */
    box-shadow: 0 10px 20px rgba(0, 123, 255, 0.4) !important; /* Glow azul */
}

/* [FIX CRÍTICO]: Oculta todos MENOS checkout Y MENOS nuestro botón de cotización. */
body .vsc-panel .woocommerce-mini-cart__buttons .button:not(.checkout):not(.vsc-btn-quote) { 
    display: none !important; 
}

/* --- MOBILE --- */
@media (max-width: 480px) {
    body .vsc-panel { max-width: none; width: 100%; }
    .vsc-floating-btn { bottom: 20px; right: 20px; width: 50px; height: 50px; }
    body .vsc-panel .vsc-header, body .vsc-panel .vsc-body { padding: 20px; }
    
    body .vsc-panel .vsc-cart-list li a:not(.remove) {
        font-size: 14px !important; 
    }
}

/* ========================================================= */
/* === ESTILOS NUEVOS: MODAL Y COTIZACIÓN (Agregados) === */
/* ========================================================= */

/* 1. Ocultamos el texto viejo "Guardar cotización" del pseudo-elemento para que no estorbe */
body .vsc-panel .woocommerce-mini-cart__buttons:before {
    display: none !important;
}

/* 2. Nuevo Botón Outline que reemplaza al texto */
.vsc-btn-quote {
    background-color: transparent !important;
    color: var(--vsc-primary) !important;
    border: 2px solid var(--vsc-primary) !important;
    width: 100%; text-align: center; border-radius: 16px !important;
    padding: 14px !important; font-weight: 700; text-transform: none; font-size: 14px !important;
    cursor: pointer; transition: all 0.3s ease !important;
    display: block !important; /* [FIX] Forzamos que se muestre siempre */
    margin-bottom: 5px !important;
}
.vsc-btn-quote:hover {
    background-color: #eff6ff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.1) !important;
}

/* 3. Estilos del Modal (PREMIUM UI) */
.vsc-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(6px);
    z-index: 10000; display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: all 0.3s ease;
}
.vsc-modal-overlay.active { opacity: 1; visibility: visible; }

.vsc-modal-card {
    background: #fff; width: 90%; max-width: 420px;
    border-radius: 24px; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden; transform: scale(0.95) translateY(10px); 
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.vsc-modal-overlay.active .vsc-modal-card { transform: scale(1) translateY(0); }

.vsc-modal-header {
    padding: 24px; border-bottom: 1px solid #f1f5f9;
    display: flex; justify-content: space-between; align-items: center;
    background: #fafbfc;
}
.vsc-modal-title-group { display: flex; align-items: center; gap: 10px; }
.vsc-modal-header h4 { margin: 0; font-size: 18px; font-weight: 700; color: #0f172a; letter-spacing: -0.5px; }

.vsc-modal-close {
    background: transparent; border: none; font-size: 20px; color: #94a3b8; 
    cursor: pointer; padding: 5px; border-radius: 50%; transition: all 0.2s;
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px;
}
.vsc-modal-close:hover { background-color: #e2e8f0; color: #ef4444; }

.vsc-modal-body { padding: 24px; }
.vsc-modal-desc { font-size: 14px; color: #64748b; margin-bottom: 24px; line-height: 1.5; text-align: center; }

.vsc-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.vsc-form-group { margin-bottom: 16px; }
.vsc-form-group label { display: block; font-size: 12px; font-weight: 700; color: #475569; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }

/* Inputs con Iconos */
.vsc-input-wrapper {
    position: relative; display: flex; align-items: center;
}
.vsc-input-wrapper i {
    position: absolute; left: 14px; color: #94a3b8; font-size: 18px;
    pointer-events: none;
}
.vsc-form-group input {
    width: 100%; padding: 12px 16px 12px 42px; /* Espacio para el icono */
    border-radius: 12px; border: 1px solid #e2e8f0;
    font-size: 14px; color: #0f172a; outline: none; 
    transition: all 0.2s ease; background-color: #f8fafc;
}
.vsc-form-group input:focus { 
    border-color: var(--vsc-primary); 
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    background-color: #fff;
}

.vsc-btn-download {
    width: 100%; background: linear-gradient(135deg, var(--vsc-primary) 0%, var(--vsc-primary-dark) 100%);
    color: #fff; border: none; padding: 16px; border-radius: 16px; 
    font-weight: 700; font-size: 16px; cursor: pointer; 
    transition: all 0.3s ease; margin-top: 12px;
    box-shadow: 0 10px 20px -5px rgba(0, 123, 255, 0.4);
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.vsc-btn-download:hover { transform: translateY(-2px); box-shadow: 0 15px 25px -5px rgba(0, 123, 255, 0.5); }
.vsc-btn-download i { font-size: 18px; }

/* Loader simple para el botón (RENOMBRADO PARA EVITAR CONFLICTOS) */
.vsc-hidden { display: none !important; }