/* Верхняя полоса сайта (sticky) */
#topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: linear-gradient(135deg, #1a5a96 0%, #2980b9 100%);
    color: #fff;
    font-size: 14px;
}

.topbar-container {
    max-width: 1260px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    height: 44px;
}

.topbar-city,
.topbar-email {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.topbar-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.topbar-city a,
.topbar-email a {
    color: #fff;
    text-decoration: none;
    border-bottom: 1px dotted rgba(255,255,255,0.5);
    transition: border-color 0.2s;
}

.topbar-city a:hover,
.topbar-email a:hover {
    border-bottom-color: #fff;
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-left: auto;
}

.topbar-nav a {
    color: #fff;
    text-decoration: none;
    padding: 10px 0;
    position: relative;
    transition: opacity 0.2s;
}

.topbar-nav a:hover {
    opacity: 0.85;
}

.topbar-nav a::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 0;
    right: 0;
    height: 1px;
    background: #fff;
    transform: scaleX(0);
    transition: transform 0.2s;
}

.topbar-nav a:hover::after {
    transform: scaleX(1);
}

/* Планшеты */
@media (max-width: 1100px) {
    .topbar-container {
        gap: 15px;
    }
    
    .topbar-nav {
        gap: 16px;
    }
    
    .topbar-nav a {
        font-size: 13px;
    }
}

/* Узкие планшеты */
@media (max-width: 900px) {
    .topbar-nav {
        gap: 12px;
    }
    
    .topbar-nav a {
        font-size: 12px;
    }
}

/* Мобильные - скрываем всю полосу */
@media (max-width: 780px) {
    #topbar {
        display: none;
    }
}

/* ===== ЛОГОТИП И КАТАЛОГ ===== */
#header-main {
    background: #fff;
    padding: 15px 0;
}

.header-main-container {
    max-width: 1260px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

.header-logo {
    flex-shrink: 0;
}

.header-logo img {
    height: 60px;
    width: auto;
    display: block;
}

/* Кнопка каталога */
.header-catalog {
    position: relative;
}

.catalog-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-width: 320px;
    padding: 14px 32px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #fff;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.catalog-btn:hover {
    background: linear-gradient(135deg, #1e7e34 0%, #1a9f7a 100%);
    transform: scale(1.02);
}

.catalog-icon {
    width: 20px;
    height: 20px;
}

/* Выпадающее меню каталога */
.catalog-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 10px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    min-width: 320px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.header-catalog:hover .catalog-dropdown,
.catalog-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Стили для списка каталога */
.catalog-dropdown ul {
    list-style: none;
    margin: 0;
    padding: 10px 0;
}

.catalog-dropdown li {
    margin: 0;
}

.catalog-dropdown li a {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    transition: background 0.15s;
}

.catalog-dropdown li a:hover {
    background: #007bff !important;
    color: #fff !important;
}


/* Планшеты */
@media (max-width: 1100px) {
    .header-main-container {
        gap: 20px;
    }
    
    .header-logo img {
        height: 50px;
    }
    
    .catalog-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* Мобильные - скрываем блок */
@media (max-width: 780px) {
    #header-main {
        display: none;
    }
}

/* ===== МОДАЛКА ВХОДА ===== */
.login-modal[hidden] {
    display: none !important;
}

.login-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.login-modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.2s;
}

.login-modal-close:hover {
    background: #e0e0e0;
    color: #333;
}

.login-modal h2 {
    margin: 0 0 24px;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    color: #333;
}

.login-field {
    margin-bottom: 16px;
}

.login-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #555;
}

.login-field input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.login-field input:focus {
    outline: none;
    border-color: #2980b9;
    box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.15);
}

.login-checkbox {
    margin-bottom: 16px;
    font-size: 14px;
    color: #555;
}

.login-checkbox label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.login-checkbox input {
    width: 16px;
    height: 16px;
}

.login-error {
    padding: 10px 12px;
    margin-bottom: 16px;
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 8px;
    color: #c00;
    font-size: 14px;
}

.login-submit {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #1a5a96 0%, #2980b9 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.login-submit:hover {
    background: linear-gradient(135deg, #154a7a 0%, #2171a3 100%);
    transform: translateY(-1px);
}

.login-links {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
    font-size: 14px;
}

.login-links a {
    color: #2980b9;
    text-decoration: none;
}

.login-links a:hover {
    text-decoration: underline;
}

/* Стили кнопки профиля */
#header_profile button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
}

#header_profile button .icon {
    width: 24px;
    height: 24px;
    stroke: #333;
    transition: stroke 0.2s;
}

#header_profile button:hover .icon {
    stroke: #2980b9;
}

