/* ==============================================
   SHOP PAGE LAYOUT
   ============================================== */

.shop-page {
    padding: 0 0 80px;
}

/* --- Category Baner --- */
.category-baner {
    width: 100%;
    overflow: hidden;
    line-height: 0; /* kill inline-block gap */
}

.category-baner--top {
    margin-bottom: 0;
}

.category-baner--bottom {
    margin-top: 60px;
}

.category-baner img {
    display: block;
    width: 100%;
    height: 280px;
    object-fit: cover;
    object-position: center 40%;
}

@media (max-width: 768px) {
    .category-baner img {
        height: 180px;
    }
}

/* Container gets top padding since baner removed it from .shop-page */
.shop-page > .container {
    padding-top: 40px;
}

/* --- Breadcrumbs (Okruszki) --- */
.shop-breadcrumbs {
    margin-bottom: 30px;
}

.woocommerce-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-family: var(--font-family-text, sans-serif);
    font-size: 13px;
    color: #666;
    margin: 0;
}

.woocommerce-breadcrumb a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    transition: color 0.3s;
}

.woocommerce-breadcrumb a:hover {
    color: #6B8E23;
}

/* Ikona domku (Home) */
.woocommerce-breadcrumb a:first-child {
    font-size: 0 !important;
    display: block;
    width: 18px;
    height: 19px;
    background-image: url("data:image/svg+xml,%3Csvg width='18' height='19' viewBox='0 0 18 19' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 16.7331H16V7.71131L9 2.26686L2 7.71131V16.7331H8V10.7331H10V16.7331ZM18 17.7331C18 18.2854 17.5523 18.7331 17 18.7331H1C0.44772 18.7331 0 18.2854 0 17.7331V7.22222C0 6.91363 0.14247 6.62232 0.38606 6.43286L8.3861 0.210645C8.7472 -0.070215 9.2528 -0.070215 9.6139 0.210645L17.6139 6.43286C17.8575 6.62232 18 6.91363 18 7.22222V17.7331Z' fill='%232E2E2E'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    position: relative;
    top: -2px;
}

/* Separator */
.breadcrumb-separator {
    display: block;
    width: 6px;
    height: 10px;
    margin: 0 6px;
    font-size: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='6' height='10' viewBox='0 0 6 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 9L5 5L1 1' stroke='%232E2E2E' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

/* --- Page Title --- */
.shop-page-title {
font-size: 72px;
    font-weight: 500;
    text-transform: uppercase;
    margin: 40px 0 90px 0;
    letter-spacing: 1px;
    line-height: 1;
}

/* --- Layout Grid (Sidebar + Content) --- */
.shop-layout,
.shop-grid {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 60px;
    align-items: start;
}

/* --- Sidebar Container --- */
.shop-sidebar {
    position: sticky;
    top: 40px;
}

/* ==============================================
   SIDEBAR MENU (ZAKTUALIZOWANE - AKORDEON)
   ============================================== */

.shop-categories {
    list-style: none;
    padding: 0;
    margin: 0;
    font-family: var(--font-family-text, sans-serif);
}

.shop-categories > li {
    margin-bottom: 12px;
}

/* Wiersz z nazwą i ikoną +/- */
.cat-parent-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 0;
}

/* Linki główne */
.shop-categories a {
    text-decoration: none;
    color: #333;
    font-size: 18px;
    line-height: 1.4;
    transition: color 0.2s ease;
    font-weight: 600;
    flex-grow: 1; /* Link zajmuje dostępną przestrzeń */
}

.shop-categories a:hover,
.shop-categories a.active {
    color: #000;
    font-weight: 600;
}

/* Ikona +/- */
.toggle-icon {
    font-size: 18px;
    line-height: 1;
    color: #666;
    font-weight: 300;
    margin-left: 10px;
    cursor: pointer; /* Ważne: pokazuje że można klikać */
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    transition: all 0.2s;
}

.toggle-icon:hover {
    color: #000;
    background-color: #f5f5f5;
    border-radius: 50%;
}

/* Podkategorie (Wcięcie) */
.shop-categories .sub-menu {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 10px;
}

.shop-categories .sub-menu li {
    margin-bottom: 8px;
}

.shop-categories .sub-menu a {
    font-size: 16px;
    color: #2E2E2E;
    font-weight: 400;
}

.shop-categories .sub-menu a:hover,
.shop-categories .sub-menu a.active {
    color: #7A8F2C;
    font-weight: 500;
}

/* --- Main Content Area --- */
.shop-main-content {
    width: 100%;
}

/* ==============================================
   FILTERS BAR
   ============================================== */

.shop-filters-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.filters-left {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    align-items: center;
}

.btn-clear-all {
    font-family: var(--font-family-text);
    font-size: 16px;
    font-weight: 600;
    color: #2E2E2E;
    text-decoration: underline;
    transition: color 0.2s;
}

.btn-clear-all:hover {
    color: #333;
}

/* Dropdown Base Styles */
.dremax-filter-dropdown,
.sorting-dropdown {
    position: relative;
    display: inline-block;
}

.dremax-filter-trigger,
.sorting-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 10px 0;
    font-family: var(--font-family-text, sans-serif);
    font-size: 18px;
    font-weight: 400;
    color: #000;
    transition: color 0.3s;
}

.dremax-filter-trigger:hover,
.sorting-trigger:hover {
    color: #666;
}

.dremax-filter-trigger .active-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: #7A8F2C;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    border-radius: 11px;
    margin: 0 4px;
}

