/* Ubicación del pedido de ventas.
   Hereda el color de marca desde variables.css (--brand-color se sobreescribe por overlay). */

.order-location-container {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    padding: .75rem;
    min-height: 100vh;
    box-sizing: border-box;
    background-color: var(--ct-light-grey, #f2f2f2);
}

/* ---------- header ---------- */

.order-location-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
}

.order-location-header-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.order-location-title {
    margin: 0;
    font-size: 1.15rem;
    line-height: 1.25;
    font-weight: 700;
    color: var(--brand-color, #774286);
    overflow-wrap: break-word;
}

.order-location-order-id {
    font-size: .95rem;
    font-weight: 600;
    color: var(--ct-mid-grey, rgb(153, 153, 153));
    font-variant-numeric: tabular-nums;
}

/* Shown on its own when the host supplies the title bar, so it needs the paragraph margin reset. */
.order-location-order-id--standalone {
    margin: 0;
}

.order-location-close {
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    background-color: var(--brand-color, #774286);
    color: var(--brand-text-color, #fff);
    font-size: .9rem;
    line-height: 1;
}

.order-location-close:focus-visible {
    outline: 2px solid var(--ct-text-color, #222);
    outline-offset: 2px;
}

/* ---------- estados: carga, error, sin seguimiento ---------- */

.order-location-state {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    padding: 2rem 1.25rem;
    text-align: center;
    background-color: var(--ct-light-white, #fff);
    border-radius: var(--ct-border-radius, .25rem);
}

.order-location-state-image {
    max-width: 190px;
    width: 60%;
    height: auto;
}

.order-location-state-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--brand-color, #774286);
}

.order-location-state-message {
    margin: 0;
    max-width: 34ch;
    font-size: .9rem;
    line-height: 1.5;
    color: var(--ct-mid-grey, rgb(153, 153, 153));
}

.order-location-spinner {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: 3px solid var(--ct-light-grey, #f2f2f2);
    border-top-color: var(--brand-color, #774286);
    animation: order-location-spin .9s linear infinite;
}

@keyframes order-location-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .order-location-spinner {
        animation-duration: 2.4s;
    }
}

/* ---------- aviso de vehículo sin posición ---------- */

.order-location-notice {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    padding: .65rem .8rem;
    border-radius: var(--ct-border-radius, .25rem);
    background-color: var(--brand-color-rgba-01, rgba(119, 66, 134, .1));
    color: var(--ct-text-color, rgb(34, 34, 34));
    font-size: .85rem;
    line-height: 1.45;
}

.order-location-notice i {
    margin-top: .15rem;
    color: var(--brand-color, #774286);
}

/* ---------- mapa ---------- */

.order-location-map-card {
    position: relative;
    flex: 1 1 auto;
    min-height: 320px;
    border-radius: var(--ct-border-radius, .25rem);
    overflow: hidden;
    background-color: var(--ct-light-white, #fff);
}

.order-location-map {
    width: 100%;
    height: 100%;
    min-height: 320px;
}

/* Shown instead of the map when it cannot be drawn. It fills the same frame so the layout does
   not jump, and it uses the body colour because it is a message the user has to read. */
.order-location-map-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    margin: 0;
    padding: 2rem 1.25rem;
    box-sizing: border-box;
    text-align: center;
    font-size: .9rem;
    line-height: 1.5;
    color: var(--ct-text-color, rgb(34, 34, 34));
}

.order-location-vehicle-legend {
    position: absolute;
    top: .6rem;
    left: .6rem;
    display: flex;
    flex-direction: column;
    padding: .35rem .6rem;
    border-radius: var(--ct-border-radius, .25rem);
    background-color: rgba(255, 255, 255, .93);
    box-shadow: 0 1px 4px var(--ct-select-customer-shadow-light, rgba(0, 0, 0, .1));
    pointer-events: none;
    max-width: 60%;
}

.order-location-vehicle-legend-title {
    font-size: .8rem;
    font-weight: 700;
    color: var(--ct-text-color, rgb(34, 34, 34));
}

.order-location-vehicle-legend-subtitle {
    font-size: .7rem;
    color: var(--ct-mid-grey, rgb(153, 153, 153));
}

/* ---------- tarjeta de seguimiento ---------- */

.order-location-tracking-card {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin: 0;
    padding: .85rem 1rem;
    border-radius: var(--ct-border-radius, .25rem);
    background-color: var(--ct-light-white, #fff);
}

.order-location-tracking-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.order-location-tracking-row dt {
    flex: 0 0 auto;
    font-size: .8rem;
    color: var(--ct-mid-grey, rgb(153, 153, 153));
}

.order-location-tracking-row dd {
    margin: 0;
    text-align: right;
    font-size: .88rem;
    font-weight: 600;
    color: var(--ct-text-color, rgb(34, 34, 34));
    overflow-wrap: anywhere;
}

.order-location-status-pill {
    display: inline-block;
    padding: .15rem .55rem;
    border-radius: 999px;
    background-color: var(--brand-color, #774286);
    color: var(--brand-text-color, #fff);
    font-size: .78rem;
    font-weight: 600;
    white-space: nowrap;
}
