/**
 * Filters Mobile Fix
 * Mejora el popup de filtros en dispositivos móviles
 */

/* Solo aplicar en móviles */
@media (max-width: 768px) {
    
    /* Popup principal - Ocupar casi toda la pantalla */
    body .filters--wrapper.pe--styled--popup,
	.elementor .filters--wrapper.pe--styled--popup,
	.elementor-element .filters--wrapper.pe--styled--popup {
		position: fixed !important;
		top: 50% !important;
		left: 50% !important;
		transform: translate(-50%, -50%) !important;
		width: 95vw !important;
		min-width: 95vw !important;
		max-width: 95vw !important;
		height: 85vh !important;
		min-height: 85vh !important;
		max-height: 85vh !important;
		margin: 0 !important;
		padding: 0 !important;
		border-radius: 16px !important;
		overflow: hidden !important;
		z-index: 999999 !important;
	}
    
    /* Contenedor interior - Scroll vertical */
    .filters--wrapper--inner {
        height: 100% !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        padding: 20px 16px 80px 16px !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    /* Botón cerrar - Fijo arriba a la derecha */
    .filters--wrapper .pop--close {
        position: sticky !important;
        top: 0 !important;
        right: 0 !important;
        z-index: 10 !important;
        background: white !important;
        border-radius: 50% !important;
        width: 40px !important;
        height: 40px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin-left: auto !important;
        margin-bottom: 16px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
        cursor: pointer !important;
    }
    
    .filters--wrapper .pop--close svg {
        width: 24px !important;
        height: 24px !important;
    }
    
    /* Items de filtro - Espaciado mejorado */
    .filters--item {
        margin-bottom: 24px !important;
        padding-bottom: 20px !important;
        border-bottom: 1px solid #eee !important;
    }
    
    .filters--item:last-child {
        border-bottom: none !important;
        padding-bottom: 0 !important;
    }
    
    /* Títulos de sección - Más legibles */
    .filter--label,
    .terms-list-title p {
        font-size: 16px !important;
        font-weight: 600 !important;
        margin-bottom: 12px !important;
        color: #333 !important;
    }
    
    /* Lista de términos - Grid responsive */
    .terms--terms {
        display: grid !important;
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
        gap: 8px !important;
        margin-bottom: 16px !important;
    }
    
    /* Items individuales - Más pequeños y compactos */
    .term--list--item {
        padding: 10px 12px !important;
        font-size: 14px !important;
        border-radius: 8px !important;
        border: 1px solid #ddd !important;
        background: white !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
    }
    
    /* Estado hover */
	.term--list--item:hover {
		background: #f5f5f5 !important;
		border-color: #999 !important;
		/* transform: scale(1.02) !important; */
	}

	/* Estado ACTIVO (cuando está seleccionado) */
	.term--list--item:has(input:checked) {
		background: #000 !important;
		border-color: #000 !important;
		color: #fff !important;
	}

	/* Texto blanco cuando está seleccionado */
	.term--list--item:has(input:checked) .term--name {
		color: #fff !important;
	}

	/* Checkbox blanco cuando está seleccionado (opcional) */
	.term--list--item:has(input:checked) input[type="checkbox"] {
		accent-color: #fff !important;
	}
    
    /* Checkbox - Más visible */
    .term--list--item input[type="checkbox"] {
        width: 18px !important;
        height: 18px !important;
        margin: 0 !important;
        cursor: pointer !important;
    }
    
    /* Nombre del término */
    .term--name {
        font-size: 13px !important;
        line-height: 1.2 !important;
        flex: 1 !important;
    }
    
    /* Select de ordenación - Mejorado */
    .pe-select {
        width: 100% !important;
    }
    
    .pe-select select,
    .select-selected {
        padding: 12px 16px !important;
        font-size: 14px !important;
        border-radius: 8px !important;
        border: 1px solid #ddd !important;
    }
    
    .select-items {
        max-height: 200px !important;
        overflow-y: auto !important;
        border-radius: 8px !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    }
    
    .select-items div {
        padding: 12px 16px !important;
        font-size: 14px !important;
    }
    
    /* Overlay de fondo - Más oscuro */
    body.filters-open::before {
        content: '' !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        background: rgba(0, 0, 0, 0.5) !important;
        z-index: 999998 !important;
    }
}

/* Tablets (768px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    
    .filters--wrapper.pe--styled--popup {
        width: 90vw !important;
        height: 80vh !important;
        max-height: 80vh !important;
    }
    
    .terms--terms {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
        gap: 10px !important;
    }
    
    .term--list--item {
        padding: 12px 14px !important;
        font-size: 15px !important;
    }
}


/* ============================================================================
   MEJORAS BOTONES DE FILTRO Y CATEGORÍAS
   ============================================================================ */

/* Solo en móviles */
@media (max-width: 768px) {
    
    /* Contenedor principal - Padding lateral */
    .saren--products--grid--controls {
        padding: 0 20px !important;
		align-items: center !important;
    }
    
    /* BOTÓN FILTER - Solo mostrar SVG, ocultar texto */
    .filters--button.pe--pop--button {
        width: 45px !important;
        height: 45px !important;
        padding: 0 !important;
        min-width: 45px !important;
/*         border-radius: 50% !important; */
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 0 !important; /* Ocultar texto */
        overflow: hidden !important;
    }
    
    /* SVG del botón filter - Más grande al quitar texto */
    .filters--button.pe--pop--button svg {
        font-size: 18px !important;
        width: 18px !important;
        height: 18px !important;
        margin: 0 !important;
		position: relative;
        right: 3px;
        color: white;
    }
    
    /* Alternativa: Si quieres ocultar completamente el texto */
    .filters--button.pe--pop--button::before {
        content: none !important;
    }
    
    /* BOTONES DE CATEGORÍAS (All, Nesspreso, Pack) */
    .saren--products--filter--cats .term--list--item {
        padding: 8px 16px !important;
        font-size: 13px !important;
        min-height: 38px !important;
/*         border-radius: 20px !important; */
        white-space: nowrap !important;
    }
    
    /* Checkbox de categorías - Más pequeño */
    .saren--products--filter--cats .term--list--item input[type="checkbox"] {
        width: 16px !important;
        height: 16px !important;
        margin-right: 6px !important;
    }
    
    /* Contenedor de categorías - Scroll horizontal mejorado */
    .saren--products--filter--cats {
        gap: 8px !important;
        padding: 10px 0 !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    /* Ocultar scrollbar pero mantener funcionalidad */
    .saren--products--filter--cats::-webkit-scrollbar {
        display: none;
    }
    
    .saren--products--filter--cats {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
}

/* Tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    
    .saren--products--grid--controls {
        padding: 0 20px !important;
    }
    
    .filters--button.pe--pop--button {
        padding: 10px 20px !important;
        font-size: 14px !important;
    }
    
    .saren--products--filter--cats .term--list--item {
        padding: 10px 18px !important;
        font-size: 14px !important;
    }
}

/* ============================================================================
   MEJORAS ESTETICA DE LISTADO PRODUCTOS
   ============================================================================ */
/* Mobile */
@media (max-width: 768px) {
	.saren--single--product {
		padding: 0 20px !important;
	}
}
/* Tablets */
@media (min-width: 769px) and (max-width: 1024px) {
	.saren--single--product {
		padding: 0 10px !important
	}
}