/* ============================================
   밀리네웨어 고객 신규 주문서 - 스타일시트
   ============================================ */

/* ========================
   CSS 변수 (디자인 토큰)
   ======================== */
:root {
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-card: #222222;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #666666;
    --accent-gold: #c9a84c;
    --accent-gold-light: #e2c97e;
    --accent-gold-dark: #a08030;
    --border-color: #333333;
    --border-focus: #c9a84c;
    --danger: #e74c3c;
    --success: #2ecc71;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 50px;
    --transition: all 0.3s ease;
    --font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ========================
   리셋 & 기본 스타일
   ======================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    min-height: 100vh;
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ========================
   앱 컨테이너
   ======================== */
#divAppContainer {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
}

/* ========================
   스텝 공통
   ======================== */
.step-page {
    display: none;
    width: 100%;
    min-height: 100vh;
    padding: 60px 0 40px 0;
    animation: fadeIn 0.4s ease;
}

.step-page.active {
    display: flex;
    flex-direction: column;
    align-items: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-16px);
    }
}

/* ========================
   뒤로가기 버튼
   ======================== */
.btn-back {
    position: fixed;
    top: 16px;
    left: 16px;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.btn-back:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    transform: scale(1.05);
}

.btn-back:active {
    transform: scale(0.95);
}

/* ========================
   대문 타이틀 & 서브타이틀
   ======================== */
.page-title {
    font-size: 28px;
    font-weight: 900;
    text-align: center;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--accent-gold-light), var(--accent-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 32px;
    line-height: 1.5;
}

.page-label {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 32px;
    line-height: 1.6;
}

/* ========================
   배너 이미지 플레이스홀더
   ======================== */
.banner-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
    padding: 20px;
    transition: var(--transition);
}

.banner-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-md);
}

/* ========================
   타원형 메인 버튼
   ======================== */
.btn-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 200px;
    height: 56px;
    padding: 0 40px;
    border: none;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dark));
    color: #0f0f0f;
    font-family: var(--font-family);
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(201, 168, 76, 0.3);
    letter-spacing: 0.5px;
    margin-top: 16px;
}

.btn-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(201, 168, 76, 0.45);
    background: linear-gradient(135deg, var(--accent-gold-light), var(--accent-gold));
}

.btn-pill:active {
    transform: translateY(0);
    box-shadow: 0 2px 12px rgba(201, 168, 76, 0.3);
}

.btn-pill:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ========================
   입력란 공통
   ======================== */
.input-group {
    width: 100%;
    margin-bottom: 24px;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.input-field {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    border: none;
    border-bottom: 2px solid var(--border-color);
    border-radius: 0;
    background: transparent;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 18px;
    font-weight: 400;
    transition: var(--transition);
    outline: none;
}

.input-field::placeholder {
    color: var(--text-muted);
    font-size: 15px;
}

.input-field:focus {
    border-bottom-color: var(--accent-gold);
    box-shadow: 0 2px 0 0 var(--accent-gold);
}

.input-field.readonly {
    color: var(--text-secondary);
    cursor: pointer;
}

/* ========================
   단위 포함 입력란
   ======================== */
.input-unit-wrap {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.input-unit-wrap .input-field {
    padding-right: 40px; /* 단위가 들어갈 공간 확보 */
}

.unit-suffix {
    position: absolute;
    right: 0;
    bottom: 12px;
    font-size: 16px;
    font-weight: 500;
    color: var(--accent-gold);
    pointer-events: none; /* 클릭 방지 */
}

/* ========================
   주소 검색 버튼
   ======================== */
.address-search-wrap {
    position: relative;
    width: 100%;
}

.address-search-wrap .input-field {
    padding-right: 100px;
}

.btn-address-search {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 36px;
    padding: 0 16px;
    border: 1px solid var(--accent-gold);
    border-radius: 20px;
    background: transparent;
    color: var(--accent-gold);
    font-family: var(--font-family);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-address-search:hover {
    background: var(--accent-gold);
    color: #0f0f0f;
}

/* ========================
   상품 세트 (Step 6)
   ======================== */
.product-set {
    width: 100%;
    padding: 20px;
    margin-bottom: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    position: relative;
    animation: fadeIn 0.3s ease;
}

.product-set-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.product-set-number {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-gold);
}

.btn-remove-set {
    width: 32px;
    height: 32px;
    border: 1px solid var(--danger);
    border-radius: 50%;
    background: transparent;
    color: var(--danger);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-remove-set:hover {
    background: var(--danger);
    color: #fff;
}

.product-set .input-group {
    margin-bottom: 16px;
}

.product-set .input-group:last-child {
    margin-bottom: 0;
}

.product-set .input-field {
    height: 44px;
    font-size: 16px;
}

.btn-add-product {
    width: 100%;
    height: 52px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-family);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

.btn-add-product:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

.product-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.product-row .input-group {
    margin-bottom: 12px;
}

.product-row-full {
    grid-column: 1 / -1;
}

/* ========================
   총 입금액 (Step 7)
   ======================== */
.amount-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.won-sign {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent-gold);
    flex-shrink: 0;
}

.amount-input-wrap .input-field {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 1px;
}

.total-qty-info {
    width: 100%;
    text-align: center;
    padding: 12px 16px;
    margin-bottom: 24px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 14px;
}

.total-qty-info strong {
    color: var(--accent-gold);
    font-weight: 700;
}

.amount-breakdown {
    width: 100%;
    margin-bottom: 24px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent-gold);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.amount-breakdown .item-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.amount-breakdown .item-line:last-child {
    margin-bottom: 0;
}

.amount-breakdown .shipping-line {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--accent-gold);
    font-weight: 500;
}

/* ========================
   구매 동의 (Step 8)
   ======================== */
.agreement-box {
    width: 100%;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 24px;
}

.agreement-box p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 12px;
}

