/* --- 1. ESTRUCTURA BASE (MOBILE FIRST) --- */
.lp-container { 
    max-width: 450px; 
    margin: 20px auto; 
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif; 
    background: #fff; 
    padding: 30px 25px; 
    border-radius: 24px; 
    box-shadow: 0 10px 40px rgba(0,0,0,0.08); 
    border: 1px solid #f1f5f9;
    position: relative; 
    overflow: visible;
}

/* --- 2. HEADER INTERNO DEL PANEL (HOLA JUAN) --- */
/* Configurado como relativo para que haga scroll y desaparezca al bajar */
.lp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative; /* NO STICKY */
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f1f5f9;
}

.lp-title {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: var(--lp-header-text, #0f172a);
    letter-spacing: -0.5px;
}

.lp-logout {
    font-size: 13px;
    font-weight: 600;
    color: #ef4444;
    text-decoration: none;
    border: 1px solid #fee2e2;
    padding: 6px 12px;
    border-radius: 20px;
    transition: all 0.2s ease;
    background: #fff;
}

.lp-logout:hover {
    background: #fee2e2;
    transform: translateY(-1px);
}

/* --- 3. HEADER GLOBAL & CAMPANA (SHORTCODES) --- */

/* Contenedor del shortcode [lp_logo_bell] */
.lp-mobile-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 10px 15px;
    background: #fff; /* Fondo blanco base */
    box-sizing: border-box;
}

/* Control de tamaño del Logo */
.lp-header-logo-img {
    max-height: 50px; 
    width: auto;
    object-fit: contain;
}

/* Campana Inteligente (Wrapper clicable) */
.lp-bell-wrapper {
    position: relative;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-right: 5px;
    transition: transform 0.2s;
}
.lp-bell-wrapper:active { transform: scale(0.95); }

.lp-bell-wrapper i {
    color: var(--lp-header-icon, #333333);
    font-size: 24px;
}

.lp-bell-count {
    display: none; /* JS lo activa */
    position: absolute;
    top: 2px;
    right: 2px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 10;
}

/* --- 4. ELEMENTOS DE FORMULARIO --- */
label {
    font-weight: 700;
    color: #475569;
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lp-input { 
    width: 100%; 
    padding: 14px; 
    margin: 0 0 20px; 
    border: 2px solid #e2e8f0; 
    border-radius: 12px; 
    box-sizing: border-box; 
    font-size: 16px; 
    background: #f8fafc; 
    transition: all 0.2s;
    color: #334155;
}
.lp-input:focus {
    outline: none;
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

/* --- 5. BOTONES E INTERACCIÓN --- */
.lp-btn { 
    width: 100%; 
    padding: 16px; 
    background: #2563eb; 
    color: white; 
    border: none; 
    border-radius: 12px; 
    font-weight: 800; 
    cursor: pointer; 
    display: block; 
    text-decoration: none; 
    margin-top: 10px; 
    text-align: center; 
    font-size: 16px; 
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); 
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2); 
}
.lp-btn:hover { 
    background: #1d4ed8; 
    transform: translateY(-2px); 
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3); 
    color: white;
}

/* Botón "¿Cómo ganar puntos?" (Estilo Call to Action) */
.lp-rules-btn {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    color: #1e293b;
    text-decoration: none;
    font-size: 16px !important;
    font-weight: 800 !important; 
    padding: 14px 25px;
    border-radius: 50px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
    margin-top: 10px;
}
.lp-rules-btn:hover {
    background: #ffffff;
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.08);
}
.lp-rules-icon {
    background: #2563eb;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

/* Modal de Reglas */
#lp-rules-modal {
    display: none; 
    text-align: left; 
    background: #fff; 
    padding: 25px; 
    margin-top: 15px; 
    border-radius: 16px; 
    font-size: 15px; 
    color: #1e293b; 
    border: 1px solid #e2e8f0; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.05); 
    line-height: 1.6;
}
#lp-rules-modal p { margin-bottom: 12px; }
#lp-rules-modal b { color: #2563eb; }

