:root {
    --tral-navy: #10283f;
    --tral-navy-2: #173d5d;
    --tral-yellow: #f2c318;
    --tral-green: #2f8b62;
    --tral-ink: #16222d;
    --tral-muted: #647483;
    --tral-line: #dce4e9;
    --tral-white: #fff;
}

html body .tral-chat-launcher {
    position: fixed !important;
    z-index: 1000001;
    right: 22px !important;
    left: auto !important;
    top: auto !important;
    bottom: 20px !important;
    display: block !important;
    align-items: center;
    width: 122px !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 122px !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 50%;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    color: var(--tral-white) !important;
    box-shadow: none !important;
    filter: drop-shadow(0 11px 13px rgba(16, 40, 63, .32));
    line-height: 0 !important;
    text-decoration: none !important;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transform-origin: center;
    transition: transform .18s ease, filter .18s ease;
}

html body .tral-chat-launcher::before,
html body .tral-chat-launcher::after { display: none !important; content: none !important; }
html body .tral-chat-launcher:hover,
html body .tral-chat-launcher:focus,
html body .tral-chat-launcher:active { background: transparent !important; box-shadow: none !important; color: #fff !important; }
html body .tral-chat-launcher:hover { transform: translateY(-3px) scale(1.035); filter: drop-shadow(0 14px 16px rgba(16, 40, 63, .38)); }
html body .tral-chat-launcher:focus-visible { outline: 3px solid var(--tral-yellow) !important; outline-offset: 2px; }
html body .tral-chat-launcher__icon { display: block !important; width: 100% !important; height: 100% !important; margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; object-fit: contain; }
html body .tral-chat-launcher__label {
    position: absolute;
    top: 50%;
    right: 108px;
    width: max-content;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--tral-navy);
    color: #fff;
    font-size: 13px;
    font-weight: 750;
    line-height: 1;
    opacity: 0;
    pointer-events: none;
    transform: translate(6px, -50%);
    transition: opacity .18s ease, transform .18s ease;
}
html body .tral-chat-launcher:hover .tral-chat-launcher__label,
html body .tral-chat-launcher:focus-visible .tral-chat-launcher__label { opacity: 1; transform: translate(0, -50%); }
html body .tral-chat-launcher[aria-expanded="true"] .tral-chat-launcher__label { opacity: 0; }

