/* TOLUENO | acceso de contacto discreto, independiente del tema de cada página. */
body.tol-contact-mounted {
    --tc-edge: 17px;
    --tc-size: 54px;
}

.tol-contact-widget {
    --tc-ink: #192536;
    --tc-muted: #637185;
    --tc-blue: #225bd0;
    --tc-line: #dce3ec;
    --tc-keyboard: 0px;
    --tc-viewport: 100vh;
    position: fixed;
    z-index: 1035;
    right: var(--tc-edge, 17px);
    right: calc(var(--tc-edge, 17px) + env(safe-area-inset-right, 0px));
    bottom: calc(var(--tc-edge, 17px) + var(--tc-keyboard));
    bottom: calc(var(--tc-edge, 17px) + env(safe-area-inset-bottom, 0px) + var(--tc-keyboard));
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 10px;
    pointer-events: none;
    color: var(--tc-ink);
    font: 400 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    text-align: left;
    letter-spacing: normal;
    -webkit-font-smoothing: antialiased;
}

@supports (height: 100dvh) {
    .tol-contact-widget { --tc-viewport: 100dvh; }
}

.tol-contact-widget *, .tol-contact-widget *::before, .tol-contact-widget *::after { box-sizing: border-box; }
.tol-contact-widget [hidden], .tol-contact-captcha-message[hidden] { display: none !important; }
.tol-contact-widget button, .tol-contact-widget input, .tol-contact-widget textarea {
    font: inherit;
    text-transform: none;
    letter-spacing: normal;
}
.tol-contact-widget button { cursor: pointer; }
.tol-contact-widget button:disabled { cursor: wait; opacity: .65; }
.tol-contact-widget a, .tol-contact-widget button { -webkit-tap-highlight-color: transparent; }
.tol-contact-widget :focus-visible, .tol-contact-captcha-message button:focus-visible {
    outline: 3px solid #81a8fb;
    outline-offset: 3px;
}

