/* Archive Products Styling - ModaBorsa */

/* Custom Product Item Structure */
.product-item {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.product-item:hover {
    border-color: #e0e0e0;
}

/* Product Image Gallery */
.product-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
}

.product-gallery {
    position: relative;
    width: 100%;
    height: 100%;
}

.gallery-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.gallery-image.active {
    opacity: 1;
}

.gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.product-item:hover .gallery-image img {
    transform: scale(1.05);
}

/* Gallery Navigation */
.gallery-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.product-item:hover .gallery-nav {
    opacity: 1;
    pointer-events: auto;
}

/* Always show navigation on mobile */
@media (max-width: 768px) {
    .gallery-nav {
        opacity: 1;
        pointer-events: auto;
    }
}

.gallery-prev,
.gallery-next {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.gallery-prev:hover,
.gallery-next:hover {
    background: #000;
    color: #fff;
    transform: scale(1.1);
}

.gallery-prev svg,
.gallery-next svg {
    width: 16px;
    height: 16px;
}

/* Mobile Gallery Enhancements */
@media (max-width: 768px) {
    .gallery-nav {
        opacity: 1;
        pointer-events: auto;
    }
    
    .gallery-prev,
    .gallery-next {
        width: 32px;
        height: 32px;
        background: rgba(0, 0, 0, 0.7);
        color: #fff;
    }
    
    .gallery-prev:hover,
    .gallery-next:hover {
        background: rgba(0, 0, 0, 0.9);
        transform: scale(1.05);
    }
    
    .gallery-prev svg,
    .gallery-next svg {
        width: 14px;
        height: 14px;
    }
}

/* Touch indicators */
.product-gallery::after {
    content: '';
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.product-item:hover .product-gallery::after {
    opacity: 1;
}

/* Gallery dots indicator (optional) */
.gallery-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-item:hover .gallery-dots {
    opacity: 1;
}

.gallery-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s ease;
}

.gallery-dot.active {
    background: rgba(255, 255, 255, 1);
}

/* Product Badges */
.sale-badge,
.new-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #000;
    color: #fff;
    padding: 2px 6px;
    border-radius: 2px;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    z-index: 2;
}

.sale-badge {
    background: #dc2626;
}

/* Product Content */
.product-content {
    padding: 15px;
}

/* Product Category */
.product-category {
    color: #999;
    font-size: 0.75rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
    display: block;
}

/* Product Title */
.product-title {
    margin: 0 0 10px 0;
}

