:root {
    --primary-red: #DB141E;
    --primary-red-hover: #b91019;
    --text-color: #171A1C;
    --text-secondary: #8C99A9;
    --bg-body: #F4F5F6;
    --bg-white: #FFFFFF;
    --border-color: #E1E5E9;
    --font-main: 'Inter', Helvetica, Arial, sans-serif;
    --container-width: 1200px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--text-color);
    line-height: 1.5;
    font-size: 14px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

ul {
    list-style: none;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 15px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: var(--primary-red);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-red-hover);
}

/* Header Specifics */
header {
    background-color: var(--bg-white);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-bar {
    background-color: #f4f5f6;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    padding: 8px 0;
    color: #59606b;
}

.top-bar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-right {
    display: flex;
    gap: 20px;
}

.top-link {
    display: flex;
    align-items: center;
    gap: 6px;
}

.top-link:hover,
.top-phone:hover {
    color: var(--primary-red);
}

.top-phone {
    font-weight: 600;
    color: var(--text-color);
}

.main-header {
    padding: 15px 0;
    background: white;
}

.main-header-inner {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
}

.logo-kz {
    color: var(--primary-red);
}

.catalog-btn {
    background-color: var(--primary-red);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

/* Homepage Styles */
.hero-section {
    margin-bottom: 30px;
    background: #e9eaec;
    padding: 40px 0;
    /* Placeholder gradient until image is set */
    background: linear-gradient(135deg, #f4f5f6 0%, #e1e5e9 100%);
}

.hero-banner {
    background-color: white;
    border-radius: 8px;
    padding: 60px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.hero-text h1 {
    font-size: 36px;
    margin-bottom: 10px;
    color: var(--text-color);
}

.hero-text p {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 25px;
}

.categories-section h2 {
    font-size: 24px;
    margin-bottom: 20px;
    font-weight: 700;
}

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

.category-card {
    background: white;
    border-radius: 8px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
    height: 160px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    color: var(--primary-red);
}

.cat-icon {
    font-size: 40px;
    color: #8C99A9;
    transition: color 0.2s;
}

.category-card:hover .cat-icon {
    color: var(--primary-red);
}

.cat-title {
    font-weight: 600;
    font-size: 16px;
}

/* Footer Styles (Placeholder for next step) */
footer {
    background-color: white;
    padding: 40px 0;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
}

.catalog-btn:hover {
    background-color: var(--primary-red-hover);
}

.search-wrapper {
    flex-grow: 1;
    display: flex;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-size: 15px;
    height: 44px;
    outline: none;
    transition: border 0.2s;
}

.search-input:focus {
    border-color: var(--primary-red);
}

.search-btn {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 50px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #59606b;
}

.search-btn:hover {
    color: var(--primary-red);
}

.user-actions {
    display: flex;
    gap: 20px;
    margin-left: 10px;
}

.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 11px;
    color: var(--text-color);
    gap: 4px;
    min-width: 50px;
}

.action-item i {
    font-size: 20px;
    color: #59606b;
    margin-bottom: 2px;
}

.action-item:hover {
    color: var(--primary-red);
}

.cart-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Styles */
.mobile-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 10px;
    color: #8C99A9;
    gap: 4px;
}

.mobile-nav .nav-item i {
    font-size: 20px;
}

.mobile-nav .nav-item:hover,
.mobile-nav .nav-item.active {
    color: var(--primary-red);
}

@media (max-width: 768px) {
    .top-bar {
        display: none;
    }

    .main-header-inner {
        flex-wrap: wrap;
        gap: 10px;
    }

    .search-wrapper {
        order: 3;
        width: 100%;
        margin-top: 10px;
    }

    .user-actions {
        display: none;
    }

    /* Show in bottom nav instead */
    .mobile-nav {
        display: flex !important;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

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

    .catalog-sidebar {
        display: none;
    }

    /* Hide filters on mobile for now */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .product-detail-layout {
        grid-template-columns: 1fr !important;
        padding: 20px !important;
    }

    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    body {
        padding-bottom: 60px;
    }

    /* Space for bottom nav */
}

/* Catalog Styles */
.catalog-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
    align-items: start;
}

.catalog-sidebar {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.filter-title {
    font-size: 18px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.filter-group {
    margin-bottom: 25px;
}

.filter-group h4 {
    font-size: 14px;
    margin-bottom: 10px;
    color: var(--text-color);
}

.filter-group ul li {
    margin-bottom: 8px;
}

.filter-group ul li a {
    color: var(--text-secondary);
    font-size: 14px;
}

.filter-group ul li a:hover {
    color: var(--primary-red);
}

/* Sidebar Categories */
.cat-item {
    margin-bottom: 5px;
}

.cat-link {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    color: var(--text-color);
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s;
}

.cat-link:hover {
    background: #f4f5f6;
    color: var(--primary-red);
}

.cat-link.active {
    background: #fff0f0;
    color: var(--primary-red);
    font-weight: 600;
}

.cat-link i {
    width: 20px;
    margin-right: 8px;
    color: #8C99A9;
}

.cat-link.active i {
    color: var(--primary-red);
}

.sub-cat-list {
    padding-left: 28px;
    display: none;
}

.cat-item.expanded .sub-cat-list {
    display: block;
}

.cat-toggle {
    margin-left: auto;
    font-size: 10px;
    color: #8C99A9;
    cursor: pointer;
    padding: 5px;
}

.price-inputs {
    display: flex;
    gap: 10px;
}

.price-inputs input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.product-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid transparent;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    border-color: var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.product-image {
    text-align: center;
    margin-bottom: 15px;
}

.product-image img {
    max-width: 100%;
    height: 150px;
    object-fit: contain;
}

.product-rating {
    font-size: 12px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.product-seller {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    background: #f4f5f6;
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
}

.product-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
    display: block;
    line-height: 1.4;
    height: 40px;
    overflow: hidden;
    color: var(--text-color);
}

.product-title:hover {
    color: var(--primary-red);
}

.product-bottom {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-price {
    font-size: 18px;
    font-weight: 700;
}

.btn-cart {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 4px;
}

/* Redesigned Categories */
.categories-new-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 50px;
}

.category-card-new {
    position: relative;
    height: 180px;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    background-size: cover;
    background-position: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-card-new::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.1));
    z-index: 1;
}

.category-card-new:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.cat-content-new {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 2;
    color: white;
}

.cat-icon-new {
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--primary-red);
}

.cat-title-new {
    font-size: 18px;
    font-weight: 700;
    display: block;
}

/* Swiper Carousel Styles */
.swiper {
    width: 100%;
    padding-bottom: 40px !important;
    /* Space for pagination/scrollbar if needed */
}

.swiper-slide {
    height: auto;
    /* Full height for flex cards */
}

.section-dynamic {
    position: relative;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.swiper-button-next,
.swiper-button-prev {
    color: var(--primary-red) !important;
    background: white;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.swiper-button-next::after,
.swiper-button-prev::after {
    font-size: 18px !important;
    font-weight: bold;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .categories-new-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* New Product Card Styles */
.product-card:hover .btn-cart-action {
    background: var(--primary-red) !important;
    color: white !important;
}

.product-card:hover .product-title {
    color: var(--primary-red) !important;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    background: var(--primary-red) !important;
    color: white !important;
    border-color: var(--primary-red) !important;
}