/**
 * Sergio Official - Regional Concierge Dock
 * Crafted with Impeccable Design Principles & Sergio Design System:
 * - Centered / Left floating dock layout (Zero collision with back-to-top)
 * - Single unified plane (Zero box-in-box)
 * - Native Light & Dark theme harmony (Matches data-bs-theme)
 * - Sergio Signature Chartreuse accent (#e1eeb7)
 * - Typography: DM Sans
 */

/* ==========================================================================
   Base Dock Container
   ========================================================================== */
.sergio-geo-bar {
    position: fixed;
    bottom: 26px;
    z-index: 99990;
    max-width: fit-content;
    border-radius: 9999px;
    padding: 6px 14px 6px 16px;
    font-family: var(--at-ff-body, 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    font-size: 13px;
    user-select: none;
    opacity: 0;
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* ==========================================================================
   Positioning: Center (Default) & Left
   ========================================================================== */

/* Center Mode (Default) */
.sergio-geo-bar.is-center,
.sergio-geo-bar:not(.is-left) {
    left: 50%;
    right: auto;
    transform: translateX(-50%) translateY(120%);
}

.sergio-geo-bar.is-center.is-visible,
.sergio-geo-bar:not(.is-left).is-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Left Mode */
.sergio-geo-bar.is-left {
    left: 28px;
    right: auto;
    transform: translateY(120%);
}

.sergio-geo-bar.is-left.is-visible {
    transform: translateY(0);
    opacity: 1;
}

/* ==========================================================================
   Internal Single-Plane Layout
   ========================================================================== */
.sergio-geo-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    white-space: nowrap;
}

/* Location Meta */
.sergio-geo-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.sergio-geo-pin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sergio-geo-location {
    font-weight: 600;
}

.sergio-geo-sep {
    font-size: 11px;
    opacity: 0.4;
}

.sergio-geo-desc {
    font-size: 12px;
    opacity: 0.7;
}

/* Controls Toolset */
.sergio-geo-tools {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Hairline Divider */
.sergio-geo-divider {
    display: inline-block;
    width: 1px;
    height: 12px;
}

/* Hotline Call Action */
.sergio-geo-action-call {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 3px 9px;
    border-radius: 9999px;
    transition: all 0.2s ease;
}

.sergio-geo-live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

/* Currency Switcher */
.sergio-geo-currency {
    background: transparent;
    border: none;
    padding: 2px 4px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11.5px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: color 0.15s ease;
}

.sergio-geo-currency .cur-opt {
    transition: color 0.15s ease;
}

.sergio-geo-currency .cur-opt.active {
    font-weight: 700;
}

.sergio-geo-currency .cur-slash {
    opacity: 0.3;
    font-size: 10px;
}

/* Region Popover Trigger */
.sergio-geo-select-wrap {
    position: relative;
}

.sergio-geo-trigger {
    background: transparent;
    border: none;
    padding: 2px 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: color 0.15s ease;
}

.sergio-geo-trigger svg {
    opacity: 0.6;
    transition: transform 0.2s ease;
}

/* Popover Menu */
.sergio-geo-menu {
    position: absolute;
    bottom: calc(100% + 14px);
    right: 50%;
    transform: translateX(50%);
    width: 250px;
    border-radius: 12px;
    padding: 6px;
    display: none;
    flex-direction: column;
    gap: 2px;
    z-index: 1000;
}

.sergio-geo-bar.is-left .sergio-geo-menu {
    right: auto;
    left: 0;
    transform: none;
}

.sergio-geo-menu.is-open {
    display: flex;
    animation: sergioMenuIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes sergioMenuIn {
    from {
        opacity: 0;
        transform: translate(50%, 6px);
    }
    to {
        opacity: 1;
        transform: translate(50%, 0);
    }
}

.sergio-geo-bar.is-left .sergio-geo-menu.is-open {
    animation: sergioMenuInLeft 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.sergio-geo-menu-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 6px 10px 4px;
}

.sergio-geo-opt {
    background: transparent;
    border: none;
    padding: 7px 10px;
    border-radius: 6px;
    text-align: left;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    transition: background-color 0.12s ease;
}

.sergio-geo-opt .opt-name {
    font-size: 12.5px;
    font-weight: 500;
    transition: color 0.12s ease;
}

.sergio-geo-opt .opt-phone {
    font-size: 11px;
    margin-top: 1px;
    opacity: 0.65;
}

/* Dismiss Icon */
.sergio-geo-dismiss {
    background: transparent;
    border: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.15s ease;
}

/* ==========================================================================
   THEME STYLING: LIGHT MODE (data-bs-theme="light" or default)
   ========================================================================== */
html[data-bs-theme="light"] .sergio-geo-bar,
body:not([data-bs-theme="dark"]) .sergio-geo-bar {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.09);
    box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.04);
    color: #1e1e1e;
}

html[data-bs-theme="light"] .sergio-geo-pin,
body:not([data-bs-theme="dark"]) .sergio-geo-pin {
    color: #1e1e1e;
}

html[data-bs-theme="light"] .sergio-geo-location,
body:not([data-bs-theme="dark"]) .sergio-geo-location {
    color: #1e1e1e;
}

html[data-bs-theme="light"] .sergio-geo-desc,
body:not([data-bs-theme="dark"]) .sergio-geo-desc {
    color: #64748b;
}

html[data-bs-theme="light"] .sergio-geo-divider,
body:not([data-bs-theme="dark"]) .sergio-geo-divider {
    background: rgba(0, 0, 0, 0.09);
}

html[data-bs-theme="light"] .sergio-geo-action-call,
body:not([data-bs-theme="dark"]) .sergio-geo-action-call {
    color: #1e1e1e !important;
    background: #e1eeb7; /* Signature Chartreuse */
    border: 1px solid #d2e0a2;
}

html[data-bs-theme="light"] .sergio-geo-action-call:hover,
body:not([data-bs-theme="dark"]) .sergio-geo-action-call:hover {
    background: #d4e3a0;
    color: #000000 !important;
}

html[data-bs-theme="light"] .sergio-geo-live-dot,
body:not([data-bs-theme="dark"]) .sergio-geo-live-dot {
    background: #16a34a;
}

html[data-bs-theme="light"] .sergio-geo-currency,
body:not([data-bs-theme="dark"]) .sergio-geo-currency {
    color: #64748b;
}

html[data-bs-theme="light"] .sergio-geo-currency .cur-opt.active,
body:not([data-bs-theme="dark"]) .sergio-geo-currency .cur-opt.active {
    color: #0f172a;
}

html[data-bs-theme="light"] .sergio-geo-trigger,
body:not([data-bs-theme="dark"]) .sergio-geo-trigger {
    color: #64748b;
}

html[data-bs-theme="light"] .sergio-geo-trigger:hover,
body:not([data-bs-theme="dark"]) .sergio-geo-trigger:hover {
    color: #0f172a;
}

html[data-bs-theme="light"] .sergio-geo-menu,
body:not([data-bs-theme="dark"]) .sergio-geo-menu {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.09);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

html[data-bs-theme="light"] .sergio-geo-menu-label,
body:not([data-bs-theme="dark"]) .sergio-geo-menu-label {
    color: #94a3b8;
}

html[data-bs-theme="light"] .sergio-geo-opt .opt-name,
body:not([data-bs-theme="dark"]) .sergio-geo-opt .opt-name {
    color: #1e293b;
}

html[data-bs-theme="light"] .sergio-geo-opt:hover,
body:not([data-bs-theme="dark"]) .sergio-geo-opt:hover {
    background: #f8fafc;
}

html[data-bs-theme="light"] .sergio-geo-opt.active,
body:not([data-bs-theme="dark"]) .sergio-geo-opt.active {
    background: rgba(225, 238, 183, 0.35);
}

html[data-bs-theme="light"] .sergio-geo-dismiss,
body:not([data-bs-theme="dark"]) .sergio-geo-dismiss {
    color: #94a3b8;
}

html[data-bs-theme="light"] .sergio-geo-dismiss:hover,
body:not([data-bs-theme="dark"]) .sergio-geo-dismiss:hover {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.05);
}

