* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #ffffff;
    color: #111;
}

.page-shell {
    width: 100%;
    margin: 0;
    background: #fff;
    min-height: 100vh;
}

.top-nav,
.store-tools,
.categories-row,
.products-section,
.cart-panel,
.payment-section,
.page-footer {
    width: min(1320px, calc(100% - 56px));
    margin-left: auto;
    margin-right: auto;
}

.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 0;
    font-size: 20px;
    font-weight: 700;
}

.logo {
    white-space: nowrap;
}

.search-wrap {
    flex: 1;
    display: flex;
    justify-content: center;
}

.search-wrap input {
    width: 340px;
    height: 42px;
    padding: 8px 12px;
    border: 1px solid #d8d8d8;
    background: #ededed;
    font-size: 15px;
}

.nav-links {
    display: flex;
    gap: 28px;
}

.nav-links a {
    color: #111;
    text-decoration: none;
}

.hero-banner {
    position: relative;
    width: 100%;
    height: 520px;
    overflow: hidden;
}

.hero-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
}

.hero-overlay {
    position: absolute;
    top: 94px;
    left: clamp(32px, 7vw, 120px);
    color: #fff;
}

.hero-overlay h1 {
    width: min(720px, calc(100vw - 120px));
    margin: 0 0 24px;
    font-size: clamp(3rem, 5vw, 5rem);
    line-height: 1.12;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
}

.shop-button,
.cart-button,
.checkout-button {
    border: none;
    background: #1d8cff;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.shop-button {
    padding: 15px 26px;
    font-size: 16px;
}

.store-tools {
    padding: 16px 0 0;
    text-align: center;
}

.tool-button {
    border: none;
    background: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
    cursor: pointer;
}

.categories-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    padding: 48px 0 30px;
    text-align: center;
}

.category-item {
    cursor: pointer;
}

.category-circle {
    width: 74px;
    height: 74px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: #e6e6e6;
    transition: transform 0.2s ease, background 0.2s ease;
}

.category-item.active .category-circle,
.category-item:hover .category-circle {
    background: #cfe4ff;
    transform: scale(1.05);
}

.category-item p {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
}

.products-section,
.cart-panel,
.payment-section {
    padding: 28px 0 0;
}

.products-section h2,
.cart-panel h2,
.payment-section h2 {
    margin: 0 0 18px;
    font-size: 38px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.product-card {
    border: 1px solid #f0f0f0;
    background: #fff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.product-card.hidden {
    display: none;
}

.product-card.highlight {
    outline: 2px solid #1d8cff;
}

.product-card img {
    display: block;
    width: 100%;
    height: 190px;
    object-fit: cover;
}

.product-info {
    padding: 14px 12px;
    min-height: 118px;
}

.product-info h3 {
    margin: 0 0 10px;
    font-size: 17px;
    line-height: 1.3;
}

.product-info p {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}

.cart-button {
    width: calc(100% - 20px);
    margin: 0 10px 12px;
    padding: 12px 0;
    font-size: 14px;
}

.cart-button.in-cart {
    background: #ef4444;
}

.summary-card {
    background: #fff0f0;
    padding: 18px 20px;
}

#cartMessage {
    margin: 0;
    font-size: 15px;
    color: #555;
}

#cartList {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
}

.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid #f3dede;
}

.cart-item:first-child {
    border-top: none;
}

.cart-item-name {
    font-size: 15px;
    font-weight: 700;
}

.cart-item-code {
    font-size: 13px;
    color: #666;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 3px;
}

.qty-button,
.remove-button {
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
}

.qty-button {
    width: 32px;
    height: 32px;
    background: #dbeafe;
    color: #1d4ed8;
}

.qty-value {
    min-width: 24px;
    text-align: center;
    font-size: 13px;
}

.remove-button {
    background: #ef4444;
    color: #fff;
    padding: 6px 10px;
}

.payment-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 18px;
}

.payment-methods {
    display: flex;
    flex-direction: column;
}

