/**
 * ==============================================================================
 * EMIPISA INDUSTRIAL B2B - ARQUITECTURA RESPONSIVE MAESTRA (MOBILE-FIRST)
 * Corrige desbordamientos, pestañas, categorías, cabecera y catálogo en móviles y tablets
 * ==============================================================================
 */

/* ------------------------------------------------------------------------------
   1. REGLAS BASE DE PREVENCIÓN DE DESBORDAMIENTO HORIZONTAL
   ------------------------------------------------------------------------------ */
html {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    height: auto !important;
    min-height: 100% !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    -webkit-text-size-adjust: 100%;
    -webkit-overflow-scrolling: touch !important;
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden !important;
    overflow-y: visible !important;
    height: auto !important;
    min-height: 100vh !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    -webkit-text-size-adjust: 100%;
    touch-action: pan-y pinch-zoom !important;
    -webkit-overflow-scrolling: touch !important;
    position: relative !important;
}

*, *::before, *::after {
    box-sizing: border-box !important;
}

img, video, canvas, svg {
    max-width: 100%;
    height: auto;
}

/* Permitir scroll vertical fluido sin bloquearse en barras táctiles horizontales */
.families-slider-strip,
.family-subcats-list,
.family-carousel-viewport,
.store-nav-bar,
.store-nav-bar-inner {
    touch-action: pan-x pan-y !important;
    overscroll-behavior-x: contain !important;
    overscroll-behavior-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

/* Evitar zoom automático indeseado en inputs en iOS Safari / Móviles */
@media (max-width: 768px) {
    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* ------------------------------------------------------------------------------
   2. WATERMARK Y FONDOS DE SECCIONES (Previene el desborde masivo de 1000px)
   ------------------------------------------------------------------------------ */
.family-bg-watermark {
    max-width: 100% !important;
    overflow: hidden !important;
    font-size: clamp(1.6rem, 5vw, 3.8rem) !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    opacity: 0.12 !important;
    pointer-events: none !important;
}

.family-catalog-section {
    overflow: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
}

/* ------------------------------------------------------------------------------
   3. CABECERA Y NAVEGACIÓN SUPERIOR RESPONSIVA
   ------------------------------------------------------------------------------ */
@media (max-width: 992px) {
    /* Barra Superior Micro (RUC, Horarios) */
    .top-micro-bar-inner {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        padding: 4px 8px !important;
        gap: 4px !important;
    }
    
    .micro-links {
        justify-content: center !important;
        gap: 10px !important;
    }

    /* Cabecera Principal */
    .store-main-header-inner {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 8px !important;
        padding: 8px 12px !important;
    }

    .store-logo-wrapper {
        flex: 0 0 auto !important;
        width: auto !important;
    }

    .brand-logo-main,
    #store-header-logo-img {
        height: 42px !important;
        max-height: 46px !important;
        max-width: 170px !important;
    }

    .store-header-actions {
        flex: 0 0 auto !important;
        width: auto !important;
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
    }

    .btn-header-action {
        padding: 6px 10px !important;
        font-size: 0.72rem !important;
        border-radius: 6px !important;
    }

    .btn-header-cart {
        padding: 6px 12px !important;
        font-size: 0.75rem !important;
        border-radius: 6px !important;
    }

    /* Buscador y Categorías perfectamente nivelados en móvil */
    .search-container-b2b {
        order: 3 !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-top: 6px !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 8px !important;
    }

    .btn-categories-dropdown {
        height: 44px !important;
        min-height: 44px !important;
        max-height: 44px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
        padding: 0 14px !important;
        font-size: 0.82rem !important;
        font-weight: 700 !important;
        background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
        color: #ffffff !important;
        border: none !important;
        border-radius: 22px !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        box-shadow: 0 2px 6px rgba(2, 132, 199, 0.28) !important;
        cursor: pointer !important;
        box-sizing: border-box !important;
    }

    .search-input-box {
        height: 44px !important;
        min-height: 44px !important;
        max-height: 44px !important;
        flex: 1 !important;
        min-width: 0 !important;
        display: flex !important;
        align-items: center !important;
        border: 1.5px solid #0284c7 !important;
        border-radius: 22px !important;
        background: #ffffff !important;
        padding: 0 4px 0 14px !important;
        box-sizing: border-box !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) !important;
    }

    .search-input-box input {
        height: 100% !important;
        border: none !important;
        outline: none !important;
        padding: 0 !important;
        font-size: 0.82rem !important;
        color: #0f172a !important;
        background: transparent !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .in-stock-label {
        display: none !important; /* Ocultar en celular para no apretar el buscador */
    }

    .btn-search-submit {
        height: 36px !important;
        width: 36px !important;
        min-width: 36px !important;
        border-radius: 50% !important;
        padding: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: #0284c7 !important;
        color: #ffffff !important;
        border: none !important;
        cursor: pointer !important;
        flex-shrink: 0 !important;
    }
}

@media (max-width: 480px) {
    /* Ocultar texto largo en botón de registro en celular ultra compacto */
    .btn-header-action:nth-child(2) {
        font-size: 0.70rem !important;
        padding: 6px 8px !important;
    }
    
    .brand-logo-main,
    #store-header-logo-img {
        height: 36px !important;
        max-width: 135px !important;
    }
}

