:root {
    --ink: #292b27;
    --muted: #74766d;
    --line: #dedbd1;
    --surface: #fffdf8;
    --canvas: #f1eee6;
    --navy: #293b38;
    --blue: #39756e;
    --blue-dark: #285a55;
    --accent: #c86b45;
    --success: #5f8065;
    --shadow: 0 14px 35px rgba(47, 54, 45, 0.11);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    overflow-x: clip;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--canvas);
    color: var(--ink);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    line-height: 1.5;
    min-width: 320px;
    overflow-x: clip;
}

button,
input,
select {
    font: inherit;
}

input,
select,
textarea {
    max-width: 100%;
}

button,
a,
input[type="checkbox"],
input[type="range"] {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

.container {
    margin: 0 auto;
    max-width: 1240px;
    padding: 0 24px;
    width: 100%;
}

.header {
    background: var(--navy);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 20;
}

.header-top {
    align-items: center;
    display: flex;
    gap: 28px;
    min-height: 82px;
}

.logo {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    font-size: 1.4rem;
    font-weight: 800;
    gap: 10px;
    letter-spacing: 0.02em;
}

.logo i {
    color: var(--accent);
    font-size: 1.7rem;
}

.search-bar {
    display: flex;
    flex: 1;
    max-width: 600px;
}

.search-bar input {
    background: var(--surface);
    border: 0;
    border-radius: 6px 0 0 6px;
    color: var(--ink);
    min-height: 44px;
    outline: 0;
    padding: 0 16px;
    width: 100%;
}

.search-bar input:focus {
    box-shadow: inset 0 0 0 2px var(--accent);
}

.search-btn,
.cta-btn,
.add-to-cart-btn,
.filter-btn,
.checkout-btn,
.newsletter-form button {
    background: var(--blue);
    border: 0;
    color: #fff;
    font-weight: 700;
    transition: background 0.2s ease, transform 0.2s ease;
}

.search-btn {
    border-radius: 0 6px 6px 0;
    min-width: 52px;
}

.search-bar input::-webkit-search-cancel-button {
    cursor: pointer;
}

.search-results-status {
    color: var(--muted);
    font-size: 0.86rem;
    margin: -8px 0 16px;
}

.search-results-status:empty {
    display: none;
}

.search-btn:hover,
.cta-btn:hover,
.add-to-cart-btn:hover,
.filter-btn:hover,
.checkout-btn:hover,
.newsletter-form button:hover {
    background: var(--blue-dark);
}

.header-actions {
    align-items: center;
    display: flex;
    gap: 14px;
    margin-left: auto;
}

.action-btn {
    background: transparent;
    border: 0;
    color: #fff;
    display: flex;
    flex-direction: column;
    font-size: 0.73rem;
    gap: 4px;
    align-items: center;
    min-width: 50px;
    opacity: 0.9;
}

.action-btn:hover {
    color: #e7ad76;
    opacity: 1;
}

.action-btn i {
    font-size: 1.05rem;
}

.cart-btn {
    position: relative;
}

.cart-count {
    background: var(--accent);
    border-radius: 10px;
    color: #fff;
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1.5;
    margin-left: 2px;
    min-width: 18px;
    padding: 0 4px;
}

.wishlist-count {
    background: var(--accent);
    border-radius: 10px;
    display: inline-block;
    font-size: 0.65rem;
    line-height: 1.5;
    margin-left: 2px;
    min-width: 18px;
    padding: 0 4px;
}

.navbar {
    align-items: center;
    border-top: 1px solid rgba(255, 253, 248, 0.12);
    display: flex;
    min-height: 48px;
}

.nav-menu {
    display: flex;
    gap: 28px;
    width: 100%;
}

.nav-menu a {
    color: #d9e2d9;
    display: block;
    font-size: 0.86rem;
    padding: 13px 0;
    transition: color 0.2s ease;
}

.nav-menu a:hover {
    color: #e7ad76;
}

.menu-toggle:focus-visible,
a:focus-visible,
button:focus-visible {
    outline: 3px solid #e7ad76;
    outline-offset: 3px;
}

.menu-toggle {
    background: transparent;
    border: 0;
    color: #fff;
    display: none;
    font-size: 1.3rem;
}

.banner {
    align-items: center;
    background: linear-gradient(110deg, rgba(41, 59, 56, 0.96), rgba(66, 93, 76, 0.84)), url("https://images.unsplash.com/photo-1593640408182-31c70c8268f5?auto=format&fit=crop&w=1800&q=80") center / cover;
    color: #fff;
    display: flex;
    min-height: 340px;
    padding: 60px 8%;
}

.banner-content {
    max-width: 620px;
}

.banner h1 {
    font-size: clamp(2.2rem, 5vw, 4rem);
    line-height: 1.05;
    margin-bottom: 18px;
}

.banner p {
    color: #e8eee4;
    font-size: 1.15rem;
    margin-bottom: 28px;
}

.cta-btn {
    border-radius: 5px;
    padding: 13px 27px;
}

.content-wrapper {
    align-items: start;
    display: grid;
    gap: 28px;
    grid-template-columns: 250px minmax(0, 1fr);
    padding: 46px 0;
}

.sidebar {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 22px;
    position: sticky;
    top: 150px;
}

.filter-section {
    border-bottom: 1px solid var(--line);
    margin-bottom: 22px;
    padding-bottom: 20px;
}

.filter-section h3 {
    font-size: 1rem;
    margin-bottom: 13px;
}

.category-list {
    display: grid;
    gap: 9px;
}

.category-link,
.brand-filter label {
    color: var(--muted);
    font-size: 0.86rem;
}

.category-link {
    align-items: center;
    display: flex;
    gap: 9px;
}

.category-link.active {
    color: var(--blue);
    font-weight: 700;
}

.category-count {
    background: #e7efe5;
    border-radius: 10px;
    color: var(--success);
    font-size: 0.7rem;
    margin-left: auto;
    min-width: 22px;
    padding: 1px 6px;
    text-align: center;
}

.category-link:hover {
    color: var(--blue);
}

.category-link i {
    color: var(--blue);
    width: 16px;
}

.price-slider {
    accent-color: var(--blue);
    width: 100%;
}

.price-display {
    color: var(--muted);
    display: flex;
    font-size: 0.78rem;
    justify-content: space-between;
    margin-top: 7px;
}

.brand-filter {
    display: grid;
    gap: 9px;
}

.brand-filter input,
.filter-btn,
.reset-btn {
    border-radius: 4px;
    font-size: 0.85rem;
    min-height: 39px;
    width: 100%;
}

.filter-btn {
    margin-bottom: 9px;
}

.reset-btn {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--muted);
}