.payment-option {
    border: 1px solid #f5dddd;
    background: #fff4f4;
    text-align: left;
    padding: 20px 18px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
}

.payment-option.active {
    background: #ffe7e7;
}

.payment-panel {
    background: #fff2f2;
    padding: 22px;
}

.payment-card {
    display: none;
}

.payment-card.payment-card-active {
    display: block;
}

.payment-card h3 {
    margin: 0 0 14px;
    font-size: 32px;
}

.payment-card p {
    margin: 0 0 12px;
    font-size: 14px;
    line-height: 1.5;
}

.payment-details {
    margin-bottom: 14px;
    font-size: 14px;
    line-height: 1.5;
}

.payment-form {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
}

.payment-form input,
.payment-form select {
    width: 100%;
    border: 1px solid #ddd;
    background: #fff;
    padding: 12px 14px;
    font-size: 14px;
}

.inline-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.checkout-button {
    padding: 12px 18px;
    font-size: 14px;
}

.payment-feedback {
    margin: 16px 0 0;
    font-size: 13px;
    color: #555;
}

.page-footer {
    padding: 28px 0 34px;
    text-align: center;
    font-size: 12px;
}

@media (max-width: 900px) {
    .top-nav,
    .store-tools,
    .categories-row,
    .products-section,
    .cart-panel,
    .payment-section,
    .page-footer {
        width: min(100% - 24px, 1320px);
    }

    .top-nav {
        flex-wrap: wrap;
        justify-content: center;
        font-size: 14px;
        padding: 14px 0;
    }

    .search-wrap input {
        width: 100%;
        max-width: 260px;
        height: 34px;
        font-size: 12px;
    }

    .nav-links {
        gap: 14px;
    }

    .hero-banner {
        height: 280px;
    }

    .hero-overlay {
        top: 34px;
        left: 24px;
    }

    .hero-overlay h1 {
        width: min(500px, calc(100vw - 96px));
        font-size: 34px;
    }
}

@media (max-width: 560px) {
    .top-nav,
    .store-tools,
    .categories-row,
    .products-section,
    .cart-panel,
    .payment-section,
    .page-footer {
        width: calc(100% - 28px);
    }

    .top-nav {
        padding: 12px 0;
        gap: 10px;
        font-size: 12px;
    }

    .search-wrap {
        order: 3;
        width: 100%;
    }

    .search-wrap input {
        max-width: none;
    }

    .hero-banner {
        height: 170px;
    }

    .hero-overlay {
        top: 18px;
        left: 16px;
    }

    .hero-overlay h1 {
        width: calc(100vw - 48px);
        font-size: 22px;
    }

    .shop-button {
        padding: 9px 14px;
        font-size: 12px;
    }

    .categories-row,
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .categories-row,
    .products-section,
    .cart-panel,
    .payment-section,
    .page-footer {
        padding-left: 14px;
        padding-right: 14px;
    }

    .categories-row {
        gap: 18px;
        padding-top: 24px;
    }

    .category-circle {
        width: 46px;
        height: 46px;
    }

    .category-item p {
        font-size: 12px;
    }

    .products-section h2,
    .cart-panel h2,
    .payment-section h2 {
        font-size: 24px;
    }

    .product-card img {
        height: 130px;
    }

    .product-info {
        min-height: 82px;
    }

    .product-info h3 {
        font-size: 13px;
    }

    .product-info p,
    .cart-button,
    #cartMessage,
    .cart-item-name,
    .cart-item-code,
    .qty-button,
    .qty-value,
    .remove-button,
    .payment-card p,
    .payment-details,
    .payment-form input,
    .payment-form select,
    .checkout-button,
    .payment-feedback,
    .page-footer {
        font-size: 12px;
    }

    .payment-layout {
        grid-template-columns: 1fr;
    }

    .payment-option {
        font-size: 14px;
        padding: 14px 12px;
    }

    .payment-card h3 {
        font-size: 22px;
    }

    .inline-fields {
        grid-template-columns: 1fr;
    }

    .cart-item {
        flex-direction: column;
        align-items: flex-start;
    }
}