/* ------------------------------------------------------------------------------
   4. BARRA DE PESTAÑAS PRINCIPALES (STORE NAV BAR) - SWIPE HORIZONTAL ELEGANTE
   ------------------------------------------------------------------------------ */
@media (max-width: 992px) {
    .store-nav-bar {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        background: #081220 !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 998 !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
    }

    .store-nav-bar::-webkit-scrollbar {
        display: none !important;
    }

    .store-nav-bar-inner {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: flex-start !important;
        width: max-content !important;
        min-width: 100% !important;
        padding: 6px 12px !important;
        gap: 6px !important;
    }

    .nav-link-item {
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        padding: 7px 14px !important;
        font-size: 0.75rem !important;
        border-radius: 20px !important;
        border-bottom: none !important;
        background: rgba(255, 255, 255, 0.05) !important;
    }

    .nav-link-item.active {
        background: #0284c7 !important;
        color: #ffffff !important;
        box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4) !important;
    }

    .nav-link-b2b-portal {
        margin-left: 4px !important;
        padding: 7px 14px !important;
    }
}

/* ------------------------------------------------------------------------------
   5. MEGA MENÚ DE CATEGORÍAS EN DISPOSITIVOS MÓVILES Y TABLETS
   ------------------------------------------------------------------------------ */
@media (max-width: 768px) {
    .store-mega-menu {
        position: fixed !important;
        top: 100px !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        height: calc(100vh - 100px) !important;
        max-height: calc(100vh - 100px) !important;
        transform: none !important;
        border-radius: 16px 16px 0 0 !important;
        overflow-y: auto !important;
        box-shadow: 0 -10px 40px rgba(0,0,0,0.3) !important;
        background: #ffffff !important;
        z-index: 999999 !important;
    }

    .mega-menu-content-matrix {
        flex-direction: column !important;
        min-height: auto !important;
        height: auto !important;
    }

    .mega-categories-col {
        width: 100% !important;
        max-height: 200px !important;
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        border-right: none !important;
        border-bottom: 2px solid #e2e8f0 !important;
        padding: 8px !important;
        gap: 6px !important;
        background: #f8fafc !important;
        scrollbar-width: none !important;
    }

    .mega-categories-col::-webkit-scrollbar {
        display: none !important;
    }

    .mega-cat-item {
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        padding: 7px 14px !important;
        border-radius: 20px !important;
        font-size: 0.74rem !important;
        font-weight: 700 !important;
        border: 1px solid #cbd5e1 !important;
        background: #ffffff !important;
        color: #334155 !important;
    }

    .mega-cat-item.active {
        background: #0284c7 !important;
        color: #ffffff !important;
        border-color: #0284c7 !important;
        box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3) !important;
    }

    .mega-cat-item i {
        display: none !important;
    }

    .mega-content-panel {
        width: 100% !important;
        padding: 14px 12px !important;
        max-height: none !important;
        overflow-y: auto !important;
    }

    .mega-panel-header {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        margin-bottom: 12px !important;
        padding-bottom: 8px !important;
        border-bottom: 1px solid #f1f5f9 !important;
    }

    .mega-panel-header h3 {
        font-size: 1.05rem !important;
        font-weight: 800 !important;
        color: #0f172a !important;
        margin: 0 !important;
    }

    .subfamilies-count-label {
        font-size: 0.70rem !important;
        color: #64748b !important;
    }

    .mega-view-all-link {
        font-size: 0.72rem !important;
        font-weight: 700 !important;
        color: #0284c7 !important;
        white-space: nowrap !important;
    }

    .mega-subfamilies-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
}