.tol-contact-launch {
    pointer-events: auto;
    display: grid;
    place-items: center;
    width: var(--tc-size, 54px);
    height: var(--tc-size, 54px);
    flex: 0 0 auto;
    padding: 0 !important;
    margin: 0 !important;
    border: 1px solid #ffffff40 !important;
    border-radius: 50% !important;
    background: #172536 !important;
    color: #fff !important;
    box-shadow: 0 5px 18px #17253633;
    transition: background-color .15s ease, box-shadow .15s ease;
}
.tol-contact-launch:hover { background: #28415c !important; box-shadow: 0 5px 20px #1725364d; }
.tol-contact-launch svg { display: block; width: 26px; height: 26px; }
.tol-contact-launch .tc-close-icon { display: none; width: 23px; height: 23px; }
.tol-contact-widget.is-open .tol-contact-launch .tc-message-icon { display: none; }
.tol-contact-widget.is-open .tol-contact-launch .tc-close-icon { display: block; }

/* Se retira temporalmente si tapa una acción de compra o un campo en edición. */
.tol-contact-widget.is-avoiding:not(.is-open), body.modal-open .tol-contact-widget {
    visibility: hidden;
    pointer-events: none;
}
.tol-contact-widget.is-avoiding:not(.is-open) .tol-contact-launch,
body.modal-open .tol-contact-launch,
body.modal-open .tol-contact-panel { pointer-events: none; }

.tol-contact-panel {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    width: 358px;
    max-width: calc(100vw - 2 * var(--tc-edge, 17px) - env(safe-area-inset-right, 0px) - env(safe-area-inset-left, 0px));
    max-height: calc(var(--tc-viewport) - var(--tc-size, 54px) - 2 * var(--tc-edge, 17px) - 10px - env(safe-area-inset-bottom, 0px));
    min-height: 0;
    overflow: hidden;
    padding: 0 !important;
    margin: 0 !important;
    border: 1px solid var(--tc-line);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 12px 38px #17253629;
}
.tol-contact-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 15px 15px 14px 17px;
    flex: 0 0 auto;
    background: #172536;
    color: #fff;
}
.tol-contact-head .tc-brand { display: block; color: #ffd3d6; font-size: 10px; font-weight: 850; letter-spacing: .10em; margin: 0 0 2px; }
.tol-contact-head h2 { color: #fff !important; margin: 0 !important; font: 750 18px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif !important; letter-spacing: -.02em !important; text-transform: none !important; }
.tol-contact-close {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: #ffffff14;
    color: #fff;
}
.tol-contact-close:hover { background: #ffffff24; }
.tol-contact-close svg { display: block; width: 19px; height: 19px; }
.tol-contact-content {
    min-height: 0;
    padding: 16px;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-color: #b5c1d0 #f6f8fa;
    background: #fff;
}
.tol-contact-intro { color: var(--tc-muted); margin: 0 0 14px !important; font-size: 14px; line-height: 1.5; }
.tol-contact-option {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 12px 10px;
    margin: 0 0 9px;
    border: 1px solid #e0e5ed;
    border-radius: 11px;
    background: #fff;
    color: var(--tc-ink) !important;
    line-height: 1.35;
    text-align: left;
    text-decoration: none !important;
    white-space: normal;
}
.tol-contact-option:hover { background: #f6f8fb; border-color: #bdcce1; }
.tol-contact-option-icon {
    display: grid;
    place-items: center;
    flex: 0 0 41px;
    width: 41px;
    height: 41px;
    border-radius: 10px;
    color: #315a9a;
    background: #e9effa;
}
.tol-contact-option--ig .tol-contact-option-icon { color: #b22162; background: #fbeaf2; }
.tol-contact-option-icon svg { width: 23px; height: 23px; display: block; }
.tol-contact-option-copy { min-width: 0; flex: 1; }
.tol-contact-option-copy strong { display: block; font-size: 14px; font-weight: 750; margin: 0 0 3px; color: #192536; }
.tol-contact-option-copy small { display: block; font-size: 12px; color: #606e81; overflow-wrap: anywhere; }
.tol-contact-option-nav { width: 17px; height: 17px; flex: 0 0 17px; color: #7c8da4; }
.tol-contact-profile { margin: 13px 1px 0 !important; color: var(--tc-muted); font-size: 12px; line-height: 1.45; }
.tol-contact-profile a { color: #2456b2 !important; text-decoration: underline !important; text-underline-offset: 2px; }

.tol-contact-back {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0 0 9px;
    margin: 0;
    min-height: 26px;
    border: 0;
    background: transparent;
    color: #2456b2;
    font-weight: 700 !important;
    font-size: 13px !important;
}
.tol-contact-back svg { width: 15px; height: 15px; }
.tol-contact-form { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.tol-contact-field { display: block; min-width: 0; margin: 0; }
.tol-contact-field > span { display: block; margin: 0 0 4px; color: #39495e; font-weight: 700; font-size: 12px; }
.tol-contact-field input, .tol-contact-field textarea {
    display: block;
    width: 100% !important;
    min-width: 0;
    max-width: 100%;
    min-height: 42px;
    margin: 0 !important;
    padding: 10px 11px !important;
    border: 1px solid #cfd8e5 !important;
    border-radius: 8px !important;
    color: #192536 !important;
    background: #fff !important;
    box-shadow: none !important;
    outline: none;
    font-size: 16px;
    line-height: 1.35;
}
.tol-contact-field textarea { min-height: 90px; resize: vertical; }
.tol-contact-field input:focus, .tol-contact-field textarea:focus {
    border-color: #477be3 !important;
    box-shadow: 0 0 0 3px #477be31f !important;
}
.tol-contact-captcha-target { width: 100%; max-width: 100%; }
.tol-contact-widget .tol-contact-captcha-target { overflow-x: auto; }
.tol-contact-captcha-message { font: 400 12px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; color: #64748b; margin: 6px 0; }
.tol-contact-captcha-message button {
    display: inline-block;
    padding: 5px 0;
    margin: 2px 0 0;
    color: #2359b6;
    background: transparent;
    border: 0;
    text-decoration: underline;
    font: 600 12px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}
.tol-contact-form-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 43px;
    padding: 10px 14px;
    width: 100%;
    border: 1px solid var(--tc-blue);
    border-radius: 9px;
    background: var(--tc-blue);
    color: #fff !important;
    font-weight: 750 !important;
    font-size: 14px !important;
}
.tol-contact-form-submit:hover:not(:disabled) { background: #1849b4; }
.tol-contact-response { padding: 10px 11px; border-radius: 8px; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.tol-contact-response.is-success { border: 1px solid #c6e6d3; color: #1d6844; background: #edf8f1; }
.tol-contact-response.is-error { border: 1px solid #f1c7ca; color: #982c37; background: #fff2f3; }
.tol-contact-response ul { margin: 7px 0 0; padding-left: 18px; }
.tol-contact-form-note { margin: 0 !important; color: #64748b; font-size: 11px; line-height: 1.4; }

/* En index y shop ya existe una flecha para volver arriba. Ambas quedan accesibles. */
body.tol-contact-mounted .scroll-up {
    right: calc(var(--tc-edge) + var(--tc-size) + 9px + env(safe-area-inset-right, 0px)) !important;
    bottom: calc(var(--tc-edge) + env(safe-area-inset-bottom, 0px)) !important;
}

@media (max-width: 650px) {
    body.tol-contact-mounted { --tc-edge: 12px; --tc-size: 48px; }
    .tol-contact-launch svg { width: 24px; height: 24px; }
    .tol-contact-launch .tc-close-icon { width: 21px; height: 21px; }
    .tol-contact-panel { border-radius: 13px; }
    .tol-contact-head { padding: 11px 12px 10px 14px; }
    .tol-contact-head h2 { font-size: 16px !important; }
    .tol-contact-content { padding: 12px; }
    .tol-contact-option { padding: 11px 9px; }
    .tol-contact-form { gap: 9px; }
    .tol-contact-widget.is-keyboard-open.is-open .tol-contact-launch { display: none; }
    .tol-contact-widget.is-keyboard-open.is-open .tol-contact-panel {
        max-height: calc(var(--tc-viewport) - 2 * var(--tc-edge, 12px) - env(safe-area-inset-bottom, 0px));
    }
}
@media (prefers-reduced-motion: reduce) {
    .tol-contact-launch { transition: none; }
}
