/* =========================================================
   Phase 12 - 사용자 예약 화면 공통 UI
   메인 페이지 / 마이페이지의 공통 디자인 체계와 맞춘다.
   기존 reservation.js가 사용하는 id/class는 유지한다.
   ========================================================= */

:root {
    --user-bg: #f7f7f7;
    --user-surface: #ffffff;
    --user-border: #dddddd;
    --user-border-soft: #eeeeee;
    --user-text: #222222;
    --user-text-sub: #777777;
    --user-text-muted: #999999;
    --user-accent: #333333;
    --user-accent-soft: #f4f4f4;
}

body {
    background: var(--user-bg);
    color: var(--user-text);
}

/* reservation.css의 독립 페이지 여백을
   공통 header/footer가 있는 사용자 사이트 기준으로 재정렬 */
.reservation-page {
    width: min(1120px, calc(100% - 40px));
    min-height: calc(100vh - 210px);
    margin: 0 auto;
    padding: 56px 0 30px;
}

.reservation-user-page {
    max-width: 1120px;
}

.my-reservation-page {
    width: min(1000px, calc(100% - 40px));
    padding-top: 60px;
}

/* =========================================================
   Page heading
   ========================================================= */

.reservation-user-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    margin-bottom: 32px;
}

.reservation-user-heading h1 {
    margin: 4px 0 10px;
    color: var(--user-text);
    font-size: 32px;
    line-height: 1.25;
    letter-spacing: -0.7px;
}

.reservation-user-heading > div:first-child > p:last-child,
.reservation-user-heading .mypage-description {
    color: var(--user-text-sub);
    font-size: 14px;
    line-height: 1.6;
}

.reservation-user-heading .eyebrow,
.guest-lookup-card .eyebrow {
    margin-bottom: 6px;
    color: #888888 !important;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
}

.reservation-page-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.reservation-page-actions .primary-link,
.reservation-page-actions .secondary-button {
    min-height: 40px;
    padding: 0 15px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
}

/* 메인/마이페이지의 버튼 톤 */
.reservation-page .primary-button,
.reservation-page .primary-link {
    border: 1px solid #333333;
    background: #333333;
    color: #ffffff;
}

.reservation-page .primary-button:not(:disabled):hover,
.reservation-page .primary-link:hover {
    background: #111111;
    border-color: #111111;
}

.reservation-page .secondary-button {
    border: 1px solid #cccccc;
    background: #ffffff;
    color: #333333;
}

.reservation-page .secondary-button:hover {
    border-color: #999999;
}

/* =========================================================
   Reservation form
   ========================================================= */

.reservation-grid {
    gap: 16px;
}

.reservation-user-page .panel,
.reservation-user-page .submit-panel {
    border: 1px solid var(--user-border);
    border-radius: 14px;
    background: var(--user-surface);
    box-shadow: none;
}

.reservation-user-page .panel {
    padding: 24px;
}

.reservation-user-page .panel h2 {
    color: var(--user-text);
    font-size: 19px;
    letter-spacing: -0.3px;
}

.reservation-user-page .panel h3 {
    color: var(--user-text);
    font-size: 15px;
}

.reservation-user-page .field > span {
    color: #555555;
}

.reservation-user-page input,
.reservation-user-page textarea,
.reservation-user-page select {
    border: 1px solid #d8d8d8;
    border-radius: 8px;
    background: #ffffff;
}

.reservation-user-page input:focus,
.reservation-user-page textarea:focus,
.reservation-user-page select:focus {
    border-color: #777777;
    box-shadow: 0 0 0 3px rgba(60, 60, 60, 0.08);
}

.reservation-user-page .field-help,
.reservation-user-page .counter {
    color: #888888;
}

.reservation-user-page .menu-content,
.reservation-user-page .hair-style-content {
    border: 1px solid #dddddd;
    border-radius: 10px;
    background: #ffffff;
}

.reservation-user-page .menu-card:hover .menu-content,
.reservation-user-page .hair-style-card:hover .hair-style-content {
    border-color: #aaaaaa;
}

.reservation-user-page .menu-radio:checked + .menu-content,
.reservation-user-page .hair-style-radio:checked + .hair-style-content {
    border-color: #333333;
    background: #f7f7f7;
    box-shadow: inset 0 0 0 1px #333333;
}

.reservation-user-page .menu-category {
    color: #666666;
}

