/* Isolated header controls, independent from legacy header rules. */
.catalog-dropdown .catalog-left {
    display: flex;
    width: 250px;
    flex-direction: column;
    gap: 3px;
}

.catalog-dropdown .catalog-left > a {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    margin: 0;
}

.catalog-dropdown .catalog-left > a > i {
    width: 17px;
    flex: 0 0 17px;
    color: #c8102e;
    font-size: 12px;
    text-align: center;
}

.catalog-dropdown .catalog-left > a.active > i,
.catalog-dropdown .catalog-left > a:hover > i {
    color: #fff;
}

.catalog-dropdown {
    width: min(1120px, calc(100vw - 48px));
}

.catalog-dropdown .catalog-right {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.catalog-dropdown .catalog-panels { min-height: 92px; }
.catalog-dropdown .catalog-category-panel { display: none; }
.catalog-dropdown .catalog-category-panel[hidden] { display: none !important; }
.catalog-dropdown .catalog-category-panel.active { display: block; }

.catalog-dropdown .catalog-child-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 24px;
    row-gap: 7px;
}

.catalog-dropdown .catalog-child-grid a {
    min-width: 0;
    padding: 9px 10px;
    border-radius: 9px;
    color: #3d4658;
    line-height: 1.35;
    white-space: nowrap;
}

.catalog-dropdown .catalog-child-grid a:hover {
    background: #f5f6f9;
    color: #d00024;
}

.catalog-dropdown .catalog-no-children {
    grid-column: 1 / -1;
    color: #7a8494;
    font-size: 13px;
}

.catalog-dropdown .catalog-promo {
    margin-top: 8px;
    padding: 15px 18px;
}

.catalog-dropdown .catalog-left > a { padding-block: 8px; }

.header-small-menu .header-daily-offer-link {
    display: inline-flex;
    align-items: center;
    column-gap: 6px;
    color: #d00024;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .header-main .mobile-menu-btn {
        order: 4;
        flex: 0 0 auto;
        margin-left: 0;
    }

    .header-main .search-box { margin-left: auto; }

    .mobile-menu .mobile-feature-link {
        color: #d00024;
        display: flex;
        align-items: center;
        gap: 9px;
        font-weight: 700;
    }

    .mobile-menu .mobile-feature-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .mobile-menu .mobile-feature-row .mobile-feature-link {
        min-height: 46px;
        padding: 8px 10px;
        border-radius: 11px;
        background: #f7f8fb;
        justify-content: center;
        text-align: center;
        font-size: 12px;
    }

    .mobile-menu.active {
        position: fixed;
        z-index: 9998;
        top: var(--mobile-menu-top, 62px);
        right: 0;
        bottom: 0;
        left: 0;
        display: block;
        max-height: none;
        height: auto;
        overflow-y: auto;
        padding-bottom: calc(28px + env(safe-area-inset-bottom));
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-menu .mobile-category-group {
        border-bottom: 1px solid #edf0f5;
    }

    .mobile-menu .mobile-category-group > summary {
        min-height: 46px;
        padding: 0 3px;
        color: #071b3a;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        list-style: none;
        cursor: pointer;
        font-size: 14px;
        font-weight: 700;
    }

    .mobile-menu .mobile-category-group > summary::-webkit-details-marker { display: none; }
    .mobile-menu .mobile-category-name {
        display: inline-flex;
        align-items: center;
        gap: 10px;
    }

    .mobile-menu .mobile-category-name > i {
        width: 18px;
        color: #d00024;
        text-align: center;
    }

    .mobile-menu .mobile-category-arrow {
        color: #9aa2b0;
        font-size: 10px;
        transition: transform .2s ease;
    }

    .mobile-menu .mobile-category-group[open] > summary {
        color: #d00024;
    }

    .mobile-menu .mobile-category-group[open] .mobile-category-arrow {
        color: #d00024;
        transform: rotate(180deg);
    }

    .mobile-menu .mobile-subcategories {
        margin: 0 0 9px 28px;
        padding: 5px 10px;
        border-left: 2px solid #edf0f5;
        background: #f8f9fb;
        border-radius: 0 9px 9px 0;
    }

    .mobile-menu .mobile-subcategories a {
        padding: 8px 7px;
        color: #465064;
        font-size: 12px;
        line-height: 1.3;
    }

    .mobile-menu .mobile-subcategories .mobile-view-all {
        color: #d00024;
        font-weight: 700;
    }

    .mobile-menu .mobile-feature-link i {
        width: 17px;
        color: #d00024;
        text-align: center;
    }

    .mobile-menu .mobile-language-title {
        margin: 4px 0 8px;
        color: #6b7280;
        font-size: 11px;
        font-weight: 600;
    }

    .mobile-menu .mobile-langs {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 7px;
    }

    .mobile-menu .mobile-langs a {
        min-height: 38px;
        padding: 0 8px;
        border: 1px solid #e2e6ed;
        border-radius: 9px;
        color: #071b3a;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        text-decoration: none;
        font-size: 11px;
        font-weight: 700;
    }

    .mobile-menu .mobile-langs a.active {
        border-color: rgba(208, 0, 36, .2);
        background: #f7edf0;
        color: #d00024;
    }

    .mobile-menu .mobile-langs img {
        width: 19px;
        height: 13px;
        border-radius: 2px;
        object-fit: cover;
    }

    .mobile-menu .mobile-langs i { font-size: 8px; }
}

