/**
 * Header V2 - Standalone стили
 * Дополнение к основным стилям сайта
 */

/* Скрытый текст для screen readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* V2 Layout */
.v2-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.v2-layout #site {
    flex: 1;
}

/* Меню каталога в header */
.catalog-menu-list {
    list-style: none;
    margin: 0;
    padding: 10px 0;
}

.catalog-menu-item {
    margin: 0;
    padding: 0;
}

.catalog-menu-item a {
    display: block;
    padding: 10px 20px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}

.catalog-menu-item a:hover {
    background-color: #007bff;
    color: #333;
}

.catalog-menu-empty {
    padding: 20px;
    text-align: center;
    color: #999;
}

/* Catalog dropdown */
.catalog-dropdown {
    position: absolute;
    top: 100%;
    left: 0 !important;
    min-width: 280px;
    max-height: 80vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.catalog-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Login Modal */
.login-modal {
    position: fixed;
    top: 0;
    left: 0 !important;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-modal-overlay {
    position: absolute;
    top: 0;
    left: 0 !important;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

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

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
}

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

.login-modal h2 {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
}

.login-modal .login-subtitle {
    color: #666;
    margin: 0 0 24px;
    font-size: 14px;
    line-height: 1.5;
}

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

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

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

.login-field input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.1);
}

.login-error {
    margin-bottom: 16px;
    padding: 12px;
    background: #fee2e2;
    border-radius: 8px;
    color: #dc2626;
    font-size: 14px;
}

.login-submit {
    width: 100%;
    padding: 14px 24px;
    background: #007bff;
    color: #333;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.login-submit:hover {
    background: #0056b3;
}

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

.login-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.login-links {
    margin-top: 16px;
    text-align: center;
}

.login-link-btn {
    background: none;
    border: none;
    color: #007bff;
    cursor: pointer;
    font-size: 14px;
    padding: 8px;
}

.login-link-btn:hover {
    text-decoration: underline;
}

.login-modal #login-code {
    text-align: center;
    font-size: 28px;
    letter-spacing: 12px;
    font-weight: 600;
    padding-left: 24px;
}

/* Footer стили */
.footer-info {
    background: #f8f9fa;
    padding: 40px 0;
}

.footer-logo-block .logo-img img {
    max-width: 80px;
    height: auto;
}

.footer-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-nav li {
    margin-bottom: 12px;
}

.footer-nav a {
    color: #333;
    text-decoration: none;
    font-size: 15px;
    transition: color 0.2s;
}

.footer-nav a:hover {
    color: #007bff;
}

.footer-contacts-block .h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 120px;
    color: #1a1a1a;
}

.footer-contacts-block .item-contact {
    margin-bottom: 120px;
    padding-bottom: 120px;
    border-bottom: 1px solid #e0e0e0;
}

.footer-contacts-block .item-contact:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.footer-copyright {
    background: #1a1a1a;
    padding: 20px 0;
    color: #999;
}

.footer-copyright .copyright {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

.footer-copyright .copy1 {
    font-weight: 500;
    color: #333;
}

.footer-copyright a {
    color: #999;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-copyright a:hover {
    color: #333;
}

/* Преимущества */
.advantages-section {
    background: #fff;
    padding: 40px 0;
}

.advantage-items {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    list-style: none;
    padding: 0;
    margin: 0;
    justify-content: center;
}

.advantage-item {
    flex: 1;
    min-width: 200px;
    max-width: 280px;
    text-align: center;
    padding: 20px;
}

.advantage-item .image-default {
    margin-bottom: 16px;
}

.advantage-item .image-default img {
    width: 48px;
    height: 48px;
}

.advantage-item .adv-name {
    font-size: 14px;
    color: #333;
    line-height: 1.5;
}

/* Scroll to top button */
#scroll-top-btn {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: #007bff;
    color: #333;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s, transform 0.2s;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 123, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

#scroll-top-btn:hover {
    transform: scale(1.1);
}

/* Telegram button */
#telegram-float-btn {
    position: fixed;
    bottom: 30px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: #0088cc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 136, 204, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 100;
}

#telegram-float-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 136, 204, 0.5);
}

/* Cookie уведомление */
#cookie_note {
    position: fixed;
    bottom: 120px;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    max-width: 600px !important;
    width: calc(100% - 40px);
    background: #fff;
    color: #333;
    padding: 20px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    z-index: 9999;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

#cookie_note::before {
    content: "🍪";
    font-size: 28px;
    flex-shrink: 0;
}

#cookie_note p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    flex: 1;
    min-width: 200px;
}

#cookie_note a {
    color: #64b5f6;
    text-decoration: underline;
    text-underline-offset: 2px;
}

#cookie_note a:hover {
    color: #90caf9;
}

#cookie_note .cookie_accept {
    padding: 12px 28px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: #fff;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.4);
}

#cookie_note .cookie_accept:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.6);
}

@media (max-width: 500px) {
    #cookie_note {
        bottom: 10px;
        padding: 16px 20px;
        flex-direction: column;
        text-align: center;
    }
    
    #cookie_note::before {
        font-size: 24px;
    }
    
    #cookie_note p {
        min-width: auto;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .login-modal-content {
        padding: 24px;
        margin: 16px;
    }
    
    .login-modal h2 {
        font-size: 20px;
    }
    
    .advantage-items {
        flex-direction: column;
        align-items: center;
    }
    
    .advantage-item {
        max-width: 100%;
    }
    
    .footer-info .container {
        flex-direction: column;
    }
    
    .footer-logo-block,
    .footer-nav-block,
    .footer-contacts-block {
        width: 100%;
        max-width: none;
    }
    
    #cookie_note {
        flex-direction: column;
        text-align: center;
    }
}

/* === Search Suggestions === */
.searchform-inp {
    position: relative;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    max-width: none !important;
    background: #fff;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    display: none;
}

.search-suggestions.active {
    display: block;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: #333;
    transition: background 0.15s;
    border-bottom: 1px solid #f5f5f5;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: #f8f9fa;
}

.suggestion-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    flex-shrink: 0;
}

.suggestion-icon svg {
    width: 18px;
    height: 18px;
}

.suggestion-text {
    flex: 1;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.suggestion-count {
    font-size: 12px;
    color: #999;
    flex-shrink: 0;
}

.suggestion-type {
    font-size: 11px;
    color: #888;
    background: #f0f0f0;
    padding: 3px 8px;
    border-radius: 4px;
    flex-shrink: 0;
}

.suggestion-type.substance {
    background: #e3f2fd;
    color: #1976d2;
}

.suggestion-type.category {
    background: #fff3e0;
    color: #f57c00;
}

/* V2 Layout - убираем лишние отступы */
.v2-layout,
.v2-layout body {
    margin: 0;
    padding: 0;
}

.v2-layout #site {
    margin: 0;
    padding: 0;
}

.v2-layout #main {
    margin: 0;
    padding: 0;
}

.v2-layout .topfix {
    display: none;
}

/* Убираем возможные отступы от body/html */
html.v2-layout,
body.v2-layout {
    margin: 0 !important;
    padding: 0 !important;
}
