/* ==============================
   TOP TIPOLOGIA BAR
   ============================== */
.sl-shop-topbar {
    display: flex;
    gap: 16px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.sl-shop-cat-btn {
    flex: 1;
    padding: 12px 24px;
    border: 2px solid #333;
    border-radius: 0;
    background: transparent;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: 'Roboto', sans-serif;
    text-align: center;
}

.sl-shop-cat-btn:hover {
    background: #333;
    color: #fff;
}

.sl-shop-cat-btn.active {
    background: #000;
    color: #fff;
    border-color: #000;
}

/* ==============================
   MAIN LAYOUT
   ============================== */
.sl-shop-container {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    width: 100%;
    margin: 0 auto;
    padding: 0;
    font-family: 'Roboto', sans-serif;
}

/* Sidebar */
.sl-shop-sidebar {
    flex: 0 0 280px;
    padding-right: 0;
}

.sl-filter-group {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid #e5e5e5;
}

.sl-filter-group:last-child {
    border-bottom: none;
}

.sl-filter-title {
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
    font-weight: 500;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.sl-filter-title::after {
    content: '\2212';
    font-size: 20px;
    font-weight: 300;
    transition: transform 0.2s ease;
}

.sl-filter-group.collapsed .sl-filter-title {
    margin-bottom: 0;
}

.sl-filter-group.collapsed .sl-filter-title::after {
    content: '+';
}

.sl-filter-content {
    overflow: hidden;
    max-height: 800px;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

.sl-filter-group.collapsed .sl-filter-content {
    max-height: 0;
    opacity: 0;
}

.sl-label-wrapper {
    display: inline-flex;
    align-items: center;
}

.sl-selected-term {
    font-size: 14px;
    text-transform: capitalize;
    color: #666;
    font-weight: 400;
}

.sl-filter-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sl-filter-list li {
    margin-bottom: 12px;
}

.sl-filter-list label {
    cursor: pointer;
    display: flex;
    align-items: center;
    font-size: 15px;
    color: #333;
    transition: all 0.2s;
    user-select: none;
}

.sl-filter-checkbox {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    accent-color: #000;
    cursor: pointer;
    border: 1px solid #ccc;
    border-radius: 2px;
}

.sl-checkbox-label {
    flex-grow: 1;
}

.sl-term-count {
    color: #999;
    font-size: 13px;
    margin-left: 8px;
}

/* Color Swatches */
.sl-color-swatches {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(28px, 1fr));
    gap: 12px;
    overflow: visible;
    padding-bottom: 8px;
}

.sl-color-swatch-item {
    position: relative;
    width: 28px;
    height: 28px;
    overflow: visible;
}

.sl-color-swatch {
    display: block;
    width: 100%;
    height: 100%;
    cursor: pointer;
    position: relative;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.sl-filter-checkbox:checked+.sl-color-swatch::after,
.sl-color-swatch:hover::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #000;
}

/* Size Filters */
.sl-size-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.sl-size-item {
    position: relative;
}

.sl-size-label {
    font-size: 15px;
    text-transform: uppercase;
    color: #333;
    cursor: pointer;
    position: relative;
    padding-bottom: 4px;
    transition: all 0.2s ease;
    font-weight: 400;
}

.sl-filter-checkbox:checked+.sl-size-label,
.sl-size-label:hover {
    font-weight: 500;
}

.sl-filter-checkbox:checked+.sl-size-label::after,
.sl-size-label:hover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #000;
}

/* ==============================
   HEADER (ordering + filtri)
   ============================== */
.sl-shop-main {
    flex: 1;
}

.sl-shop-result-count {
    font-size: 14px;
    color: #666;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e5e5;
}

.sl-shop-result-count strong {
    color: #000;
    font-weight: 600;
}

.sl-shop-header {
    display: flex;
    justify-content: right;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 16px;
}

.sl-shop-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sl-orderby {
    border: 2px solid #333;
    border-radius: 0;
    padding: 10px 16px;
    background: transparent;
    font-size: 14px;
    outline: none;
    cursor: pointer;
    color: #333;
    font-family: 'Roboto', sans-serif;
}

.sl-filtri-btn {
    border: 2px solid #333;
    border-radius: 0;
    padding: 10px 24px;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    color: #333;
    font-family: 'Roboto', sans-serif;
    transition: all 0.2s ease;
}

.sl-filtri-btn:hover {
    background: #333;
    color: #fff;
}

/* ==============================
   PRODUCT GRID
   ============================== */
.sl-products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.sl-product-item {
    width: 100%;
    position: relative;
}

/* Loader */
.sl-loader {
    text-align: center;
    padding: 40px 0;
    width: 100%;
}

.sl-spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 2px solid rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    border-top-color: #000;
    animation: sl-spin 0.8s linear infinite;
}