.reset-btn:hover {
    border-color: var(--blue);
    color: var(--blue);
}

.products-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.products-header h2,
.featured-brands h2 {
    font-size: 1.65rem;
}

.sort-select {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--muted);
    min-height: 39px;
    padding: 0 11px;
}

.products-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.product-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 7px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.product-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-3px);
}

.product-image-container {
    background: #e9e6dc;
    min-height: 205px;
    position: relative;
}

.product-image {
    display: block;
    height: 205px;
    object-fit: cover;
    width: 100%;
}

.product-badge {
    background: var(--success);
    border-radius: 3px;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    left: 11px;
    padding: 4px 8px;
    position: absolute;
    text-transform: uppercase;
    top: 11px;
}

.product-badge.hot {
    background: #a94f3f;
}

.product-badge.sale {
    background: var(--accent);
}

.wishlist-btn {
    background: #fff;
    border: 0;
    border-radius: 50%;
    color: var(--muted);
    height: 32px;
    position: absolute;
    right: 11px;
    top: 11px;
    width: 32px;
}

.wishlist-btn:hover {
    color: #a94f3f;
}

.wishlist-btn.is-liked {
    color: #c92d42;
}

.wishlist-btn.is-liked i {
    animation: heart-pop 0.2s ease-out;
}

@keyframes heart-pop {
    50% {
        transform: scale(1.3);
    }
}

.product-info {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 16px;
}

.product-name {
    font-size: 0.98rem;
    line-height: 1.35;
    min-height: 42px;
}

.product-price {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.product-description {
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.4;
    margin-bottom: 15px;
}

.price {
    color: var(--blue-dark);
    font-size: 1.1rem;
    font-weight: 800;
}

.original-price {
    color: #9a988e;
    font-size: 0.76rem;
    text-decoration: line-through;
}

.discount {
    background: #e7efe5;
    color: var(--success);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 5px;
}

.add-to-cart-btn {
    border-radius: 4px;
    margin-top: auto;
    min-height: 38px;
    width: 100%;
}

.pagination {
    display: flex;
    gap: 7px;
    justify-content: center;
    margin-top: 30px;
}

.page-btn {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--muted);
    min-height: 35px;
    min-width: 35px;
    padding: 0 10px;
}

.page-btn:hover,
.page-btn.active {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
}

