/* WISPA · capa visual sobre Bootstrap 5 */

:root {
    --wx-radius: .8rem;
    --wx-shadow-rgb: 15 23 42;
    --wx-border: rgb(var(--wx-shadow-rgb) / .12);
    --wx-shadow-sm: 0 2px 8px rgb(var(--wx-shadow-rgb) / .06);
    --wx-shadow-md: 0 10px 30px rgb(var(--wx-shadow-rgb) / .12);
}

/* ==========================================================================
   NAVEGACIÓN ADMIN
   ========================================================================== */
.offcanvas-lg.wx-side,
.wx-side {
    width: var(--wx-side);
    color: var(--wx-sidebar-contrast);
    background-color: var(--wx-sidebar) !important;
    border-right: 1px solid color-mix(in srgb, var(--wx-sidebar-contrast) 8%, transparent);
    box-shadow: 3px 0 18px var(--wx-border);
    transition: width .2s ease;
    --bs-offcanvas-bg: var(--wx-sidebar);
    --bs-offcanvas-color: var(--wx-sidebar-contrast);
}

.wx-side .nav-link {
    position: relative;
    min-height: 42px;
    padding: .62rem .7rem;
    color: color-mix(in srgb, var(--wx-sidebar-contrast) 70%, transparent);
    border: 1px solid transparent;
    border-radius: .65rem;
    white-space: nowrap;
    transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}

.wx-brand-link {
    min-height: 48px;
}

.wx-brand-logo-wrap {
    display: flex;
    align-items: center;
    width: min(100%, 190px);
    height: 48px;
    overflow: hidden;
}

.wx-brand-logo-full {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 46px;
    object-fit: contain;
    object-position: left center;
}

.wx-brand-favicon {
    display: none;
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.wx-logo-force-white {
    filter: brightness(0) invert(1);
}

.wx-side .nav-link:hover,
.wx-side .nav-link:focus-visible {
    color: var(--wx-sidebar-contrast);
    background-color: color-mix(in srgb, var(--bs-primary) 24%, transparent);
    border-color: color-mix(in srgb, var(--bs-primary) 42%, transparent);
}

.wx-side .nav-link.active {
    color: var(--wx-sidebar-contrast);
    background-color: color-mix(in srgb, var(--bs-primary) 30%, transparent);
    border-color: color-mix(in srgb, var(--bs-primary) 48%, transparent);
    font-weight: 600;
}

.wx-side .nav-link.active::before {
    position: absolute;
    top: 9px;
    bottom: 9px;
    left: -4px;
    width: 3px;
    content: "";
    background-color: var(--bs-primary);
    border-radius: 0 3px 3px 0;
}

.wx-side .nav-link .bi:first-child {
    min-width: 1.35rem;
    color: color-mix(in srgb, var(--wx-sidebar-contrast) 72%, transparent);
    font-size: 1.05rem;
    text-align: center;
}

.wx-side .nav-link:hover .bi:first-child,
.wx-side .nav-link.active .bi:first-child {
    color: color-mix(in srgb, var(--bs-primary) 55%, white);
}

.wx-side .submenu {
    margin: .15rem 0 .35rem .95rem;
    padding-left: .55rem;
    border-left: 1px solid color-mix(in srgb, var(--wx-sidebar-contrast) 14%, transparent);
}

.wx-side .submenu .nav-link {
    min-height: 34px;
    margin-bottom: 2px;
    padding: .4rem .65rem;
    font-size: .86rem;
}

.wx-side .submenu .nav-link.active {
    color: var(--bs-primary-contrast);
    background-color: var(--bs-primary);
    border-color: transparent;
}

.wx-side .submenu .nav-link.active::before {
    display: none;
}

.wx-side .caret {
    transition: transform .16s ease;
}

.wx-side [aria-expanded="true"] .caret {
    transform: rotate(90deg);
}

.wx-toggle {
    position: fixed;
    top: 18px;
    left: calc(var(--wx-side) - 17px);
    z-index: 1040;
    width: 34px;
    height: 34px;
    color: var(--bs-primary-contrast);
    background-color: var(--bs-primary);
    border: 3px solid var(--bs-body-bg);
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--wx-accent) 48%, transparent),
        0 3px 10px rgb(var(--wx-shadow-rgb) / .2);
    transition: left .2s ease, transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.wx-toggle:hover,
.wx-toggle:focus-visible {
    color: var(--bs-primary-contrast);
    background-color: var(--bs-primary-hover);
    transform: scale(1.06);
    box-shadow:
        0 0 0 2px color-mix(in srgb, var(--wx-accent) 58%, transparent),
        0 5px 14px rgb(var(--wx-shadow-rgb) / .28);
}

