*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --brand:       #3C3489;
    --brand-mid:   #534AB7;
    --brand-light: #EEEDFE;
    --brand-dark:  #26215C;
    --surface:     #F7F6F3;
    --white:       #FFFFFF;
    --border:      rgba(0, 0, 0, 0.08);
    --border-md:   rgba(0, 0, 0, 0.13);
    --border-str:  rgba(0, 0, 0, 0.18);
    --text-1:      #18171C;
    --text-2:      #5A5869;
    --text-3:      #9896A4;
    --success:     #1D9E75;
    --success-bg:  #EAF3DE;
    --radius:      12px;
    --radius-sm:   8px;
    --radius-xs:   6px;
    --shadow-sm:   0 1px 3px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.04);
    --shadow-md:   0 2px 8px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.07);
    --sidebar-w:   260px;
    --transition:  .22s cubic-bezier(.25,.1,.25,1);
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Sora', sans-serif;
    background: var(--surface);
    color: var(--text-1);
    font-size: 14.5px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.layout {
    min-height: 100vh;
}

.products-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
}

.list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 0 22px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.result-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.query-text {
    font-family: 'DM Serif Display', serif;
    font-size: 17px;
    color: var(--text-1);
}

.count-text {
    font-size: 12.5px;
    color: var(--text-3);
}

.top-search-bar {
    display: flex;
    align-items: center;
    background: var(--white);
    border: 1px solid var(--border-md);
    border-radius: 40px;
    overflow: hidden;
    min-width: 320px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.top-search-bar:focus-within {
    border-color: var(--brand-mid);
    box-shadow: 0 0 0 3px rgba(83, 74, 183, 0.1);
}

.top-search-bar input {
    flex: 1;
    border: none;
    outline: none;
    padding: 10px 18px;
    font-family: 'Sora', sans-serif;
    font-size: 13.5px;
    color: var(--text-1);
    background: transparent;
}

.top-search-bar input::placeholder {
    color: var(--text-3);
}

.top-search-bar button {
    width: 44px;
    height: 40px;
    border: none;
    background: var(--brand);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 40px 40px 0;
    transition: background var(--transition);
    flex-shrink: 0;
}

.top-search-bar button:hover {
    background: var(--brand-dark);
}

.main-content {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    gap: 28px;
    align-items: start;
}

@media (max-width: 900px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    .top-search-bar { min-width: 220px; }
}

.filters-sidebar {
    position: sticky;
    top: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 40px;
}

.filter-group {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 18px;
}

.filter-title {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--text-3);
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.cat-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cat-link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 10px;
    border-radius: var(--radius-xs);
    text-decoration: none;
    font-size: 13px;
    color: var(--text-2);
    transition: background var(--transition), color var(--transition);
}

.cat-link:hover {
    background: var(--surface);
    color: var(--text-1);
}

.cat-link.active {
    background: var(--brand-light);
    color: var(--brand);
    font-weight: 600;
}

.cat-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: .65;
}

.cat-link.active .cat-icon {
    opacity: 1;
    stroke: var(--brand);
}

.sub-list {
    list-style: none;
    margin-top: 4px;
    padding-left: 22px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sub-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: var(--radius-xs);
    text-decoration: none;
    font-size: 12.5px;
    color: var(--text-2);
    transition: background var(--transition), color var(--transition);
}

.sub-link:hover {
    background: var(--surface);
    color: var(--text-1);
}

.sub-link.sub-active {
    color: var(--brand-mid);
    font-weight: 600;
}

.sub-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
    opacity: .6;
}

.sub-link.sub-active .sub-dot {
    opacity: 1;
    background: var(--brand-mid);
}

.price-filter-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.price-input-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.price-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.price-field label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-3);
}

.price-field input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-md);
    border-radius: var(--radius-xs);
    font-family: 'Sora', sans-serif;
    font-size: 13px;
    color: var(--text-1);
    background: var(--surface);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.price-field input:focus {
    border-color: var(--brand-mid);
    box-shadow: 0 0 0 3px rgba(83, 74, 183, 0.1);
    background: var(--white);
}

.price-sep {
    font-size: 13px;
    color: var(--text-3);
    padding-bottom: 9px;
    flex-shrink: 0;
}

.dual-slider-container {
    position: relative;
    height: 28px;
    display: flex;
    align-items: center;
}

.slider-track {
    position: absolute;
    width: 100%;
    height: 3px;
    border-radius: 3px;
    background: var(--border-md);
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
}

.slider-fill {
    position: absolute;
    height: 3px;
    background: var(--brand-mid);
    border-radius: 3px;
    z-index: 2;
    pointer-events: none;
}

