/* Основные стили для интернет-магазина автозапчастей */
/* Версия 5.2 - Обновления: подкатегории в каталоге, меню по центру */

/* Принудительное применение темно-красных цветов */
* {
    --primary-color: #991b1b;
    --primary-hover: #7f1d1d;
}

:root {
    --primary-color: #991b1b !important;
    --primary-hover: #7f1d1d !important;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    --light-color: #fef2f2;
    --dark-color: #651a1a;
    --border-color: #fecaca;
    --text-color: #0f172a;
    --text-muted: #64748b;
    --bg-color: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(220, 38, 38, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(220, 38, 38, 0.15), 0 2px 4px -1px rgba(220, 38, 38, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(220, 38, 38, 0.2), 0 4px 6px -2px rgba(220, 38, 38, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f8fafc;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    max-width: 100vw;
    position: relative;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

/* Header */
.header {
    background: var(--bg-color);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    flex-wrap: nowrap;
    gap: 15px;
}

.header-top .header-search {
    flex: 1;
    max-width: 500px;
    margin: 0 15px;
    display: none;
}

@media (min-width: 769px) {
    .header-top .header-search {
        display: block;
    }
}

.header-top .header-search .search-form {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 0;
    position: relative;
}

.header-top .header-search .search-input {
    flex: 1;
    padding: 8px 15px;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.header-top .header-search .search-input:focus {
    border-color: #991b1b !important;
}

.header-top .header-search .search-btn {
    padding: 8px 16px;
    background: #991b1b !important;
    background-color: #991b1b !important;
    color: white !important;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    flex-shrink: 0;
}

.header-top .header-search .search-btn:hover {
    background: #7f1d1d !important;
}

.header-top .header-search .search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
}

.logo {
    display: flex;
    align-items: center;
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-color);
}

.logo-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    transition: transform 0.3s;
}

.logo-img:hover {
    transform: scale(1.05);
}

.logo-text {
    display: none; /* Скрываем текст, оставляем только логотип */
}

.header-contacts {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.phone-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

.contacts-link {
    color: #991b1b !important;
    text-decoration: none;
    font-size: 14px;
}

/* Search */
.search-container {
    padding: 10px 0;
    border-top: 1px solid var(--border-color);
    display: block;
}

.pp-phone-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(153, 27, 27, 0.08);
    color: #991b1b;
    transition: transform 0.15s ease, background 0.2s ease;
}

.pp-phone-btn:hover {
    background: rgba(153, 27, 27, 0.14);
}

.pp-phone-btn:active {
    transform: scale(0.96);
}

.pp-phone-btn svg {
    width: 20px;
    height: 20px;
}

/* ===== Phone Quick Modal ===== */
.pp-modal {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: none;
}

.pp-modal--open {
    display: block;
}

.pp-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.55);
    backdrop-filter: blur(6px);
}

.pp-modal__dialog {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(92vw, 420px);
    background: #fff;
    border-radius: 14px;
    padding: 18px 16px 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.pp-modal__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.06);
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    color: #0f172a;
}

.pp-modal__title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
    padding-right: 40px;
}

.pp-modal__subtitle {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 14px;
}

.pp-modal__actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pp-modal__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 12px;
    padding: 12px 14px;
    font-weight: 700;
    border: 2px solid transparent;
}

.pp-modal__btn--primary {
    background: #991b1b;
    color: #fff;
}

.pp-modal__messengers {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pp-modal__chip {
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    color: #0f172a;
    background: #fff;
    font-weight: 600;
    font-size: 14px;
}

body.pp-modal-open {
    overflow: hidden;
}

/* ===== Footer mobile accordion + socials ===== */
.pp-footer-social {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.pp-footer-social__title {
    font-size: 13px;
    opacity: 0.85;
    margin-bottom: 8px;
}

.pp-footer-social__row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.pp-footer-social__chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.08);
}

.pp-footer-social__reviews {
    display: inline-flex;
    text-decoration: none;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    opacity: 0.95;
}

