/* ============================================
   abis.md - Main Stylesheet
   ============================================ */

:root {
    --primary: #3b5998;
    --primary-hover: #29487d;
    --primary-dark: #29487d;
    --text-dark: #333;
    --text-muted: #666;
    --border-color: #E5E5E5;
    --bg-light: #F8F9FA;
}

html {
    min-height: 100%;
}

body {
    font-family: 'Open Sans', sans-serif;
    color: var(--text-dark);
    background: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   Header
   ============================================ */
.header {
    padding: 15px 0;
    background: var(--primary);
}

.logo {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
}
.logo span {
    color: #dfe3ee;
}

.top-phone {
    border: 1px solid rgba(255,255,255,0.6);
    color: #fff;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    margin-left: 20px;
}
.top-phone:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

/* ============================================
   Search
   ============================================ */
.search-wrapper {
    display: flex;
    align-items: stretch;
    height: 46px;
    max-width: 550px;
    border-radius: 23px;
    overflow: hidden;
}

.btn-catalog {
    background: var(--primary-dark);
    color: #fff;
    border: none;
    padding: 0 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    border-radius: 0;
}
.btn-catalog:hover {
    background: #1d3a6b;
    color: #fff;
}
.btn-catalog i {
    font-size: 16px;
}

.search-input {
    border: none;
    padding: 0 16px;
    flex: 1;
    min-width: 0;
    outline: none;
    background: #fff;
    font-size: 14px;
    height: 100%;
    border-radius: 0;
}
.search-input:focus {
    box-shadow: none;
    background: #fff;
}
.search-input::placeholder {
    color: #999;
}

.btn-history {
    background: var(--primary-dark);
    color: #fff;
    border: none;
    border-left: 1px solid rgba(255,255,255,0.15);
    width: 46px;
    height: 100%;
    flex-shrink: 0;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-history:hover {
    background: #1d3a6b;
    color: #fff;
}

/* ============================================
   Header Icons
   ============================================ */
.header-icons {
    display: flex;
    align-items: center;
    gap: 20px;
}
.header-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(255,255,255,0.5);
    color: #fff;
    padding: 5px 12px;
    border-radius: 18px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.header-login-btn:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}
.header-icons .btn-icon {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 18px;
    position: relative;
    padding: 0;
}
.header-icons .btn-icon:hover {
    color: #dfe3ee;
}

.lang-switch {
    font-weight: 600;
    color: #fff;
    cursor: pointer;
}
.lang-switch:hover {
    color: #dfe3ee;
}

.dropdown-toggle::after {
    display: none;
}

/* ============================================
   Main Layout
   ============================================ */
.main-content {
    padding: 30px 0;
    flex: 1 0 auto;
}

/* ============================================
   Auth Card (Sidebar)
   ============================================ */
.auth-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    padding: 25px;
}
.auth-card h4 {
    text-align: center;
    margin-bottom: 20px;
    font-weight: 600;
}
.auth-card .form-control {
    border-radius: 8px;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
}
.auth-card .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(51,102,255,0.1);
}

