/*CARDS CATEGORIAS*/
/* Media Queries para móvil - Mostrar solo 2 cards */
@media (max-width: 768px) {
    .children-category-container {
        padding: 0;
        margin: 20px auto;
        overflow: hidden;
        position: relative;
        width: 100%;
    }
    .children-category-container .wrapper {
        justify-content: unset!important;
    }
    
    .children-category-container .wrapper {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 10px;
        padding: 15px 10px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        scroll-behavior: smooth;
    }
    
    .children-category-container .wrapper::-webkit-scrollbar {
        display: none;
    }
    
    .children-category-container .slide {
        flex: 0 0 calc(50% - 10px); /* 2 cards por vista */
        scroll-snap-align: start;
        text-decoration: none;
        color: inherit;
        min-width: calc(50% - 10px);
    }
    
    .children-category-container .category-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        text-align: center;
        padding: 15px 10px;
        background: #fff;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        border: 1px solid #e0e0e0;
        height: 140px;
        width: 100%;
        box-sizing: border-box;
    }
    .children-category-container .category-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start; /* Cambiar de center a flex-start */
        text-align: center;
        padding: 15px 10px; /* Reducir padding vertical */
        background: #fff;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        border: 1px solid #e0e0e0;
        height: 140px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .children-category-container picture {
        display: block;
        margin-top: 10px!important; /* AGREGAR esto */
        margin-bottom: 5px!important; /* AGREGAR esto */
    }
    
    .children-category-container picture,
    .children-category-container img {
        display: block;
        width: 50px !important;
        height: 50px !important;
        object-fit: contain;
        margin: 0 auto;
        flex-shrink: 0;
    }
    
    .children-category-container .category-item-title {
        max-width: 100% !important;
        width: 100%;
        font-size: 14px;
        font-weight: 600;
        margin-top: 8px;
        line-height: 1.3;
        color: #333;
        text-align: center;
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
        padding: 0 5px;
        display: block;
    }
    .amslider-container .children-category-container .category-item {
        padding: 0px!important;
    }
}

/* Para tablets pequeñas - ajuste fino */
@media (max-width: 480px) {
    .children-category-container .slide {
        flex: 0 0 calc(50% - 8px);
        min-width: calc(50% - 8px);
    }
    
    .children-category-container .wrapper {
        gap: 8px;
        padding: 12px 8px;
    }
    
    .children-category-container .category-item {
        height: 130px;
        padding: 15px 8px;
    }
    
    .children-category-container picture,
    .children-category-container img {
        width: 45px !important;
        height: 45px !important;
    }
    
    .children-category-container .category-item-title {
        font-size: 13px;
    }

    .children-category-container .wrapper {
        justify-content: unset!important;
    }
}

/* Para pantallas muy pequeñas */
@media (max-width: 360px) {
    .children-category-container .slide {
        flex: 0 0 calc(50% - 6px);
        min-width: calc(50% - 6px);
    }
    
    .children-category-container .wrapper {
        gap: 6px;
        padding: 10px 6px;
    }
    
    .children-category-container .category-item {
        height: 120px;
        padding: 12px 6px;
    }
    
    .children-category-container picture,
    .children-category-container img {
        width: 40px !important;
        height: 40px !important;
    }
    
    .children-category-container .category-item-title {
        font-size: 12px;
    }


}

/*TABLA DE TALLAS */

@media (max-width: 1200px) {
.page-product-grouped .table-wrapper.grouped .grouped-products-wrapper {
    display: flex!important;
    flex-wrap: wrap!important;
    column-gap: 3rem!important;
    row-gap: 2rem;
    width: 100%;
}


.page-product-grouped .table-wrapper.grouped .grouped-product-item {
    width: 39% !important;
}

.page-product-grouped .table-wrapper.grouped .grouped-product-item .quantity-selector {
    width: 8.5em!important;
}

.amsearch-wrapper-content .amsearch-item.product-item {
    width: 19rem !important;
}

.amsearch-wrapper-content a.action.towishlist {
    display: none !important;
}

}

/*BUSCADOR PRODUCTOS / VISTA PREVIA */ 


@media (max-width: 768px) {
    #product-content .product-quickview-content .grouped-products-wrapper {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }
    
    .product-quickview-content .grouped-product-item {
        width: 100% !important;
    }

    div#quickview-modal .product-quickview-content {
        display: block!important;
    }
    .amsearch-more-results {
        position: relative!important;
    }
    .amsearch-additional-content .amsearch-leftside-sidebar {
        width: 100% !important;

    }

    .quantity-selector .input-text.qty {
        padding: 7px 0;
    }

    
}

/*PAGINA CATEGORIA */