@keyframes sl-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==============================
   SLIDE-IN FILTER PANEL (AND logic)
   ============================== */
.sl-filtri-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sl-filtri-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sl-filtri-panel {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    max-width: 90vw;
    height: 100%;
    background: #fff;
    z-index: 9999;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
}

.sl-filtri-panel.active {
    right: 0;
}

.sl-filtri-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 30px;
    border-bottom: 1px solid #e5e5e5;
}

.sl-filtri-panel-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sl-filtri-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #333;
    line-height: 1;
    padding: 0;
}

.sl-filtri-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 30px;
}

/* AND panel uses same visual styles as sidebar */
.sl-filtri-panel-body .sl-and-filter-group {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid #e5e5e5;
}

.sl-filtri-panel-body .sl-and-filter-group:last-child {
    border-bottom: none;
}

.sl-filtri-panel-body .sl-and-filter-title {
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
    font-weight: 500;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.sl-filtri-panel-body .sl-and-filter-title::after {
    content: '\2212';
    font-size: 20px;
    font-weight: 300;
}

.sl-filtri-panel-body .sl-and-filter-group.collapsed .sl-and-filter-title {
    margin-bottom: 0;
}

.sl-filtri-panel-body .sl-and-filter-group.collapsed .sl-and-filter-title::after {
    content: '+';
}

.sl-filtri-panel-body .sl-and-filter-content {
    overflow: hidden;
    max-height: 800px;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

.sl-filtri-panel-body .sl-and-filter-group.collapsed .sl-and-filter-content {
    max-height: 0;
    opacity: 0;
}

.sl-filtri-panel-body .sl-and-filter-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sl-filtri-panel-body .sl-and-filter-list li {
    margin-bottom: 12px;
}

.sl-filtri-panel-body .sl-and-filter-list label {
    cursor: pointer;
    display: flex;
    align-items: center;
    font-size: 15px;
    color: #333;
    transition: all 0.2s;
    user-select: none;
}

.sl-filtri-panel-body .sl-and-filter-checkbox {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    accent-color: #000;
    cursor: pointer;
}

.sl-filtri-panel-body .sl-and-checkbox-label {
    flex-grow: 1;
}

.sl-filtri-panel-body .sl-and-term-count {
    color: #999;
    font-size: 13px;
    margin-left: 8px;
}

.sl-filtri-panel-body .sl-and-label-wrapper {
    display: inline-flex;
    align-items: center;
}

.sl-filtri-panel-body .sl-and-selected-term {
    font-size: 14px;
    text-transform: capitalize;
    color: #666;
    font-weight: 400;
}

/* AND panel: Color Swatches */
.sl-filtri-panel-body .sl-and-color-swatches,
.sl-filtri-panel-body .sl-color-swatches {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(28px, 1fr));
    gap: 12px;
    overflow: visible;
    padding-bottom: 8px;
}

.sl-filtri-panel-body .sl-and-color-swatch-item,
.sl-filtri-panel-body .sl-color-swatch-item {
    position: relative;
    width: 28px;
    height: 28px;
    overflow: visible;
}

.sl-filtri-panel-body .sl-and-color-swatch,
.sl-filtri-panel-body .sl-color-swatch {
    display: block;
    width: 100%;
    height: 100%;
    cursor: pointer;
    position: relative;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.sl-filtri-panel-body .sl-and-filter-checkbox:checked+.sl-and-color-swatch::after,
.sl-filtri-panel-body .sl-and-color-swatch:hover::after,
.sl-filtri-panel-body .sl-and-filter-checkbox:checked+.sl-color-swatch::after,
.sl-filtri-panel-body .sl-color-swatch:hover::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #000;
}

/* AND panel: Size Filters */
.sl-filtri-panel-body .sl-and-size-filters,
.sl-filtri-panel-body .sl-size-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.sl-filtri-panel-body .sl-and-size-item,
.sl-filtri-panel-body .sl-size-item {
    position: relative;
}

.sl-filtri-panel-body .sl-and-size-label,
.sl-filtri-panel-body .sl-size-label {
    font-size: 15px;
    text-transform: uppercase;
    color: #333;
    cursor: pointer;
    position: relative;
    padding-bottom: 4px;
    transition: all 0.2s ease;
    font-weight: 400;
}

.sl-filtri-panel-body .sl-and-filter-checkbox:checked+.sl-and-size-label,
.sl-filtri-panel-body .sl-and-size-label:hover,
.sl-filtri-panel-body .sl-and-filter-checkbox:checked+.sl-size-label,
.sl-filtri-panel-body .sl-size-label:hover {
    font-weight: 500;
}

.sl-filtri-panel-body .sl-and-filter-checkbox:checked+.sl-and-size-label::after,
.sl-filtri-panel-body .sl-and-size-label:hover::after,
.sl-filtri-panel-body .sl-and-filter-checkbox:checked+.sl-size-label::after,
.sl-filtri-panel-body .sl-size-label:hover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #000;
}

