/* ===========================================
   BA.UI - Drawer
   Right-side sliding panel component
   =========================================== */

/* -------------------------------------------
   Backdrop
------------------------------------------- */

.ba-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: transparent;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}

.ba-drawer-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

/* -------------------------------------------
   Drawer (Panel Style)
------------------------------------------- */

.ba-drawer {
    position: fixed;
    z-index: 1050;
    top: 50%;
    right: 0;
    transform: translateY(-50%) translateX(100%);
    width: 340px;
    max-width: 90vw;
    max-height: 80vh;
    background: #fff;
    border-radius: 12px 0 0 12px;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    transition: transform .3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.ba-drawer.is-open {
    transform: translateY(-50%) translateX(0);
}

/* -------------------------------------------
   Drawer Header
------------------------------------------- */

.ba-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #E5E7EB;
    flex-shrink: 0;
    background: #fff;
}

.ba-drawer__title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1F2937;
}

.ba-drawer__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #6B7280;
    cursor: pointer;
    transition: background .18s ease, color .18s ease;
}

.ba-drawer__close:hover {
    background: #F3F4F6;
    color: #1F2937;
}

.ba-drawer__close svg {
    width: 20px;
    height: 20px;
}

/* -------------------------------------------
   Drawer Body
------------------------------------------- */

.ba-drawer__body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    min-height: 0;
}

/* -------------------------------------------
   Drawer Footer
------------------------------------------- */

.ba-drawer__footer {
    padding: 16px 24px;
    border-top: 1px solid #E5E7EB;
    flex-shrink: 0;
}

/* -------------------------------------------
   Currency Section Styles
------------------------------------------- */

.ba-currency-section {
    margin-bottom: 24px;
}

.ba-currency-section__title {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 16px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ba-currency-table {
    width: 100%;
    border-collapse: collapse;
}

.ba-currency-table td {
    padding: 8px 0;
    vertical-align: middle;
}

.ba-currency-row {
    border-bottom: 1px solid #F3F4F6;
}

.ba-currency-row:last-child {
    border-bottom: none;
}

.ba-currency-code {
    font-size: 15px;
    font-weight: 600;
    color: #1F2937;
    width: 60px;
}

.ba-currency-name {
    font-size: 13px;
    color: #6B7280;
}

.ba-currency-value {
    font-size: 15px;
    font-weight: 500;
    color: #1F2937;
    text-align: right;
}

.ba-currency-label {
    font-size: 11px;
    color: #9CA3AF;
    text-align: right;
    font-weight: 500;
}

/* -------------------------------------------
   Currency Input Group
------------------------------------------- */

.ba-currency-input-group {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    border: 1px solid #D1D5DB;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.ba-currency-input-group:focus-within {
    border-color: var(--ba-primary, #2563EB);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.ba-currency-input-group:last-child {
    margin-bottom: 0;
}

.ba-currency-input-group__prepend {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 35px;
    background: #F9FAFB;
    border-right: 1px solid #D1D5DB;
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    flex-shrink: 0;
}

.ba-currency-input-group__input {
    flex: 1;
    height: 35px;
    padding: 0 16px;
    border: none;
    background: #fff;
    font-size: 15px;
    color: #1F2937;
    outline: none;
}

.ba-currency-input-group__input::placeholder {
    color: #9CA3AF;
}

/* -------------------------------------------
   Drawer Trigger Button
------------------------------------------- */

.ba-drawer-trigger {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1030;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: none;
    border-radius: 50% 0 0 50%;
    background: #fff;
    color: #424F5D;
    box-shadow: -2px 0 12px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    transition: background .2s ease, color .2s ease, width .2s ease;
}

.ba-drawer-trigger:hover {
    background: #f5f5f5;
    color: #2563EB;
    width: 52px;
}

.ba-drawer-trigger:active {
    background: #e8e8e8;
}

.ba-drawer-trigger svg {
    width: 22px;
    height: 22px;
}

/* -------------------------------------------
   Responsive
------------------------------------------- */

@media (max-width: 480px) {
    .ba-drawer {
        width: 100%;
        max-width: 100%;
        max-height: 70vh;
        border-radius: 12px 12px 0 0;
        top: auto;
        bottom: 0;
        transform: translateY(100%);
    }

    .ba-drawer.is-open {
        transform: translateY(0);
    }

    .ba-drawer-trigger {
        top: auto;
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        transform: none;
    }

    .ba-drawer-trigger svg {
        width: 20px;
        height: 20px;
    }
}
}
