/* =====================================================
   TES TOP BAR — Front-end styles
   Uses CSS variables injected inline from PHP settings
===================================================== */

#tes-top-bar {
    --tes-bg:  #1a1a1a;
    --tes-tc:  #cccccc;
    --tes-hc:  #e8b84b;
    --tes-ac:  #cc0000;

    background: var(--tes-bg);
    color: var(--tes-tc);
    font-family: inherit;
    font-size: 12.5px;
    line-height: 1;
    position: relative;
    z-index: 99999;
    width: 100%;
    box-sizing: border-box;
}

.tes-tb-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    height: 38px;
    gap: 16px;
}

/* ---- LEFT LINKS ---- */
.tes-tb-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
}

.tes-tb-links li a {
    display: block;
    color: var(--tes-tc) !important;
    text-decoration: none !important;
    padding: 0 14px;
    height: 38px;
    line-height: 38px;
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: 0.2px;
    transition: color 0.18s, background 0.18s;
    white-space: nowrap;
    border-right: 1px solid rgba(255,255,255,0.07);
}

.tes-tb-links li:first-child a {
    border-left: 1px solid rgba(255,255,255,0.07);
}

.tes-tb-links li a:hover {
    color: var(--tes-hc) !important;
    background: rgba(255,255,255,0.05);
}

/* HELP / last link accent */
.tes-tb-links li:last-child a {
    color: var(--tes-ac) !important;
    font-weight: 700;
}
.tes-tb-links li:last-child a:hover {
    color: var(--tes-hc) !important;
}

/* ---- RIGHT: LOCATION SWITCHER ---- */
.tes-tb-location {
    position: relative;
    flex-shrink: 0;
}

.tes-tb-loc-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 4px;
    color: var(--tes-tc);
    font-size: 12.5px;
    font-weight: 600;
    padding: 5px 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.18s, background 0.18s;
    letter-spacing: 0.2px;
}

.tes-tb-loc-toggle:hover,
.tes-tb-loc-toggle.open {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.35);
}

.tes-tb-loc-flag {
    font-size: 16px;
    line-height: 1;
}

.tes-tb-chevron {
    width: 10px;
    height: 6px;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.tes-tb-loc-toggle.open .tes-tb-chevron {
    transform: rotate(180deg);
}

/* Dropdown */
.tes-tb-loc-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.18);
    list-style: none;
    margin: 0;
    padding: 6px 0;
    min-width: 180px;
    z-index: 100000;
    display: none;
    animation: tesFadeDown 0.16s ease;
}

@keyframes tesFadeDown {
    from { opacity:0; transform:translateY(-6px); }
    to   { opacity:1; transform:translateY(0); }
}

.tes-tb-loc-dropdown.open {
    display: block;
}

.tes-tb-loc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    color: #333 !important;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.tes-tb-loc-item-flag {
    font-size: 18px;
    line-height: 1;
}

.tes-tb-loc-item:hover,
.tes-tb-loc-item.active {
    background: #f5f5f5;
    color: var(--tes-ac, #cc0000) !important;
}

.tes-tb-loc-item.active {
    font-weight: 700;
}

/* ---- MOBILE ---- */
@media (max-width: 600px) {
    .tes-tb-inner {
        padding: 0 12px;
        height: 36px;
    }

    .tes-tb-links li a {
        padding: 0 9px;
        font-size: 11.5px;
        height: 36px;
        line-height: 36px;
    }

    .tes-tb-loc-toggle {
        font-size: 11.5px;
        padding: 4px 8px;
    }
}

@media (max-width: 420px) {
    .tes-tb-links li:not(:last-child) {
        display: none;
    }
}