.sl-filtri-panel-footer {
    display: flex;
    gap: 12px;
    padding: 20px 30px;
    border-top: 1px solid #e5e5e5;
}

.sl-filtri-apply {
    flex: 1;
    padding: 14px 24px;
    background: #000;
    color: #fff;
    border: none;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
    transition: background 0.2s ease;
}

.sl-filtri-apply:hover {
    background: #333;
}

.sl-filtri-reset {
    padding: 14px 24px;
    background: transparent;
    color: #666;
    border: 1px solid #ccc;
    font-size: 14px;
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
    transition: all 0.2s ease;
}

.sl-filtri-reset:hover {
    border-color: #333;
    color: #333;
}

/* ==============================
   RESPONSIVE
   ============================== */
@media (max-width: 1024px) {
    .sl-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sl-shop-container {
        flex-direction: column;
    }

    .sl-shop-sidebar {
        flex: none;
        width: 100%;
        padding-right: 0;
    }

    .sl-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .sl-shop-topbar {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .sl-shop-topbar::-webkit-scrollbar {
        display: none;
    }

    .sl-shop-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .sl-shop-header-right {
        width: 100%;
        justify-content: space-between;
    }
}

/* ==============================
   PAGINATION
   ============================== */
.sl-pagination {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 8px;
    padding: 40px 0 20px;
    flex-wrap: nowrap;
}

.sl-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: 2px solid #333;
    border-radius: 0;
    background: transparent !important;
    color: #333;
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-align: center;
    min-width: 48px;
    flex: 0 0 auto;
}

.sl-page-btn:hover:not(:disabled):not(.active) {
    background: #f1f2f3 !important;
    border-color: #000;
    color: #000;
}

.sl-page-btn.active {
    background: #000 !important;
    color: #fff;
    border-color: #000;
    font-weight: 600;
}

.sl-page-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.sl-page-prev,
.sl-page-next {
    flex: 0 0 auto;
    padding: 10px 16px;
    font-size: 13px;
    background: transparent !important;
}

.sl-page-prev:hover,
.sl-page-next:hover {
    background: transparent !important;
    border-color: #000;
    color: #000;
}

.sl-page-prev.active,
.sl-page-next.active,
.sl-page-prev:active,
.sl-page-next:active {
    background: transparent !important;
}

@media (max-width: 768px) {
    .sl-page-btn span {
        display: none;
    }
    .sl-page-btn {
        padding: 10px 14px;
        min-width: 40px;
        font-size: 13px;
    }
    .sl-page-prev,
    .sl-page-next {
        padding: 10px 12px;
    }
}