.dremax-filter-trigger .icon,
.sorting-trigger .icon {
    font-size: 20px;
    line-height: 1;
    font-weight: 300;
}

/* Dropdown Content */
.dremax-filter-content,
.sorting-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 320px;
    background: #fff;
    border: 1px solid #e5e5e5;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    z-index: 1000;
    margin-top: 8px;
}

.sorting-content {
    min-width: 240px;
    padding: 12px;
}

.dremax-filter-dropdown.open .dremax-filter-content,
.sorting-dropdown.open .sorting-content {
    display: block;
}

.sorting-content select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    background: #fff;
    border: 1px solid #ddd;
    padding: 10px 12px;
    font-family: var(--font-family-text, sans-serif);
    font-size: 14px;
    color: #333;
    cursor: pointer;
    outline: none;
}

/* Filter Options Grid */
.dremax-filter-content ul {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    list-style: none !important;
    margin: 0 0 20px 0 !important;
    padding: 0 !important;
    max-height: none !important;
    overflow: visible !important;
}

.dremax-filter-content ul li {
    margin: 0 !important;
    padding: 12px 16px !important;
    border: 1px solid #ddd !important;
    width: 100%;
    cursor: pointer;
    user-select: none;
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #333;
    font-size: 14px;
    font-weight: 400;
    transition: all 0.2s ease;
    border-radius: 0;
    text-align: center;
}

.dremax-filter-content ul li:hover {
    background: #f5f5f5;
    border-color: #ccc !important;
}

.dremax-filter-content ul li.active {
    background-color: #2E2E2E !important;
    color: #fff !important;
    font-weight: 600;
    border-color: #2E2E2E !important;
}

.dremax-filter-content ul li.active:hover {
    background-color: #1a1a1a !important;
    border-color: #1a1a1a !important;
}

.dremax-filter-content ul li .count {
    display: none;
}

.dremax-filter-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid #e5e5e5;
    gap: 16px;
}

.btn-clear {
    color: #666;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    background: transparent;
    padding: 0;
    text-decoration: underline;
}

.btn-clear:hover {
    color: #333;
}

.btn-apply {
    background: #2E2E2E;
    color: #fff;
    padding: 10px 32px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    border: none;
    border-radius: 0;
    transition: background 0.2s ease;
}

.btn-apply:hover {
    background: #1a1a1a;
}

/* ==============================================
   PRODUCTS GRID
   ============================================== */

.shop-content-full {
    position: relative;
    min-height: 400px;
    transition: opacity 0.3s ease;
    width: 100%;
}

/* Loading Spinner */
.shop-content-full.loading {
    opacity: 0.4;
    pointer-events: none;
}

.shop-content-full.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #7A8F2C;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1000;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Grid Layout */
ul.products {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px 24px;
    list-style: none;
    margin: 0 0 40px 0;
    padding: 0;
}

ul.products::before {
    display: none !important;
}

ul.products li {
    border: none;
    padding: 0;
    background: transparent;
}

ul.products li a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Product Image Wrapper & Badge */
.product-image-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
    background: #fff;
}

.product-image-wrapper img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: contain;
    padding: 20px;
    display: block;
    transition: transform 0.3s ease;
}

ul.products li a:hover .product-image-wrapper img {
    transform: scale(1.05);
}

/* Badge Promocyjny (-10%) */
.sale-badge {
    position: absolute;
    bottom: -70px;
    right: 12px;
    background: #5C2C00;
    color: #fff;
    font-family: var(--font-family-heading, sans-serif);
    font-size: 12px;
    font-weight: 600;
    padding: 4px;
    width: 47px;
    border-radius: 0;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 2;
}

/* Product Title */
ul.products li h2 {
    font-family: var(--font-family-text, sans-serif);
    font-size: 16px;
    font-weight: 400;
    margin: 0 0 8px 0;
    color: #333;
    transition: color 0.3s;
    text-align: center;
}

ul.products li a:hover h2 {
    color: #7A8F2C;
}

/* Product Price (Old & New) */
ul.products li .product-price {
    font-family: var(--font-family-text, sans-serif);
    font-size: 16px;
    font-weight: 400;
    color: #333;
    margin-bottom: 15px;
    display: flex; /* Dodane display:flex */
    flex-wrap: wrap;
    justify-content: center;
    align-items: baseline;
    gap: 8px;
}

/* Stara cena (szara, przekreślona) */
ul.products li .product-price del {
    color: #999;
    font-size: 13px;
    text-decoration: line-through;
    opacity: 0.8;
}

/* Nowa cena (kolor Primary, pogrubiona) */
ul.products li .product-price ins {
    text-decoration: none;
    color: #7A8F2C;
    font-weight: 600;
    font-size: 16px;
    background: transparent;
}

/* Bezpiecznik: ukrycie przycisku dodaj do koszyka */
ul.products li .add_to_cart_button {
    display: none;
}

/* ==============================================
   PAGINATION
   ============================================== */

.woocommerce-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 60px;
}

.woocommerce-pagination a,
.woocommerce-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid #eee;
    background: white;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
}

.woocommerce-pagination a:hover,
.woocommerce-pagination .current {
    background: #7A8F2C;
    color: white;
    border-color: #7A8F2C;
}

/* ==============================================
   RESPONSIVE
   ============================================== */

@media (max-width: 1022px) {
    .shop-layout {
        grid-template-columns: 1fr;
    }
    
    .shop-sidebar {
        display: none;
    }
    
    ul.products {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .filters-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .dremax-filter-content,
    .sorting-content {
        min-width: 280px;
    }

    ul.products {
        grid-template-columns: 1fr;
    }
}