/* ==========================================
   1. ESTILOS CSS INTEGRADOS - PROARTE
   ========================================== */
:root { --primary: #ff6600; --text: #333333; --bg: #f4f7f6; --white: #ffffff; }
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Roboto', sans-serif; background-color: var(--bg); color: var(--text); line-height: 1.4; overflow-x: hidden; }

/* ==========================================
   CABECERA (HEADER) Y BUSCADOR
   ========================================== */
.main-header { 
    background-color: #399BD5; 
    padding: 20px 30px; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); 
    position: sticky; top: 0; z-index: 100; 
    text-align: center;
}

/* BOTÓN INSTALAR APP EN CABECERA */
.btn-instalar-app {
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #90caf9;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: 15px;
}

.btn-instalar-app:hover {
    background: #1976d2;
    color: #ffffff;
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(25, 118, 210, 0.2);
}

.main-title { font-weight: 900; color: #ffffff; text-transform: uppercase; font-size: 1.1rem; letter-spacing: 1px; margin-bottom: 15px; }
.main-logo { height: 60px; margin-bottom: 5px; cursor: pointer; }

.btn-volver-tienda { 
    position: absolute; right: 30px; top: 25px; 
    text-decoration: none; color: #ffffff; font-size: 0.9rem; font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.4); padding: 10px 20px; border-radius: 30px; 
    background: rgba(255, 255, 255, 0.15); transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05); backdrop-filter: blur(4px);
}
.btn-volver-tienda:hover { 
    background: #ffffff; color: #399BD5; box-shadow: 0 4px 15px rgba(0,0,0,0.15); 
    border-color: #ffffff; transform: scale(1.05); 
}

/* --- ESTILO DEL CONTADOR GLOBAL --- */
.contador-badge {
    background: rgba(255, 255, 255, 0.2); color: #fff; padding: 5px 15px; border-radius: 20px; 
    font-size: 0.85rem; font-weight: bold; margin-top: 10px; border: 1px solid rgba(255, 255, 255, 0.4); 
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); backdrop-filter: blur(4px); display: inline-block;
}		

