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

:root {
    --primary-dark: #0f172a;       
    --primary-accent: #3b82f6;     
    --secondary-accent: #f97316;   
    --text-light: #f8fafc;
    --text-dark: #334155;
    --bg-light: #f1f5f9;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* HEADER */
header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: var(--text-light);
    padding: 0 5%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.logo {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 1px;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo2 {
    width: 85px;
    border-radius: 20px;
    letter-spacing: 1px;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    color: var(--secondary-accent);
}

.nav-menu {
    display: flex;
    gap: 30px;
}

.nav-menu a {
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    font-size: 16px;
}

.nav-menu a:hover {
    color: var(--primary-accent);
}

.btn-reg {
    background-color: var(--primary-accent);
    color: white;
    padding: 10px 25px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn-reg:hover {
    background-color: transparent;
    border-color: var(--primary-accent);
    color: var(--primary-accent);
}

.auth-buttons { display:flex; gap:12px; align-items:center; }
.nav-user { color: #cbd5e1; margin-right: 12px; font-weight:600; }

/* MAIN */
main {
    flex: 1;
}

/* Обновленный контейнер поисковой строки */
.search-bar {
    display: flex;
    align-items: center;
    background: #ffffff;
    padding: 6px; /* Маленький паддинг, чтобы кнопка была почти в край */
    padding-left: 20px; /* Отступ для первого текста */
    border-radius: 100px; 
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    max-width: 900px;
    width: 95%; 
    margin: 40px auto; 
    border: 1px solid #ececec;
    transition: all 0.3s ease;
}

/* Общие стили для полей */
.search-bar input, 
.search-bar select {
    border: none;
    outline: none;
    padding: 12px 15px;
    background: transparent;
    font-size: 14px;
    color: var(--text-dark);
    border-right: 1px solid #f0f0f0; /* Тонкие разделители */
}

/* Убираем разделитель у последнего инпута перед кнопкой */
#max_price {
    border-right: none;
}

/* Настройка пропорций полей */
#query { flex: 2.5; }
#category { flex: 1.2; cursor: pointer; }
#min_price, #max_price { flex: 0.8; width: 80px; }

/* Кнопка поиска ТЕПЕРЬ ВНУТРИ */
#search-btn {
    background: var(--primary-accent);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 100px; /* Овальная кнопка */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 10px; /* Небольшой отступ от полей */
    white-space: nowrap;
}

#search-btn:hover {
    background: #2563eb;
    transform: scale(1.05);
}

/* Адаптация под мобилки (улучшенная) */
@media (max-width: 768px) {
    .search-bar {
        flex-direction: column;
        border-radius: 24px;
        padding: 15px;
        gap: 0;
    }

    .search-bar input,
    .search-bar select {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #eee;
        padding: 15px 5px;
    }

    #search-btn {
        width: 100%;
        margin-left: 0;
        margin-top: 15px;
        padding: 15px;
    }
}

#max_price {
border-right: none;
}


#query { flex: 2; } 
#category { flex: 1; cursor: pointer; }
#min_price, #max_price { flex: 0.8; }


#search-btn {
background: #2563eb; 
color: white;
border: none;
padding: 15px 35px;
border-radius: 40px;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
margin-left: 50px;
}

#search-btn:hover {
background: #1d4ed8;
transform: scale(1.02);
box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Адаптация под мобильные устройства */
@media (max-width: 768px) {
.search-bar {
flex-direction: column;
border-radius: 20px;
padding: 15px;
gap: 10px;
}

.search-bar input,
.search-bar select {
width: 100%;
border-right: none;
border-bottom: 1px solid #eee;
}

#search-btn {
width: 100%;
margin-left: 0;
margin-top: 10px;
}

}


.hero-section {
    background: linear-gradient(to bottom, #1e293b 0%, var(--bg-light) 100%);
    padding: 60px 5% 40px;
    text-align: center;
    margin-bottom: 20px;
}

.hero-title {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hero-subtitle {
    color: #d3dce9;
    margin-bottom: 30px;
}

.listings-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 60px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.car-card {
    display: flex;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    height: 250px;
}

.car-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.car-image {
    width: 35%;
    position: relative;
}

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

.car-details {
    width: 65%;
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.car-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.car-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 5px;
}

.car-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary-accent);
}