.shopping-cart {
    background: #fff;
    border-left: 1px solid var(--line);
    box-shadow: -10px 0 30px rgba(47, 54, 45, 0.14);
    display: flex;
    flex-direction: column;
    max-width: 390px;
    min-height: 100vh;
    overflow-y: auto;
    padding: 24px;
    position: fixed;
    right: 0;
    top: 0;
    transform: translateX(105%);
    transition: transform 0.25s ease;
    visibility: hidden;
    width: 100%;
    z-index: 30;
}

.shopping-cart.open {
    transform: translateX(0);
    visibility: visible;
}

.cart-overlay {
    background: rgba(20, 27, 24, 0.48);
    inset: 0;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    transition: opacity 0.25s ease;
    z-index: 25;
}

.cart-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.cart-header {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    padding-bottom: 18px;
}

.cart-header h2 {
    font-size: 1.3rem;
}

.close-cart {
    background: transparent;
    border: 0;
    color: var(--muted);
    font-size: 1.15rem;
}

.cart-items-container {
    flex: 1;
    min-height: 180px;
    overflow-y: auto;
    padding: 18px 0;
}

.wishlist-items {
    flex: 1;
    min-height: 180px;
    overflow-y: auto;
    padding: 18px 0;
}

.wishlist-item {
    align-items: flex-start;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 12px;
    padding: 14px 0;
}

.wishlist-item-image {
    background: var(--canvas);
    border-radius: 5px;
    flex: 0 0 70px;
    height: 70px;
    object-fit: contain;
    padding: 4px;
    width: 70px;
}

.wishlist-item-details {
    flex: 1;
    min-width: 0;
}

.wishlist-item-details h3 {
    font-size: 0.84rem;
    line-height: 1.35;
    margin-bottom: 5px;
}

.wishlist-item-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 9px;
}

.wishlist-add-btn,
.wishlist-remove-btn {
    background: transparent;
    border: 0;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 0;
}

.wishlist-add-btn {
    color: var(--blue-dark);
}

.wishlist-remove-btn {
    color: #a94f3f;
}

.wishlist-items .empty-cart span {
    display: block;
    font-size: 0.78rem;
    margin-top: 6px;
}

.cart-item {
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 13px;
    padding: 14px 0;
}

.cart-item-image {
    background: var(--canvas);
    height: 76px;
    object-fit: cover;
    width: 76px;
}

.cart-item-details {
    flex: 1;
    min-width: 0;
}

.cart-item-details h3 {
    font-size: 0.86rem;
    line-height: 1.3;
    margin-bottom: 4px;
}

.cart-item-price {
    color: var(--blue-dark);
    font-size: 0.82rem;
    font-weight: 700;
}

.cart-item-controls {
    align-items: center;
    display: flex;
    gap: 9px;
    margin-top: 8px;
}

.cart-item-controls button:not(.cart-remove) {
    background: #f1eee6;
    border: 1px solid var(--line);
    border-radius: 3px;
    height: 26px;
    width: 26px;
}

.cart-item-controls span {
    font-size: 0.82rem;
    min-width: 14px;
    text-align: center;
}

.cart-remove {
    background: transparent;
    border: 0;
    color: #a94f3f;
    font-size: 0.76rem;
    margin-left: auto;
}

.empty-cart {
    color: var(--muted);
    text-align: center;
}

.empty-cart i {
    color: #aeb5a8;
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.cart-summary {
    border-top: 1px solid var(--line);
    padding-top: 15px;
}

.summary-row {
    color: var(--muted);
    display: flex;
    font-size: 0.88rem;
    justify-content: space-between;
    margin-bottom: 8px;
}

.summary-row.total {
    color: var(--ink);
    font-size: 1.05rem;
    font-weight: 800;
    margin-top: 12px;
}

.checkout-btn,
.continue-shopping-btn {
    border-radius: 4px;
    min-height: 41px;
    margin-top: 18px;
    width: 100%;
}

.checkout-btn:disabled {
    background: #aeb5a8;
    cursor: not-allowed;
}

.continue-shopping-btn {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--muted);
}

.continue-shopping-btn:hover {
    border-color: var(--blue);
    color: var(--blue);
}

.featured-brands {
    background: #fff;
    border-top: 1px solid var(--line);
    padding: 44px 0;
}

.featured-brands h2 {
    margin-bottom: 22px;
    text-align: center;
}

.brands-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(6, 1fr);
}

.brand-box {
    align-items: center;
    border: 1px solid var(--line);
    display: flex;
    justify-content: center;
    min-height: 88px;
    padding: 10px;
}