.input-password {
    position: relative;
}
.input-password .toggle-pass {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

.btn-login {
    background: var(--primary);
    color: #fff;
    border: none;
    width: 100%;
    padding: 12px;
    border-radius: 25px;
    font-weight: 600;
}
.btn-login:hover {
    background: var(--primary-hover);
    color: #fff;
}

.social-login {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
}
.social-login a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.social-login .google { color: #DB4437; }
.social-login .facebook { color: #4267B2; }

/* ============================================
   Banner Slider
   ============================================ */
.banner-slider {
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    height: 220px;
    background: linear-gradient(135deg, #4A90E2 0%, #7B68EE 100%);
}
.banner-slider img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: rgba(255,255,255,0.7);
}
.banner-placeholder i {
    font-size: 48px;
    margin-bottom: 10px;
}
.banner-placeholder span {
    font-size: 18px;
    font-weight: 600;
}

.slider-dots {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}
.slider-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
}
.slider-dots span.active {
    background: #fff;
}

/* ============================================
   Info Blocks
   ============================================ */
.info-blocks {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 25px;
}
.info-block {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    padding: 25px;
}
.info-block h5 {
    font-weight: 700;
    margin-bottom: 10px;
}
.info-block p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 0;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}
.info-item:hover {
    color: var(--primary-hover);
}
.info-item .icon {
    width: 50px;
    height: 50px;
    background: var(--bg-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.info-item .icon img {
    width: 30px;
    height: 30px;
}

/* ============================================
   Car Brands
   ============================================ */
.car-brands {
    margin-top: 50px;
    text-align: center;
}
.car-brands h2 {
    font-weight: 700;
    margin-bottom: 30px;
}

.brands-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    padding: 30px;
}

.brands-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
}

.brand-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 10px;
    border-radius: 10px;
    background: var(--bg-light);
    text-decoration: none;
    color: var(--text-dark);
    transition: all 0.2s ease;
    border: 2px solid transparent;
}
.brand-item:hover {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 4px 15px rgba(51,102,255,0.15);
    transform: translateY(-2px);
}
.brand-item img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin-bottom: 10px;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all 0.2s ease;
}
.brand-item:hover img {
    filter: grayscale(0%);
    opacity: 1;
}
.brand-item span {
    font-size: 13px;
    font-weight: 600;
}

.btn-all-brands {
    background: var(--primary);
    color: #fff;
    padding: 10px 25px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-all-brands:hover {
    background: var(--primary-hover);
    color: #fff;
}

/* ============================================
   Footer
   ============================================ */
.footer {
    margin-top: 50px;
    padding: 32px 0 0;
    background: var(--primary);
    border-top: 3px solid var(--primary-dark);
    flex-shrink: 0;
}
.footer-menu h6 {
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    margin-bottom: 15px;
    color: #fff;
}
.footer-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-menu ul li {
    margin-bottom: 8px;
}
.footer-menu ul li a {
    color: #c3cce0;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.15s;
}
.footer-menu ul li a:hover {
    color: #fff;
    text-decoration: underline;
}

.footer-bottom {
    border-top: 1px solid #4a69a8;
    padding: 18px 0;
    margin-top: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.footer-bottom span {
    font-size: 13px;
    color: #9fadd0;
}

.footer-social a {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    color: #fff;
    text-decoration: none;
    transition: all 0.2s;
}
.footer-social a:hover {
    background: #1d3a6b;
    color: #fff;
}

/* ============================================
   Floating Buttons
   ============================================ */
.btn-floating {
    position: fixed;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 1000;
}
.btn-scroll-top {
    bottom: 80px;
    background: #fff;
    color: var(--text-dark);
}
.btn-contact {
    bottom: 20px;
    background: var(--primary);
    color: #fff;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 991px) {
    .info-blocks {
        grid-template-columns: 1fr;
    }
    .search-wrapper {
        max-width: 100%;
    }
    .brands-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 767px) {
    /* Хедер: каждая секция на свою строку, на всю ширину */
    .header .row {
        row-gap: 10px;
    }
    .header .row > .col,
    .header .row > .col-auto {
        flex: 0 0 100%;
        max-width: 100%;
    }
    .header .col-auto:first-child > .d-flex {
        justify-content: space-between;
    }
    .top-phone {
        margin-left: 0;
    }
    .search-wrapper {
        height: 44px;
    }
    /* «Каталог авто» -> только иконка, чтобы поле ввода влезло */
    .btn-catalog span {
        display: none;
    }
    .btn-catalog {
        padding: 0 16px;
    }
    .header-icons {
        justify-content: flex-start;
        gap: 22px;
    }

    .sidebar {
        margin-bottom: 30px;
    }

    /* Гостевую форму входа (sidebar) прячем на мобиле — вход через кнопку в хедере -> /login.
       Панель залогиненного (.user-panel) и рекламные баннеры в сайдбаре остаются. */
    .sidebar .auth-card:not(.user-panel) {
        display: none;
    }
}

@media (max-width: 575px) {
    .brands-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .logo {
        font-size: 24px;
    }
    .top-phone {
        font-size: 13px;
        padding: 6px 12px;
    }
}