.car-meta {
    display: flex;
    gap: 20px;
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.car-meta span i {
    margin-right: 5px;
}

.car-desc {
    color: #475569;
    font-size: 0.95rem;
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.car-actions {
    margin-top: 15px;
    display: flex;
    justify-content: flex-end;
    gap: 10px; 
}

.btn-details {
    padding: 10px 20px;
    background-color: var(--primary-dark);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.btn-details:hover {
    background-color: #334155;
}

/* FOOTER */
footer {
    background-color: #0f172a;
    color: #94a3b8;
    padding: 60px 5% 20px;
    font-size: 0.9rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-col ul li a:hover {
    color: white;
    text-decoration: underline;
}

.footer-col img {
    width: 50px;
    border-radius: 20px;
    
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: background 0.3s;
}

.social-links a:hover {
    background: var(--primary-accent);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    text-align: center;
}

@media (max-width: 768px) {
    .nav-menu { display: none; }
    
    .car-card {
        flex-direction: column;
        height: auto;
    }
    .car-image {
        width: 100%;
        height: 200px;
    }
    .car-details {
        width: 100%;
    }
    .footer-content {
        grid-template-columns: 1fr;
    }
}

.btn-login-mode {
    background-color: transparent;
    border: 2px solid rgba(255,255,255,0.3);
}
.btn-login-mode:hover {
    border-color: var(--primary-accent);
    background-color: var(--primary-accent);
    color: white;
}

.auth-page {
    background: linear-gradient(to bottom, #1e293b 0%, #1e293b 150px, var(--bg-light) 150px, var(--bg-light) 100%);
    padding: 60px 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.auth-container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

.auth-card {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h2 {
    font-size: 1.8rem;
    color: var(--primary-dark);
    margin-bottom: 10px;
}

.auth-header p {
    color: #64748b;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    transition: color 0.3s;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s;
    background-color: #f8fafc;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary-accent);
    background-color: white;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.input-wrapper input:focus + i,
.input-wrapper input:focus ~ i {
    color: var(--primary-accent);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
    font-size: 0.9rem;
    color: #64748b;
}

.checkbox-group a {
    color: var(--primary-accent);
    text-decoration: none;
}

.btn-submit {
    width: 100%;
    padding: 14px;
    background-color: var(--primary-accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s;
}

.btn-submit:hover {
    background-color: #2563eb;
}

.btn-submit:active {
    transform: scale(0.98);
}

.auth-divider {
    text-align: center;
    margin: 25px 0;
    position: relative;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #e2e8f0;
    z-index: 1;
}

.auth-divider span {
    background-color: white;
    padding: 0 10px;
    color: #94a3b8;
    position: relative;
    z-index: 2;
    font-size: 0.9rem;
}

.social-auth {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-dark);
    transition: background 0.2s;
}

.btn-social:hover {
    background-color: #f1f5f9;
}

.btn-social.google i { color: #db4437; }
.btn-social.apple i { color: #000; }

.auth-footer {
    text-align: center;
    font-size: 0.9rem;
    color: #64748b;
}

.auth-footer a {
    color: var(--primary-accent);
    text-decoration: none;
    font-weight: 600;
}

@media (max-width: 500px) {
    .auth-card {
        padding: 25px;
    }
    .social-auth {
        grid-template-columns: 1fr;
    }
}

/* Chat PLACAHOLDER STYLE */

.chat-slider {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  font-family: 'Montseerrat', sans-serif;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.chat-panel {
  width: 100%;
  max-width: 720px;
  transform: translateY(calc(100% - 56px));
  transition: transform 300ms ease;
  pointer-events: auto;
  box-shadow: 0 -6px 24px rgba(0,0,0,0.15);
  background: #fff;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  overflow: hidden;
}
.chat-panel.open {
  transform: translateY(0);
}
.chat-handle {
  height: 56px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  padding: 0 16px;
  background: linear-gradient(90deg,#0f62fe,#6f8cff);
  color: #fff;
  cursor: pointer;
}
.chat-body {
  padding: 12px;
  max-height: 320px;
  overflow-y: auto;
  background: #f7f8fb;
}
.chat-messages { margin-bottom: 8px; }
.chat-msg { margin: 8px 0; padding: 8px 12px; border-radius: 12px; max-width: 78%; }
.chat-msg.user { background: #0f62fe; color: #fff; margin-left: auto; }
.chat-msg.bot { background: #fff; color: #121212; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.chat-suggestions { display:flex; gap:8px; flex-wrap:wrap; margin:8px 0; }
.chat-suggestion { background:#e6eefc; color:#0f62fe; padding:6px 10px; border-radius:16px; cursor:pointer; font-size:13px; }
.chat-input-row { display:flex; gap:8px; padding:12px; background:#fff; border-top:1px solid #eee; }
.chat-input { flex:1; padding:10px 12px; border-radius:8px; border:1px solid #ddd; }
.chat-send { background:#0f62fe; color:#fff; border:none; padding:10px 14px; border-radius:8px; cursor:pointer; }

.chat-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    min-height: calc(100vh - 200px); 
    background: #f4f7f9;
}

.chat-wrapper {
    width: 100%;
    max-width: 900px;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 600px;
}


.chat-header {
    background: #0a192f;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}



.chat-window {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 15px;
    font-size: 15px;
    line-height: 1.5;
}

.message.ai {
    background: #f0f2f5;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
    color: #333;
}

.message.user {
    background: #0a192f;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.chat-input-area {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

.chat-input-area input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    outline: none;
    font-family: 'Inter', sans-serif;
}

.chat-input-area button {
    background: #0a192f;
    color: white;
    border: none;
    padding: 0 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
}

.chat-input-area button:hover {
    background: #1a2a44;
}

.btn-chat.disabled {
    background-color: #bdc3c7 !important; 
    color: #7f8c8d !important;
    cursor: not-allowed; 
    transform: none !important; 
    box-shadow: none !important;
    opacity: 0.7;
}
.video-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.video-content {
    background: #000;
    padding: 20px;
    border-radius: 12px;
    max-width: 700px;
    width: 90%;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    color: white;
    font-size: 28px;
    cursor: pointer;
}

.cart-button {
    position: relative;
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
}

.cart-button:hover {
    transform: scale(1.1);
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--secondary-accent);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.btn-add {
    padding: 10px 20px;
    background-color: var(--primary-accent);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-add:hover {
    background-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-add:active {
    transform: translateY(0);
}