/* ------------------------------------------------------------------------------
   6. CINTA DE FAMILIAS Y CATEGORÍAS (STICKY FAMILY STRIP)
   ------------------------------------------------------------------------------ */
@media (max-width: 992px) {
    .sticky-family-bar-wrapper {
        position: relative !important;
        top: auto !important;
        width: 100% !important;
        overflow: hidden !important;
    }

    .sticky-family-bar-container {
        padding: 6px 8px !important;
        width: 100% !important;
        gap: 4px !important;
    }

    /* En pantallas táctiles, ocultamos las flechas duras para dar paso al swipe táctil natural */
    .slider-arrow-btn {
        display: none !important;
    }

    .families-slider-strip {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        scroll-snap-type: x mandatory !important;
        padding: 4px 6px !important;
        gap: 8px !important;
    }

    .families-slider-strip::-webkit-scrollbar {
        display: none !important;
    }

    .family-chip-card {
        scroll-snap-align: start !important;
        flex: 0 0 105px !important;
        width: 105px !important;
        min-width: 105px !important;
        max-width: 105px !important;
        height: 86px !important;
        padding: 6px 4px !important;
        border-radius: 8px !important;
    }

    .family-chip-card .chip-title {
        font-size: 0.65rem !important;
        line-height: 1.15 !important;
        text-align: center !important;
    }

    .family-chip-card .chip-icon,
    .family-chip-card img {
        max-height: 34px !important;
    }
}

/* ------------------------------------------------------------------------------
   7. SECCIONES DE FAMILIA EN PORTADA (VÁLVULAS, BRIDAS, TUBERÍAS)
   ------------------------------------------------------------------------------ */
@media (max-width: 992px) {
    .family-catalog-section {
        padding: 24px 0 30px 0 !important;
    }

    .family-layout-container {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
        padding: 0 14px !important;
    }

    .family-specs-column {
        width: 100% !important;
        padding-right: 0 !important;
    }

    .family-title-heading {
        font-size: 1.35rem !important;
        margin-bottom: 10px !important;
    }

    .family-buttons-group {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        margin-top: 14px !important;
    }

    .btn-family-pill {
        padding: 6px 16px !important;
        font-size: 0.74rem !important;
    }

    /* Subcategorías como botones deslizados en móvil */
    .family-subcats-column {
        width: 100% !important;
        padding: 0 !important;
    }

    .family-subcats-list {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        gap: 6px !important;
        padding-bottom: 6px !important;
    }

    .family-subcats-list::-webkit-scrollbar {
        display: none !important;
    }

    .family-subcat-item {
        white-space: nowrap !important;
        background: #f1f5f9 !important;
        border: 1px solid #cbd5e1 !important;
        border-radius: 16px !important;
        padding: 4px 12px !important;
        font-size: 0.72rem !important;
        flex-shrink: 0 !important;
    }

    .family-subcat-item.active {
        background: #0284c7 !important;
        color: #ffffff !important;
        border-color: #0284c7 !important;
    }

    .family-products-column-wrap {
        padding-top: 10px !important;
    }
}