.reservation-user-page .time-button {
    border: 1px solid #d6d6d6;
    border-radius: 8px;
    background: #ffffff;
    color: #333333;
}

.reservation-user-page .time-button:hover:not(:disabled) {
    border-color: #999999;
}

.reservation-user-page .time-button.selected {
    border-color: #333333;
    background: #333333;
    color: #ffffff;
}

.reservation-user-page .member-notice,
.reservation-user-page .empty-box,
.reservation-user-page .loading-box {
    border-color: #d6d6d6;
    border-radius: 10px;
    background: #fafafa;
    color: #666666;
}

.reservation-user-page .file-drop {
    border-color: #cccccc;
    border-radius: 10px;
    background: #fafafa;
}

.reservation-user-page .file-drop:hover {
    border-color: #888888;
    background: #f7f7f7;
}

.reservation-user-page .submit-panel {
    margin-top: 16px;
    padding: 20px 24px;
}

.reservation-user-page .reservation-summary {
    color: #666666;
    font-size: 14px;
}

/* =========================================================
   My reservations - mypage style
   ========================================================= */

.my-reservation-page .mypage-header {
    margin-bottom: 32px;
}

.my-reservation-page .mypage-header h1 {
    margin-bottom: 10px;
    color: #222222;
    font-size: 32px;
}

.my-reservation-page .mypage-section {
    margin-bottom: 28px;
}

.my-reservation-page .mypage-section-header {
    margin-bottom: 14px;
}

.reservation-history-card {
    display: block;
    padding: 22px;
    overflow: visible;
}

.reservation-history-card .toolbar {
    margin-bottom: 14px;
}

.my-reservation-page .reservation-list {
    gap: 10px;
}

.my-reservation-page .reservation-item {
    border: 1px solid #eeeeee;
    border-radius: 10px;
    padding: 18px;
    background: #ffffff;
    transition:
            border-color 0.18s ease,
            background 0.18s ease;
}

.my-reservation-page .reservation-item:hover {
    border-color: #cccccc;
    background: #fcfcfc;
}

.my-reservation-page .reservation-item-header strong {
    color: #222222;
}

.my-reservation-page .status-badge {
    border-radius: 999px;
    font-size: 11px;
}

.my-reservation-page .action-button {
    border: 1px solid #cccccc;
    border-radius: 8px;
    background: #ffffff;
    color: #333333;
}

.my-reservation-page .action-button:hover {
    border-color: #999999;
}

.my-reservation-page > .panel.empty-box {
    border: 1px solid #dddddd;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: none;
}

/* =========================================================
   Guest reservation lookup
   ========================================================= */

.guest-reservation-page {
    max-width: 1000px;
}

.guest-lookup-card {
    max-width: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 14px;
    align-items: end;
    padding: 26px;
}

.guest-lookup-card .section-title-row {
    grid-column: 1 / -1;
    margin-bottom: 2px;
}

.guest-lookup-card .section-title-row h2 {
    margin: 0;
    font-size: 20px;
}

.guest-lookup-card .field {
    margin-bottom: 0;
}

.guest-lookup-card #lookupButton {
    min-height: 43px;
    white-space: nowrap;
}

.guest-reservation-page #lookupResult {
    max-width: none;
    margin-top: 14px;
}

/* =========================================================
   Modal
   기존 기능 유지 + 사용자 페이지 톤 정리
   ========================================================= */

.reservation-page .detail-modal {
    border: 1px solid #dddddd;
    border-radius: 14px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.18);
}

.reservation-page .detail-block {
    border: 1px solid #eeeeee;
    background: #fafafa;
}

/* footer가 페이지 본문과 자연스럽게 이어지도록 */
.site-footer {
    margin-top: 40px;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 820px) {
    .reservation-page,
    .my-reservation-page {
        width: min(100% - 32px, 1120px);
        padding-top: 40px;
    }

    .reservation-user-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .reservation-page-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .guest-lookup-card {
        grid-template-columns: 1fr;
    }

    .guest-lookup-card .section-title-row {
        grid-column: auto;
    }
}

