/*
 * Back Space — RFQ drawer component (owned by class-bst-rfq-cart.php)
 * Version 1.5.1. Slides with transform (no layout animation); no blur on mobile.
 * Depends on bst-tokens.css.
 */

/* ---------------------------------------------------------------------------
 * RFQ drawer — single authoritative definition
 *     Slides with transform (no layout animation). No blur on mobile.
 * ------------------------------------------------------------------------ */
.bst-rfq-trigger {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9999;
    display: none;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 999px;
    border: 1px solid var(--bspc-dark-border);
    background: var(--bspc-dark-canvas);
    color: #FFFFFF;
    font-family: var(--bst-font);
    font-size: 14px;
    font-weight: 700;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    transition: transform var(--motion-ui) var(--ease-standard), background-color var(--motion-ui) var(--ease-standard);
}
.bst-rfq-trigger.is-visible { display: inline-flex; }
@media (hover: hover) and (pointer: fine) {
    .bst-rfq-trigger:hover { transform: translateY(-3px); background: var(--bspc-dark-surface); }
}
.bst-rfq-badge {
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--bspc-orange);
    color: #FFFFFF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
}
.bst-rfq-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(1, 9, 16, 0.72);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--motion-transition) var(--ease-standard), visibility 0s linear var(--motion-transition);
}
.bst-rfq-overlay.active {
    opacity: 1;
    visibility: visible;
    transition: opacity var(--motion-transition) var(--ease-standard), visibility 0s;
}
@media (min-width: 768px) and (hover: hover) and (pointer: fine) {
    @supports ((backdrop-filter: blur(6px)) or (-webkit-backdrop-filter: blur(6px))) {
        .bst-rfq-overlay {
            background: rgba(1, 9, 16, 0.5);
            -webkit-backdrop-filter: blur(6px);
            backdrop-filter: blur(6px);
        }
    }
}
.bst-rfq-drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 100000;
    width: min(460px, 92vw);
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--bspc-card);
    border-left: 1px solid var(--bspc-border);
    box-shadow: var(--shadow-drawer);
    font-family: var(--bst-font);
    color: var(--bspc-text-primary);
    transform: translate3d(100%, 0, 0);
    visibility: hidden;
    transition: transform var(--motion-transition) var(--ease-standard), visibility 0s linear var(--motion-transition);
}
.bst-rfq-drawer.active {
    transform: translate3d(0, 0, 0);
    visibility: visible;
    transition: transform var(--motion-transition) var(--ease-standard), visibility 0s;
}
.bst-rfq-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    background: var(--bspc-dark-canvas);
    border-bottom: 1px solid var(--bspc-dark-border);
    color: #FFFFFF;
}
.bst-rfq-header h3 { margin: 0; font-size: 16px; font-weight: 800; color: #FFFFFF; }
.bst-rfq-header p { margin: 2px 0 0; font-size: 12px; color: var(--bspc-dark-text-secondary); }
.bst-rfq-close {
    width: 40px;
    height: 40px;
    flex: none;
    border: 1px solid var(--bspc-dark-border);
    border-radius: 10px;
    background: transparent;
    color: #FFFFFF;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}
.bst-rfq-body { flex: 1; padding: 20px; overflow-y: auto; overscroll-behavior: contain; }
.bst-rfq-empty { margin: 0 0 4px; padding: 16px; border-radius: 12px; background: var(--bspc-card-subtle); font-size: 13px; line-height: 1.55; color: var(--bspc-text-secondary); }
.bst-rfq-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--bspc-border);
}
.bst-rfq-item__title { font-size: 14px; font-weight: 700; color: var(--bspc-text-primary); }
.bst-rfq-item__meta { margin-top: 2px; font-size: 12px; color: var(--bspc-text-secondary); }
.bst-rfq-item__price { margin-top: 2px; font-size: 13px; font-weight: 700; color: var(--bspc-text-primary); }
.bst-rfq-type {
    display: inline-block;
    margin-bottom: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--bspc-card-subtle);
    color: var(--bspc-text-secondary);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.bst-rfq-type--unit { background: var(--bspc-dark-canvas); color: #FFFFFF; }
.bst-rfq-qty { display: flex; align-items: center; gap: 6px; }
.bst-rfq-qty button {
    width: 30px;
    height: 30px;
    border: 1px solid var(--bspc-border);
    border-radius: 8px;
    background: var(--bspc-card);
    color: var(--bspc-text-primary);
    cursor: pointer;
}
.bst-rfq-qty .bst-rfq-remove { border-color: transparent; color: #B91C1C; font-size: 18px; }
.bst-rfq-qty output { min-width: 18px; text-align: center; font-weight: 700; }
.bst-rfq-total { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; font-size: 14px; font-weight: 700; }
.bst-rfq-form-wrap { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--bspc-border); }
.bst-rfq-form-wrap h4 { margin: 0 0 14px; font-size: 13px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--bspc-text-primary); }
.bst-rfq-field { margin-bottom: 14px; }
.bst-rfq-field label { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 700; color: var(--bspc-text-secondary); }
.bst-rfq-field input,
.bst-rfq-field select,
.bst-rfq-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--bspc-border);
    border-radius: 8px;
    background: var(--bspc-card);
    font-family: var(--bst-font);
    font-size: 16px; /* prevents iOS zoom on focus */
    color: var(--bspc-text-primary);
}
/* Astra gives selects a fixed height/line-height that clips the text on mobile. */
.bst-rfq-field select {
    height: auto !important;
    min-height: 46px;
    line-height: 1.4 !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}