.slider {
    position: absolute;
    width: 100%;
    height: 3px;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    pointer-events: none;
    z-index: 3;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--white);
    border: 2.5px solid var(--brand);
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 1px 4px rgba(60, 52, 137, 0.25);
    transition: transform .15s, box-shadow .15s;
}

.slider::-webkit-slider-thumb:hover,
.slider::-webkit-slider-thumb:active {
    transform: scale(1.18);
    box-shadow: 0 2px 8px rgba(60, 52, 137, 0.35);
}

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--white);
    border: 2.5px solid var(--brand);
    cursor: pointer;
    pointer-events: all;
}

.price-submit-btn {
    width: 100%;
    padding: 10px 0;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Sora', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: .02em;
    transition: background var(--transition), transform var(--transition);
}

.price-submit-btn:hover {
    background: var(--brand-dark);
    transform: translateY(-1px);
}

.price-submit-btn:active {
    transform: translateY(0);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
    padding-bottom: 60px;
}

.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: var(--text-1);
    display: flex;
    flex-direction: column;
    transition:
        transform var(--transition),
        border-color var(--transition),
        box-shadow var(--transition);
    opacity: 0;
    transform: translateY(16px);
    animation: cardIn .42s ease forwards;
}

@keyframes cardIn {
    to { opacity: 1; transform: translateY(0); }
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--border-str);
    box-shadow: var(--shadow-md);
}

.card-badge-new {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    background: var(--brand);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 20px;
    pointer-events: none;
}

.card-img-holder {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--surface);
    flex-shrink: 0;
}

.card-img-holder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .38s cubic-bezier(.25,.1,.25,1);
}

.card:hover .card-img-holder img {
    transform: scale(1.07);
}

.no-img-box {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-3);
    font-size: 12px;
}

.no-img-box svg {
    width: 36px;
    height: 36px;
    opacity: .4;
}

.card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(60, 52, 137, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition);
    backdrop-filter: blur(2px);
}

.card:hover .card-overlay {
    opacity: 1;
}

.overlay-cta {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .06em;
    padding: 8px 18px;
    border: 1.5px solid rgba(255,255,255,.75);
    border-radius: 24px;
    transform: translateY(6px);
    transition: transform var(--transition);
}

.card:hover .overlay-cta {
    transform: translateY(0);
}

.card-body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.group-label {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--text-3);
}

.product-title {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-1);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.price-row {
    display: flex;
    align-items: baseline;
    gap: 3px;
    margin-top: 4px;
}

.currency {
    font-size: 12px;
    font-weight: 500;
    color: var(--brand);
}

.price-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--brand);
    letter-spacing: -.4px;
}

.contact-us {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--brand-mid);
    font-style: italic;
}

.stock-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 500;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.stock-in  { color: #1D9E75; }
.stock-in svg { stroke: #1D9E75; }

.stock-critical { color: #ef6c00; }
.stock-critical svg { stroke: #ef6c00; }

.stock-out { color: #c62828; }
.stock-out svg { stroke: #c62828; }

.stock-contact { color: #1565c0; }
.stock-contact svg { stroke: #1565c0; }

.not-found {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 72px 32px;
    text-align: center;
    gap: 14px;
}

.not-found-icon {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: var(--white);
    border: 1px solid var(--border-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.not-found-icon svg {
    stroke: var(--text-3);
}

.not-found h2 {
    font-family: 'DM Serif Display', serif;
    font-size: 22px;
    font-weight: 400;
    color: var(--text-1);
}

.not-found p {
    font-size: 14px;
    color: var(--text-2);
    max-width: 340px;
}

.btn-back {
    margin-top: 6px;
    display: inline-block;
    padding: 10px 24px;
    background: var(--brand);
    color: #fff;
    text-decoration: none;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .02em;
    transition: background var(--transition), transform var(--transition);
}

.btn-back:hover {
    background: var(--brand-dark);
    transform: translateY(-1px);
}

.card:nth-child(1)  { animation-delay: .04s; }
.card:nth-child(2)  { animation-delay: .08s; }
.card:nth-child(3)  { animation-delay: .12s; }
.card:nth-child(4)  { animation-delay: .16s; }
.card:nth-child(5)  { animation-delay: .20s; }
.card:nth-child(6)  { animation-delay: .24s; }
.card:nth-child(7)  { animation-delay: .28s; }
.card:nth-child(8)  { animation-delay: .32s; }
.card:nth-child(9)  { animation-delay: .36s; }
.card:nth-child(10) { animation-delay: .40s; }
.card:nth-child(11) { animation-delay: .44s; }
.card:nth-child(12) { animation-delay: .48s; }

@media (max-width: 900px) {
    .filters-sidebar {
        position: static;
    }
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (max-width: 600px) {
    .list-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .top-search-bar {
        width: 100%;
        min-width: unset;
    }
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .card-body { padding: 11px 12px 13px; }
}