@media (max-width: 520px) {
    .reservation-page,
    .my-reservation-page {
        width: min(100% - 24px, 1120px);
        padding-top: 30px;
    }

    .reservation-user-heading h1,
    .my-reservation-page .mypage-header h1 {
        font-size: 27px;
    }

    .reservation-page-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .reservation-page-actions .primary-link,
    .reservation-page-actions .secondary-button {
        width: 100%;
    }

    .reservation-user-page .panel,
    .reservation-user-page .submit-panel,
    .reservation-history-card,
    .guest-lookup-card {
        padding: 18px;
    }
}


/* =========================================================
   Phase 13 - 예약 시술 카테고리 / 상세 메뉴 2단계 선택
   ========================================================= */

.service-category-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.service-category-card {
    display: block;
    min-width: 0;
    cursor: pointer;
}

.service-category-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.service-category-content {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    padding: 13px 10px;
    border: 1px solid #dddddd;
    border-radius: 10px;
    background: #ffffff;
    transition:
            border-color 0.18s ease,
            background 0.18s ease,
            transform 0.18s ease;
}

.service-category-content strong {
    color: #222222;
    font-size: 15px;
}

.service-category-content small {
    color: #999999;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.service-category-card:hover
.service-category-content {
    border-color: #999999;
    transform: translateY(-1px);
}

.service-category-radio:checked
+ .service-category-content {
    border-color: #333333;
    background: #f7f7f7;
    box-shadow: inset 0 0 0 1px #333333;
}

.section-title-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.service-menu-help {
    margin-top: 7px;
    margin-bottom: 0;
}

.service-detail-menu-list {
    margin-top: 2px;
}

.service-detail-card .menu-content {
    min-height: 104px;
    justify-content: center;
}

.inline-text-link {
    color: #333333;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

@media (max-width: 820px) {
    .service-category-list {
        grid-template-columns:
                repeat(3, minmax(0, 1fr));
    }

    .section-title-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 520px) {
    .service-category-list {
        grid-template-columns:
                repeat(2, minmax(0, 1fr));
    }

    .section-title-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .section-title-actions
    .secondary-button {
        width: 100%;
    }
}


/* =========================================================
   Phase 14 - 헤어스타일 선택 컨텍스트
   ========================================================= */

.selected-hairstyle-context {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;

    margin-bottom: 16px;
    padding: 20px 22px;

    border: 1px solid #d9d9d9;
    border-radius: 14px;

    background: #ffffff;
}

.selected-hairstyle-label {
    margin-bottom: 5px;

    color: #888888;

    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.3px;
}

.selected-hairstyle-title {
    display: block;

    margin-bottom: 5px;

    color: #222222;

    font-size: 18px;
}

.selected-hairstyle-context p:last-child {
    color: #777777;

    font-size: 13px;
    line-height: 1.5;
}

.selected-hairstyle-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;

    flex-shrink: 0;
}

.service-category-card.disabled {
    cursor: not-allowed;
}

.service-category-card.disabled
.service-category-content {
    opacity: 0.38;
    background: #f3f3f3;
}

.service-category-card.disabled:hover
.service-category-content {
    border-color: #dddddd;
    transform: none;
}

@media (max-width: 700px) {
    .selected-hairstyle-context {
        align-items: flex-start;
        flex-direction: column;
    }

    .selected-hairstyle-actions {
        width: 100%;
    }
}


/* Phase UI polish - 시술 메뉴 카드 */
.service-detail-menu-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.service-detail-card .service-detail-content {
    min-height: 126px;
    align-items: flex-start;
    justify-content: space-between;
    padding: 18px;
    border-radius: 12px;
}

.service-detail-topline {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
}

.service-detail-check {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border: 1px solid #dddddd;
    border-radius: 50%;
    color: transparent;
    font-size: 12px;
    font-weight: 900;
}

.service-detail-name {
    margin-top: 10px;
    font-size: 17px;
    letter-spacing: -0.3px;
}

.service-detail-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 12px;
    color: #666666;
    font-size: 13px;
}

.service-detail-price {
    color: #222222;
    font-weight: 800;
}

.service-detail-divider {
    color: #c6c6c6;
}

.service-detail-card .menu-radio:checked + .service-detail-content .service-detail-check {
    border-color: #333333;
    background: #333333;
    color: #ffffff;
}

@media (max-width: 620px) {
    .service-detail-menu-list {
        grid-template-columns: 1fr;
    }
}


/* 내 예약 - 프로젝트 공통 톤의 취소 사유 모달 */
.cancel-reason-modal {
    width: min(520px, calc(100vw - 32px));
}

