/* ===== HEADER — ЕДИНЫЙ ВИД НА ВСЕХ СТРАНИЦАХ ===== */

/* ===== TOP BAR ===== */
.top-bar-link {
    transition: color 0.2s;
}

.top-bar-link:hover {
    color: #FF6B00 !important;
}

/* ===== SEARCH — DESKTOP ===== */
@media (min-width: 768px) {
    #search-input {
        display: block !important;
        width: 100% !important;
        height: 44px !important;
        padding: 0 16px !important;
        border-radius: 12px 0 0 12px !important;
        border: 2px solid rgba(10, 31, 68, 0.15) !important;
        border-right: none !important;
        background: #F5F7FA !important;
        font-size: 14px !important;
        color: #1F2A44 !important;
        outline: none !important;
        transition: border-color 0.2s, box-shadow 0.2s, background 0.2s !important;
    }

    #search-input:focus {
        border-color: #FF6B00 !important;
        background: #FFFFFF !important;
        box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.1) !important;
    }

    #search-input::placeholder {
        color: #8A94A6 !important;
        font-size: 14px !important;
    }

    /* Скрыть мобильный поиск на десктопе */
    #search-input-mobile {
        display: none !important;
    }
}

/* ===== SEARCH — MOBILE ===== */
@media (max-width: 767px) {
    #search-input {
        display: none !important;
    }

    #search-input-mobile {
        display: block !important;
    }
}

/* ===== HEADER ACTIONS — DESKTOP ===== */
@media (min-width: 1024px) {

    /* Контейнер кнопок */
    #header-actions {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        margin-left: auto !important;
        margin-right: 0 !important;
        padding: 0 !important;
        gap: 20px !important;
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
        transform: none !important;
        translate: none !important;
        -webkit-transform: none !important;
        flex-shrink: 0 !important;
    }

    /* Кнопка Логин */
    #login-btn {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-width: auto !important;
        max-width: none !important;
        width: auto !important;
        height: auto !important;
        padding: 8px 12px !important;
        margin: 0 !important;
        margin-right: 0 !important;
        border-radius: 12px !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        flex-shrink: 0 !important;
        white-space: nowrap !important;
        transform: none !important;
        translate: none !important;
    }

    #login-btn:hover,
    #login-btn:focus {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        outline: none !important;
    }

    #login-btn:hover i,
    #login-btn:hover svg {
        color: #FF6B00 !important;
        transition: color 0.2s ease !important;
    }

    #login-btn:hover .text-xs {
        color: #FF6B00 !important;
        transition: color 0.2s ease !important;
    }

    #login-btn:active {
        transform: scale(0.96) !important;
    }

    /* Кнопка Корзина */
    #cart-btn {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-width: auto !important;
        max-width: none !important;
        width: auto !important;
        height: auto !important;
        padding: 8px 12px !important;
        margin: 0 !important;
        margin-right: 0 !important;
        padding-right: 0 !important;
        border-radius: 12px !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        flex-shrink: 0 !important;
        white-space: nowrap !important;
        transform: none !important;
        translate: none !important;
        -webkit-transform: none !important;
    }

    #cart-btn:hover,
    #cart-btn:focus {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        outline: none !important;
    }

    #cart-btn:hover i,
    #cart-btn:hover svg {
        color: #FF6B00 !important;
        transition: color 0.2s ease !important;
    }

    #cart-btn:hover .text-xs {
        color: #FF6B00 !important;
        transition: color 0.2s ease !important;
    }

    #cart-btn:active {
        transform: scale(0.96) !important;
    }

    /* Иконки внутри кнопок */
    #login-btn i,
    #login-btn svg,
    #cart-btn i,
    #cart-btn svg {
        width: 20px !important;
        height: 20px !important;
        flex-shrink: 0 !important;
    }

    /* Текст внутри кнопок */
    #login-btn .text-xs,
    #cart-btn .text-xs {
        font-size: 12px !important;
        line-height: 1.2 !important;
    }

    /* Бейдж корзины */
    #cart-badge {
        top: -2px !important;
        right: -2px !important;
        min-width: 16px !important;
        height: 16px !important;
        padding: 0 3px !important;
        background: #FF6B00 !important;
        color: white !important;
        font-weight: 700 !important;
        font-size: 9px !important;
        line-height: 16px !important;
        text-align: center !important;
        border-radius: 8px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-shadow: 0 1px 3px rgba(255, 107, 0, 0.3) !important;
        transform: none !important;
        animation: none !important;
        z-index: 10 !important;
        white-space: nowrap !important;
    }
}