/* Carrusel de Productos por Familia en Móvil */
@media (max-width: 768px) {
    .family-specs-body {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px 12px !important;
        background: #f8fafc !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 8px !important;
        padding: 10px 12px !important;
        margin-bottom: 12px !important;
        font-size: 0.70rem !important;
    }

    .family-specs-body p,
    .family-specs-body .spec-prop-item {
        margin: 0 !important;
        line-height: 1.3 !important;
        color: #475569 !important;
    }

    .family-specs-body strong {
        color: #0f172a !important;
        font-weight: 700 !important;
    }

    .family-carousel-arrow {
        display: none !important; /* Swipe táctil fluido nativo */
    }

    .family-carousel-viewport {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scroll-snap-type: x mandatory !important;
        padding: 6px 4px 14px 4px !important;
        scrollbar-width: none !important;
        touch-action: pan-x pan-y !important;
    }

    .family-carousel-viewport::-webkit-scrollbar {
        display: none !important;
    }

    .family-carousel-track {
        display: flex !important;
        gap: 12px !important;
        width: max-content !important;
        transform: none !important; /* Habilita el desplazamiento táctil directo sin retraso de JS */
        touch-action: pan-x pan-y !important;
    }

    .family-carousel-track .sku-b2b-card {
        scroll-snap-align: start !important;
        flex: 0 0 200px !important;
        min-width: 200px !important;
        max-width: 200px !important;
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 12px !important;
        padding: 10px !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
    }

    .family-carousel-track .sku-img-wrapper {
        height: 140px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: #f8fafc !important;
        border-radius: 8px !important;
        overflow: hidden !important;
        position: relative !important;
    }

    .sku-product-main-title {
        font-size: 0.74rem !important;
        font-weight: 700 !important;
        color: #0f172a !important;
        margin: 6px 0 2px 0 !important;
        line-height: 1.25 !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        height: 2.5em !important;
    }

    .sku-product-sub-spec {
        font-size: 0.68rem !important;
        color: #64748b !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        margin-bottom: 6px !important;
    }
}

/* ------------------------------------------------------------------------------
   8. REJILLA DEL CATÁLOGO DE PRODUCTOS (CATALOG GRID)
   ------------------------------------------------------------------------------ */
@media (max-width: 900px) {
    .catalog-split-container {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
        padding: 0 12px !important;
    }

    .catalog-sidebar-panel {
        width: 100% !important;
    }

    /* Acordeón de Categorías en Móvil: Pills deslizables */
    .filter-pills-cloud {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        max-height: 180px !important;
        overflow-y: auto !important;
        padding: 4px 0 !important;
    }

    .filter-pill-btn {
        padding: 4px 9px !important;
        font-size: 0.70rem !important;
        border-radius: 12px !important;
    }
}

