/* =============================================
   Stampaideas - Conversión Total v3.6.0
   ============================================= */

/* ==========================================
   CUOTAS SIN INTERÉS
   ========================================== */
.stampa-cuotas-wrap {
    margin: 12px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-family: inherit;
}
.stampa-cuotas-bloque {
    border-radius: 10px;
    padding: 12px 16px;
    border: 1px solid transparent;
}
.stampa-cuotas-bloque.stampa-mp {
    background: linear-gradient(135deg, #e8f8ff 0%, #d0f0ff 100%);
    border-color: #7dd3fc;
}
.stampa-cuotas-bloque.stampa-vp {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #86efac;
}
.stampa-bloque-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.stampa-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    letter-spacing: 0.03em;
    white-space: nowrap;
    line-height: 1.5;
}
.stampa-badge-mp { background: #0284c7; color: #fff !important; }
.stampa-badge-vp { background: #16a34a; color: #fff !important; }
.stampa-subtitulo {
    font-size: 12px;
    color: #475569;
    font-weight: 600;
    line-height: 1.3;
}
.stampa-lineas {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 20px;
    margin-bottom: 10px;
}
.stampa-cuota-linea {
    display: flex;
    align-items: baseline;
    gap: 5px;
    line-height: 1.3;
}
.stampa-cuota-linea strong { font-size: 20px; font-weight: 800; }
.stampa-cuota-linea span  { font-size: 15px; font-weight: 500; color: #1e293b; }
.stampa-cuotas-bloque.stampa-mp .stampa-cuota-linea strong { color: #0369a1; }
.stampa-cuotas-bloque.stampa-vp .stampa-cuota-linea strong { color: #15803d; }
.stampa-nota {
    margin: 0 !important;
    font-size: 11px;
    color: #64748b;
    line-height: 1.5;
    border-top: 1px solid rgba(0,0,0,0.07);
    padding-top: 8px;
}
.stampa-nota small { display: block; margin-top: 1px; font-size: 10px; color: #94a3b8; }
.stampa-cuotas-checkout-row td,
.stampa-cuotas-carrito-row td { padding: 0 !important; }
.stampa-cuotas-checkout-row .stampa-cuotas-wrap,
.stampa-cuotas-carrito-row .stampa-cuotas-wrap { margin-top: 8px; }


/* ==========================================
   PRECIO POR UNIDAD
   ========================================== */
.stampa-unidad-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
    padding: 10px 14px;
    background: #fefce8;
    border: 1px solid #fde047;
    border-radius: 8px;
}
.stampa-unidad-variable { display: none; }
.stampa-unidad-icono { font-size: 20px; flex-shrink: 0; }
.stampa-unidad-texto { display: flex; flex-direction: column; gap: 1px; }
.stampa-unidad-texto strong {
    font-size: 11px; font-weight: 700; color: #854d0e;
    text-transform: uppercase; letter-spacing: 0.05em;
}
.stampa-unidad-texto span { font-size: 14px; font-weight: 600; color: #1e293b; }


/* ==========================================
   BANNER CURSO BONUS
   ========================================== */
.stampa-curso-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
    padding: 14px 16px;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 2px solid #f59e0b;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}
.stampa-curso-banner::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    background: linear-gradient(180deg, #f59e0b, #d97706);
}
.stampa-curso-icono { font-size: 28px; flex-shrink: 0; line-height: 1; }
.stampa-curso-texto { flex: 1; font-size: 13px; color: #1c1917; line-height: 1.5; }
.stampa-curso-texto strong {
    display: block; font-size: 14px; font-weight: 800;
    color: #92400e; margin-bottom: 3px;
}
.stampa-curso-texto em { font-style: normal; font-weight: 700; color: #78350f; }
.stampa-curso-cta {
    flex-shrink: 0;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff !important;
    text-decoration: none !important;
    font-size: 12px; font-weight: 700;
    padding: 9px 16px; border-radius: 8px;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(217,119,6,0.35);
    transition: all 0.2s;
}
.stampa-curso-cta:hover {
    background: linear-gradient(135deg, #d97706, #b45309) !important;
    box-shadow: 0 3px 10px rgba(217,119,6,0.45);
    transform: translateY(-1px);
}


/* ==========================================
   BADGES DE CONFIANZA — centrados
   ========================================== */
.stampa-badges-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    justify-content: center;
    align-items: center;
}
.stampa-badge-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    color: #374151;
    font-weight: 600;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    line-height: 1.3;
    min-height: 32px;
}
.stampa-badge-icon { font-size: 15px; line-height: 1; }
.stampa-badge-item.stampa-badge-sin-icono .stampa-badge-icon { display: none; }

/* Envío gratis: ancho completo centrado */
.stampa-badge-item.stampa-badge-gratis {
    width: 100%;
    background: #dcfce7;
    border-color: #86efac;
    color: #15803d;
    font-weight: 700;
    font-size: 13px;
    justify-content: center;
    border-radius: 8px;
    padding: 8px 14px;
}
/* Garantía: azul */
.stampa-badge-item.stampa-badge-garantia {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}


/* ==========================================
   URGENCIA DE STOCK — 3 niveles con sentido
   ========================================== */

/* 🔥 CRÍTICO: 1 unidad — rojo intenso, pulso rápido */
.stampa-stock-critico,
p.stampa-stock-critico,
.stock.stampa-stock-critico {
    color: #b91c1c !important;
    font-weight: 800 !important;
    font-size: 15px !important;
    animation: stampa-pulse-rapido 1.2s ease-in-out infinite;
    display: block;
    padding: 4px 0;
}

/* ⚠️ URGENTE: 2-5 unidades — naranja fuerte, pulso normal */
.stampa-stock-urgente,
p.stampa-stock-urgente,
.stock.stampa-stock-urgente {
    color: #c2410c !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    animation: stampa-pulse 2s ease-in-out infinite;
    display: block;
    padding: 4px 0;
}

@keyframes stampa-pulse-rapido {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
@keyframes stampa-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.75; }
}


/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
    .stampa-cuotas-bloque { padding: 10px 12px; }
    .stampa-cuota-linea strong { font-size: 18px; }
    .stampa-cuota-linea span { font-size: 13px; }
    .stampa-curso-banner { flex-wrap: wrap; }
    .stampa-curso-cta { width: 100%; text-align: center; margin-top: 6px; }
    .stampa-badges-wrap { gap: 6px; }
    .stampa-badge-item { font-size: 11px; }
    .stampa-badge-item.stampa-badge-gratis { font-size: 12px; }
    .stampa-unidad-texto span { font-size: 13px; }
}


/* ==========================================
   OVERRIDES AVADA
   ========================================== */
.stampa-cuotas-wrap p.stampa-nota { margin-bottom: 0 !important; padding-bottom: 0 !important; }
.stampa-cuotas-wrap strong,
.stampa-curso-banner strong,
.stampa-badges-wrap strong,
.stampa-unidad-wrap strong { font-weight: 700 !important; }
.stampa-cuotas-wrap *,
.stampa-curso-banner *,
.stampa-badges-wrap *,
.stampa-unidad-wrap * { box-sizing: border-box; }


/* ==========================================
   AVISO ENVÍO COSTOSO
   ========================================== */
.stampa-envio-caro-aviso {
    margin: 8px 0;
    padding: 12px 16px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    font-size: 13px;
    color: #374151;
    line-height: 1.6;
}
.stampa-envio-caro td {
    padding: 0 !important;
}


/* ==========================================
   FIX GALERÍA PRODUCTO MÓVIL (Módulo 13)
   NO forzamos tamaños — dejamos que el slider
   (FlexSlider) recalcule solo vía window.resize.
   Aquí solo ajustes cosméticos suaves.
   ========================================== */
@media (max-width: 768px) {
    .product .images-container,
    .fusion-woocommerce-product-images {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    /* Contenedores de la galería a ancho completo (sin tocar los slides,
       de eso se encarga el JS del Módulo 13) */
    .single-product .woocommerce-product-gallery {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        float: none !important;
    }
    /* Thumbnails cuadrados y nítidos */
    .flex-control-thumbs li img {
        object-fit: cover !important;
    }
}


/* ==========================================
   VIDEO EN GALERÍA DE PRODUCTO (Módulo 14)
   Thumbnail de video + reproductor lightbox
   ========================================== */

/* Thumbnail de video dentro de la tira de miniaturas */
.flex-control-thumbs li.stampa-video-thumb {
    position: relative;
    cursor: pointer;
    z-index: 2;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.flex-control-thumbs li.stampa-video-thumb img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    pointer-events: none; /* el tap lo recibe el <li>, no la imagen */
}
.stampa-video-thumb-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 26px;
    height: 26px;
    background: rgba(233,30,140,0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    box-shadow: 0 1px 4px rgba(0,0,0,0.35);
}
.stampa-video-thumb-badge svg { width: 12px; height: 12px; fill: #fff; }

/* ── Lightbox del video ── */
.stampa-video-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0,0,0,0.88);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}
.stampa-video-lightbox.stampa-open { display: flex; }
.stampa-video-lightbox-inner {
    position: relative;
    width: 100%;
    max-width: 900px;
}
/* Para shorts (vertical) usamos 9:16, para normales 16:9.
   Default 16:9; si el video es short, JS agrega .stampa-vertical */
.stampa-video-lightbox-frame {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}
.stampa-video-lightbox-inner.stampa-vertical {
    max-width: 420px;
}
.stampa-video-lightbox-inner.stampa-vertical .stampa-video-lightbox-frame {
    padding-bottom: 177.78%; /* 9:16 */
}
.stampa-video-lightbox-frame iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    border: none;
}
.stampa-video-lightbox-close {
    position: absolute;
    top: -44px;
    right: 0;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.stampa-video-lightbox-close:hover { background: rgba(255,255,255,0.3); }