@media (max-width: 768px) {
    .site-header .sticky-phone,
    .site-header.is-fixed .sticky-phone {
        display: none !important;
    }

    .site-header,
    .site-header.is-fixed {
        position: sticky;
        top: 0;
        transform: none;
        animation: none;
    }
}

.header-small-menu .header-daily-offer-icon {
    width: 16px;
    min-width: 16px;
    height: 18px;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #d00024;
    position: static;
}

.header-small-menu .header-daily-offer-icon i {
    margin: 0;
    position: static;
    display: block;
    font-size: 14px;
    line-height: 1;
}

.header-small-menu .header-daily-offer-link:hover {
    color: #9b001b;
}

.header-small-menu .header-campaign-link {
    display: inline-flex;
    align-items: center;
    column-gap: 7px;
    color: #d00024;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.header-small-menu .header-campaign-icon {
    width: 16px;
    min-width: 16px;
    height: 18px;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: static;
    color: #d00024;
}

.header-small-menu .header-campaign-icon i {
    margin: 0;
    position: static;
    display: block;
    font-size: 15px;
    line-height: 1;
}

.header-small-menu .header-campaign-text {
    margin: 0;
    position: static;
    display: inline-block;
}

.header-top .language-switcher {
    position: relative;
    display: block;
    flex: 0 0 auto;
    margin: 0;
    font-size: 12px;
}

.header-top .language-switcher > summary {
    width: 76px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #dfe3eb;
    border-radius: 8px;
    background: #fff;
    color: #071b3a;
    display: flex;
    align-items: center;
    gap: 7px;
    list-style: none;
    cursor: pointer;
    font-weight: 700;
}

.header-top .language-switcher > summary::-webkit-details-marker { display: none; }
.header-top .language-switcher .language-flag {
    width: 21px;
    height: 14px;
    border-radius: 2px;
    object-fit: cover;
    display: block;
    flex: 0 0 21px;
    box-shadow: 0 0 0 1px rgba(7, 27, 58, .1);
}
.header-top .language-switcher > summary i {
    margin-left: auto;
    color: #9b001b;
    font-size: 9px;
    transition: transform .2s ease;
}

.header-top .language-switcher[open] > summary i { transform: rotate(180deg); }

