/* style.css */
:root {
    --kaspi-red: #f14635;
    --kaspi-red-hover: #d93b2b;
    --bg-gray: #fbfbfb;
    --text-main: #333333;
    --text-muted: #999999;
    --border-color: #e5e5e5;
    --yellow-badge: #fcf5d2;
    --whatsapp-green: #25d366;
}

body {
    font-family: 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-gray);
    color: var(--text-main);
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

/* Header */
.header-top {
    background: var(--bg-gray);
    color: var(--text-muted);
    padding: 6px 0;
    font-size: 12px;
    border-bottom: 1px solid var(--border-color);
}

.header-main {
    background: white;
    box-shadow: 0 1px 0 rgba(0,0,0,0.08);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--kaspi-red);
    text-decoration: none;
    letter-spacing: -0.5px;
    white-space: nowrap;
}

/* Поиск */
.search-input {
    background: #fdfdfd;
    border: 2px solid var(--kaspi-red);
    border-radius: 8px 0 0 8px;
    height: 40px; /* Чуть компактнее */
    font-size: 14px;
    box-shadow: none !important;
}

.search-btn {
    background: var(--kaspi-red);
    color: white;
    border: 2px solid var(--kaspi-red);
    border-radius: 0 8px 8px 0;
    height: 40px;
    width: 50px;
    transition: background 0.2s;
}

.search-btn:hover {
    background: var(--kaspi-red-hover);
    border-color: var(--kaspi-red-hover);
}

/* Кнопка WhatsApp (Вместо корзины) */
.btn-consultant {
    border: 1px solid var(--whatsapp-green);
    color: var(--whatsapp-green);
    background: white;
    border-radius: 20px;
    padding: 6px 16px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-consultant:hover {
    background: var(--whatsapp-green);
    color: white;
}

/* Sidebar */
.sidebar-wrapper {
    background: white;
    border-radius: 8px;
    padding: 10px 0;
}

.accordion-button {
    font-size: 14px;
    font-weight: 500;
    padding: 12px 16px;
    color: var(--text-main);
    background: white !important;
    box-shadow: none !important;
}

.accordion-button:not(.collapsed) {
    color: var(--kaspi-red);
}

.sidebar-link {
    display: block;
    padding: 8px 16px 8px 32px;
    font-size: 13px;
    color: #666;
    text-decoration: none;
    transition: 0.2s;
}

.sidebar-link:hover {
    color: var(--kaspi-red);
    background: #fff5f5;
}

/* Product Card */
.product-card {
    background: white;
    border: 1px solid transparent;
    border-radius: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
    height: 100%;
    position: relative;
    padding: 12px;
}

.product-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
    z-index: 2;
}

.card-img-wrapper {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.card-img-top {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.card-title {
    font-size: 13px;
    line-height: 1.4;
    height: 38px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 8px;
    color: var(--text-main);
}

/* Рейтинг */
.rating {
    font-size: 11px;
    color: #ffc107;
    margin-bottom: 8px;
}
.rating span { color: #999; margin-left: 4px; }

/* Рассрочка */
.installment-badge {
    display: inline-block;
    background: var(--yellow-badge);
    color: var(--text-main);
    font-weight: 600;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 4px;
}

.price {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.stock-status {
    font-size: 11px;
    color: #28a745;
    margin-bottom: 8px;
}

.btn-kaspi {
    background: var(--kaspi-red);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    width: 100%;
    padding: 8px 0;
    transition: 0.2s;
}

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

/* Slider Categories */
.categories-slider {
    overflow-x: auto;
    white-space: nowrap;
    padding: 4px 0 14px 0;
    scrollbar-width: none;
}
.categories-slider::-webkit-scrollbar { display: none; }

.cat-pill {
    display: inline-block;
    padding: 8px 16px;
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 20px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 13px;
    margin-right: 8px;
    transition: 0.2s;
}
.cat-pill:hover { background: #f0f0f0; }
.cat-pill.active {
    background: #eef1f9;
    color: var(--kaspi-red);
    border-color: transparent;
    font-weight: 600;
}

/* Product Detail */
.product-detail-container {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.detail-price-block {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
}

/* Mobile Fixes */
@media (max-width: 768px) {
    .card-img-wrapper { height: 130px; }
    .price { font-size: 15px; }
    .header-main { padding: 10px 0; }
    .product-detail-container { padding: 16px; }
    
    /* Скрываем текст кнопки WhatsApp на совсем маленьких экранах, оставляем иконку */
    .btn-consultant span { display: none; }
    .btn-consultant { padding: 6px 10px; border-radius: 8px; }
    .btn-consultant i { font-size: 18px; margin: 0; }
}

@media (min-width: 380px) {
     /* Если экран чуть шире, показываем текст */
     .btn-consultant span { display: inline; }
     .btn-consultant { border-radius: 20px; padding: 6px 16px; }
}