/* --- CARRUSEL Y LIMPIEZA DE ARCHIVOS --- */
.proarte-carrusel { position: relative; width: 100%; height: 220px; border-radius: 8px; overflow: hidden; background: transparent; display: flex; align-items: center; justify-content: center; border: none; }
.proarte-carrusel img { max-width: 100%; max-height: 100%; object-fit: contain; position: absolute; opacity: 0; transition: opacity 0.5s ease-in-out; }
.proarte-carrusel img.activa { opacity: 1; z-index: 1; }
.car-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.4); color: white; border: none; width: 30px; height: 30px; cursor: pointer; z-index: 2; border-radius: 50%; font-size: 14px; transition: 0.3s; display: flex; align-items: center; justify-content: center; }
.car-btn:hover { background: rgba(0,0,0,0.8); }
.car-prev { left: 10px; }
.car-next { right: 10px; }
.btn-limpiar { background: none; border: none; color: #d32f2f; cursor: pointer; font-size: 1.1rem; margin-left: 8px; display: none; vertical-align: middle; }
.btn-limpiar:hover { transform: scale(1.2); }

/* --- MODO REVENDEDOR --- */
.btn-revendedor {
    position: absolute; right: 30px; top: 75px; 
    background: rgba(0,0,0,0.2); color: #fff; border: 1px solid rgba(255,255,255,0.4); 
    padding: 8px 15px; border-radius: 20px; font-size: 0.85rem; font-weight: bold; cursor: pointer; transition: 0.3s;
}
.btn-revendedor:hover { background: #fff; color: #2e7d32; }

/* BUSCADOR DE PRODUCTOS */
.search-container { 
    position: absolute; 
    left: 30px; 
    top: 50%; 
    transform: translateY(-50%); 
    width: 300px; 
}
.search-input {
    width: 100%; padding: 10px 20px 10px 40px; border-radius: 30px;
    border: 1px solid rgba(255,255,255,0.8); outline: none; font-size: 0.95rem;
    background-color: rgba(255, 255, 255, 0.95); color: #333; transition: 0.3s;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.search-input::placeholder { color: #888; }
.search-input:focus { background-color: #fff; box-shadow: 0 0 12px rgba(255,255,255,0.8); }
.search-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); font-size: 1.1rem; opacity: 0.6; color: #333; }

/* REGLAS RESPONSIVE DEL HEADER */
@media (max-width: 768px) {
    .btn-volver-tienda { position: relative; right: auto; top: auto; transform: none; margin-bottom: 10px; width: 90%; }
    .search-container { position: relative; left: auto; top: auto; transform: none; width: 90%; margin-bottom: 15px; }
    .modules-grid { grid-template-columns: 1fr 1fr !important; }
    .btn-revendedor { position: relative; right: auto; top: auto; bottom: auto; width: 90%; margin-top: 0; margin-bottom: 10px; }
    .rev-badge { width: 90%; font-size: 0.7rem; margin-bottom: 12px; white-space: normal; }
}

/* MAGIA DEL BUSCADOR: SINGLE MODE */
.modules-grid.single-mode {
    display: flex !important; 
    justify-content: center; 
    align-items: flex-start;
    padding-top: 30px;
}
.modules-grid.single-mode .module-card {
    transform: scale(1.20); 
    margin: 30px; 
    width: 220px; /* FIX: Obliga a la tarjeta a tener cuerpo */
    max-width: 250px;
    flex-shrink: 0; /* FIX: Evita que se aplaste como fideo */
}
.modules-grid.single-mode .module-card:hover {
    transform: scale(1.20) translateY(-5px); 
}

/* DISEÑO DE GRILLA PRINCIPAL */
.container { max-width: 1400px; margin: 2vh auto; padding: 0 15px; min-height: 75vh; height: auto; padding-bottom: 20px; }
.modules-grid { 
    display: grid; 
    grid-template-columns: repeat(6, 1fr); 
    gap: 12px; 
    height: 100%;
}
.module-card { 
    background: var(--white); 
    padding: 15px; 
    border-radius: 10px; 
    box-shadow: 0 3px 10px rgba(0,0,0,0.04); 
    transition: all 0.3s ease; text-align: center; cursor: pointer; 
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    border-bottom: 1px solid #eee;
    border-left: 1px solid #eee;
    border-right: 1px solid #eee;
}
.module-card:hover { 
    transform: translateY(-4px); 
    box-shadow: 0 8px 20px rgba(0,0,0,0.12); 
}
.module-card.disabled { opacity: 0.5; cursor: default; border: 1px dashed #ccc !important; box-shadow: none; background: #fafafa !important; }
.module-card.disabled:hover { transform: none; box-shadow: none; }
.module-card.en-revision { filter: grayscale(100%); opacity: 0.6; position: relative; }
.module-card.en-revision .module-desc { color: #d32f2f; font-weight: 900; }
.module-card.en-revision::after { content: "🚧 EN REVISIÓN"; position: absolute; top: -10px; right: 10px; background: #d32f2f; color: white; padding: 4px 8px; border-radius: 10px; font-size: 0.7rem; font-weight: bold; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }

body.admin-mode .module-card.en-revision { filter: none; opacity: 1; outline: 3px dashed #d32f2f; cursor: pointer !important; pointer-events: auto !important; }
body.admin-mode .module-card.en-revision::after { content: "🔓 DESBLOQUEADO (ADMIN)"; background: #4CAF50; }

/* COLORES DE LAS TARJETAS */
.module-card:nth-child(1) { border-top: 4px solid #FF6B6B; background: linear-gradient(to bottom, #fffafa, #ffffff); } 
.module-card:nth-child(2) { border-top: 4px solid #4ECDC4; background: linear-gradient(to bottom, #f0fbfb, #ffffff); } 
.module-card:nth-child(3) { border-top: 4px solid #FFE66D; background: linear-gradient(to bottom, #fffdf2, #ffffff); } 
.module-card:nth-child(4) { border-top: 4px solid #1A535C; background: linear-gradient(to bottom, #f2f7f8, #ffffff); } 
.module-card:nth-child(5) { border-top: 4px solid #FF9F1C; background: linear-gradient(to bottom, #fff8f0, #ffffff); } 
.module-card:nth-child(6) { border-top: 4px solid #9B5DE5; background: linear-gradient(to bottom, #f8f2fe, #ffffff); } 
.module-card:nth-child(7) { border-top: 4px solid #F15BB5; background: linear-gradient(to bottom, #fef2f8, #ffffff); } 
.module-card:nth-child(8) { border-top: 4px solid #00BBF9; background: linear-gradient(to bottom, #f0fbff, #ffffff); } 
.module-card:nth-child(9) { border-top: 4px solid #00F5D4; background: linear-gradient(to bottom, #effffd, #ffffff); } 
.module-card:nth-child(10) { border-top: 4px solid #8AC926; background: linear-gradient(to bottom, #f7fdf0, #ffffff); } 
.module-card:nth-child(11) { border-top: 4px solid #6A4C93; background: linear-gradient(to bottom, #f6f3f9, #ffffff); } 
.module-card:nth-child(12) { border-top: 4px solid #1982C4; background: linear-gradient(to bottom, #f1f8fc, #ffffff); } 
.module-card:nth-child(13) { border-top: 4px solid #8D99AE; background: linear-gradient(to bottom, #f7f8f9, #ffffff); } 
.module-card:nth-child(14) { border-top: 4px solid #D90429; background: linear-gradient(to bottom, #fcf0f2, #ffffff); } 
.module-card:nth-child(15) { border-top: 4px solid #38B000; background: linear-gradient(to bottom, #f2fbf0, #ffffff); } 
.module-card:nth-child(16) { border-top: 4px solid #FF5722; background: linear-gradient(to bottom, #fff5f2, #ffffff); } 
.module-card:nth-child(17) { border-top: 4px solid #009688; background: linear-gradient(to bottom, #f2fcfb, #ffffff); } 
.module-card:nth-child(18) { border-top: 4px solid #795548; background: linear-gradient(to bottom, #fcfaf8, #ffffff); } 
.module-card:nth-child(19) { border-top: 4px solid #E91E63; background: linear-gradient(to bottom, #fdf0f5, #ffffff); } 
.module-card:nth-child(20) { border-top: 4px solid #FFC300; background: linear-gradient(to bottom, #fffdf0, #ffffff); }
.module-card:nth-child(21) { border-top: 4px solid #9C27B0; background: linear-gradient(to bottom, #f8f2fe, #ffffff); } 
.module-card:nth-child(22) { border-top: 4px solid #FF9800; background: linear-gradient(to bottom, #fff8f0, #ffffff); } 
.module-card:nth-child(23) { border-top: 4px solid #2196F3; background: linear-gradient(to bottom, #f0f7ff, #ffffff); } 
.module-card:nth-child(24) { border-top: 4px solid #607D8B; background: linear-gradient(to bottom, #f4f6f7, #ffffff); } 
.module-card:nth-child(25) { border-top: 4px solid #607D8B; background: linear-gradient(to bottom, #f0f4f7, #ffffff); }

.module-icon { font-size: 2.8rem; margin-bottom: 8px; display: block; }
.module-icon img { height: 3.5rem; object-fit: contain; margin-bottom: 8px; display: block; } 
.module-title { font-weight: 700; font-size: 1.05rem; margin-bottom: 5px; line-height: 1.1; }
.module-desc { font-size: 0.75rem; color: #666; font-weight: 400; line-height: 1.2; }

/* ==========================================
   MODALES Y FORMULARIOS
   ========================================== */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.75); z-index: 1000; justify-content: center; align-items: center; backdrop-filter: blur(5px); }
.modal-content { background: #ffffff; width: 95%; max-width: 600px; max-height: 90vh; border-radius: 12px; overflow-y: auto; position: relative; box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
.close-btn { position: absolute; right: 15px; top: 12px; font-size: 1.8rem; color: #fff; cursor: pointer; line-height: 1; z-index: 10; text-shadow: 0 2px 4px rgba(0,0,0,0.3); transition: 0.2s;}
.close-btn:hover { color: #ffcccc; transform: scale(1.1); }
.modal-cap { position: relative; }
.mod-header { padding: 15px; text-align: center; border-radius: 12px 12px 0 0; margin-bottom: 15px; }
.mod-header h2 { color: #ffffff !important; font-weight: 900; font-size: 1.4rem; text-transform: uppercase; letter-spacing: 1px; text-shadow: 0 2px 5px rgba(0,0,0,0.2); }
.mod-body { padding: 0 30px 15px; }

/* REGLA UNIVERSAL DE TAMAÑO PARA MODALES (RESPONSIVE) */
.modal-content { width: 95% !important; max-width: 1100px !important; margin: 20px auto !important; }
@media (min-width: 768px) { .modal-content { width: 80% !important; min-width: 850px !important; } }

#modal-m12 .modal-content { max-width: 850px; }

/* LAYOUT 2 COLUMNAS (E-COMMERCE) */
.split-layout { display: grid; grid-template-columns: 1fr 1.5fr; gap: 20px; align-items: start; }
.layout-left { display: flex; flex-direction: column; gap: 15px; position: sticky; top: 15px; }
.layout-right { display: flex; flex-direction: column; gap: 12px; }

.product-image-box { background: transparent; border: none; border-radius: 10px; padding: 15px; text-align: center; min-height: 220px; display: flex; flex-direction: column; justify-content: center; align-items: center; overflow: hidden; box-shadow: none; }
.product-image-box img { max-width: 100%; height: auto; border-radius: 6px; display: block; }
.product-image-box .img-placeholder { color: #aaa; font-weight: 900; font-size: 1.2rem; text-transform: uppercase; letter-spacing: 2px; }
.product-image-box .img-sub { color: #888; font-size: 0.8rem; margin-top: 5px; }

/* CAJAS DE ARCHIVOS */
.file-section { background: #e0f2f1; padding: 15px; border-radius: 8px; border: 1px dashed #009688; margin-top: 15px; }
.file-section-title { font-weight: bold; color: #00796b; margin-bottom: 10px; font-size: 0.9rem; text-transform: uppercase; display: block; }
.file-input-wrapper { position: relative; overflow: hidden; display: inline-block; width: 100%; margin-bottom: 5px; }
.file-input-wrapper input[type=file] { font-size: 100px; position: absolute; left: 0; top: 0; opacity: 0; cursor: pointer; }
.btn-file { background: #009688; color: white; padding: 10px 15px; border-radius: 6px; display: block; text-align: center; font-weight: bold; cursor: pointer; transition: 0.3s; }
.btn-file:hover { background: #00796b; }
.file-name { font-size: 0.8rem; color: #555; display: block; margin-bottom: 10px; font-style: italic; word-break: break-all; text-align: center;}
.captcha-box { margin-top: 15px; display: flex; justify-content: center; transform: scale(0.95); }
.modal-content .captcha-box { display: none !important; } /* APAGAR CAPTCHAS VIEJOS */

/* RESPONSIVE SPLIT LAYOUT */
@media (max-width: 768px) {
    .split-layout { display: flex; flex-direction: column; gap: 0; }
    .layout-left { display: contents; } 
    .product-image-box { order: 1; width: 100%; margin-bottom: 20px; }
    .layout-right { order: 2; width: 100%; margin-bottom: 10px; }
    .layout-left > div:not(.product-image-box):not(.res-box) { order: 3; width: 100%; margin-bottom: 15px; }
    .res-box { order: 4; width: 100%; }
}

/* COLORES DINÁMICOS ENCABEZADOS MODALES */
#modal-m8 .mod-header { background-color: #FF6B6B; } 
#modal-m23 .mod-header { background-color: #2196F3 !important; }
#modal-m1 .mod-header { background-color: #4ECDC4; } 
#modal-m9 .mod-header { background-color: #E4C824; } 
#modal-m12 .mod-header { background-color: #1A535C; } 
#modal-m6 .mod-header { background-color: #FF9F1C; } 
#modal-m4 .mod-header { background-color: #9B5DE5; } 
#modal-m11 .mod-header { background-color: #F15BB5; } 
#modal-m7 .mod-header { background-color: #00BBF9; } 
#modal-m14 .mod-header { background-color: #00BFA5; } 
#modal-m5 .mod-header { background-color: #72A620; } 
#modal-m13 .mod-header { background-color: #6A4C93; } 
#modal-m3 .mod-header { background-color: #1982C4; } 
#modal-m10 .mod-header { background-color: #8D99AE; } 
#modal-m2 .mod-header { background-color: #D90429; } 
#modal-m15 .mod-header { background-color: #38B000; } 
#modal-m16 .mod-header { background-color: #FF5722; } 
#modal-m17 .mod-header { background-color: #009688; } 
#modal-m18 .mod-header { background-color: #795548; } 
#modal-m19 .mod-header { background-color: #E91E63; } 

.form-group { margin-bottom: 12px; text-align: left; }
.form-group label { display: block; font-weight: 700; font-size: 0.8rem; color: #666; margin-bottom: 4px; text-transform: uppercase; }
input, select { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 0.95rem; transition: 0.3s; }
input:disabled, select:disabled { background-color: #f5f5f5; color: #aaa; border-color: #eee; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.res-box { margin-top: 15px; padding: 15px; background: #fafafa; border: 2px dashed #ddd; border-radius: 10px; text-align: center; }
canvas { max-width: 100%; height: auto; border: 1px solid #eee; margin-top: 10px; background-color: #fff;}
.total { font-size: 2rem; font-weight: 900; color: #ff6600 !important; display: block; line-height: 1; margin-top: 5px; }
.unit-text { color: #888; font-size: 0.9rem; margin-top: 5px; font-weight: 400; font-style: italic; } 

.mod-body-bottom { padding: 0 30px 25px; }
.cliente-seccion { border-top: 1px solid #eee; padding-top: 15px; margin-top: 10px; }
.btn-wa { display: block; width: 100%; padding: 12px; background: #25D366; color: #fff; text-align: center; border-radius: 6px; font-weight: 700; text-decoration: none; font-size: 1.05rem; border: none; cursor: pointer; transition: 0.2s;}
.btn-wa:hover { background: #20b858; }
.btn-captura { background: #333; color: white; padding: 8px 15px; border: none; border-radius: 5px; cursor: pointer; font-size: 0.85rem; margin-bottom: 10px; display: inline-block; width: 100%; transition: 0.3s;}
.btn-captura:hover { background: #555; }
.msg-ok { display: none; color: #20b858; font-weight: bold; margin-top: 10px; text-align: center; font-size: 0.9rem; }

/* ESTILOS DE REVENDEDOR (EXTRA) */
.main-header.rev-mode { background-color: #2e7d32 !important; transition: 0.5s; } 
.rev-badge { display: none; background: #fff; color: #2e7d32; font-size: 0.8rem; font-weight: 900; padding: 4px 12px; border-radius: 10px; margin-top: 5px; text-transform: uppercase; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
.main-header.rev-mode .rev-badge { display: inline-block; }
.main-header.rev-mode .btn-revendedor { display: none; }

/* ==========================================
   WIDGETS FLOTANTES (NOTAS, CALCULADORA, CARRITO)
   ========================================== */
.btn-notas-flotante { position: fixed; bottom: 150px; right: 20px; width: 50px; height: 50px; background: #FF9F1C; color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; box-shadow: 0 4px 10px rgba(0,0,0,0.2); cursor: pointer; z-index: 9998; transition: 0.3s; border: none; }
.btn-notas-flotante:hover { transform: scale(1.1); background: #e88e15; }
.widget-notas { display: none; position: fixed; bottom: 210px; right: 20px; width: 280px; background: #fff; border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.2); z-index: 9999; border: 1px solid #ddd; overflow: hidden; animation: slideUp 0.3s ease; }
.notas-header { background: #FF9F1C; color: white; padding: 10px 15px; font-weight: bold; display: flex; justify-content: space-between; align-items: center; }
#notas-texto { width: 100%; height: 200px; padding: 15px; border: none; resize: none; font-family: 'Roboto', sans-serif; font-size: 0.9rem; color: #333; outline: none; background: #fffdf2; }
.notas-footer { display: flex; justify-content: space-between; align-items: center; padding: 10px 15px; background: #f8f9fa; border-top: 1px solid #eee; }
#notas-status { font-size: 0.75rem; color: #2e7d32; font-style: italic; }
.btn-limpiar-notas { background: none; border: none; color: #d32f2f; cursor: pointer; font-size: 0.8rem; font-weight: bold; transition: 0.2s; }
.btn-limpiar-notas:hover { color: #b71c1c; text-decoration: underline; }

.btn-calc-flotante { position: fixed; bottom: 20px; right: 20px; width: 50px; height: 50px; background: #399BD5; color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; box-shadow: 0 4px 10px rgba(0,0,0,0.2); cursor: pointer; z-index: 9998; transition: 0.3s; border: none; }
.btn-calc-flotante:hover { transform: scale(1.1); background: #2b7cae; }
.widget-calculadora { display: none; position: fixed; bottom: 80px; right: 20px; width: 250px; background: #fff; border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.2); z-index: 9999; border: 1px solid #ddd; overflow: hidden; animation: slideUp 0.3s ease; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.calc-header { background: #399BD5; color: white; padding: 10px 15px; font-weight: bold; display: flex; justify-content: space-between; align-items: center; }
.calc-pantalla { width: 100%; text-align: right; font-size: 1.5rem; padding: 15px 10px; margin-bottom: 10px; border: none; border-bottom: 1px solid #eee; background: #f9f9f9; color: #333; outline: none; }
.calc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 0 15px 15px; }
.calc-btn { padding: 12px 0; border: 1px solid #eee; border-radius: 8px; font-weight: bold; font-size: 1.1rem; cursor: pointer; transition: 0.2s; background: #fff; color: #555; }
.calc-btn:hover { background: #f0f0f0; }
.calc-btn.op { background: #f8f9fa; color: #399BD5; }
.calc-btn.eq { background: #399BD5; color: white; border-color: #399BD5; }
.calc-btn.clear { background: #ffebee; color: #d32f2f; border-color: #ffcdd2; }

/* CARRITO FLOTANTE */
.btn-carrito-flotante { position: fixed; bottom: 85px; right: 20px; width: 50px; height: 50px; background: #25D366; color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; box-shadow: 0 4px 10px rgba(0,0,0,0.2); cursor: pointer; z-index: 9998; transition: 0.3s; border: none; }
.btn-carrito-flotante:hover { transform: scale(1.1); background: #20b858; }
.cart-badge { position: absolute; top: -5px; right: -5px; background: #d32f2f; color: white; font-size: 0.75rem; font-weight: bold; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; display: none; }
.widget-carrito { display: none; position: fixed; bottom: 145px; right: 20px; width: 320px; max-height: calc(100vh - 170px); background: #fff; border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.2); z-index: 9999; border: 1px solid #ddd; overflow: hidden; animation: slideUp 0.3s ease; flex-direction: column; }
.carrito-header { background: #25D366; color: white; padding: 12px 15px; font-weight: bold; display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.carrito-body { padding: 15px; overflow-y: auto; flex-grow: 1; background: #f9f9f9; min-height: 90px; }
.carrito-item { background: #fff; border: 1px solid #eee; padding: 10px; border-radius: 8px; margin-bottom: 10px; position: relative; box-shadow: 0 2px 5px rgba(0,0,0,0.02);}
.carrito-item-title { font-weight: bold; font-size: 0.9rem; color: #333; margin-bottom: 5px; padding-right: 20px;}
.carrito-item-desc { font-size: 0.8rem; color: #666; line-height: 1.2; white-space: pre-wrap;}
.carrito-item-price { font-weight: 900; color: #ff6600; font-size: 1rem; text-align: right; margin-top: 5px; }
.btn-quitar-item { position: absolute; top: 8px; right: 8px; background: none; border: none; color: #d32f2f; cursor: pointer; font-size: 1.1rem; }
.carrito-footer { padding: 15px 15px 45px 15px; background: #fff; border-top: 1px solid #eee; flex-shrink: 0; } 
.carrito-total-box { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.carrito-total-label { font-weight: bold; color: #555; text-transform: uppercase; font-size: 0.9rem; }
.carrito-total-monto { font-weight: 900; color: #ff6600; font-size: 1.4rem; }
.btn-carrito-accion { width: 100%; padding: 10px; border-radius: 6px; font-weight: bold; cursor: pointer; transition: 0.2s; border: none; margin-bottom: 8px; display: block; text-align: center; text-decoration: none;}
.btn-seguir { background: #e0e0e0; color: #333; }
.btn-seguir:hover { background: #d5d5d5; }
.btn-finalizar { background: #25D366; color: #fff; font-size: 1.1rem; }
.btn-finalizar:hover { background: #20b858; }
.btn-vaciar { background: transparent; color: #d32f2f; width: 100%; border: none; font-size: 0.85rem; font-weight: bold; cursor: pointer; text-decoration: underline; margin-top: 12px; padding-bottom: 5px; }

/* BANNER DE SESIÓN */
.session-banner { display: none; background: #fff3e0; color: #e65100; padding: 10px 20px; text-align: center; font-size: 0.95rem; font-weight: bold; border-bottom: 1px solid #ffe0b2; }
.session-banner-cerrar { color: #d32f2f; cursor: pointer; text-decoration: underline; margin-left: 15px; font-size: 0.8rem; }

/* ========================================== */
/* 🌀 EFECTO TARJETAS 3D GIRATORIAS GLOBAL    */
/* ========================================== */
.card-3d {
    background: transparent !important;
    perspective: 1000px;
    cursor: pointer;
    box-shadow: none !important;
    padding: 0 !important;
    border: none !important; /* FIX: Remueve el borde gris externo del módulo */
}

.card-3d .card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 190px;
    transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
    transform-style: preserve-3d;
}

/* Computadoras: Hover */
@media (hover: hover) {
    .card-3d:hover .card-inner { transform: rotateY(180deg); }
}

/* Celulares: Giro manual */
.card-3d.girada .card-inner { transform: rotateY(180deg); }

.card-front, .card-back {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    box-sizing: border-box !important;
    overflow: hidden;
}

.card-front { 
    background: #fff; 
}

/* ========================================== */
/* 🛠️ FIX: AJUSTES DE ESPACIO EN DORSO 3D     */
/* ========================================== */
.card-back {
    color: #fff;
    transform: rotateY(180deg);
    padding: 15px 10px !important; 
    justify-content: center !important;
    gap: 8px;
}

.card-back h4 {
    font-size: 0.95rem !important;
    margin-bottom: 0 !important;
}

.card-back p {
    font-size: 0.75rem !important;
    line-height: 1.25 !important;
    margin-bottom: 5px !important;
}

.btn-cotizar-dorso {
    background: #fff;
    border: none;
    padding: 6px 14px !important;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.8rem !important;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: transform 0.2s;
    margin-top: 5px;
}

.btn-cotizar-dorso:hover { 
    transform: scale(1.05); 
}