/* Botones Secundarios */
.lp-btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    box-shadow: none;
}
.lp-btn-secondary:hover { background: #e2e8f0; color: #1e293b; }

.lp-btn-red {
    background: #ef4444;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.2);
}
.lp-btn-red:hover { background: #dc2626; }

/* Botón Compartir (Shortcode [lp_share_button]) */
.lp-share-btn {
    display: inline-flex; align-items: center; gap: 10px;
    background: #d97706; color: white;
    padding: 14px 30px; border-radius: 50px;
    font-weight: 800; text-decoration: none; font-size: 16px;
    box-shadow: 0 4px 10px rgba(217, 119, 6, 0.3);
    transition: transform 0.2s;
    border: none; cursor: pointer; margin: 0;
}
.lp-share-btn:hover { transform: scale(1.05); color: white; }

/* Botones Iconos */
.lp-wa-btn, .lp-email-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 50%;
    text-decoration: none; transition: transform 0.2s; font-size: 18px; border: none; cursor: pointer;
}
.lp-wa-btn { background-color: #25D366; color: white; box-shadow: 0 3px 8px rgba(37, 211, 102, 0.3); }
.lp-email-btn { background-color: #3b82f6; color: white; box-shadow: 0 3px 8px rgba(59, 130, 246, 0.3); }
.lp-wa-btn:hover, .lp-email-btn:hover { transform: scale(1.15); }


/* --- 6. TARJETA DE CRÉDITO 3D --- */
.lp-credit-card {
    background: linear-gradient(135deg, var(--card-c1, #1e293b) 0%, var(--card-c2, #0f172a) 100%);
    border-radius: 20px;
    padding: 25px;
    color: white;
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.4), inset 0 0 0 1px rgba(255,255,255,0.1);
    position: relative;
    overflow: hidden;
    margin-bottom: 25px;
    transform: perspective(1000px) rotateX(2deg);
    transition: transform 0.3s ease;
}
.lp-credit-card:hover { transform: perspective(1000px) rotateX(0deg) translateY(-5px); }
.lp-credit-card::before {
    content: ""; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}
.lp-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; position: relative; z-index: 2; }
.lp-card-chip { 
    width: 50px; height: 36px; background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%); 
    border-radius: 8px; border: 1px solid #92400e; position: relative; overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.lp-card-chip::after {
    content: ""; position: absolute; top:0; left: 50%; width: 1px; height: 100%;
    border-left: 1px solid rgba(255,255,255,0.3); border-right: 1px solid rgba(0,0,0,0.1);
}
.lp-card-meta { font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: rgba(255,255,255,0.7); margin-bottom: 4px; font-weight: 700; }
.lp-card-number { font-family: 'Courier New', monospace; font-size: 22px; letter-spacing: 3px; margin-bottom: 20px; text-shadow: 0 2px 2px rgba(0,0,0,0.3); font-weight: bold; }
.lp-verified-badge { 
    background: rgba(255,255,255,0.2); color: #fff; font-size: 10px; padding: 4px 10px; 
    border-radius: 20px; font-weight: 800; display: inline-flex; align-items: center; gap: 5px; 
    border: 1px solid rgba(255,255,255,0.4); backdrop-filter: blur(4px); text-transform: uppercase; letter-spacing: 0.5px;
}

/* --- 7. GRID DE SELLOS --- */
.lp-card-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 15px 0; position: relative; z-index: 2; }
.lp-slot { 
    aspect-ratio: 1; border-radius: 50%; background: rgba(255,255,255,0.15); 
    display: flex; align-items: center; justify-content: center; font-size: 11px; color: rgba(255,255,255,0.5); 
    border: 1px dashed rgba(255,255,255,0.3); transition: all 0.3s; overflow: hidden; padding: 0;
}
.lp-slot.filled { background: #fff; border: 2px solid #fff; box-shadow: 0 0 15px rgba(255,255,255,0.4); transform: scale(1.15); }
.lp-slot img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.lp-progress-bar { width: 100%; height: 6px; background: rgba(255,255,255,0.15); border-radius: 3px; margin-top: 25px; overflow: hidden; }
.lp-progress-fill { height: 100%; background: #4ade80; box-shadow: 0 0 10px #4ade80; transition: width 0.6s ease-out; }

/* --- 8. TARJETA REFERIDOS (GOLD) --- */
.lp-share-card { 
    background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 15px 30px rgba(217, 119, 6, 0.15); 
    margin-top: 30px; border: 1px solid #fcd34d; text-align: center;
}
.lp-share-header { background: linear-gradient(90deg, #f59e0b, #d97706); padding: 15px; color: white; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; font-size: 15px; }
.lp-share-body { padding: 25px; }
.lp-share-body p { margin: 0 0 20px; color: #475569; font-size: 14px; line-height: 1.6; }

/* --- 9. DASHBOARD GERENCIAL --- */
.lp-tab-nav { display: flex; border-bottom: 2px solid #f1f5f9; margin-bottom: 20px; gap: 10px; overflow-x: auto; }
.lp-tab-btn { 
    flex: 1; padding: 12px; border: none; background: none; 
    cursor: pointer; font-weight: 600; color: #64748b; 
    transition: all 0.2s; border-bottom: 2px solid transparent;
    white-space: nowrap; font-size: 14px;
}
.lp-tab-btn:hover { background: #f8fafc; color: #334155; }
.lp-tab-btn.active-tab { color: #2563eb; border-bottom-color: #2563eb; }

.lp-stat-card { background: #f8fafc; padding: 20px; border-radius: 12px; text-align: center; flex: 1; border: 1px solid #e2e8f0; margin-bottom: 15px; }
.lp-stat-num { display: block; font-size: 32px; font-weight: 800; color: #0f172a; line-height: 1.2; }
.lp-stat-label { font-size: 11px; text-transform: uppercase; color: #64748b; font-weight: 700; letter-spacing: 0.5px; }
.lp-meta-box { background: #f0f9ff; border: 1px solid #bae6fd; padding: 15px; border-radius: 10px; text-align: center; margin-bottom: 20px; }
.lp-meta-title { font-size: 11px; text-transform: uppercase; color: #0284c7; font-weight: 800; letter-spacing: 1px; }
.lp-meta-val { font-size: 20px; font-weight: 800; color: #0c4a6e; display: block; margin-top: 5px; }
.lp-stat-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 10px; border-bottom: 1px solid #f1f5f9; font-size: 14px; color: #334155; }
.lp-stat-row:last-child { border: none; }
.lp-stat-row strong { color: #0f172a; }

/* --- 10. MENSAJES Y RESEÑAS --- */
.lp-msg { padding: 15px; border-radius: 12px; margin-bottom: 25px; text-align: center; font-size: 15px; font-weight: 500; }
.lp-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.lp-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* Grid de Reseñas (Carrusel) */
.lp-reviews-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 20px; 
    margin-top: 20px;
    padding-bottom: 10px; 
}
.lp-review-public-card { 
    background: #fff; padding: 20px; border-radius: 12px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); border: 1px solid #f1f5f9; 
    transition: transform 0.2s;
    /* FIX: display flex por defecto */
    display: flex; 
    flex-direction: column;
    margin-bottom: 15px; 
}
.lp-review-public-card:hover { transform: translateY(-3px); }
.lp-rev-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.lp-rev-avatar { width: 40px; height: 40px; background: #e0e7ff; color: #4338ca; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 16px; }
.lp-rev-stars { color: #f59e0b; font-size: 14px; margin-top: 2px; letter-spacing: 2px; }
.lp-rev-body { font-size: 14px; color: #475569; line-height: 1.5; font-style: italic; margin-bottom: 0; }
.lp-review-card { background: #f8fafc; padding: 15px; margin-bottom: 10px; border-radius: 10px; border: 1px solid #e2e8f0; font-size: 14px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }

/* --- RESPONSIVE FIXES --- */
@media (max-width: 450px) {
    .lp-credit-card > div:nth-of-type(4) { flex-direction: column; align-items: flex-start !important; gap: 10px; }
    .lp-credit-card > div:nth-of-type(4) > div { text-align: left !important; width: 100%; }
    .lp-card-meta { margin-bottom: 2px; }
    .lp-reviews-grid { gap: 15px; }
}

@keyframes pop { 0% { transform: scale(0.5); opacity: 0; } 70% { transform: scale(1.2); } 100% { transform: scale(1.1); opacity: 1; } }
.shake-animation { animation: shake 0.5s infinite; }
@keyframes shake { 0% { transform: rotate(0deg); } 25% { transform: rotate(15deg); } 50% { transform: rotate(0deg); } 75% { transform: rotate(-15deg); } 100% { transform: rotate(0deg); } }