/* BR-1215: guided product tours (driver.js) in the V2 theme. Loaded from index.php; every rule is scoped to tour classes.
   Fonts: the app registers one family per weight (MontserratRegular/SemiBold/Bold); there is no plain "Montserrat".
   Stacking: V2 side panels are 10001, dialogs 10002, select menus 10003 (revamp_stylesV2.css). The
   help button uses 10001 (appended to <body> after the panels, so it sits over them and under dialogs); the tour
   overlay uses 10002 because the filter panel nests one 10001 layer inside another. */

/* ---- popover ---- */
.driver-popover.id-tour {
    background: #fff;
    color: #2b2140;
    border-radius: 12px;
    padding: 18px 20px 14px;
    min-width: 300px;
    max-width: 360px;
    box-shadow: 0 18px 44px rgba(26, 14, 51, .38);
    font-family: MontserratRegular, Montserrat, system-ui, sans-serif;
}
.id-tour .driver-popover-title {
    background: none;
    padding: 0;
    margin: 0 0 6px;
    font: 700 17px/1.3 MontserratBold, Montserrat, system-ui, sans-serif;
    color: #33225a;
}
.id-tour .driver-popover-description {
    font: 400 14px/1.55 MontserratRegular, Montserrat, system-ui, sans-serif;
    color: #4b4262;
}
.id-tour .driver-popover-description b { font-family: MontserratBold, Montserrat, system-ui, sans-serif; font-weight: 700; color: #2b2140; }
.id-tour .driver-popover-progress-text { font: 600 12px MontserratSemiBold, Montserrat, system-ui, sans-serif; color: #8d84a3; }
.id-tour .driver-popover-footer { margin-top: 16px; gap: 8px; align-items: center; }
.id-tour .driver-popover-navigation-btns { gap: 8px; }
.id-tour .driver-popover-footer button {
    text-shadow: none;
    border-radius: 8px;
    padding: 8px 16px;
    margin: 0;
    font: 600 13px MontserratSemiBold, Montserrat, system-ui, sans-serif;
    border: 1px solid #33225a;
    background: #fff;
    color: #33225a;
}
.id-tour .driver-popover-footer button:hover { background: #f1edf8; }
.id-tour .driver-popover-footer .driver-popover-next-btn { background: #33225a; color: #fff; }
.id-tour .driver-popover-footer .driver-popover-next-btn:hover { background: #452f74; }
.id-tour .driver-popover-footer button.id-tour-skip {
    border: 0;
    background: none;
    color: #8d84a3;
    padding: 8px 2px;
    margin-right: auto;
}
.id-tour .driver-popover-footer button.id-tour-skip:hover { color: #33225a; background: none; }
.id-tour .driver-popover-close-btn { color: #8d84a3; }
.id-tour .driver-popover-close-btn:hover { color: #33225a; }
.id-tour.driver-popover:focus { outline: none; }   /* BR-1273: the popover takes focus, not the x */
.id-tour .driver-popover-footer button:focus-visible,
.id-tour .driver-popover-close-btn:focus-visible { outline: 3px solid #e74c3c; outline-offset: 2px; }
.id-tour .id-tour-bar { height: 4px; border-radius: 4px; background: #ece8f4; margin-top: 12px; overflow: hidden; }
.id-tour .id-tour-bar i { display: block; height: 100%; background: #e74c3c; transition: width .3s; }
.id-tour.id-tour-busy .driver-popover-footer button { opacity: .5; pointer-events: none; }
.id-tour.id-tour-welcome { min-width: 380px; max-width: 420px; }
.id-tour .id-tour-eyebrow {
    font: 700 11px MontserratBold, Montserrat, system-ui, sans-serif;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #e74c3c;
    margin-bottom: 6px;
}

/* ---- overlay + highlighted element ---- */
.driver-overlay { z-index: 10002 !important; } /* over panels (10001) including the nested filter panel */
.driver-active .driver-active-element { outline: 3px solid #e74c3c !important; outline-offset: 3px; border-radius: 6px; }

/* Keep the V2 side menu open while a tour step points into it (mirrors revamp_stylesV2.css .leftmenupanel:hover). */
.leftmenupanel.id-tour-menu-open { flex: 0 0 182px; max-width: 182px; }
.leftmenupanel.id-tour-menu-open ul li a span.menu-text { display: inline-flex; }
/* ...and a group's flyout, when a step points at one of its entries (Customers > Customers List). */
.leftmenupanel.id-tour-menu-open li.id-tour-sub-open > .submenu { display: block !important; }

/* ---- help button + menu ---- */
.id-help-fab {
    position: fixed;
    right: 22px;
    bottom: 22px;
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 50%;
    background: #33225a;
    color: #fff;
    font: 700 24px/52px MontserratBold, Montserrat, system-ui, sans-serif;
    text-align: center;
    padding: 0;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(26, 14, 51, .4);
    z-index: 10001;
}
.id-help-fab:hover { background: #452f74; }
.id-help-fab:focus-visible { outline: 3px solid #e74c3c; outline-offset: 3px; }
.id-help-menu {
    position: fixed;
    right: 22px;
    bottom: 86px;
    width: 290px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 18px 44px rgba(26, 14, 51, .32);
    padding: 8px;
    z-index: 10001;
    font-family: MontserratRegular, Montserrat, system-ui, sans-serif;
}
.id-help-menu h4 {
    margin: 6px 10px 8px;
    font: 700 12px MontserratBold, Montserrat, system-ui, sans-serif;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #8d84a3;
}
.id-help-menu button {
    display: flex;
    width: 100%;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: #2b2140;
    font: 600 14px MontserratSemiBold, Montserrat, system-ui, sans-serif;
    text-align: left;
    cursor: pointer;
}
.id-help-menu button:hover, .id-help-menu button:focus-visible { background: #f1edf8; color: #33225a; outline: none; }
.id-help-menu button span.id-ico {
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: #ece8f4;
    color: #33225a;
    display: grid;
    place-items: center;
    font-size: 13px;
}
.id-help-menu button.id-primary span.id-ico { background: #33225a; color: #fff; }
.id-help-menu small { display: block; font: 400 12px MontserratRegular, Montserrat, system-ui, sans-serif; color: #8d84a3; }


/* ---- chat with our team (WhatsApp): first menu item + its panel ---- */
.id-help-menu button.id-chat { background: #eaf7ef; }
.id-help-menu button.id-chat:hover, .id-help-menu button.id-chat:focus-visible { background: #dcf1e4; color: #14532d; }
.id-help-menu button.id-chat span.id-ico { background: #15803d; color: #fff; }
.id-help-menu button.id-chat span.id-ico svg { width: 17px; height: 17px; }
.id-help-sep { height: 1px; background: #eeebf4; margin: 6px 10px; }
.id-help-menu.id-help-chat { width: 330px; box-sizing: border-box; padding: 6px 18px 18px; display: flex; flex-direction: column; gap: 14px; }
.id-chat-head { display: flex; align-items: center; justify-content: space-between; margin: 0 -10px; }
.id-chat-head h4 { margin: 0; }
.id-help-menu .id-chat-head button { width: 36px; height: 36px; padding: 0; justify-content: center; color: #5d5375; }
.id-chat-title { font: 700 17px MontserratBold, Montserrat, system-ui, sans-serif; color: #1f1438; }
.id-chat-intro { margin: -8px 0 0; font: 400 13px/1.45 MontserratRegular, Montserrat, system-ui, sans-serif; color: #5d5375; }
.id-chat-qr { display: flex; gap: 14px; align-items: center; border: 1px solid #e7e3ef; border-radius: 12px; padding: 12px; }
.id-chat-code { flex: none; width: 132px; height: 132px; }
.id-chat-code svg { display: block; width: 100%; height: 100%; }
.id-chat-how { display: flex; flex-direction: column; gap: 6px; min-width: 0; font: 400 13px/1.4 MontserratRegular, Montserrat, system-ui, sans-serif; color: #3f3656; }
.id-chat-how b { font: 700 14px MontserratBold, Montserrat, system-ui, sans-serif; color: #1f1438; }
.id-chat-or { display: flex; align-items: center; gap: 10px; font: 400 12px MontserratRegular, Montserrat, system-ui, sans-serif; color: #8d84a3; }
.id-chat-or::before, .id-chat-or::after { content: ''; flex: 1; height: 1px; background: #eeebf4; }
a.id-chat-open { display: flex; align-items: center; justify-content: center; gap: 10px; height: 46px; border-radius: 10px; background: #15803d; color: #fff !important; font: 600 14px MontserratSemiBold, Montserrat, system-ui, sans-serif; text-decoration: none !important; }
a.id-chat-open:hover, a.id-chat-open:focus-visible { background: #166534; outline: none; }
.id-chat-number { display: flex; align-items: center; justify-content: space-between; gap: 8px; font: 400 13px MontserratRegular, Montserrat, system-ui, sans-serif; color: #5d5375; }
.id-chat-number b { color: #1f1438; font-variant-numeric: tabular-nums; }
.id-help-menu .id-chat-number button.id-chat-copy { width: auto; padding: 6px 8px; color: #33225a; font-size: 13px; }

/* Below 993px the V2 shell hides page content and tours can't run, but chat still can: the button stays and
   the menu becomes a bottom sheet over a dimmed page (tap the dim to close). */
.id-help-scrim { display: none; }
@media (max-width: 992px) {
    /* white ring: below 993px the shell shows its purple "rotate your device" screen, the same colour as the button */
    .id-help-fab { right: 16px; bottom: 24px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .9), 0 8px 22px rgba(26, 14, 51, .4); }
    .id-help-scrim { display: block; position: fixed; inset: 0; background: rgba(26, 14, 51, .5); z-index: 10000; }
    .id-help-menu, .id-help-menu.id-help-chat {
        left: 0; right: 0; bottom: 0; width: auto; max-height: 90vh; overflow-y: auto;
        border-radius: 20px 20px 0 0; padding: 14px 16px 26px; z-index: 10002;
    }
    .id-help-menu.id-help-chat { padding: 10px 20px 28px; gap: 16px; }
    .id-help-menu button { min-height: 52px; font-size: 15px; }
    .id-help-menu .id-chat-head button, .id-help-menu .id-chat-number button.id-chat-copy { min-width: 44px; min-height: 44px; }
    .id-chat-code { width: 104px; height: 104px; }
    a.id-chat-open { height: 52px; font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .id-tour .id-tour-bar i { transition: none; }
}