@media (max-width: 768px) {
    .products.grid .product-items {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 15px !important;
    }
    
    .products.grid .product-items .product-item {
        width: 100% !important;
        margin: 0 !important;
    }
    
    /* Asegurar que las imágenes se adapten */
    .products.grid .product-item .product-image-photo {
        max-width: 70% !important;
        height: auto !important;
    }

    .page-products .product-items .item.product.product-item {
        padding: 0!important;
    }

    .products.grid .product-item  .porto-section.p-0 {
        max-width: 83%;
    }
    
    /* Ajustar el contenido para que quepa bien */
    .products.grid .product-item .product-item-details {
        padding: 10px !important;
    }

    div#amasty-shopby-product-list .quick-view-content {
        left: 0 !important;
        top:  0%!important;
    }
    div#amasty-shopby-product-list  .product-quickview-content  .product-quickview-content {
        display: block!important;
    }

    #amasty-shopby-product-list  .quick-view-content .product-image {
        width: 100%!important;
    }

    #amasty-shopby-product-list .product-quickview-content .grouped-products-wrapper {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    #amasty-shopby-product-list .quick-view-content .product-info {
        width: 100%;
    }
}

/*LOGIN */ 


@media (max-width: 768px) {
    .customer-account-login .login-container .row {
        width: 22rem!important;
        margin-left: 0rem!important;
    }

    .customer-account-login   .action.primary {
        padding: 1em 0 !important;
    }

}

/*FILTROS PAG CATEGORIA */ 

div#narrow-by-list {
    max-height: 100% !important;
}
/* Fix quickview modal height for products with many options in category pages */
.mfp-iframe-holder .mfp-iframe-scaler {
    padding-top: 0 !important;
    height: 90vh !important;
    overflow: visible !important;
}

.mfp-iframe-holder .mfp-iframe-scaler iframe {
    height: 90vh !important;
    position: relative !important;
}

.mfp-iframe-holder .mfp-content {
    max-width: 1000px !important;
}

/* Ensure proper vertical centering */
.mfp-wrap {
    overflow-y: auto !important;
}

.mfp-container {
    padding: 30px 8px !important;
}

}

}

/* QUICKVIEW MODAL FIX FOR CATEGORY PAGES */
#quick-view-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.7) !important;
    z-index: 9999 !important;
    padding: 20px !important;
    overflow-y: auto !important;
}

#quick-view-modal .quick-view-content {
    position: relative !important;
    background: white !important;
    max-width: 1200px !important;
    width: 95% !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    border-radius: 4px !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5) !important;
    margin: 0 auto !important;
}

#quick-view-modal .product-quickview-content {
    display: block !important;
    width: 100% !important;
}

#quick-view-modal .product-image,
#quick-view-modal .product-info {
    display: block !important;
    width: 100% !important;
}
/* Simple quickview modal fix - works for both category and wishlist */
body.modal-open {
    overflow: hidden;
}

#quick-view-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 9999;
    overflow-y: auto;
    padding: 30px 15px;
}

#quick-view-modal .quick-view-content {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
    background: #fff;
    border-radius: 5px;
    padding: 30px;
    max-height: 85vh;
    overflow-y: auto;
}

#quick-view-modal .modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 30px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10;
}


/* Layered navigation collapse - expand */
#narrow-by-list .filter-options-content[aria-hidden="true"] {
  display: none !important;
  height: 0 !important;
  overflow: hidden !important;
}

#narrow-by-list .filter-options-content[aria-hidden="false"] {
  display: block !important;
  height: auto !important;
  overflow: visible !important;
}

.filter-options-title {
    cursor: pointer;
    position: relative;
    padding-right: 30px;
}

.filter-options-title .toggle {
    position: absolute !important;
    right: 0 !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
}

/* Force toggle to show and override all Porto styles */
#narrow-by-list .filter-options-item .filter-options-title .toggle {
  display: inline-block !important;
  width: auto !important;
  height: auto !important;
  line-height: normal !important;
  right: 0 !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  position: absolute !important;
  margin-top: 0 !important;
  padding: 0 !important;
  background: none !important;
  border: none !important;
  text-decoration: none !important;
}

#narrow-by-list .filter-options-item .filter-options-title .toggle::before {
  content: none !important;
  display: none !important;
}

#narrow-by-list .filter-options-item .filter-options-title .toggle::after {
  content: '▼' !important;
  font-family: inherit !important;
  display: inline-block !important;
  font-size: 14px !important;
  color: #333 !important;
  transition: transform 0.3s ease !important;
}

#narrow-by-list .filter-options-item.active .filter-options-title .toggle::after {
  transform: rotate(180deg) !important;
}

#narrow-by-list .filter-options-item .filter-options-title .toggle::before,
#narrow-by-list .filter-options-item .filter-options-title .toggle::after {
  background: none !important;
  left: auto !important;
  top: auto !important;
}

#narrow-by-list .filter-options-content .label {
  text-transform: uppercase !important;
}

.product-item-inner{
	
	z-index:100 !important;
	
}