/* ===== HEADER ACTIONS — MOBILE ===== */
@media (max-width: 1023px) {
    #mobile-menu-toggle {
        display: none !important;
    }

    #header-actions {
        display: none !important;
    }

    #login-btn,
    #cart-btn {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 14px !important;
        transform: none !important;
        translate: none !important;
        background: #F0F2F5 !important;
        border: none !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
        display: none !important;
        align-items: center !important;
        justify-content: center !important;
        transition: all 0.2s ease !important;
        -webkit-tap-highlight-color: transparent !important;
        position: relative !important;
    }

    #login-btn i,
    #login-btn svg,
    #cart-btn i,
    #cart-btn svg {
        width: 20px !important;
        height: 20px !important;
        color: #1F2A44 !important;
        transition: color 0.2s ease !important;
    }

    #login-btn:hover,
    #login-btn:focus {
        background: #E8ECF4 !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    }

    #login-btn:active {
        transform: scale(0.92) !important;
        box-shadow: none !important;
    }

    #login-btn:hover i,
    #login-btn:hover svg {
        color: #FF6B00 !important;
    }

    #cart-btn:hover,
    #cart-btn:focus {
        background: #FFF3E8 !important;
        box-shadow: 0 2px 8px rgba(255, 107, 0, 0.12) !important;
    }

    #cart-btn:active {
        transform: scale(0.92) !important;
        box-shadow: none !important;
    }

    #cart-btn:hover i,
    #cart-btn:hover svg {
        color: #FF6B00 !important;
    }

    #login-btn .hidden,
    #cart-btn .hidden {
        display: none !important;
    }

    /* Бейдж корзины — мобильный */
    #cart-badge {
        position: absolute !important;
        top: -2px !important;
        right: -2px !important;
        min-width: 16px !important;
        height: 16px !important;
        padding: 0 3px !important;
        background: #FF3B30 !important;
        color: white !important;
        font-weight: 700 !important;
        font-size: 9px !important;
        line-height: 16px !important;
        text-align: center !important;
        border-radius: 8px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-shadow: 0 1px 3px rgba(255, 59, 48, 0.3) !important;
        transform: none !important;
        animation: none !important;
        z-index: 10 !important;
        white-space: nowrap !important;
    }
}

/* ===== SIDEBAR CATEGORIES MENU ===== */

/* Container for each category row */
.menu-item {
    position: relative;
}

/* Sidebar links */
.sidebar-item {
    transition: all 0.2s ease-in-out;
}

/* Hover effect on category links */
.menu-item:hover>.sidebar-item {
    background-color: #FFF7ED !important;
    /* light orange accent background */
    color: #FF6B00 !important;
    /* orange accent text color */
}

/* Move arrow on hover */
.menu-item:hover .sidebar-arrow {
    transform: translateX(4px);
    color: #FF6B00 !important;
}

/* Mega Menu container */
.mega-menu {
    position: absolute;
    left: 100%;
    top: 0;
    width: 720px;
    min-height: 100%;
    background-color: #FFFFFF;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 0 16px 16px 16px;
    box-shadow: 10px 10px 30px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    z-index: 100;
    display: none;
    opacity: 0;
    transform: translateX(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Show Mega Menu on hover */
.menu-item:hover .mega-menu {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

/* Mega Menu Grid Layout (columns) */
.mega-menu-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
}

/* Column styles */
.mega-menu-column {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Column Header (Level 2 Category) */
.mega-menu-column h4 {
    font-size: 14px;
    font-weight: 700;
    color: #1F2A44;
    border-bottom: 1px solid #F1F5F9;
    padding-bottom: 0.25rem;
}

.mega-menu-column h4 a {
    color: #1F2A44;
    transition: color 0.2s;
}

.mega-menu-column h4 a:hover {
    color: #FF6B00;
}

/* Level 3 items list */
.mega-menu-column ul {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mega-menu-column ul li a {
    font-size: 13px;
    color: #64748B;
    transition: all 0.2s;
}

.mega-menu-column ul li a:hover {
    color: #FF6B00;
    padding-left: 2px;
}

/* ===== SEARCH ADAPTIVE BREAKPOINTS ===== */

/* Desktop Search (768px and up) */
@media (min-width: 768px) {
    .desktop-search {
        display: flex !important;
    }

    .mobile-search-toggle {
        display: none !important;
    }

    .mobile-search-dropdown {
        display: none !important;
    }
}

/* Margin on desktop search when header actions are visible */
@media (min-width: 1024px) {
    .desktop-search {
        margin-right: 24px !important;
    }
}

/* Mobile Search (below 768px) */
@media (max-width: 767px) {
    .desktop-search {
        display: none !important;
    }

    .mobile-search-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 40px !important;
        height: 40px !important;
        background: #F8F9FC !important;
        border: 1.5px solid #E2E8F0 !important;
        border-radius: 12px !important;
        color: #1F2A44 !important;
        transition: all 0.2s ease-in-out;
        position: absolute !important;
        right: 12px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        padding: 0 !important;
        cursor: pointer;
        z-index: 10 !important;
    }

    .mobile-search-toggle svg,
    .mobile-search-toggle i {
        width: 18px !important;
        height: 18px !important;
    }

    @media (min-width: 640px) {
        .mobile-search-toggle {
            right: 16px !important;
        }
    }

    .mobile-search-toggle:hover {
        background: #F1F5F9 !important;
        border-color: #CBD5E1 !important;
        color: #FF6B00 !important;
    }

    .mobile-search-toggle.active {
        background: #FF6B00 !important;
        border-color: #FF6B00 !important;
        color: #FFFFFF !important;
        box-shadow: 0 4px 10px rgba(255, 107, 0, 0.2) !important;
    }

    .mobile-search-dropdown {
        display: block !important;
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        border-top-width: 0 !important;
        transition: all 0.3s ease-in-out;
    }

    .mobile-search-dropdown.open {
        max-height: 80px;
        opacity: 1;
        padding-top: 8px !important;
        padding-bottom: 8px !important;
        border-top: 1px solid rgba(226, 232, 240, 0.5) !important;
    }
}