/* En Móviles (Celulares): Catálogo en 2 Columnas Simétricas Limpias */
@media (max-width: 768px) {
    .catalog-cards-grid-5cols {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .b2b-product-card {
        padding: 8px !important;
        border-radius: 8px !important;
    }

    .b2b-product-card .card-thumb-wrap {
        height: 130px !important;
        max-height: 130px !important;
    }

    .b2b-product-card .product-card-title {
        font-size: 0.78rem !important;
        line-height: 1.25 !important;
        height: 2.5em !important;
        overflow: hidden !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
    }

    .b2b-product-card .card-sku-badge {
        font-size: 0.62rem !important;
        padding: 1px 4px !important;
    }

    .b2b-product-card .btn-add-to-quote,
    .b2b-product-card .btn-card-whatsapp {
        font-size: 0.70rem !important;
        padding: 6px 8px !important;
    }
}

/* En celulares muy pequeños (iPhone SE, < 360px) */
@media (max-width: 360px) {
    .catalog-cards-grid-5cols {
        grid-template-columns: 1fr !important;
    }
}

/* ------------------------------------------------------------------------------
   9. CARRUSEL HERO BANNER PRINCIPAL (PROPORCIONES ARMÓNICAS Y EQUILIBRADAS EN MÓVIL)
   ------------------------------------------------------------------------------ */
@media (max-width: 768px) {
    .hero-industrial-banner,
    .hero-slides-wrapper {
        height: auto !important;
        min-height: 350px !important;
        max-height: 410px !important;
        position: relative !important;
    }

    .hero-slide {
        min-height: 350px !important;
        max-height: 410px !important;
    }

    .hero-slide-grid {
        padding: 22px 14px 18px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        height: 100% !important;
    }

    .hero-content,
    .hero-slide-content {
        padding: 0 !important;
        max-width: 100% !important;
        margin: 0 !important;
        z-index: 2 !important;
    }

    /* Tag de cabecera en el banner */
    .hero-pill-tag,
    .hero-content .hero-pill-tag {
        font-size: 0.65rem !important;
        padding: 3px 8px !important;
        margin-bottom: 8px !important;
        letter-spacing: 0.4px !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 5px !important;
        border-radius: 4px !important;
        font-weight: 700 !important;
        max-width: 100% !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    /* Título Armónico y Proporcional (NO sobredimensionado) */
    .hero-content h2,
    #hero-slide-1-title,
    .hero-title-main {
        font-size: clamp(1.15rem, 4.8vw, 1.40rem) !important;
        line-height: 1.25 !important;
        font-weight: 800 !important;
        margin-bottom: 8px !important;
        letter-spacing: -0.3px !important;
        text-transform: uppercase !important;
        color: #ffffff !important;
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.75) !important;
        word-break: break-word !important;
    }

    .hero-content h2 span,
    #hero-slide-1-title span {
        font-size: inherit !important;
        color: #38bdf8 !important;
        display: inline !important;
    }

    /* Descripción corta y precisa */
    .hero-content p,
    #hero-slide-1-desc,
    .hero-subtitle-desc {
        font-size: 0.76rem !important;
        line-height: 1.35 !important;
        color: #e2e8f0 !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        margin-bottom: 12px !important;
        text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8) !important;
        max-width: 95% !important;
    }

    /* Grupo de Botones de Acción */
    .hero-cta-group,
    .hero-actions-cluster {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .btn-hero-primary,
    .btn-hero-cta {
        padding: 8px 16px !important;
        font-size: 0.78rem !important;
        font-weight: 800 !important;
        border-radius: 20px !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 6px !important;
    }

    .btn-hero-whatsapp {
        padding: 7px 12px !important;
        font-size: 0.72rem !important;
        border-radius: 18px !important;
    }

    /* Overlay oscuro sutil para que el texto resalte con nitidez */
    .hero-slide-overlay {
        background: linear-gradient(180deg, rgba(7, 24, 46, 0.82) 0%, rgba(9, 34, 66, 0.70) 50%, rgba(12, 51, 99, 0.60) 100%) !important;
    }

    /* Flechas del banner en celular: más pequeñas y discretas */
    .hero-slider-arrow {
        width: 32px !important;
        height: 32px !important;
        font-size: 1rem !important;
        background: rgba(15, 23, 42, 0.5) !important;
    }
}

/* ------------------------------------------------------------------------------
   10. MODALES Y DIÁLOGOS (SolCot, Auth, Términos)
   ------------------------------------------------------------------------------ */
