/* --- Header --- */
header {
    border-bottom: 4px solid var(--red);
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 9999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

.header-flex { display: flex; align-items: stretch; height: 60px; justify-content: space-between; flex-wrap: nowrap; }
.logo, header .logo { color: #fff !important;  background: var(--red); color: #fff !important; padding: 0 20px; display: flex; align-items: center; font-weight: 700; font-size: 24px; font-family: var(--font-head); letter-spacing: -0.5px; flex-shrink: 0; }

.top-nav { display: flex; flex-grow: 1; overflow: hidden; margin-left: 10px; }
.top-nav li a { padding: 0 16px; height: 60px; display: flex; align-items: center; font-weight: 600; font-size: 12px; text-transform: uppercase; color: #444; white-space: nowrap; }
.top-nav li a:hover { color: var(--red); }

/* --- HEADER INFORMER --- */
.header-informer {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
    margin-right: 15px;
    font-size: 13px;
    font-weight: 700;
    color: #333;
}
.h-inf-item { display: flex; align-items: center; gap: 6px; line-height: 1; white-space: nowrap; }
.h-inf-item svg { width: 18px; height: 18px; fill: #f39c12; }

.currency-stack { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; border-left: 1px solid #eee; padding-left: 12px; height: 30px; }
.curr-val { white-space: nowrap; color: #333; }

.header-controls { display: flex; align-items: stretch; }
.search-trigger, .menu-toggle, .theme-toggle { cursor: pointer; display: flex; align-items: center; justify-content: center; width: 50px; height: 60px; background: transparent; border: none; outline: none; padding: 0; border-left: 1px solid #eee; }
.header-controls svg { width: 22px; height: 22px; fill: #555; }

/* --- Search --- */
.search-overlay { display: none; position: absolute; top: 60px; left: 0; width: 100%; background: #fff; border-bottom: 2px solid var(--red); z-index: 9998; padding: 10px 0; }
.search-overlay form { display: flex; flex-direction: column; max-width: 1140px; margin: 0 auto; padding: 0 15px; position: relative; }
.search-overlay input { width: 100%; border: 1px solid #ddd; padding: 10px; font-size: 16px; outline: none; border-radius: 4px; }

#search-results { 
    position: absolute; 
    top: 100%; 
    left: 15px; 
    right: 15px; 
    background: #fff; 
    border: 1px solid #ddd; 
    z-index: 100; 
    display: none; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.1); 
    border-radius: 0 0 8px 8px; 
    overflow: hidden;
    flex-direction: column !important; /* ГАРАНТИРУЕМ КОЛОНКУ */
}

/* --- News Ticker --- */
.news-ticker { min-height: 40px; background: #fcfcfc; border-bottom: 1px solid #f0f0f0; padding: 10px 0; overflow: hidden; }
.ticker-wrap { display: flex; align-items: center; }
.ticker-label { background: inherit; padding-right: 15px; color: var(--important); font-weight: 900; text-transform: uppercase; font-size: 13px; z-index: 5; white-space: nowrap; }
.ticker-scroll { overflow: hidden; flex: 0 1 auto; position: relative; height: 18px; }
.ticker-content { display: flex; white-space: nowrap; position: absolute; animation: ticker-anim 40s linear infinite; }
.ticker-content a { margin-right: 40px; font-size: 13px; font-weight: 600; color: #444; }
@keyframes ticker-anim { 0% { transform: translate3d(0,0,0); } 100% { transform: translate3d(-50%,0,0); } }

/* --- Live Search Items --- */
body #search-results .aj-res { 
    display: flex !important; 
    width: 100% !important;
    float: none !important;
    clear: both !important;
    align-items: center !important; 
    gap: 15px !important; 
    padding: 12px 15px !important; 
    border-bottom: 1px solid #eee !important; 
    text-decoration: none !important; 
    color: #333 !important;
    box-sizing: border-box !important;
}
body #search-results .aj-res:last-child { border-bottom: none !important; }
body #search-results .aj-res:hover { background-color: #f9f9f9 !important; color: #bb1919 !important; }
body #search-results .aj-res img { width: 44px !important; height: 44px !important; border-radius: 6px !important; object-fit: cover !important; flex-shrink: 0 !important; }
body #search-results .aj-res span { font-size: 14px !important; font-weight: 600 !important; line-height: 1.3 !important; display: block !important; white-space: normal !important; }