.header-top .language-switcher .language-dropdown {
    position: absolute;
    top: calc(100% + 7px);
    right: 0;
    z-index: 3000;
    width: 112px;
    padding: 5px;
    border: 1px solid #e1e5ec;
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(7, 27, 58, .16);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.header-top .language-switcher .language-dropdown::before { display: none; }
.header-top .language-switcher .language-dropdown a {
    width: 100%;
    min-height: 35px;
    padding: 0 8px;
    border-radius: 6px;
    color: #071b3a;
    display: flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
    font-weight: 600;
}

.header-top .language-switcher .language-dropdown a:hover,
.header-top .language-switcher .language-dropdown a.active {
    background: #f7edf0;
    color: #9b001b;
}

.header-top .language-switcher .language-dropdown a i {
    margin-left: auto;
    color: #9b001b;
    font-size: 9px;
}

@media (max-width: 1100px) {
    .header-top .language-switcher { display: none; }
}

.mobile-language-switcher,
.mobile-home-link,
.mobile-action-label { display: none; }

@media (max-width: 768px) {
    html { background: #071b3a; }
    body { background: #fff; padding-bottom: 68px; }

    .header-main { gap: 8px; padding-inline: 12px; }
    .header-main .sticky-logo { flex: 0 0 auto; width: 101px; }
    .header-main .sticky-logo img { width: 100%; height: auto; display: block; }

    .header-main .search-box {
        order: 2;
        width: 38px;
        height: 38px;
        border-radius: 10px;
    }
    .header-main .search-box::before { width: 38px; }

    .mobile-language-switcher {
        position: relative;
        order: 3;
        display: block;
        flex: 0 0 auto;
    }

    .mobile-language-switcher > summary {
        width: 61px;
        height: 38px;
        padding: 0 7px;
        border: 1px solid #dfe3eb;
        border-radius: 10px;
        background: #fff;
        color: #071b3a;
        display: flex;
        align-items: center;
        gap: 5px;
        list-style: none;
        cursor: pointer;
        font-size: 11px;
        font-weight: 700;
    }

    .mobile-language-switcher > summary::-webkit-details-marker { display: none; }
    .mobile-language-switcher img {
        width: 19px;
        height: 13px;
        border-radius: 2px;
        object-fit: cover;
        display: block;
    }

    .mobile-language-switcher > summary i {
        margin-left: auto;
        color: #d00024;
        font-size: 8px;
    }

    .mobile-language-dropdown {
        position: absolute;
        top: calc(100% + 6px);
        right: 0;
        z-index: 3100;
        width: 88px;
        padding: 5px;
        border: 1px solid #e2e6ed;
        border-radius: 9px;
        background: #fff;
        box-shadow: 0 12px 26px rgba(7, 27, 58, .18);
    }

    .mobile-language-dropdown a {
        min-height: 34px;
        padding: 0 7px;
        border-radius: 6px;
        color: #071b3a;
        display: flex;
        align-items: center;
        gap: 8px;
        text-decoration: none;
        font-size: 11px;
        font-weight: 700;
    }
    .mobile-language-dropdown a.active { background: #f7edf0; color: #d00024; }

    .header-main .mobile-menu-btn { order: 4; flex: 0 0 auto; }

    .header-main .header-actions {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 4000;
        width: 100%;
        height: 64px;
        padding: 5px max(8px, env(safe-area-inset-right)) max(5px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
        border-top: 1px solid #e1e5ec;
        background: rgba(255, 255, 255, .97);
        box-shadow: 0 -8px 24px rgba(7, 27, 58, .1);
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 2px;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    .header-main .header-actions .mobile-home-link { display: flex; }
    .header-main .header-actions .action-divider { display: none; }
    .header-main .header-actions .action-item {
        width: auto;
        min-width: 0;
        height: 52px;
        padding: 4px 2px;
        border: 0;
        border-radius: 10px;
        background: transparent;
        color: #071b3a;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        text-decoration: none;
    }

    .header-main .header-actions .action-item:active,
    .header-main .header-actions .mobile-home-link { background: #f2f5f9; color: #d00024; }
    .header-main .header-actions .action-item > i { font-size: 19px; }
    .header-main .header-actions .mobile-action-label {
        display: block;
        max-width: 100%;
        overflow: hidden;
        color: currentColor;
        font-size: 9px;
        font-weight: 600;
        line-height: 1;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .header-main .header-actions .cart-count { top: 1px; right: calc(50% - 20px); }
}