.pp-accordion__btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 0;
    border: none;
    background: transparent;
    color: #fff;
    cursor: pointer;
    text-align: left;
}

.pp-accordion__title {
    font-weight: 700;
    font-size: 16px;
}

.pp-accordion__chev {
    opacity: 0.9;
    transform: rotate(0deg);
    transition: transform 0.2s ease;
}

.pp-accordion__content {
    display: none;
    padding-bottom: 12px;
}

.pp-accordion--open .pp-accordion__content {
    display: block;
}

.pp-accordion--open .pp-accordion__chev {
    transform: rotate(180deg);
}

@media (min-width: 769px) {
    .pp-accordion__btn,
    .pp-accordion__content {
        display: block;
    }
    .pp-accordion__chev {
        display: none;
    }
    .pp-accordion__btn {
        cursor: default;
        padding: 0;
    }
}

/* ===== Header desktop extras ===== */
.pp-header-cart {
    margin-left: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    color: #0f172a;
    text-decoration: none;
    background: rgba(153, 27, 27, 0.06);
    position: relative;
}

.pp-header-cart svg {
    width: 22px;
    height: 22px;
}

.pp-header-cart .cart-badge {
    position: absolute;
    top: -4px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

.pp-header-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-left: 16px;
    align-items: flex-start;
}

.pp-header-address {
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: none;
}

.pp-header-address:hover {
    text-decoration: underline;
}

.pp-header-hours {
    font-size: 12px;
    color: var(--text-muted);
    opacity: 0.85;
}

@media (min-width: 769px) {
    .search-container {
        display: none; /* Скрываем отдельный блок поиска на PC */
    }
}

.search-form {
    display: flex;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    align-items: center;
}

.search-form-logo {
    display: none; /* Скрываем логотип в поисковой форме на ПК */
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
    min-width: 0;
    box-sizing: border-box;
}

.search-input:focus {
    border-color: #991b1b !important;
}

.search-btn {
    padding: 10px 18px;
    background: #991b1b !important;
    background-color: #991b1b !important;
    color: white !important;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    flex-shrink: 0;
    box-sizing: border-box;
    min-width: 44px;
}

.search-btn:hover {
    background: #7f1d1d !important;
    background-color: #7f1d1d !important;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 5px;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.search-suggestions.active {
    display: block;
}

.search-suggestions ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.search-suggestions li {
    border-bottom: 1px solid var(--border-color);
}

.search-suggestions li:last-child {
    border-bottom: none;
}

.search-suggestions li a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    text-decoration: none;
    color: var(--text-color);
    transition: background 0.2s;
}

.search-suggestions li a:hover {
    background: var(--light-color);
}

.search-suggestions li a img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

.search-suggestions li a div {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.search-suggestions li a strong {
    font-weight: 600;
    color: var(--text-color);
}

.search-suggestions li a span {
    font-size: 14px;
    color: var(--text-muted);
}

.search-suggestions li a .price {
    font-weight: bold;
    color: #000000 !important;
    font-size: 14px;
}

/* Navigation */
.main-nav {
    border-top: 1px solid var(--border-color);
    padding: 8px 0;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-menu li a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-menu li a:hover {
    color: #991b1b !important;
}

/* Нижнее меню */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 2px solid var(--border-color);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    padding: 10px 0;
}

.bottom-nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.bottom-nav-menu li {
    flex: 1 1 0;
    text-align: center;
    min-width: 0;
    max-width: 100%;
}

.bottom-nav-menu li[style*="display: none"] {
    display: none !important;
}

.bottom-nav-menu li a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 5px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: color 0.3s;
}

.bottom-nav-menu li a:hover {
    color: #991b1b !important;
}

.bottom-nav-menu li a svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

@media (max-width: 768px) {
    .main-nav {
        display: none;
    }
    
    .bottom-nav {
        display: block;
    }
    
    body {
        padding-bottom: 70px;
    }
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-color);
    border-radius: 3px;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 40px 0;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

.section-title {
    font-size: 23px;
    font-weight: bold;
    margin-bottom: 30px;
    text-align: center;
}