/* ==========================================================================
   THEME STYLING: DARK MODE (data-bs-theme="dark")
   ========================================================================== */
html[data-bs-theme="dark"] .sergio-geo-bar,
body.at-dark-mode .sergio-geo-bar {
    background: rgba(18, 18, 18, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.2);
    color: #f5f5f5;
}

html[data-bs-theme="dark"] .sergio-geo-pin,
body.at-dark-mode .sergio-geo-pin {
    color: #e1eeb7;
}

html[data-bs-theme="dark"] .sergio-geo-location,
body.at-dark-mode .sergio-geo-location {
    color: #ffffff;
}

html[data-bs-theme="dark"] .sergio-geo-desc,
body.at-dark-mode .sergio-geo-desc {
    color: #8c8c8c;
}

html[data-bs-theme="dark"] .sergio-geo-divider,
body.at-dark-mode .sergio-geo-divider {
    background: rgba(255, 255, 255, 0.12);
}

html[data-bs-theme="dark"] .sergio-geo-action-call,
body.at-dark-mode .sergio-geo-action-call {
    color: #e1eeb7 !important;
    background: rgba(225, 238, 183, 0.08);
    border: 1px solid rgba(225, 238, 183, 0.18);
}

html[data-bs-theme="dark"] .sergio-geo-action-call:hover,
body.at-dark-mode .sergio-geo-action-call:hover {
    background: rgba(225, 238, 183, 0.16);
    border-color: rgba(225, 238, 183, 0.35);
    color: #ffffff !important;
}

