/**
 * #rental-tab-modal 전용 (기존 #rental-modal / view.css .rental-modal 과 분리)
 */

.rental-tab-modal[hidden] {
    display: none !important;
}

.rental-tab-modal.is-open {
    display: flex !important;
    position: fixed;
    inset: 0;
    z-index: 10060;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.45);
}

.rental-tab-modal .modal-inner {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: min(82vh, 720px);
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    min-height: 0;
}

.rental-tab-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.rental-tab-modal .modal-header h2 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: #111;
}

.rental-tab-modal .modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    color: #666;
    cursor: pointer;
    border-radius: 6px;
}

.rental-tab-modal .modal-close:hover {
    background: #f0f0f0;
    color: #111;
}

.rental-tab-modal .modal-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 탭 제거 버전 — 본문만 달력·시간 */
.rental-tab-modal--date-only .modal-body {
    padding: 0 12px 8px;
    box-sizing: border-box;
}

.rental-tab-modal .tabs {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    box-sizing: border-box;
}

.rental-tab-modal .tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px 0;
    border-radius: 12px;
    border: 1.2px solid #eaeaea;
    background: #fbfbfb;
    color: #111;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.35;
    cursor: pointer;
    box-sizing: border-box;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.rental-tab-modal .tab:hover:not(.active):not(.is-disabled) {
    background: #f2f2f2;
}

.rental-tab-modal .tab.active {
    border-color: #4e73df;
    background: #4e73df;
    color: #fff;
}

.rental-tab-modal .tab.is-disabled {
    opacity: 0.4;
    pointer-events: none;
}

.rental-tab-modal .tab-panel {
    display: none;
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 0 12px 12px;
    box-sizing: border-box;
}

.rental-tab-modal .tab-panel.active {
    display: flex;
    flex-direction: column;
}

.rental-tab-modal .branch-select-wrap {
    margin-top: 16px;
    padding: 0 4px;
    box-sizing: border-box;
}

/* gp-select: 모달 내부만 — 화살표(.arrow) + 라벨 정렬 */
/* gp-select.js: 열림 시 래퍼에 .is-open (components/ui/gp-select/gp-select.js) */
.rental-tab-modal .gp-select__btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rental-tab-modal .gp-select__btn .arrow,
.rental-tab-modal .gp-select__btn .gp-select__arrow {
    margin-left: 8px;
    flex-shrink: 0;
    color: #666;
    transition: transform 0.2s ease;
    transform: rotate(0deg);
}

.rental-tab-modal .gp-select.is-open .gp-select__btn .arrow,
.rental-tab-modal .gp-select.is-open .gp-select__btn .gp-select__arrow {
    transform: rotate(180deg);
}

.rental-tab-modal .branch-info {
    display: none;
    margin-top: 16px;
    padding: 16px;
    background: #f5f7fb;
    border-radius: 8px;
}

.rental-tab-modal .branch-info ul {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.rental-tab-modal .branch-info li {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 14px;
}

.rental-tab-modal .branch-info li strong {
    flex-shrink: 0;
    min-width: 50px;
}

.rental-tab-modal .modal-footer {
    flex-shrink: 0;
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #eee;
    background: #fff;
}

.rental-tab-modal .modal-footer .btn-reset,
.rental-tab-modal .modal-footer .btn-apply {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
}

.rental-tab-modal .btn-reset {
    gap: 6px;
}

.rental-tab-modal .btn-reset .icon-reset {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: inherit;
}

.rental-tab-modal .modal-footer .btn-apply {
    background: #111;
    border-color: #111;
    color: #fff;
}

.rental-tab-modal .rental-tab-modal__calendar {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.rental-tab-modal .rental-tab-modal__calendar > .rr-booking-modal-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    gap: 20px;
}

.rental-tab-modal .rental-tab-modal__calendar .rr-panel-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* 대여·반납 시간: 한 줄 flex (rental-tab-modal embed 전용 마크업 .time-row) */
.rental-tab-modal .time-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.rental-tab-modal .time-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.rental-tab-modal .time-col .gp-select {
    width: 100%;
}

.rental-tab-modal .time-field-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
}

.rental-tab-modal .time-sep {
    flex-shrink: 0;
    margin-top: 22px;
    color: #666;
    font-size: 0.9375rem;
    line-height: 1.2;
}

@media (max-width: 380px) {
    .rental-tab-modal .time-row {
        flex-direction: column;
        align-items: stretch;
    }

    .rental-tab-modal .time-sep {
        margin: 4px 0;
        text-align: center;
    }
}