.wx-menu-flyout {
    position: fixed;
    z-index: 1090;
    width: 220px;
    padding: .45rem;
    color: var(--bs-body-color);
    background-color: var(--bs-body-bg);
    border: 1px solid var(--wx-border);
    border-radius: .75rem;
}

.wx-menu-flyout-title {
    padding: .45rem .6rem .55rem;
    color: var(--bs-secondary-color);
    border-bottom: 1px solid var(--bs-border-color);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.wx-menu-flyout-link {
    display: flex;
    align-items: center;
    min-height: 38px;
    margin-top: .2rem;
    padding: .48rem .65rem;
    color: var(--bs-body-color);
    border-radius: .5rem;
    text-decoration: none;
}

.wx-menu-flyout-link:hover,
.wx-menu-flyout-link:focus-visible {
    color: var(--bs-primary);
    background-color: var(--bs-tertiary-bg);
}

.wx-menu-flyout-link.active {
    color: var(--bs-primary-contrast);
    background-color: var(--bs-primary);
}

@media (min-width: 992px) {
    .wx-side {
        position: fixed;
        z-index: 1030;
        top: 0;
        bottom: 0;
        left: 0;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .wx-main {
        margin-left: var(--wx-side);
        transition: margin-left .2s ease;
    }

    .wx-mini .wx-side {
        width: var(--wx-mini);
        overflow-x: hidden;
    }

    .wx-mini .wx-main {
        margin-left: var(--wx-mini);
    }

    .wx-mini .wx-toggle {
        left: calc(var(--wx-mini) - 17px);
    }

    .wx-mini .wx-side .wx-label,
    .wx-mini .wx-side .caret,
    .wx-mini .wx-side .badge-pronto,
    .wx-mini .wx-side .submenu {
        display: none;
    }

    .wx-mini .wx-side .nav-link {
        justify-content: center;
        min-height: 44px;
        padding-right: .5rem;
        padding-left: .5rem;
    }

    .wx-mini .wx-side .nav-link.active::before {
        left: -8px;
    }

    .wx-mini .wx-brand-link {
        justify-content: center;
        padding-right: 0 !important;
        padding-left: 0 !important;
    }

    .wx-mini .wx-brand-logo-wrap {
        justify-content: center;
        width: 40px;
    }

    .wx-mini .wx-brand-logo-wrap.has-favicon .wx-brand-logo-full {
        display: none;
    }

    .wx-mini .wx-brand-logo-wrap.has-favicon .wx-brand-favicon {
        display: block;
    }

    .wx-mini .wx-brand-logo-wrap:not(.has-favicon) .wx-brand-logo-full {
        max-width: 40px;
        max-height: 40px;
    }
}

.wx-customer-content .card {
    border: 1px solid var(--wx-border) !important;
    border-radius: var(--wx-radius);
    box-shadow: var(--wx-shadow-sm) !important;
}

.wx-customer-content .card-header,
.wx-customer-edit .wx-edit-section .card-header {
    background-color: var(--bs-tertiary-bg);
    border-bottom: 1px solid var(--bs-border-color);
}

.wx-customer-content .form-control,
.wx-customer-content .form-select {
    border-color: color-mix(in srgb, var(--bs-border-color) 82%, var(--bs-secondary-color));
}

.wx-customer-content .form-control:focus,
.wx-customer-content .form-select:focus {
    border-color: color-mix(in srgb, var(--bs-primary) 65%, white);
    box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--bs-primary) 15%, transparent);
}

.wx-location-map {
    width: 100%;
    height: min(58vh, 560px);
    min-height: 340px;
    background-color: var(--bs-tertiary-bg);
}

.wx-location-map .leaflet-control-attribution {
    font-size: .68rem;
}

.wx-coordinate-box {
    padding: 1rem;
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: .85rem;
}

.wx-coordinate-box .form-control[readonly] {
    color: var(--bs-emphasis-color);
    background: var(--bs-body-bg);
}

@media (max-width: 767.98px) {
    .wx-page-header {
        flex-direction: row !important;
        align-items: center !important;
    }

    .wx-page-header .wx-page-actions {
        flex-wrap: nowrap !important;
        margin-left: auto;
    }

    .wx-page-header .wx-page-actions .wx-action-icon {
        display: inline-flex;
        width: 38px;
        height: 38px;
        padding: 0;
        align-items: center;
        justify-content: center;
    }

    .wx-page-header .wx-page-actions .wx-action-label {
        display: none;
    }

    .wx-page-header .wx-page-actions .wx-action-icon-symbol {
        margin: 0 !important;
        font-size: 1rem;
    }

    .wx-location-map {
        height: 55vh;
        min-height: 300px;
    }
}