/* Categories */
.categories-section {
    margin-bottom: 50px;
}

/* ===== Hero banner ===== */
.hero-banner {
    margin-bottom: 28px;
}

.hero-banner__card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    min-height: 260px;
}

.hero-banner__content {
    padding: 22px;
}

.hero-banner__title {
    font-size: 28px;
    font-weight: 900;
    margin-bottom: 8px;
}

.hero-banner__text {
    color: var(--text-muted);
    margin-bottom: 14px;
}

.hero-banner__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.hero-banner__media {
    background: #eef2f7;
    background-size: 100% 100%;
    position: relative;
    overflow: hidden;
}

.hero-banner__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

@media (min-width: 900px) and (prefers-reduced-motion: no-preference) {
    .hero-banner__media {
        background-size: 220% 220%;
        animation: heroShift 16s ease-in-out infinite;
    }
}

@keyframes heroShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.model-links {
    margin-bottom: 26px;
}

.model-links__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(140px, 1fr));
    gap: 14px;
    max-width: 760px;
    margin: 0 auto;
}

.model-link-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    min-height: 160px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: #fff;
    text-decoration: none;
    color: var(--text-color);
    font-size: 20px;
    font-weight: 900;
    text-align: center;
    overflow: hidden;
    cursor: pointer;
    padding: 0;
}

.model-link-card--toggle {
    width: 100%;
    border: 1px solid var(--border-color);
}

.model-link-card__photo-wrap {
    display: block;
    height: 100px;
    background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
}

.model-link-card__photo-wrap.is-fallback::before {
    content: "Porter";
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #475569;
    font-weight: 800;
}

.model-link-card__photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.model-link-card__title {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    padding: 6px 8px;
}

.model-links-subcats {
    max-width: 760px;
    margin: 10px auto 0;
}

.model-links-subcats__panel {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px;
    background: #fff;
    margin-bottom: 8px;
}

.model-subcats-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.model-subcat-link {
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    padding: 6px 12px;
    text-decoration: none;
    color: #0f172a;
    background: #f8fafc;
    font-size: 14px;
}

.model-subcats-link:hover,
.model-subcat-link:hover {
    border-color: #991b1b;
    color: #991b1b;
}

.model-links-subcats__empty {
    color: #64748b;
    font-size: 14px;
}

.product-favorite-side {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 2px solid #e2e8f0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    line-height: 1;
    color: #64748b;
    z-index: 2;
}

.product-favorite-side.active {
    color: #fff;
    border-color: #991b1b;
    background: #991b1b;
}

.main-image-container .product-favorite-side--detail {
    z-index: 20;
    top: 12px;
    right: 12px;
    width: 48px;
    height: 48px;
    font-size: 26px;
}

@media (max-width: 768px) {
    .hero-banner__card {
        grid-template-columns: 1fr;
    }
    .hero-banner__media {
        height: 120px;
    }
    .hero-banner__title {
        font-size: 18px;
    }
    .model-links__grid { max-width: 100%; }
    .model-link-card {
        min-height: 140px;
        font-size: 18px;
    }
    .model-link-card__photo-wrap { height: 92px; }
    .model-links {
        margin-bottom: 16px;
    }
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

@media (max-width: 768px) {
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
}

.category-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    text-decoration: none;
    color: var(--text-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

@media (hover: hover) and (pointer: fine) {
    .category-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    }
}

.category-card img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
}

.category-placeholder {
    width: 100px;
    height: 100px;
    background: #991b1b !important;
    background-color: #991b1b !important;
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: bold;
}

.category-card h3 {
    font-size: 16px;
    margin: 0;
}

/* Products */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    overflow-x: hidden;
    width: 100%;
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    height: 100%;
    min-height: 0;
}

@media (hover: hover) and (pointer: fine) {
    .product-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-lg);
        border-color: #991b1b !important;
    }
}

.product-link {
    text-decoration: none;
    color: var(--text-color);
}

