/* Gemar Webshop Mobile Enhancements */

/* Mobile Filter FAB */
.gemar-filter-fab {
    display: none;
    position: fixed;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    z-index: 1040;
    padding: 12px 32px;
    min-height: 44px;
    border-radius: 50px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    background: #2490ef;
    color: #fff;
    font-weight: 600;
    border: none;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.gemar-filter-fab:active {
    background: #1d73bf;
}

@media (max-width: 768px) {
    /* Ocultamos los filtros de su posicion nativa */
    .product-filter {
        display: none;
    }
    /* Estilos offcanvas aplicados cuando se le agrega la clase .show-mobile mediante JS */
    .product-filter.show-mobile {
        display: block !important;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(85vw, 340px);
        max-width: calc(100% - 48px);
        background: #fff;
        z-index: 1055;
        padding: 24px;
        padding-top: calc(24px + env(safe-area-inset-top, 0px));
        padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        box-shadow: 4px 0 24px rgba(0,0,0,0.15);
        animation: slideInLeft 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .gemar-filter-fab {
        display: flex;
    }
    
    /* Overlay para el offcanvas */
    .gemar-filter-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1050;
        backdrop-filter: blur(2px);
        animation: fadeInOverlay 0.3s ease;
    }
    .gemar-filter-overlay.show {
        display: block;
    }
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}
@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Fix for Tables in PDP overflowing */
.product-details table,
.product-description table,
.web-page-content table {
    display: block !important;
    overflow-x: auto !important;
    width: 100% !important;
    -webkit-overflow-scrolling: touch;
    border-collapse: collapse;
}
.product-details table td,
.product-details table th {
    min-width: 120px;
}