.tral-chat {
    position: fixed !important;
    z-index: 1000000;
    right: 28px !important;
    left: auto !important;
    top: auto !important;
    bottom: 139px !important;
    display: flex;
    visibility: hidden;
    flex-direction: column;
    width: min(400px, calc(100vw - 32px)) !important;
    height: min(535px, calc(100dvh - 170px)) !important;
    min-height: 390px;
    margin: 0 !important;
    overflow: hidden;
    border: 1px solid rgba(16, 40, 63, .14);
    border-radius: 22px;
    background: linear-gradient(180deg, #edf4f7 0%, #f7f9fa 42%, #f7f9fa 100%);
    box-shadow: 0 26px 70px rgba(16, 40, 63, .3), 0 5px 18px rgba(16, 40, 63, .12);
    backdrop-filter: blur(14px);
    opacity: 0;
    transform: translateY(18px) scale(.94);
    transform-origin: bottom right;
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
}

.tral-chat.is-open { visibility: visible; opacity: 1; transform: none; }
html body .tral-chat .tral-chat__header {
    display: flex !important;
    flex: 0 0 auto;
    align-items: center !important;
    justify-content: space-between !important;
    min-height: 82px !important;
    margin: 0 !important;
    padding: 13px 14px 13px 16px !important;
    border: 0 !important;
    background: linear-gradient(135deg, #0d2941 0%, #174765 100%) !important;
    color: #fff !important;
}
.tral-chat__identity { display: flex; min-width: 0; align-items: center; gap: 11px; }
.tral-chat__avatar { position: relative; display: grid; flex: 0 0 50px; width: 50px; height: 50px; place-items: center; border: 2px solid rgba(255, 255, 255, .82); border-radius: 50%; background: rgba(255, 255, 255, .96); box-shadow: 0 5px 15px rgba(0, 0, 0, .18); }
.tral-chat__avatar img { display: block !important; width: 48px !important; height: 48px !important; margin: 0 !important; object-fit: contain; }
.tral-chat__avatar i { position: absolute; right: -1px; bottom: 1px; width: 12px; height: 12px; border: 2px solid #fff; border-radius: 50%; background: #32c77a; box-shadow: 0 0 0 2px rgba(50, 199, 122, .18); }
.tral-chat__identity-text { display: block; min-width: 0; }
.tral-chat__header strong,
.tral-chat__header small { display: block; }
.tral-chat__header strong { color: #fff !important; font-size: 17px; font-weight: 800; letter-spacing: -.15px; line-height: 1.2; }
.tral-chat__header small { overflow: hidden; margin-top: 5px; color: rgba(255, 255, 255, .78) !important; font-size: 10.5px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
html body .tral-chat .tral-chat__close,
html body .tral-contact-modal__close {
    display: grid !important;
    flex: 0 0 36px;
    width: 36px !important;
    min-width: 0 !important;
    max-width: 36px !important;
    height: 36px !important;
    min-height: 0 !important;
    max-height: 36px !important;
    margin: 0 !important;
    padding: 0 !important;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .18) !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, .1) !important;
    box-shadow: none !important;
    color: #fff !important;
    font-size: 25px !important;
    font-weight: 300 !important;
    line-height: 1 !important;
    appearance: none;
    cursor: pointer;
}
html body .tral-chat .tral-chat__close:hover { background: rgba(255, 255, 255, .2) !important; transform: rotate(5deg); }
.tral-chat__messages { flex: 1 1 auto; overflow: auto; padding: 18px 16px 10px; scroll-behavior: smooth; scrollbar-color: rgba(16, 40, 63, .22) transparent; scrollbar-width: thin; }

.tral-chat-message { width: fit-content; max-width: 87%; margin: 0 0 11px; padding: 11px 14px; border-radius: 17px; color: var(--tral-ink); font-size: 13.5px; line-height: 1.48; white-space: pre-wrap; box-shadow: 0 4px 15px rgba(16, 40, 63, .07); }
.tral-chat-message--assistant { border: 1px solid rgba(16, 40, 63, .07); border-bottom-left-radius: 5px; background: rgba(255, 255, 255, .98); }
.tral-chat-message--user { margin-left: auto; border-bottom-right-radius: 5px; background: linear-gradient(135deg, #143c59, #0f2d45); box-shadow: 0 7px 18px rgba(16, 40, 63, .18); color: #fff; }
.tral-chat-message--system { margin-inline: auto; border: 0; background: #fff5c6; box-shadow: none; color: #66540b; font-size: 11.5px; text-align: center; }
.tral-chat-message--typing { color: var(--tral-muted); font-style: italic; }

html body .tral-chat .tral-chat__form {
    display: grid !important;
    flex: 0 0 auto;
    grid-template-columns: minmax(0, 1fr) 48px;
    align-items: end !important;
    gap: 9px !important;
    width: auto !important;
    margin: 0 12px 8px !important;
    padding: 7px 7px 7px 14px !important;
    border: 1px solid rgba(16, 40, 63, .13) !important;
    border-radius: 18px !important;
    background: rgba(255, 255, 255, .98) !important;
    box-shadow: 0 8px 24px rgba(16, 40, 63, .09) !important;
}
html body .tral-chat .tral-chat__form textarea {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 46px !important;
    min-height: 46px !important;
    max-height: 94px !important;
    margin: 0 !important;
    padding: 12px 2px 10px !important;
    overflow-y: auto !important;
    resize: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--tral-ink) !important;
    font-family: inherit !important;
    font-size: 13.5px !important;
    font-weight: 400 !important;
    line-height: 1.45 !important;
}
html body .tral-chat .tral-chat__form textarea::placeholder { color: #8795a0; opacity: 1; }
html body .tral-chat .tral-chat__form button {
    display: grid !important;
    width: 48px !important;
    min-width: 0 !important;
    max-width: 48px !important;
    height: 48px !important;
    min-height: 0 !important;
    max-height: 48px !important;
    margin: 0 !important;
    padding: 0 !important;
    place-items: center;
    border: 0 !important;
    border-radius: 14px !important;
    background: linear-gradient(135deg, #ffd52e, #efb900) !important;
    box-shadow: 0 6px 15px rgba(199, 147, 0, .28) !important;
    color: var(--tral-navy) !important;
    font-size: 20px !important;
    line-height: 1 !important;
    appearance: none;
    cursor: pointer;
}
html body .tral-chat .tral-chat__form button:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(199, 147, 0, .36) !important; }
.tral-chat__footer { flex: 0 0 auto; margin: 0; padding: 0 12px 10px; text-align: center; }
html body .tral-chat .tral-chat__advisor {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 7px 12px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--tral-navy) !important;
    font-size: 11.5px !important;
    font-weight: 750 !important;
    line-height: 1.2 !important;
    text-transform: none !important;
    cursor: pointer;
}
html body .tral-chat .tral-chat__advisor:hover { background: rgba(16, 40, 63, .07) !important; }
.tral-chat__disclaimer { margin: 3px 0 0; padding: 0; color: #82909b; font-size: 8.5px; line-height: 1.25; text-align: center; }

.tral-product-cards { display: grid; gap: 9px; margin-bottom: 12px; }
.tral-chat-product-offer { display:flex; justify-content:flex-start; margin:0 0 12px; }
.tral-chat-product-offer__button { border:1px solid rgba(16,40,63,.18); border-radius:999px; padding:10px 15px; background:#fff7d2; color:var(--tral-navy); font-size:12px; font-weight:800; cursor:pointer; box-shadow:0 5px 14px rgba(16,40,63,.08); }
.tral-chat-product-offer__button:hover { background:var(--tral-yellow); }
.tral-chat-product-offer__button:disabled { opacity:.65; cursor:wait; }
.tral-product-card { display: grid; grid-template-columns: 86px 1fr; overflow: hidden; border: 1px solid var(--tral-line); border-radius: 13px; background: #fff; box-shadow: 0 4px 15px rgba(16, 40, 63, .07); }
.tral-product-card__image { min-height: 114px; background: #f3f4f5; }
.tral-product-card__image img { width: 100%; height: 100%; object-fit: contain; }
.tral-product-card__content { min-width: 0; padding: 10px; }
.tral-product-card__title { display: block; color: var(--tral-ink); font-size: 13px; font-weight: 750; line-height: 1.25; }
.tral-product-card__price { display: block; margin-top: 5px; color: var(--tral-green); font-size: 13px; }
.tral-product-card p { margin: 5px 0; color: #435462; font-size: 11px; line-height: 1.3; }
.tral-product-card small { display: block; color: var(--tral-muted); font-size: 9px; }
.tral-product-card__actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tral-product-card__actions button, .tral-product-card__actions a { padding: 6px 8px; border-radius: 6px; font: 700 10px/1.2 inherit; text-align: center; }
.tral-product-card__add { border: 0; background: var(--tral-yellow); color: var(--tral-navy); cursor: pointer; }
.tral-product-card__add.is-added { background: #dff3e9; color: #176443; }
.tral-product-card__view { border: 1px solid #cbd6dd; color: var(--tral-navy); }

.tral-contact-modal { position: fixed; z-index: 1000010; inset: 0; display: grid; visibility: hidden; place-items: center; padding: 18px; opacity: 0; transition: opacity .2s, visibility .2s; }
.tral-contact-modal.is-open { visibility: visible; opacity: 1; }
.tral-contact-modal__backdrop { position: absolute; inset: 0; background: rgba(8, 23, 35, .72); backdrop-filter: blur(3px); }
.tral-contact-modal__dialog { position: relative; width: min(650px, 100%); max-height: calc(100vh - 36px); overflow: auto; padding: 28px; border-radius: 17px; background: #fff; box-shadow: 0 24px 80px rgba(0, 0, 0, .32); }
html body .tral-contact-modal .tral-contact-modal__close {
    position: absolute;
    top: 12px;
    right: 14px;
    border-color: rgba(16, 40, 63, .12) !important;
    background: #eef3f6 !important;
    color: var(--tral-navy) !important;
}
html body .tral-contact-modal .tral-contact-modal__close:hover { background: #e1e9ee !important; }
.tral-contact-modal h2 { margin: 0 35px 6px 0; color: var(--tral-navy); font-size: 27px; }
.tral-contact-modal__intro { margin: 0 0 22px; color: var(--tral-muted); }
.tral-contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.tral-contact-form label { color: var(--tral-ink); font-size: 13px; font-weight: 650; }
.tral-contact-form label > span { color: #b32d2e; }
.tral-contact-form input:not([type="radio"]):not([type="checkbox"]) { display: block; width: 100%; margin-top: 5px; padding: 10px 11px; border: 1px solid #cbd6dd; border-radius: 8px; }
.tral-contact-form fieldset { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 18px 0 13px; padding: 13px; border: 1px solid var(--tral-line); border-radius: 9px; }
.tral-contact-form legend { padding: 0 4px; color: var(--tral-navy); font-weight: 750; }
.tral-contact-consent { display: block; margin: 10px 0; font-weight: 450 !important; line-height: 1.4; }
.tral-contact-form__error { min-height: 20px; margin: 10px 0 2px; color: #b32d2e; font-size: 13px; }
.tral-contact-form__submit, .tral-contact-whatsapp, .tral-contact-done { display: inline-flex; justify-content: center; padding: 11px 19px; border: 0; border-radius: 8px; background: var(--tral-yellow); color: var(--tral-navy); font-weight: 800; cursor: pointer; }
.tral-contact-form__submit:disabled { opacity: .6; cursor: wait; }
.tral-contact-success { padding: 18px; border-radius: 12px; background: #f2f8f5; color: var(--tral-ink); text-align: center; }
.tral-contact-reference { display: block; margin: 11px 0; color: var(--tral-navy); }
.tral-contact-whatsapp { margin: 7px; background: #25d366; color: #073e1c; }
.tral-contact-done { margin: 7px; background: var(--tral-navy); color: #fff; }
.tral-modal-open { overflow: hidden; }

.tral-cart-quote-button { width: 100%; margin-top: 9px !important; background: var(--tral-navy) !important; color: #fff !important; }
.tral-cart-quote-note { margin: 7px 0 0; color: var(--tral-muted); font-size: 11px; text-align: center; }
.tral-checkout-choice { margin: 0 0 20px; padding: 17px; border: 2px solid var(--tral-yellow); border-radius: 11px; background: #fffcf0; }
.tral-checkout-choice h3 { margin: 0 0 11px; color: var(--tral-navy); font-size: 18px; }
.tral-checkout-choice label { display: grid; grid-template-columns: 22px 1fr; align-items: start; margin: 8px 0; color: var(--tral-ink); cursor: pointer; }
.tral-checkout-choice label input { grid-row: 1 / span 2; margin-top: 3px; }
.tral-checkout-choice label strong, .tral-checkout-choice label span { grid-column: 2; }
.tral-checkout-choice label span { color: var(--tral-muted); font-size: 12px; font-weight: 400; }
.tral-checkout-choice--block { max-width: 1100px; margin-inline: auto; }

@media (max-width: 600px) {
    html body .tral-chat-launcher { right: 7px !important; bottom: 7px !important; width: 98px !important; height: 98px !important; }
    html body .tral-chat-launcher__label { display: none; }
    html body .tral-chat { right: 8px !important; bottom: 107px !important; width: calc(100vw - 16px) !important; height: min(560px, calc(100dvh - 122px)) !important; min-height: 360px; border-radius: 15px; }
    .tral-contact-modal { padding: 8px; }
    .tral-contact-modal__dialog { max-height: calc(100dvh - 16px); padding: 22px 17px; border-radius: 14px; }
    .tral-contact-grid { grid-template-columns: 1fr; gap: 10px; }
    .tral-contact-modal h2 { font-size: 23px; }
}

@media (prefers-reduced-motion: reduce) {
    .tral-chat, .tral-contact-modal { transition: none; }
}


/* Lista TRAL: productos disponibles + consultas de stock/precio */
html body .tral-product-card__status {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin: 2px 0 7px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.25;
}
html body .tral-product-card__status.is-available {
    color: #176845;
    background: #e8f7ef;
}
html body .tral-product-card__status.is-inquiry {
    color: #745800;
    background: #fff5c7;
}
html body .tral-product-card__quantity {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--tral-muted);
    font-size: 11px;
    font-weight: 700;
}
html body .tral-product-card__quantity input {
    width: 56px !important;
    min-height: 34px !important;
    padding: 4px 6px !important;
    border: 1px solid var(--tral-line) !important;
    border-radius: 8px !important;
    background: #fff !important;
    color: var(--tral-ink) !important;
}
html body .tral-product-card__inquiry,
html body .tral-chat__list {
    border: 0 !important;
    border-radius: 9px !important;
    background: var(--tral-yellow) !important;
    color: var(--tral-navy) !important;
    font-weight: 800 !important;
    cursor: pointer !important;
}
html body .tral-product-card__inquiry {
    min-height: 36px !important;
    padding: 7px 10px !important;
    font-size: 12px !important;
}
html body .tral-product-card__inquiry.is-added {
    background: #dff3e8 !important;
    color: #176845 !important;
}
html body .tral-chat__list {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    min-height: 39px;
    margin-bottom: 8px;
    padding: 8px 12px;
}
html body .tral-chat__list[hidden] {
    display: none !important;
}
html body .tral-chat__list b {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--tral-navy);
    color: #fff;
    font-size: 11px;
}
html body .tral-contact-list-summary {
    margin: 0 0 16px;
    padding: 13px;
    border: 1px solid #eadb91;
    border-radius: 12px;
    background: #fffaf0;
}
html body .tral-contact-list-summary[hidden] {
    display: none !important;
}
html body .tral-contact-list-summary__title {
    display: block;
    margin-bottom: 8px;
    color: var(--tral-navy);
}
html body .tral-contact-list-summary__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-top: 1px solid rgba(16, 40, 63, .1);
}
html body .tral-contact-list-summary__item span {
    display: grid;
    gap: 2px;
    color: var(--tral-ink);
    font-size: 13px;
    font-weight: 700;
}
html body .tral-contact-list-summary__item small {
    color: var(--tral-muted);
    font-size: 11px;
    font-weight: 500;
}
html body .tral-contact-list-summary__item button {
    border: 0;
    background: transparent;
    color: #a33;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
