/* ================================================
   SHOP PAGE IMPROVEMENTS - MODERN UI/UX
   ================================================ */

/* Shop Page Container */
.woocommerce-shop #main,
.archive.woocommerce #main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Shop Header */
.woocommerce-products-header {
    text-align: center;
    margin-bottom: 60px;
    padding: 60px 20px;
    background: linear-gradient(135deg, rgba(232, 5, 76, 0.05) 0%, rgba(232, 169, 5, 0.05) 100%);
    border-radius: 30px;
    position: relative;
    overflow: hidden;
}

.woocommerce-products-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 70%, rgba(232, 5, 76, 0.1) 0%, transparent 50%);
    animation: liquidRotate 30s linear infinite;
}

.woocommerce-products-header__title {
    font-size: 48px;
    font-weight: 800;
    color: var(--dark-gray);
    margin: 0 0 20px;
    position: relative;
    z-index: 1;
}

.woocommerce-products-header__description {
    font-size: 18px;
    color: var(--text-gray);
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Shop Controls */
.shop-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    flex-wrap: wrap;
    gap: 20px;
}

.woocommerce-result-count {
    margin: 0;
    color: var(--text-gray);
    font-size: 16px;
}

.woocommerce-ordering select {
    padding: 12px 20px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.woocommerce-ordering select:hover,
.woocommerce-ordering select:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* Products Grid - Preserve WooCommerce columns system */
.woocommerce ul.products {
    clear: both;
    margin: 0;
    padding: 0;
    /* Remove grid to preserve WooCommerce float-based columns */
}

.woocommerce ul.products::after,
.woocommerce ul.products::before {
    content: " ";
    display: table;
}

.woocommerce ul.products::after {
    clear: both;
}

/* Product Card - Maintain WooCommerce float system */
.woocommerce ul.products li.product {
    float: left;
    margin: 0 3.8% 2.992em 0;
    padding: 0;
    position: relative;
    width: 22.05%;
    margin-left: 0;
    
    /* Enhanced styling */
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border-radius: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* WooCommerce columns system */
.woocommerce ul.products li.first {
    clear: both;
}

.woocommerce ul.products li.last {
    margin-right: 0;
}

.woocommerce ul.products.columns-1 li.product {
    width: 100%;
    margin-right: 0;
}

.woocommerce ul.products.columns-2 li.product {
    width: 48%;
}

.woocommerce ul.products.columns-3 li.product {
    width: 30.75%;
}

.woocommerce ul.products.columns-4 li.product {
    width: 22.05%;
}

.woocommerce ul.products.columns-5 li.product {
    width: 16.95%;
}

.woocommerce ul.products.columns-6 li.product {
    width: 13.5%;
}

[data-theme="dark"] .woocommerce ul.products li.product {
    background: rgba(255, 255, 255, 0.08);
    border: none;
}

.woocommerce ul.products li.product:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Product Image */
.woocommerce ul.products li.product a img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    margin: 0;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.woocommerce ul.products li.product:hover a img {
    transform: scale(1.1);
}

/* Sale Badge */
.woocommerce ul.products li.product .onsale {
    position: absolute;
    top: 20px;
    left: 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #ff1744 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 700;
    z-index: 2;
    min-width: auto;
    min-height: auto;
    line-height: 1;
    animation: badgePulse 2s infinite;
}

/* Product Content */
.product-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 20px;
    font-weight: 700;
    margin: 10px;
    color: var(--dark-gray);
}

/* Product title styling - nazwa produktu i kategoria */
.woocommerce ul.products li.product .woocommerce-loop-product__title .product-name {
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
    display: block;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title .product-category {
    font-size: 16px;
    line-height: 1;
    color: #d1d0d0;
    display: block;
    margin-top: 5px;
}

.woocommerce ul.products li.product .price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0 0 15px;
    margin-bottom: 15px;
    padding-inline: 12px;
}

.woocommerce ul.products li.product .price del {
    opacity: 0.5;
    font-size: 18px;
    color: var(--text-gray);
}

.woocommerce ul.products li.product .price ins {
    text-decoration: none;
}

/* Star Rating */
.woocommerce ul.products li.product .star-rating {
    margin: 0 auto 15px 0;
    font-size: 14px;
}

/* Add to Cart Button */
.woocommerce ul.products li.product .button {
    margin: auto 0 0 0;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #ff1744 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(232, 5, 76, 0.3);
}

.woocommerce ul.products li.product .button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(232, 5, 76, 0.5);
    text-decoration: none;
    color: white;
}

/* Pagination */
.woocommerce nav.woocommerce-pagination {
    margin-top: 60px;
}

.woocommerce nav.woocommerce-pagination ul {
    display: flex;
    justify-content: center;
    gap: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 15px;
}

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

.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.8);
    color: var(--dark-gray);
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 45px;
    text-align: center;
}

.woocommerce nav.woocommerce-pagination ul li a:hover,
.woocommerce nav.woocommerce-pagination ul li span.current {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(232, 5, 76, 0.3);
}

/* Shop Sidebar */
.shop-sidebar {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
}

.shop-sidebar .widget {
    margin-bottom: 30px;
}

.shop-sidebar .widget:last-child {
    margin-bottom: 0;
}

.shop-sidebar .widget-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--dark-gray);
}

/* Price Filter */
.widget_price_filter .price_slider_wrapper {
    padding: 20px 0;
}

.widget_price_filter .ui-slider {
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 5px;
    height: 8px;
}

.widget_price_filter .ui-slider-range {
    background: linear-gradient(135deg, var(--primary-color) 0%, #ff1744 100%);
    border-radius: 5px;
}

.widget_price_filter .ui-slider-handle {
    width: 20px;
    height: 20px;
    background: white;
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    top: -6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.widget_price_filter .ui-slider-handle:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 10px rgba(232, 5, 76, 0.3);
}

/* Product Categories Widget */
.widget_product_categories ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget_product_categories ul li {
    margin-bottom: 12px;
}

.widget_product_categories ul li a {
    color: var(--dark-gray);
    text-decoration: none;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.widget_product_categories ul li a:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(5px);
}

.widget_product_categories ul li .count {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 14px;
}

/* Loading State */
.shop-loading {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
}

.shop-loading.active {
    display: block;
}

.shop-loading-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(232, 5, 76, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .woocommerce ul.products li.product {
        width: 48% !important;
        margin: 1% !important;
        margin-bottom: 30px !important;
    }
}

@media (max-width: 480px) {
    
    .woocommerce-products-header__title {
        font-size: 32px;
    }
    
    .shop-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .woocommerce-ordering {
        width: 100%;
    }
    
    .woocommerce-ordering select {
        width: 100%;
    }
    
    .woocommerce ul.products li.product .price {
        padding-inline: 10px;
    }
    .woocommerce ul.products li.product .button {
        font-size: 0.85rem;
    }
}

/* Dark Mode Adjustments */
[data-theme="dark"] .shop-controls,
[data-theme="dark"] .shop-sidebar {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .woocommerce-ordering select {
    background: rgba(255, 255, 255, 0.1);
    color: var(--dark-gray);
    border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .widget_product_categories ul li a {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .widget_product_categories ul li a:hover {
    background: var(--primary-color);
}

/* Animations */
@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes liquidRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}