.agreement-box p:last-child {
    margin-bottom: 0;
}

.agreement-box .highlight {
    color: var(--danger);
    font-weight: 700;
}

.agreement-box .bold {
    color: var(--text-primary);
    font-weight: 700;
}

.checkbox-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
    cursor: pointer;
    margin-bottom: 16px;
}

.checkbox-custom {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.checkbox-wrap input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-wrap input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
}

.checkbox-wrap input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    color: #0f0f0f;
    font-size: 14px;
    font-weight: 700;
}

.checkbox-label {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ========================
   완료 페이지 (Step 9)
   ======================== */
.complete-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-gold-light), var(--accent-gold));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin-bottom: 24px;
    animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    60% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.btn-kakao {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 240px;
    height: 56px;
    padding: 0 32px;
    border: none;
    border-radius: var(--radius-lg);
    background: #FEE500;
    color: #191919;
    font-family: var(--font-family);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(254, 229, 0, 0.3);
    gap: 8px;
    text-decoration: none;
    margin-top: 16px;
}

.btn-kakao:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(254, 229, 0, 0.45);
}

.btn-kakao:active {
    transform: translateY(0);
}

.notice-highlight {
    width: 100%;
    margin-top: 24px;
    padding: 16px 20px;
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: var(--radius-sm);
    text-align: center;
}

.notice-highlight p {
    font-size: 14px;
    font-weight: 700;
    color: var(--danger);
    line-height: 1.6;
}

.notice-highlight strong {
    color: #fff;
    background: var(--danger);
    padding: 2px 6px;
    border-radius: 4px;
}

/* ========================
   프로그레스 오버레이
   ======================== */
#divProgressOverlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 15, 15, 0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 20px;
    backdrop-filter: blur(4px);
}

#divProgressOverlay.show {
    display: flex;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.progress-text {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ========================
   토스트 알림
   ======================== */
#divToast {
    display: none;
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    padding: 14px 28px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    max-width: 90%;
    text-align: center;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ========================
   스텝 인디케이터
   ======================== */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 32px;
}

.step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-color);
    transition: var(--transition);
}

.step-dot.active {
    background: var(--accent-gold);
    width: 24px;
    border-radius: 4px;
}

.step-dot.done {
    background: var(--accent-gold-dark);
}

/* ========================
   반응형 - 모바일
   ======================== */
@media (max-width: 520px) {
    #divAppContainer {
        padding: 0 20px;
    }

    .page-title {
        font-size: 24px;
    }

    .page-label {
        font-size: 16px;
    }

    .btn-pill {
        width: 100%;
        min-width: unset;
    }

    .btn-kakao {
        width: 100%;
        min-width: unset;
    }

    .product-row {
        grid-template-columns: 1fr;
    }

    .btn-back {
        top: 12px;
        left: 12px;
    }
}

/* ========================
   반응형 - PC 큰 화면
   ======================== */
@media (min-width: 768px) {
    #divAppContainer {
        padding: 0 32px;
    }

    .step-page {
        padding: 80px 0 60px 0;
    }

    .btn-back {
        left: calc(50% - 240px - 40px);
    }
}

/* ========================
   모달 (최종 확인)
   ======================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    backdrop-filter: blur(8px);
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    max-height: 80vh; /* 부모창의 세로 크기를 넘지 않게 */
    animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-gold);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.confirm-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.confirm-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.confirm-item:last-child {
    border-bottom: none;
}

.confirm-item .label {
    font-size: 12px;
    color: var(--text-muted);
}

.confirm-item .value {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 500;
    word-break: break-all;
}

.modal-footer {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 1px solid var(--border-color);
}

.btn-confirm-submit {
    height: 52px;
    background: #FEE500; /* 노란색 */
    color: #191919;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn-confirm-submit:hover {
    background: #e6cf00;
}

.btn-confirm-cancel {
    height: 52px;
    background: #000; /* 검은색 */
    color: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-confirm-cancel:hover {
    background: #222;
}

/* ========================
   스크롤바 커스텀
   ======================== */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ========================
   셀렉션 컬러
   ======================== */
::selection {
    background: var(--accent-gold);
    color: #0f0f0f;
}