.brand-box img {
    max-height: 65px;
    max-width: 100%;
    object-fit: contain;
}

.footer {
    background: var(--navy);
    color: #d9e2d9;
    padding: 48px 0 20px;
}

.footer-content {
    display: grid;
    gap: 30px;
    grid-template-columns: repeat(5, 1fr);
}

.footer-section h3 {
    color: #fff;
    font-size: 0.95rem;
    margin-bottom: 14px;
}

.footer-section ul {
    display: grid;
    gap: 8px;
}

.footer-section a {
    color: #b4c1b4;
    font-size: 0.82rem;
}

.footer-section a:hover {
    color: #e7ad76;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    font-size: 1.15rem;
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.newsletter-form input {
    border: 0;
    border-radius: 3px;
    min-height: 37px;
    padding: 0 10px;
}

.newsletter-form button {
    border-radius: 3px;
    min-height: 37px;
}

.footer-bottom {
    align-items: center;
    border-top: 1px solid rgba(255, 253, 248, 0.13);
    color: #b4c1b4;
    display: flex;
    font-size: 0.78rem;
    justify-content: space-between;
    margin-top: 36px;
    padding-top: 20px;
}

.payment-methods {
    display: flex;
    font-size: 1.45rem;
    gap: 9px;
}

@media (max-width: 1050px) {
    .header-top {
        gap: 16px;
    }

    .header-actions {
        gap: 7px;
    }

    .nav-menu {
        gap: 18px;
    }

    .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .brands-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .footer-content {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) and (min-width: 761px) {
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }

    .header-top {
        gap: 12px;
    }

    .logo {
        font-size: 1.2rem;
    }

    .header-actions .action-btn {
        min-width: 42px;
    }

    .content-wrapper {
        gap: 20px;
        grid-template-columns: 210px minmax(0, 1fr);
    }

    .products-grid {
        gap: 14px;
    }
}

@media (max-width: 760px) {
    .container {
        padding: 0 16px;
    }

    .header-top {
        flex-wrap: wrap;
        padding: 15px 0;
    }

    .logo {
        order: 1;
    }

    .header-actions {
        order: 2;
    }

    .search-bar {
        flex-basis: 100%;
        max-width: none;
        order: 3;
    }

    .navbar {
        flex-wrap: wrap;
        padding-bottom: 10px;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        gap: 0;
        order: 2;
        padding: 8px 0 4px;
        width: 100%;
    }

    .nav-menu.open {
        display: flex;
    }

    .nav-menu a {
        border-top: 1px solid rgba(255, 253, 248, 0.1);
        padding: 11px 2px;
    }

    .menu-toggle {
        display: block;
        margin-left: auto;
        min-height: 44px;
        min-width: 44px;
        order: 1;
    }

    .banner {
        min-height: 290px;
        padding: 48px 16px;
    }

    .banner h1 {
        font-size: 2.45rem;
    }

    .content-wrapper {
        gap: 22px;
        grid-template-columns: 1fr;
        padding: 30px 0;
    }

    .sidebar {
        position: static;
    }

    .filter-section {
        margin-bottom: 16px;
        padding-bottom: 15px;
    }

    .products-grid {
        gap: 12px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .product-image-container,
    .product-image {
        min-height: 150px;
        height: 150px;
    }

    .product-info {
        padding: 12px;
    }

    .product-name {
        font-size: 0.87rem;
    }

    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 440px) {
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .header-top {
        column-gap: 8px;
        row-gap: 12px;
    }

    .logo {
        font-size: 1.12rem;
        gap: 7px;
    }

    .logo i {
        font-size: 1.35rem;
    }

    .header-actions .action-btn span {
        display: none;
    }

    .header-actions {
        gap: 8px;
    }

    .header-actions .action-btn {
        min-height: 40px;
        min-width: 40px;
    }

    .header-actions .action-btn i {
        font-size: 1.15rem;
    }

    .products-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .sort-select {
        width: 100%;
    }

    .product-image-container,
    .product-image {
        min-height: 125px;
        height: 125px;
    }

    .product-info {
        padding: 10px;
    }

    .product-name {
        font-size: 0.82rem;
        min-height: 0;
    }

    .product-description {
        font-size: 0.74rem;
    }

    .price {
        font-size: 0.98rem;
    }

    .brands-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-content {
        grid-template-columns: 1fr 1fr;
    }

    .footer-bottom {
        align-items: flex-start;
        flex-direction: column;
        gap: 15px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
