/* Kaspi.kz Style Mobile-First Design */
:root {
    --kaspi-red: #0f46b9;
    --kaspi-blue: #0984e3;
    --kaspi-dark: #2d3436;
    --kaspi-gray: #636e72;
    --kaspi-light-gray: #ddd;
    --kaspi-bg: #f8f9fa;
    --kaspi-white: #ffffff;
    --kaspi-success: #00b894;
    --kaspi-warning: #fdcb6e;
    
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.15);
    
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background-color: var(--kaspi-bg);
    color: var(--kaspi-dark);
    margin: 0;
    padding: 0;
    line-height: 1.4;
    overflow-x: hidden;
    padding-bottom: 80px; /* For bottom navigation */
}
.product-link {
    text-decoration: none;
    color: inherit;
    display: block; /* Для корректного клика по всей области слайдера */
}

.product-name-link {
    text-decoration: none;
    color: inherit;
}

.product-name-link:hover {
    color: var(--kaspi-red); /* Подсветка при наведении */
}
/*Стил для рейтинга*/
.product-rating {
            display: flex;
            align-items: center;
            gap: 4px;
            font-size: var(--font-size-sm);
            color: #333;
			padding-bottom: 5px;
        }
        .product-rating .star {
            color: #ff9900; /* Желтый цвет звезды, как у Amazon */
            font-size: 1em;
        }
        .product-rating .rating-value {
            font-weight: 500;
            color: #333;
        }
        .product-rating .review-count {
            color: #666;
            font-size: var(--font-size-sm);
        }
        .product-rating .review-icon {
            font-size: 1em;
            color: #666;
        }
/*Стил для рейтинга*/		
/* Mobile-first responsive design */
.container {
    max-width: 100%;
    padding: 0 16px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .container {
        max-width: 540px;
    }
}

@media (min-width: 992px) {
    .container {
        max-width: 992px;
    }
}
/* Управление видимостью корзины */
.desktop-only {
    display: none;
}

.mobile-only {
    display: block;
}

@media (min-width: 768px) {
    .desktop-only {
        display: block;
		margin-top: 10px;
    }
    .mobile-only {
        display: none;
    }
    .bottom-nav {
        display: none;
    }
}

@media (max-width: 767px) {
    .desktop-only {
        display: none;
    }
    .mobile-only {
        display: block;
    }
    .bottom-nav {
        display: block;
    }
}
/* Header Styles */
.kaspi-header {
    background: var(--kaspi-white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 12px 0;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.kaspi-logo {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--kaspi-red);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.header-btn {
    background: none;
    border: none;
    color: var(--kaspi-gray);
    font-size: 1.2rem;
    padding: 8px;
    border-radius: var(--border-radius-sm);
    position: relative;
    transition: all 0.2s ease;
}

.header-btn:hover {
    background: var(--kaspi-bg);
    color: var(--kaspi-red);
}

.header-btn .badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--kaspi-red);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

/* Search Bar */
.search-container {
    padding: 16px 0;
    background: var(--kaspi-white);
}

.search-form {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    border: 1px solid var(--kaspi-light-gray);
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    background: var(--kaspi-bg);
    color: var(--kaspi-dark);
}

.search-input:focus {
    outline: none;
    border-color: var(--kaspi-red);
    background: var(--kaspi-white);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--kaspi-gray);
    font-size: var(--font-size-lg);
}

/* Category Pills */
.categories-scroll {
    display: flex;
    gap: 8px;
    padding: 16px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    justify-content: space-between;
    overflow-x: auto;  
    -webkit-overflow-scrolling: touch; 
}

.categories-scroll::-webkit-scrollbar {
    display: none;
}

.category-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
    padding: 0px 0px;
    background: var(--kaspi-white);
	border-radius: 20px 20px 0px 0px;
    text-decoration: none;
    color: var(--kaspi-dark);
    font-size: var(--font-size-xs);
    font-weight: 500;
    transition: all 0.2s ease;
    text-align: center;
	background: var(--kaspi-bg);
	
}

.category-pill:hover {
    background: var(--kaspi-red);
    color: var(--kaspi-white);
    transform: translateY(-2px);
}

.category-pill i {
    font-size: 1.2rem;
    margin-bottom: 2px;
}