.bst-rfq-qty button {
    padding: 0 !important;
    line-height: 1 !important;
    min-height: 0 !important;
}
.bst-rfq-field input:focus,
.bst-rfq-field select:focus,
.bst-rfq-field textarea:focus { outline: 2px solid var(--bspc-orange); outline-offset: 1px; border-color: transparent; }
.bst-rfq-hp { position: absolute !important; left: -9999px !important; }
.bst-rfq-btn-add {
    width: 100%;
    min-height: 48px;
    padding: 12px 20px;
    border: 0;
    border-radius: var(--bst-radius-sm);
    background: var(--bspc-orange);
    color: #FFFFFF;
    font-family: var(--bst-font);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color var(--motion-micro) var(--ease-standard), transform var(--motion-micro) var(--ease-standard);
}
.bst-rfq-btn-add:hover { background: #E63800; }
.bst-rfq-btn-add:active { transform: scale(0.98); }
.bst-rfq-btn-add[disabled] { opacity: 0.6; cursor: wait; }
.bst-rfq-btn-wa {
    width: 100%;
    min-height: 48px;
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: var(--bst-radius-sm);
    background: #1F8F4E;
    color: #FFFFFF;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
}
.bst-rfq-btn-wa:hover { background: #18773F; color: #FFFFFF; }
.bst-rfq-confirm { padding: 24px 4px; text-align: center; }
.bst-rfq-confirm__icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: #D1FAE5;
    color: #047857;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}
.bst-rfq-confirm h3 { margin: 0; font-size: 18px; font-weight: 800; }
.bst-rfq-confirm p { margin: 8px 0 16px; font-size: 13px; color: var(--bspc-text-secondary); }
.bst-rfq-ref { margin-bottom: 18px; padding: 14px; border-radius: 10px; background: var(--bspc-card-subtle); text-align: left; font-size: 13px; }
.bst-rfq-ref code { font-family: var(--bst-font-mono); font-size: 12px; }
.bst-rfq-link { margin-top: 14px; border: 0; background: transparent; color: var(--bspc-text-secondary); font-size: 13px; text-decoration: underline; cursor: pointer; }
html.bst-rfq-locked,
html.bst-rfq-locked body { overflow: hidden; }


/* Reduced motion: the drawer still opens and closes (functional state), without sliding. */
@media (prefers-reduced-motion: reduce) {
    .bst-rfq-drawer,
    .bst-rfq-drawer.active,
    .bst-rfq-overlay,
    .bst-rfq-overlay.active,
    .bst-rfq-trigger,
    .bst-rfq-btn-add { transition: none; }
    .bst-rfq-trigger:hover,
    .bst-rfq-btn-add:active { transform: none; }
}
.bst-visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap;
}
