@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 62.5%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;

    font-family: "Inter", Arial, sans-serif;

    background: #f6f6f4;
    color: #111;

    transition:
        background 0.35s ease,
        color 0.35s ease;
}

button,
input,
select {
    font-family: inherit;
}

.balk {
    position: sticky;
    top: 0;
    z-index: 1000;

    min-height: 76px;

    display: flex;
    align-items: center;

    padding: 15px 40px;

    gap: 15px;

    background: rgba(255, 255, 255, 0.92);

    border-bottom: 1px solid #e5e5e5;

    backdrop-filter: blur(18px);

    box-shadow:
        0 4px 25px rgba(0, 0, 0, 0.04);

    transition: 0.35s ease;
}

.search-form {
    display: flex;
    align-items: center;

    width: 260px;
    height: 44px;

    background: #f3f3f1;

    border: 1px solid #dededb;
    border-radius: 8px;

    overflow: hidden;

    transition: 0.25s ease;
}

.search-form:focus-within {
    background: white;

    border-color: #111;

    box-shadow:
        0 0 0 3px rgba(0, 0, 0, 0.05);
}

.search-form input {
    flex: 1;

    width: 100%;
    height: 100%;

    padding: 0 14px;

    border: none;
    outline: none;

    background: transparent;
    color: #111;

    font-size: 13px;
}

.search-form input::placeholder {
    color: #888;
}

.search-form button {
    width: 46px;
    height: 100%;

    border: none;

    background: transparent;
    color: #111;

    font-size: 14px;

    cursor: pointer;

    transition: 0.2s ease;
}

.search-form button:hover {
    background: #111;
    color: white;
}

.filters {
    display: flex;
    align-items: center;

    margin-left: auto;

    gap: 10px;
}

.filters label {
    display: flex;
    align-items: center;

    gap: 7px;

    color: #555;

    font-size: 11px;
    font-weight: 600;

    white-space: nowrap;
}

.filters select,
.filters input {
    height: 40px;

    padding: 0 11px;

    border: 1px solid #dededb;
    border-radius: 7px;

    outline: none;

    background: #f8f8f6;
    color: #111;

    font-size: 12px;

    cursor: pointer;

    transition: 0.2s ease;
}

.filters input {
    width: 125px;
    cursor: text;
}

.filters select:hover,
.filters input:hover,
.filters select:focus,
.filters input:focus {
    border-color: #111;
}

.cart-button {
    position: relative;

    width: 44px;
    height: 44px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid #111;
    border-radius: 8px;

    background: #111;
    color: white;

    font-size: 16px;

    cursor: pointer;

    transition: 0.25s ease;
}

.cart-button:hover {
    background: white;
    color: #111;

    transform: translateY(-2px);
}

#cart-count {
    position: absolute;

    top: -7px;
    right: -7px;

    min-width: 20px;
    height: 20px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0 5px;

    border-radius: 50%;

    background: #e63946;
    color: white;

    font-size: 10px;
    font-weight: 700;

    border: 2px solid white;
}

.darkmodebutton {
    height: 44px;

    padding: 0 15px;

    border: 1px solid #111;
    border-radius: 8px;

    background: transparent;
    color: #111;

    font-size: 11px;
    font-weight: 700;

    cursor: pointer;

    transition: 0.25s ease;
}

.darkmodebutton:hover {
    background: #111;
    color: white;
}

.button {
    display: block;

    margin: 40px auto 10px;

    padding: 12px 25px;

    border: none;
    border-radius: 8px;

    background: #111;
    color: white;

    font-size: 12px;
    font-weight: 700;

    letter-spacing: 0.04em;

    cursor: pointer;

    transition: 0.25s ease;
}

.button:hover {
    background: #333;

    transform: translateY(-2px);

    box-shadow:
        0 10px 25px rgba(0, 0, 0, 0.15);
}

.products {
    width: min(1280px, calc(100% - 60px));

    margin: 50px auto 80px;

    display: grid;

    grid-template-columns: repeat(3, 1fr);

    gap: 25px;
}

.products__product {
    position: relative;

    min-height: 490px;

    display: flex;
    flex-direction: column;

    background: white;

    border: 1px solid #e8e8e5;
    border-radius: 12px;

    overflow: hidden;

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease,
        border-color 0.3s ease;
}

.products__product:hover {
    transform: translateY(-6px);

    border-color: #d1d1ce;

    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.1);
}

.products__product::before {
    content: "";

    position: absolute;

    top: 0;
    left: 0;

    width: 100%;
    height: 62%;

    background: #f3f3f1;

    z-index: 0;
}

.products__product .blonk {
    position: relative;
    z-index: 1;

    width: 100%;
    height: 285px;

    padding: 25px;

    object-fit: contain;

    transition:
        transform 0.45s cubic-bezier(.2, .7, .2, 1);
}

.products__product:hover .blonk {
    transform: scale(1.06);
}

.sale-badge {
    position: absolute;

    top: 15px;
    left: 15px;

    z-index: 5;

    padding: 7px 10px;

    background: #111;
    color: white;

    font-size: 10px;
    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: 0.08em;

    border-radius: 4px;
}

.products__product a {
    position: relative;
    z-index: 2;

    margin: 15px 20px 0;

    color: #111;

    font-size: 15px;
    font-weight: 700;

    line-height: 1.4;

    transition: color 0.2s ease;
}