html[data-bs-theme="dark"] .sergio-geo-live-dot,
body.at-dark-mode .sergio-geo-live-dot {
    background: #e1eeb7;
}

html[data-bs-theme="dark"] .sergio-geo-currency,
body.at-dark-mode .sergio-geo-currency {
    color: #737373;
}

html[data-bs-theme="dark"] .sergio-geo-currency .cur-opt.active,
body.at-dark-mode .sergio-geo-currency .cur-opt.active {
    color: #ffffff;
}

html[data-bs-theme="dark"] .sergio-geo-trigger,
body.at-dark-mode .sergio-geo-trigger {
    color: #8c8c8c;
}

html[data-bs-theme="dark"] .sergio-geo-trigger:hover,
body.at-dark-mode .sergio-geo-trigger:hover {
    color: #ffffff;
}

html[data-bs-theme="dark"] .sergio-geo-menu,
body.at-dark-mode .sergio-geo-menu {
    background: #161616;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

html[data-bs-theme="dark"] .sergio-geo-menu-label,
body.at-dark-mode .sergio-geo-menu-label {
    color: #5a5a5a;
}

html[data-bs-theme="dark"] .sergio-geo-opt .opt-name,
body.at-dark-mode .sergio-geo-opt .opt-name {
    color: #d4d4d4;
}

html[data-bs-theme="dark"] .sergio-geo-opt:hover,
body.at-dark-mode .sergio-geo-opt:hover {
    background: rgba(255, 255, 255, 0.06);
}

html[data-bs-theme="dark"] .sergio-geo-opt:hover .opt-name,
body.at-dark-mode .sergio-geo-opt:hover .opt-name {
    color: #ffffff;
}

html[data-bs-theme="dark"] .sergio-geo-opt.active,
body.at-dark-mode .sergio-geo-opt.active {
    background: rgba(225, 238, 183, 0.08);
}

html[data-bs-theme="dark"] .sergio-geo-opt.active .opt-name,
body.at-dark-mode .sergio-geo-opt.active .opt-name {
    color: #e1eeb7;
}

html[data-bs-theme="dark"] .sergio-geo-dismiss,
body.at-dark-mode .sergio-geo-dismiss {
    color: #5a5a5a;
}

html[data-bs-theme="dark"] .sergio-geo-dismiss:hover,
body.at-dark-mode .sergio-geo-dismiss:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   Mobile & Small Screens
   ========================================================================== */
@media (max-width: 768px) {
    .sergio-geo-bar.is-center,
    .sergio-geo-bar.is-left,
    .sergio-geo-bar {
        left: 50% !important;
        right: auto !important;
        bottom: 18px;
        width: calc(100% - 24px);
        max-width: 440px;
        padding: 6px 12px;
        transform: translateX(-50%) translateY(120%);
    }

    .sergio-geo-bar.is-visible {
        transform: translateX(-50%) translateY(0) !important;
    }

    .sergio-geo-inner {
        justify-content: space-between;
    }

    .sergio-geo-desc {
        display: none;
    }

    .sergio-geo-sep {
        display: none;
    }

    .sergio-geo-menu {
        right: 0;
        left: auto;
        transform: none;
        width: 240px;
    }

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