/* Acompanhar pedido — dialog + mapa (padrão dark/laranja) */
.pub-track-btn {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.pub-track-btn:hover {
    background: rgba(var(--pub-primary-rgb), 0.18);
    border-color: rgba(var(--pub-primary-rgb), 0.45);
}
.pub-track-btn.has-active {
    border-color: rgba(var(--pub-primary-rgb), 0.55);
    color: var(--pub-primary-3, #FFB347);
}
.pub-track-btn__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--pub-primary, #FF6B35);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.pub-order-track {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.pub-order-track[hidden] { display: none !important; }
.pub-order-track__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.22s ease;
}
.pub-order-track.is-open .pub-order-track__backdrop { opacity: 1; }
.pub-order-track__sheet {
    position: relative;
    z-index: 1;
    width: min(520px, 100%);
    max-height: min(92vh, 760px);
    background: #18181B;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    transform: translateY(16px);
    opacity: 0;
    transition: transform 0.22s ease, opacity 0.22s ease;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-sizing: border-box;
}
.pub-order-track.is-open .pub-order-track__sheet {
    transform: translateY(0);
    opacity: 1;
}
@media (min-width: 768px) {
    .pub-order-track {
        align-items: center;
        padding: 1.5rem;
    }
    .pub-order-track__sheet {
        border-radius: 20px;
        max-height: min(86vh, 720px);
    }
}

.pub-order-track__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.1rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.pub-order-track__kicker {
    margin: 0;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #A1A1AA;
}
.pub-order-track__title {
    margin: 0.15rem 0 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
}
.pub-order-track__close,
.pub-order-track__back {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.pub-order-track__body {
    padding: 1rem 1.1rem 1.25rem;
    overflow: auto;
    flex: 1;
}

.pub-track-perm {
    margin: 0 0 0.85rem;
    padding: 0.85rem 0.9rem;
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(var(--pub-primary-rgb), 0.22), rgba(var(--pub-primary-rgb), 0.08));
    border: 1px solid rgba(var(--pub-primary-rgb), 0.4);
}
.pub-track-perm[hidden] { display: none !important; }
.pub-track-perm__title {
    margin: 0 0 0.25rem;
    font-size: 0.92rem;
    font-weight: 700;
    color: #FFE8DC;
}
.pub-track-perm__hint {
    margin: 0 0 0.7rem;
    font-size: 0.78rem;
    line-height: 1.35;
    color: #FFD4C2;
    opacity: 0.92;
}
.pub-track-perm__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 2.55rem;
    border: 0;
    border-radius: 10px;
    background: var(--pub-primary, #FF6B35);
    color: #1a0f0a;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
}
.pub-track-perm__btn:active {
    transform: scale(0.98);
}

.pub-track-perm__ios {
    margin: 0.55rem 0 0;
    font-size: 0.72rem;
    line-height: 1.35;
    color: #FFD4C2;
    opacity: 0.88;
}
.pub-track-perm__ios[hidden] { display: none !important; }

.pub-track-sound {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0 0 0.85rem;
    padding: 0.55rem 0.7rem;
    border-radius: 10px;
    background: rgba(var(--pub-primary-rgb), 0.1);
    border: 1px solid rgba(var(--pub-primary-rgb), 0.28);
    color: #FFD4C2;
    font-size: 0.82rem;
    cursor: pointer;
    user-select: none;
}
.pub-track-sound input {
    width: 1.05rem;
    height: 1.05rem;
    accent-color: var(--pub-primary, #FF6B35);
    flex-shrink: 0;
}

.pub-track-btn.is-alerting {
    animation: pub-track-pulse 0.9s ease 2;
}
@keyframes pub-track-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(var(--pub-primary-rgb), 0); }
    40% { box-shadow: 0 0 0 8px rgba(var(--pub-primary-rgb), 0.35); }
}

.pub-track-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: #A1A1AA;
}
.pub-track-empty i {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.75rem;
    opacity: 0.7;
}