.product-image {
    position: relative;
    width: 100%;
    height: 200px;
    background: var(--light-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    padding: 15px;
    padding-bottom: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.product-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
}

.product-article {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.product-price {
    font-size: 16px;
    font-weight: bold;
    color: #000000 !important;
    margin-bottom: 10px;
    min-height: 24px;
    display: flex;
    align-items: center;
}

.product-actions-row {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding: 0 15px 15px;
    align-items: center;
}

.btn-cart {
    flex: 1;
    padding: 12px;
    background: #991b1b !important;
    background-color: #991b1b !important;
    color: white !important;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-sizing: border-box;
}

.btn-favorite {
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent !important;
    background-color: transparent !important;
    color: #64748b !important;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-sizing: border-box;
}

.btn-favorite:hover {
    border-color: #991b1b;
    color: #991b1b !important;
    background: rgba(153, 27, 27, 0.05) !important;
    transform: scale(1.05);
}

.btn-favorite.active {
    border-color: #991b1b;
    background: #991b1b !important;
    background-color: #991b1b !important;
    color: white !important;
}

.btn-favorite.active:hover {
    background: #7f1d1d !important;
    background-color: #7f1d1d !important;
    transform: scale(1.05);
}

.btn-cart:hover {
    background: #7f1d1d !important;
    background-color: #7f1d1d !important;
}

.btn-cart:disabled {
    background: var(--secondary-color);
    cursor: not-allowed;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge-out {
    background: var(--danger-color);
    color: white;
    position: absolute;
    top: 10px;
    right: 10px;
}

.badge-success {
    background: var(--success-color);
    color: white;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    border: none;
    font-size: 16px;
    transition: all 0.3s;
    touch-action: manipulation;
}

.btn-primary {
    background: #991b1b !important;
    background-color: #991b1b !important;
    color: white !important;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: #7f1d1d !important;
    background-color: #7f1d1d !important;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

/* Footer */
.footer {
    background: var(--dark-color);
    color: white;
    padding: 40px 0 20px;
    margin-top: 50px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3 {
    margin-bottom: 15px;
    font-size: 18px;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section a {
    color: #adb5bd;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #495057;
    color: #adb5bd;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* Text utilities */
.text-center {
    text-align: center;
}

/* Catalog */
.catalog-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.filters-sidebar {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    height: fit-content;
    position: sticky;
    top: 100px;
    overflow: hidden;
}

.filters-sidebar h2 {
    margin-top: 0;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.filters-sidebar h2 {
    font-size: 20px;
    margin-bottom: 20px;
}

.filter-group {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.filter-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-group h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-color);
}

.filter-select,
.filter-group input[type="number"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.filter-select:focus,
.filter-group input[type="number"]:focus {
    outline: none;
    border-color: #991b1b !important;
}

.price-range {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.price-range input {
    flex: 1;
    min-width: 100px;
}

.price-range span {
    color: var(--text-muted);
    font-weight: 500;
}

.price-info {
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-muted);
    padding: 8px 12px;
    background: var(--light-color);
    border-radius: 6px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 0;
    transition: color 0.2s;
}

.checkbox-label:hover {
    color: #991b1b !important;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #991b1b !important;
}

.subcategories-container {
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.subcategories-container h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.subcategories-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.subcategory-link {
    display: block;
    padding: 8px 12px;
    background: var(--light-color);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 14px;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.subcategory-link:hover {
    background: #991b1b;
    color: white;
    border-color: #991b1b;
}

.products-section {
    flex: 1;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.related-products {
    margin-top: 50px;
    padding-top: 30px;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.catalog-header {
    margin-bottom: 30px;
}

.search-results-info {
    color: var(--text-muted);
    margin-top: 10px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.pagination-link {
    padding: 8px 12px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s;
}

.pagination-link:hover {
    background: #991b1b !important;
    background-color: #991b1b !important;
    color: white;
    border-color: #991b1b !important;
}

.pagination-link.active {
    background: #991b1b !important;
    background-color: #991b1b !important;
    color: white;
    border-color: #991b1b !important;
}

/* Product Detail */
.product-detail {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.breadcrumbs {
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--text-muted);
}

.breadcrumbs a {
    color: #991b1b !important;
    text-decoration: none;
}

.breadcrumbs span {
    margin: 0 8px;
}

.product-gallery {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.main-image {
    width: 100%;
    height: 400px;
    background: var(--light-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    overflow: hidden;
}

.main-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

.main-image img.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.thumbnails {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.thumbnails img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

.thumbnails img:hover {
    border-color: #991b1b !important;
}

.main-image-container {
    position: relative;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(153, 27, 27, 0.85);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.9);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    user-select: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.gallery-nav:hover {
    background: rgba(153, 27, 27, 1);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.gallery-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.gallery-prev {
    left: 15px;
}

.gallery-next {
    right: 15px;
}

.image-counter {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 10;
}

.thumbnail-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumbnail-item:hover {
    border-color: #991b1b !important;
}

.thumbnail-item.active {
    border-color: #991b1b !important;
    border-width: 3px;
}

.product-title {
    font-size: 24px;
    margin-bottom: 15px;
    line-height: 1.3;
}

@media (max-width: 768px) {
    .product-title {
        font-size: 20px;
    }
}

.product-price-block {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: nowrap;
}

.product-stock-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pp-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: #fff;
    color: #0f172a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease;
    font-size: 18px;
    line-height: 1;
}

.pp-icon-btn:hover {
    border-color: #991b1b;
    background: rgba(153, 27, 27, 0.05);
}

.pp-icon-btn:active {
    transform: scale(0.97);
}

.pp-icon-btn svg {
    width: 18px;
    height: 18px;
}

.product-feedback__card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.product-feedback__head {
    padding: 12px 14px;
    font-weight: 800;
    background: rgba(153, 27, 27, 0.06);
    color: #0f172a;
}

.product-feedback__body {
    padding: 14px;
}

.product-price-block .product-price {
    font-size: 24px;
    margin: 0;
    color: #000000 !important;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
}

/* Предотвращение авто-зума на мобильных устройствах */
input[type="text"],
input[type="search"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"],
textarea,
select {
    font-size: 16px !important;
}

@media (max-width: 768px) {
    input[type="text"],
    input[type="search"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px !important;
    }
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #991b1b !important;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 10000;
    animation: slideIn 0.3s ease;
    max-width: 400px;
}

.notification-success {
    background: var(--success-color);
    color: white;
}

.notification-error {
    background: var(--danger-color);
    color: white;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Product Detail Additional Styles */
.product-info {
    flex: 1;
}

.product-description {
    margin: 20px 0;
    padding: 15px;
    background: var(--light-color);
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    max-height: 300px;
    overflow-y: auto;
}

.product-description h3 {
    margin-bottom: 10px;
    font-size: 16px;
}

.product-description p {
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

.product-compatibility {
    margin: 20px 0;
    padding: 15px;
    background: var(--light-color);
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    max-height: 300px;
    overflow-y: auto;
}

.product-compatibility h3 {
    margin-bottom: 10px;
    font-size: 16px;
}

.product-compatibility p {
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

.product-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 5px;
}

.quantity-selector button {
    width: 35px;
    height: 35px;
    border: none;
    background: #991b1b !important;
    background-color: #991b1b !important;
    color: white !important;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.quantity-selector button:hover {
    background: #7f1d1d !important;
    background-color: #7f1d1d !important;
}

.quantity-selector input {
    width: 60px;
    text-align: center;
    border: none;
    font-size: 16px;
    font-weight: 500;
}

.btn-large {
    padding: 15px 30px;
    font-size: 18px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state p {
    font-size: 18px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* Предотвращение горизонтального скролла */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

* {
    max-width: 100%;
    box-sizing: border-box;
}

img, video {
    max-width: 100%;
    height: auto;
}

/* Responsive */
/* Адаптация админ панели для мобильных */
@media (max-width: 768px) {
    .admin-container {
        flex-direction: column;
    }
    
    .admin-sidebar {
        position: relative;
        width: 100%;
        height: auto;
        display: flex;
        flex-wrap: wrap;
        padding: 10px;
    }
    
    .admin-sidebar a {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .admin-main {
        margin-left: 0;
        padding: 15px;
    }
    
    .products-table {
        font-size: 12px;
    }
    
    .products-table th,
    .products-table td {
        padding: 8px 4px;
    }
    
    .products-table th:nth-child(3),
    .products-table td:nth-child(3),
    .products-table th:nth-child(4),
    .products-table td:nth-child(4) {
        display: none;
    }
    
    #bulkActions {
        flex-direction: column;
        gap: 10px;
    }
    
    #bulkActions .btn {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .catalog-layout {
        grid-template-columns: 1fr;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
        gap: 20px;
    }
    
    .filters-sidebar {
        position: static;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    .products-section {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    
    .header-top {
        padding: 8px 0;
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .header-top .header-search {
        display: none; /* Скрываем поиск в header-top на мобильной */
    }
    
    .header-contacts {
        display: none; /* Скрываем контакты на мобильной, чтобы освободить место */
    }
    
    .logo-img {
        width: 50px;
        height: 50px;
    }
    
    .header-top .logo {
        display: none; /* Скрываем логотип в header-top на мобильной */
    }
    
    .search-container {
        padding: 8px 0;
        border-top: 1px solid var(--border-color);
        display: block !important; /* Показываем отдельный блок поиска на мобильной */
        width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    .search-form {
        max-width: 100%;
        width: 100%;
        gap: 8px;
        align-items: center;
        padding: 0 10px;
        box-sizing: border-box;
        overflow: hidden;
    }
    
    .search-form-logo {
        display: flex;
        align-items: center;
        flex-shrink: 0;
    }
    
    .logo-img-mobile {
        width: 50px;
        height: 50px;
        object-fit: contain;
        transition: transform 0.3s;
    }
    
    .logo-img-mobile:hover {
        transform: scale(1.05);
    }
    
    .search-input {
        padding: 8px 12px;
        font-size: 16px !important;
        min-width: 0;
        flex: 1 1 auto;
        box-sizing: border-box;
    }
    
    .search-btn {
        padding: 8px 12px;
        flex-shrink: 0;
        min-width: 44px;
        box-sizing: border-box;
    }
    
    .search-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 10px;
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        padding: 15px;
        z-index: 999;
        max-height: calc(100vh - 200px);
        overflow-y: auto;
    }
    
    .nav-menu.active {
        display: flex;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    .main-nav {
        padding: 6px 0;
        position: relative;
    }
    
    .main-content {
        padding: 20px 0;
        overflow-x: hidden;
        width: 100%;
        max-width: 100%;
    }
    
    .container {
        padding: 0 15px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    .popular-products-section,
    .products-section,
    .related-products {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    
    .popular-products-section .container,
    .products-section .container {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .category-card {
        padding: 12px 8px;
        min-height: auto;
    }
    
    .category-card img,
    .category-placeholder {
        width: 60px;
        height: 60px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .category-card {
        padding: 12px 8px;
    }
    
    .category-card img,
    .category-placeholder {
        width: 60px;
        height: 60px;
    }
    
    .category-card h3 {
        font-size: 12px;
        margin-top: 8px;
        line-height: 1.3;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        max-height: none;
        overflow-y: visible;
        overflow-x: hidden;
        width: 100%;
        box-sizing: border-box;
    }
    
    .popular-products-section {
        overflow-x: hidden;
    }
    
    .products-section {
        overflow-x: hidden;
    }
    
    .related-products {
        overflow-x: hidden;
        margin-top: 50px;
        padding-top: 30px;
    }
    
    .product-card {
        /* Компактные карточки на мобильных */
        min-height: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }
    
    .product-image {
        height: 100px; /* Уменьшаем высоту изображения для 3 рядов */
        min-height: 100px;
    }
    
    .product-info {
        padding: 8px 6px; /* Уменьшаем padding */
        min-height: 0;
        flex: 1;
        display: flex;
        flex-direction: column;
    }
    
    .product-name {
        font-size: 13px !important; /* Уменьшаем размер шрифта для одной строки */
        margin-bottom: 4px !important;
        line-height: 1.1 !important;
        display: block !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        min-height: auto !important;
        max-height: 12px !important;
        height: 12px !important;
    }
    
    .product-card .product-name,
    .related-products .product-name,
    .popular-products-section .product-name {
        font-size: 13px !important;
        line-height: 1.1 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-height: 12px !important;
        height: 12px !important;
    }
    
    .product-article {
        font-size: 11px;
        margin-bottom: 4px;
        line-height: 1.2;
    }
    
    .product-price {
        font-size: 14px;
        font-weight: 600;
        margin-bottom: 6px;
        min-height: 20px; /* Фиксируем высоту цены */
        display: flex;
        align-items: center;
        color: #000000 !important;
    }
    
    .product-actions-row {
        gap: 6px;
        padding: 0 8px 8px;
    }
    
    .btn-cart {
        padding: 8px 10px;
        font-size: 13px;
        min-height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }
    
    .btn-favorite {
        width: 36px;
        height: 36px;
        padding: 0;
        font-size: 18px;
        border-width: 1.5px;
    }
    
    .product-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .quantity-selector {
        justify-content: center;
    }
    
    .btn-large {
        width: 100%;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .gallery-nav {
        width: 45px;
        height: 45px;
        font-size: 26px;
    }
    
    .gallery-prev {
        left: 10px;
    }
    
    .gallery-next {
        right: 10px;
    }
    
    .main-image {
        height: 300px;
    }
    
    .thumbnails {
        gap: 8px;
    }
    
    .thumbnails img,
    .thumbnail-item {
        width: 60px;
        height: 60px;
    }
    
    .image-counter {
        bottom: 10px;
        right: 10px;
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* ===== ЧАТ ВИДЖЕТ ===== */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.chat-button {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    position: relative;
    color: white;
}

.chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6);
}

.chat-button.active {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    border-radius: 12px;
    min-width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    padding: 0 6px;
    border: 2px solid white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.chat-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    height: 600px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chat-header-info h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.chat-header-info .chat-status {
    font-size: 12px;
    opacity: 0.9;
    display: block;
    margin-top: 4px;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 75%;
    animation: slideIn 0.3s ease;
}

.chat-message-user {
    align-self: flex-end;
}

.chat-message-admin {
    align-self: flex-start;
}

.chat-message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.chat-message-user .chat-message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.chat-message-name {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    opacity: 0.9;
}

.chat-message-text {
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 6px;
}

.chat-input-container {
    padding: 16px;
    background: white;
    border-top: 1px solid #e9ecef;
}

.chat-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: #667eea;
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chat-send-btn:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.chat-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .chat-widget {
        bottom: 90px;
        right: 15px;
    }
    
    .chat-button {
        width: 56px;
        height: 56px;
    }
    
    .chat-window {
        bottom: 155px;
        right: 15px;
        left: 15px;
        width: auto;
        height: 50vh;
        max-height: 450px;
    }
    
    .chat-message {
        max-width: 85%;
    }
    
    .chat-header {
        padding: 14px 16px;
    }
    
    .chat-header-info h3 {
        font-size: 16px;
    }
    
    .chat-messages {
        padding: 16px;
    }
    
    .chat-input-container {
        padding: 12px;
    }
    
    .chat-send-btn {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .chat-window {
        height: 75vh;
    }
    
    .chat-message {
        max-width: 90%;
    }
}

/* Telegram button styles */
a[href*="t.me"] {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: #0088cc;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    transition: background 0.3s ease, transform 0.2s ease;
}

a[href*="t.me"]:hover {
    background: #006ba3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 136, 204, 0.3);
}

a[href*="t.me"]:active {
    transform: translateY(0);
}

a[href*="t.me"] svg {
    flex-shrink: 0;
}