.cancel-modal-eyebrow {
    margin: 0 0 5px;
    color: #8a8a8a;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.4px;
}

.cancel-modal-description {
    margin: 4px 0 18px;
    color: #777777;
    font-size: 13px;
    line-height: 1.6;
}

.cancel-reason-modal textarea {
    min-height: 112px;
    resize: vertical;
}

.cancel-reason-modal .counter {
    display: block;
    margin-top: 6px;
    color: #999999;
    font-size: 11px;
    text-align: right;
}

.danger-button {
    min-height: 42px;
    padding: 0 18px;
    border: 1px solid #222222;
    border-radius: 8px;
    background: #222222;
    color: #ffffff;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.danger-button:hover {
    background: #000000;
}

.danger-button:disabled {
    cursor: wait;
    opacity: 0.55;
}


.review-write-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

/* =========================================================
   Final fix - My reservation status badge alignment
   예약 건수가 늘어나도 header/status 배치가 흔들리지 않도록
   display: contents 기반 배치를 제거하고 header flex로 고정한다.
   ========================================================= */

#reservationList .reservation-item {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

#reservationList .reservation-item-header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    min-width: 0;
}

#reservationList .reservation-item-header > div:first-child {
    min-width: 0;
}

#reservationList .status-badge {
    /* 기존 grid item 속성 무효화 */
    grid-column: auto;
    grid-row: auto;
    align-self: auto;
    justify-self: auto;

    /* 배지 자체 크기와 글자 위치 고정 */
    flex: 0 0 auto;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box;
    min-width: 72px;
    height: 34px;
    min-height: 34px;
    margin: 0;
    padding: 0 12px;

    border-radius: 999px;
    line-height: 1 !important;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
    word-break: keep-all;
    font-size: 11px;
    font-weight: 800;
}

#reservationList .reservation-item > div:not(.reservation-item-header):not(.reservation-actions),
#reservationList .reservation-actions {
    grid-column: 1;
}

#reservationList .reservation-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
}

@media (max-width: 720px) {
    #reservationList .reservation-item-header {
        align-items: flex-start;
    }

    #reservationList .status-badge {
        min-width: 68px;
        height: 32px;
        min-height: 32px;
        padding: 0 10px;
    }
}


/* Event discount pricing */
.event-discount-badge { display:inline-flex; width:max-content; padding:5px 9px; border-radius:999px; background:#222; color:#fff; font-size:11px; font-weight:800; }
.reservation-price-preview { display:grid; gap:7px; min-width:280px; padding:14px 16px; border:1px solid #ddd; border-radius:12px; background:#fff; }
.reservation-price-preview > div { display:flex; justify-content:space-between; gap:18px; color:#777; font-size:12px; }
.reservation-price-preview .price-event strong { color:#a04f66; }
.reservation-price-preview .price-final { padding-top:8px; border-top:1px solid #eee; color:#222; }
.reservation-price-preview .price-final strong { font-size:17px; }


/* =========================================================
   리뷰 작성 완료 상태
   ========================================================= */

.review-completed-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    cursor: default;

    border-color: #e1e1e1;

    background: #f3f3f3;

    color: #8a8a8a;

    pointer-events: none;

    white-space: nowrap;
}


/* =========================================================
   내 예약 페이징
   ========================================================= */

.user-pagination {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 12px;

    margin-top: 18px;
    padding-top: 16px;

    border-top: 1px solid #eeeeee;
}

.user-pagination.hidden {
    display: none;
}

.user-pagination-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 68px;
    height: 38px;

    padding: 0 14px;

    border: 1px solid #d7d7d7;
    border-radius: 8px;

    background: #ffffff;

    color: #333333;

    font-size: 13px;
    font-weight: 700;

    cursor: pointer;
}

.user-pagination-button:hover:not(:disabled) {
    border-color: #999999;
    background: #fafafa;
}

.user-pagination-button:disabled {
    cursor: default;
    opacity: 0.4;
}

.user-pagination-info {
    min-width: 58px;

    color: #555555;

    font-size: 13px;
    font-weight: 700;

    text-align: center;
}
/* =========================================================
   예약 화면 액션 버튼 크기 통일
   ========================================================= */

.reservation-user-page .section-title-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.reservation-user-page .section-title-actions .secondary-button {
    width: 132px;
    min-height: 42px;
    padding: 0 12px;
    white-space: nowrap;
}