@media (max-width: 768px) {
    .modal-container,
    .modal-content,
    .buyer-auth-card,
    .solcot-modal-dialog {
        width: 95vw !important;
        max-width: 95vw !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
        margin: 10px auto !important;
        padding: 16px 12px !important;
        border-radius: 12px !important;
    }

    /* Tablas con scroll horizontal suave en celulares */
    .table-responsive,
    .solcot-table-wrapper,
    table {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
}

/* ------------------------------------------------------------------------------
   11. BOTÓN FLOTANTE DE WHATSAPP
   ------------------------------------------------------------------------------ */
.btn-whatsapp-floating,
.floating-whatsapp-btn {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    z-index: 99999 !important;
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.4) !important;
}

@media (max-width: 480px) {
    .btn-whatsapp-floating,
    .floating-whatsapp-btn {
        bottom: 16px !important;
        right: 14px !important;
        transform: scale(0.9) !important;
    }
}

/* ------------------------------------------------------------------------------
   12. GOOGLE MATERIAL PRELOADER & SKELETON IMAGE LOADERS
   ------------------------------------------------------------------------------ */

/* Top Loading Bar (Línea de carga superior sutil tipo YouTube/GitHub) */
.top-loading-progress-line {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #0284c7, #38bdf8, #f59e0b, #0284c7);
    background-size: 200% 100%;
    animation: top-loading-bar-anim 1.2s ease-in-out infinite;
    z-index: 10000000;
}

@keyframes top-loading-bar-anim {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Overlay de Pantalla Completa con Blur Suave */
#emipisa-global-preloader,
.global-preloader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(11, 17, 32, 0.88) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.35s ease;
    will-change: opacity, visibility;
    pointer-events: auto;
}

#emipisa-global-preloader.preloader-hidden,
.global-preloader-overlay.preloader-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.preloader-minimal-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
}

.preloader-card,
.preloader-inner-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.preloader-logo-wrap,
.preloader-logo {
    display: none !important;
}

.google-spinner-wrap {
    width: 52px;
    height: 52px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preloader-text-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.preloader-text-status,
.preloader-brand-title {
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.preloader-text-sub,
.preloader-subtitle {
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 500;
}

/* Google Material Circular Spinner SVG */
.google-circular-spinner,
.google-material-spinner {
    animation: google-spinner-rotate 2s linear infinite;
    width: 48px;
    height: 48px;
}

.spinner-path,
.google-spinner-path {
    stroke-dasharray: 1, 200;
    stroke-dashoffset: 0;
    animation: google-spinner-dash 1.5s ease-in-out infinite, google-spinner-color 6s ease-in-out infinite;
    stroke-linecap: round;
}

@keyframes google-spinner-rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes google-spinner-dash {
    0% {
        stroke-dasharray: 1, 200;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 89, 200;
        stroke-dashoffset: -35px;
    }
    100% {
        stroke-dasharray: 89, 200;
        stroke-dashoffset: -124px;
    }
}

@keyframes google-spinner-color {
    100%, 0% {
        stroke: #38bdf8;
    }
    40% {
        stroke: #0284c7;
    }
    66% {
        stroke: #f59e0b;
    }
    80%, 90% {
        stroke: #10b981;
    }
}

/* Mini Google Spinner para Skeletons de Imágenes de Productos */
.img-skeleton-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f1f5f9;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 2;
    transition: opacity 0.3s ease;
}

.mini-google-spinner {
    width: 24px;
    height: 24px;
    animation: google-spinner-rotate 1.8s linear infinite;
}

.mini-spinner-path {
    stroke: #0284c7;
    stroke-dasharray: 1, 150;
    stroke-dashoffset: 0;
    animation: google-spinner-dash 1.4s ease-in-out infinite;
    stroke-linecap: round;
}

.mini-loader-text {
    font-size: 0.65rem;
    color: #64748b;
    font-weight: 600;
}

/* Efecto Fade-in suave al cargar imágenes */
.b2b-dynamic-img {
    opacity: 0;
    transition: opacity 0.35s ease-in-out;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.b2b-dynamic-img.img-loaded {
    opacity: 1 !important;
}