.category-pill .count {
    font-size: 0.65rem;
    opacity: 0.7;
}

/* Banner Slider */
.banner-slider {
    position: relative;
    margin: 16px 0;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.banner-slide {
    position: relative;
    height: 180px;
    background: linear-gradient(135deg, var(--kaspi-red), var(--kaspi-blue));
    display: flex;
    align-items: center;
    padding: 24px;
    color: white;
    background-size: cover;
    background-position: center;
}

.banner-content {
    z-index: 2;
    position: relative;
}

.banner-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin-bottom: 4px;
}

.banner-subtitle {
    font-size: var(--font-size-sm);
    opacity: 0.9;
}

.banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, rgba(214, 48, 49, 0.8), rgba(9, 132, 227, 0.6));
    pointer-events: none; /* 🔒 Не перехватывает клики */
}

/* Product Grid */
.products-section {
    padding: 16px 0;
}

.section-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--kaspi-dark);
}

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

/* Product Card - Kaspi Style */
.product-card {
    background: var(--kaspi-white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    position: relative;
}

.product-image-container {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--kaspi-bg);
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.favorite-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--kaspi-gray);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.favorite-btn:hover,
.favorite-btn.active {
    background: var(--kaspi-red);
    color: white;
}

.product-info {
    padding: 12px;
}

.product-brand {
    font-size: var(--font-size-xs);
    color: var(--kaspi-gray);
    margin-bottom: 4px;
    font-weight: 500;
}

.product-name {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--kaspi-dark);
    margin-bottom: 8px;
    line-height: 1.3;
    height: 2.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-price {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--kaspi-red);
    margin-bottom: 8px;
}

.product-installment {
    background: var(--kaspi-bg);
    padding: 6px 8px;
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-xs);
    color: var(--kaspi-gray);
    margin-bottom: 12px;
}

.product-actions {
    /*display: flex;*/
    gap: 8px;
}

.btn-kaspi {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

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

.btn-primary:hover {
    background: #0f46b9;
}

.btn-outline {
    background: transparent;
    color: var(--kaspi-red);
    border: 1px solid var(--kaspi-red);
}

.btn-outline:hover {
    background: var(--kaspi-red);
    color: white;
}
/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--kaspi-white);
    border-top: 1px solid var(--kaspi-light-gray);
    z-index: 9999;
    padding: 8px 0;
}

.nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 4px;
    text-decoration: none;
    color: var(--kaspi-gray);
    font-size: 10px;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    flex: 1;
    text-align: center;
}

.nav-item.active {
    color: var(--kaspi-red);
}

.nav-item i {
    font-size: 1.2rem;
}

.nav-item .badge {
    position: absolute;
    top: 4px;
    right: 8px;
    background: var(--kaspi-red);
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

/* Loading and Empty States */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 0;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--kaspi-light-gray);
    border-top: 3px solid var(--kaspi-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-state i {
    font-size: 3rem;
    color: var(--kaspi-light-gray);
    margin-bottom: 16px;
}

.empty-state h3 {
    color: var(--kaspi-gray);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--kaspi-gray);
    font-size: var(--font-size-sm);
}

/* Animations */
.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Modal and Toast */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
   /* transform: translateX(-50%);*/
    background: var(--kaspi-dark);
    color: white;
    padding: 12px 20px;
    border-radius: var(--border-radius);
    font-size: var(--font-size-sm);
    z-index: 2000;
    animation: slideUp 0.3s ease-out;
}

.toast.success {
    background: var(--kaspi-success);
}

.toast.error {
    background: var(--kaspi-red);
}

/* Responsive Design */
@media (min-width: 768px) {
    .container {
        padding: 0 24px;
    }
    
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
    
    .banner-slide {
        height: 220px;
        padding: 32px;
    }
    
    .bottom-nav {
        display: none;
    }
    
    body {
        padding-bottom: 0;
    }
}

@media (min-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }

.justify-center { justify-content: center; }
.align-center { align-items: center; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }

.font-weight-bold { font-weight: 700; }
.font-weight-medium { font-weight: 500; }
.font-weight-normal { font-weight: 400; }

.text-red { color: var(--kaspi-red); }
.text-gray { color: var(--kaspi-gray); }
.text-dark { color: var(--kaspi-dark); }