.product-title a {
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.product-title a:hover {
    color: #000;
    text-decoration: none;
}

/* Product Price */
.product-price {
    font-size: 1rem;
    font-weight: 600;
    color: #000;
}

.product-price del {
    color: #999;
    font-size: 0.85rem;
    margin-right: 6px;
}

.product-price ins {
    text-decoration: none;
    color: #dc2626;
}

/* Grid Layout - 4 items per row - Override Flatsome */
.woocommerce ul.products,
.woocommerce .products.row,
.woocommerce .products.row.row-small,
.woocommerce .products.row.large-columns-4 {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    width: 100% !important;
}

/* Override Flatsome's column system */
.woocommerce .products.row .product-item,
.woocommerce .products.row .product-small,
.woocommerce .products.row .col {
    width: 100% !important;
    max-width: none !important;
    flex: none !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    display: block !important;
}

/* Disable Flatsome's equalize-box system */
.woocommerce .products.row.equalize-box,
.woocommerce .products.row.equalize-box .col,
.woocommerce .products.row.equalize-box .product-item {
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
}

/* Override any Flatsome flexbox system */
.woocommerce .products.row[class*="columns-"] {
    display: grid !important;
    flex-direction: unset !important;
    flex-wrap: unset !important;
    align-items: unset !important;
    justify-content: unset !important;
}

.woocommerce ul.products li.product {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Responsive Design - Override Flatsome */
@media (max-width: 1200px) {
    .woocommerce ul.products,
    .woocommerce .products.row,
    .woocommerce .products.row.row-small,
    .woocommerce .products.row.medium-columns-3 {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 18px !important;
    }
}

@media (max-width: 768px) {
    .woocommerce ul.products,
    .woocommerce .products.row,
    .woocommerce .products.row.row-small,
    .woocommerce .products.row.small-columns-2 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }
    
    .product-content {
        padding: 12px;
    }
    
    .product-title a {
        font-size: 0.85rem;
    }
    
    .product-price {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .woocommerce ul.products,
    .woocommerce .products.row,
    .woocommerce .products.row.row-small {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    .product-content {
        padding: 10px;
    }
}

/* Archive Page Specific Styling */
.archive .woocommerce ul.products {
    margin-top: 30px;
}

/* Front Page Products Styling */
.products-container {
    margin-top: 30px;
}

/* More specific selectors for front page */
.products-container .woocommerce ul.products,
.products-container .woocommerce .products.row,
.products-container .woocommerce .products.row.row-small,
.products-container .woocommerce .products.row.large-columns-4,
.products-container .products.row,
.products-container .products.row.row-small,
.products-container .products.row.large-columns-4,
.products-container .products.row.medium-columns-3,
.products-container .products.row.small-columns-2,
.products-container .products.row.equalize-box {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    width: 100% !important;
    flex-direction: unset !important;
    flex-wrap: unset !important;
    align-items: unset !important;
    justify-content: unset !important;
}

/* Override Flatsome's column system for front page */
.products-container .woocommerce .products.row .product-item,
.products-container .woocommerce .products.row .product-small,
.products-container .woocommerce .products.row .col,
.products-container .products.row .product-item,
.products-container .products.row .product-small,
.products-container .products.row .col {
    width: 100% !important;
    max-width: none !important;
    flex: none !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    display: block !important;
    position: relative !important;
}

/* Disable Flatsome's equalize-box system for front page */
.products-container .woocommerce .products.row.equalize-box,
.products-container .woocommerce .products.row.equalize-box .col,
.products-container .woocommerce .products.row.equalize-box .product-item,
.products-container .products.row.equalize-box,
.products-container .products.row.equalize-box .col,
.products-container .products.row.equalize-box .product-item {
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
}

/* Override any Flatsome flexbox system for front page */
.products-container .woocommerce .products.row[class*="columns-"],
.products-container .products.row[class*="columns-"] {
    display: grid !important;
    flex-direction: unset !important;
    flex-wrap: unset !important;
    align-items: unset !important;
    justify-content: unset !important;
}

/* Front Page Responsive Design */
@media (max-width: 1200px) {
    .products-container .woocommerce ul.products,
    .products-container .woocommerce .products.row,
    .products-container .woocommerce .products.row.row-small,
    .products-container .woocommerce .products.row.medium-columns-3,
    .products-container .products.row,
    .products-container .products.row.row-small,
    .products-container .products.row.medium-columns-3 {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 18px !important;
    }
}

@media (max-width: 768px) {
    .products-container .woocommerce ul.products,
    .products-container .woocommerce .products.row,
    .products-container .woocommerce .products.row.row-small,
    .products-container .woocommerce .products.row.small-columns-2,
    .products-container .products.row,
    .products-container .products.row.row-small,
    .products-container .products.row.small-columns-2 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }
}

@media (max-width: 480px) {
    .products-container .woocommerce ul.products,
    .products-container .woocommerce .products.row,
    .products-container .woocommerce .products.row.row-small,
    .products-container .products.row,
    .products-container .products.row.row-small {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
}

.archive .woocommerce .woocommerce-result-count {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.archive .woocommerce .woocommerce-ordering {
    margin-bottom: 20px;
}

.archive .woocommerce .woocommerce-ordering select {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 8px 12px;
    background: #fff;
    color: #333;
    font-size: 0.9rem;
}

.archive .woocommerce .woocommerce-ordering select:focus {
    border-color: #000;
    outline: none;
}

/* Pagination */
.woocommerce nav.woocommerce-pagination {
    margin-top: 40px;
    text-align: center;
}

.woocommerce nav.woocommerce-pagination ul {
    display: inline-flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 5px;
}

.woocommerce nav.woocommerce-pagination ul li {
    margin: 0;
}

.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
    display: block;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
}

.woocommerce nav.woocommerce-pagination ul li a:hover {
    background: #000;
    color: #fff;
    border-color: #000;
}

.woocommerce nav.woocommerce-pagination ul li span.current {
    background: #000;
    color: #fff;
    border-color: #000;
}