.pub-track-order {
    width: 100%;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    border-radius: 14px;
    padding: 0.9rem 1rem;
    margin-bottom: 0.65rem;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.pub-track-order:hover {
    border-color: rgba(var(--pub-primary-rgb), 0.55);
    background: rgba(var(--pub-primary-rgb), 0.1);
}
.pub-track-order__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}
.pub-track-order__store {
    display: block;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.85);
}
.pub-track-order__phase {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.78rem;
    color: var(--pub-primary-3, #FFB347);
}
.pub-track-live {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #0F0F10;
    background: #4ADE80;
    border-radius: 999px;
    padding: 0.15rem 0.45rem;
}

.pub-track-status {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
}
.pub-track-hint {
    margin: 0 0 0.75rem;
    font-size: 0.85rem;
    color: #A1A1AA;
}
.pub-track-done {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.45rem;
    margin: 0.35rem 0 0.5rem;
    padding: 1.6rem 1.1rem;
    border-radius: 16px;
    background: rgba(74, 222, 128, 0.12);
    border: 1px solid rgba(74, 222, 128, 0.35);
    color: #fff;
}
.pub-track-done[hidden] {
    display: none !important;
}
.pub-track-done > i {
    font-size: 2.4rem;
    color: #4ADE80;
    line-height: 1;
}
.pub-track-done__title {
    margin: 0.2rem 0 0;
    font-size: 1.25rem;
    font-weight: 800;
}
.pub-track-done__hint {
    margin: 0;
    font-size: 0.9rem;
    color: #C4C4CC;
}
.pub-track-done__back {
    margin-top: 0.75rem;
    min-height: 48px;
    padding: 0.65rem 1.2rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}
.pub-track-queue {
    margin: 0 0 0.85rem;
    padding: 0.75rem 0.9rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}
.pub-track-queue__title {
    margin: 0 0 0.45rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--pub-primary-3, #FFB347);
}
.pub-track-queue__list {
    margin: 0;
    padding-left: 1.2rem;
    font-size: 0.9rem;
}
.pub-track-queue__list li.is-you {
    font-weight: 800;
    color: var(--pub-primary, #FF6B35);
}
.pub-track-queue__eta {
    margin: 0.45rem 0 0;
    font-size: 0.8rem;
    color: #A1A1AA;
}
.pub-track-code {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    margin: 0 0 0.85rem;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    background: rgba(var(--pub-primary-rgb), 0.16);
    border: 1px solid rgba(var(--pub-primary-rgb), 0.4);
    color: #fff;
    text-align: center;
}
.pub-track-code__label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--pub-primary-3, #FFB347);
    font-weight: 600;
}
.pub-track-code__digits {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0.28em;
    color: #fff;
    line-height: 1.2;
}
.pub-track-code__hint {
    font-size: 0.8rem;
    color: #A1A1AA;
}
.pub-track-order__code {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.45rem;
    padding: 0.3rem 0.55rem;
    border-radius: 8px;
    background: rgba(var(--pub-primary-rgb), 0.18);
    color: var(--pub-primary-3, #FFB347);
    font-size: 0.8rem;
}
.pub-track-order__code strong {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: 0.12em;
    color: #fff;
}
.pub-track-eta {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0 0 0.5rem;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    background: rgba(var(--pub-primary-rgb), 0.16);
    color: var(--pub-primary-3, #FFB347);
    font-size: 0.85rem;
    font-weight: 600;
}
.pub-track-vehicle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0 0 0.85rem;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.82rem;
    font-weight: 600;
}
.pub-track-map {
    height: 280px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #0F0F10;
}
.pub-track-map.is-empty {
    display: flex;
    align-items: center;
    justify-content: center;
}
.pub-track-map.is-empty::after {
    content: 'O mapa aparece quando o entregador sai com o pedido e envia o GPS.';
    color: #A1A1AA;
    font-size: 0.82rem;
    text-align: center;
    padding: 1.5rem;
    max-width: 16rem;
}
.pub-track-marker { background: transparent !important; border: 0 !important; }
.pub-track-marker__dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    border: 2px solid #fff;
}

body.pub-track-open { overflow: hidden; }