.products__product a:hover {
    color: #555;
}

.products__product h2 {
    position: relative;
    z-index: 2;

    margin: 8px 20px 15px;

    color: #111;

    font-size: 17px;
    font-weight: 700;
}

.old-price {
    margin-right: 6px;

    color: #999;

    font-size: 13px;

    text-decoration: line-through;
}

button.add {
    display: block;

    position: relative;
    z-index: 2;

    width: calc(100% - 40px);

    margin: auto 20px 20px;

    padding: 13px;

    border: 1px solid #111;
    border-radius: 7px;

    background: #111;
    color: white;

    font-size: 11px;
    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: 0.08em;

    cursor: pointer;

    transition: 0.25s ease;
}

button.add:hover {
    background: white;
    color: #111;

    transform: translateY(-2px);
}

button.remove {
    display: none;
}

.cart-dropdown {
    position: absolute;

    top: 72px;
    right: 30px;

    width: 360px;

    padding: 20px;

    display: none;

    background: white;
    color: #111;

    border: 1px solid #ddd;
    border-radius: 10px;

    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.15);

    z-index: 2000;
}

.cart-dropdown.show {
    display: block;
    animation: cartIn 0.2s ease;
}

.cart-dropdown ul {
    list-style: none;
}

.cart-dropdown li {
    padding: 10px 0;

    border-bottom: 1px solid #eee;

    font-size: 12px;
}

@keyframes cartIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cart-item {
    display: flex;
    align-items: center;

    gap: 10px;

    padding: 10px 0;

    border-bottom: 1px solid #eee;
}

.cart-image {
    width: 70px;
    height: 70px;

    object-fit: contain;

    background: #f5f5f3;

    border-radius: 6px;
}

.cart-info {
    display: flex;
    flex-direction: column;

    gap: 4px;
}

.cart-info h3 {
    font-size: 12px;
}

.cart-info p {
    font-size: 12px;
    font-weight: 700;
}

.remove-btn {
    padding: 5px 8px;

    border: none;
    border-radius: 4px;

    background: #e63946;
    color: white;

    font-size: 10px;

    cursor: pointer;
}

.balk1 {
    height: 140px;

    background: #111;

    border-top: 1px solid #222;
}

body.dark-mode {
    background: #0c0c0c;
    color: white;
}

body.dark-mode .balk {
    background: rgba(15, 15, 15, 0.94);
    border-color: #292929;
}

body.dark-mode .search-form {
    background: #181818;
    border-color: #333;
}

body.dark-mode .search-form input {
    color: white;
}

body.dark-mode .search-form button {
    color: white;
}

body.dark-mode .filters label {
    color: #aaa;
}

body.dark-mode .filters select,
body.dark-mode .filters input {
    background: #181818;
    border-color: #333;
    color: white;
}

body.dark-mode .darkmodebutton {
    border-color: white;
    color: white;
}

body.dark-mode .darkmodebutton:hover {
    background: white;
    color: #111;
}

body.dark-mode .products__product {
    background: #151515;
    border-color: #292929;
}

body.dark-mode .products__product::before {
    background: #1d1d1d;
}

body.dark-mode .products__product a,
body.dark-mode .products__product h2 {
    color: white;
}

body.dark-mode .products__product a:hover {
    color: #aaa;
}

body.dark-mode button.add {
    background: white;
    color: #111;
    border-color: white;
}

body.dark-mode button.add:hover {
    background: transparent;
    color: white;
}

body.dark-mode .cart-button {
    background: white;
    color: #111;
    border-color: white;
}

body.dark-mode .cart-dropdown {
    background: #151515;
    color: white;
    border-color: #333;
}

body.dark-mode .cart-dropdown li {
    border-color: #333;
}

body.dark-mode .button {
    background: white;
    color: #111;
}

body.dark-mode .button:hover {
    background: #ddd;
}

body.dark-mode .balk1 {
    background: #050505;
}

@media (max-width: 1050px) {

    .balk {
        padding: 12px 20px;
        gap: 10px;
    }

    .search-form {
        width: 210px;
    }

    .filters {
        gap: 7px;
    }

    .filters label {
        font-size: 10px;
    }

    .products {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 700px) {

    .balk {
        position: relative;

        flex-direction: column;

        padding: 15px;

        gap: 12px;
    }

    .search-form {
        width: 100%;
    }

    .filters {
        width: 100%;

        display: grid;
        grid-template-columns: 1fr;

        gap: 8px;
    }

    .filters label {
        width: 100%;
    }

    .filters select,
    .filters input {
        width: 100%;
    }

    .cart-button {
        width: 100%;
        border-radius: 7px;
    }

    .darkmodebutton {
        width: 100%;
    }

    .products {
        width: calc(100% - 30px);

        margin-top: 30px;

        grid-template-columns: 1fr;

        gap: 20px;
    }

    .products__product {
        min-height: 470px;
    }

    .products__product .blonk {
        height: 280px;
    }

    .cart-dropdown {
        position: fixed;

        top: 15px;
        left: 5%;

        width: 90%;
    }

    .button {
        width: calc(100% - 30px);
    }
}

@media (max-width: 400px) {

    html {
        font-size: 56%;
    }

    .products__product {
        min-height: 440px;
    }

    .products__product .blonk {
        height: 250px;
    }
}