/* ============================================================
   팜플 결제 페이지 스타일
   반응형 (모바일 우선)
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont,
                 'Noto Sans KR', 'Segoe UI', sans-serif;
    background: #f5f5f7;
    color: #1d1d1f;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px 16px;
    min-height: 100vh;
}

/* 헤더 */
.header {
    text-align: center;
    padding: 24px 0 16px;
}

.logo-link {
    display: inline-block;
}

.logo-img {
    width: 250px;
    height: auto;
}

.header-sub {
    font-size: 13px;
    color: #86868b;
    margin-top: 6px;
}

/* 회원 바 */
.member-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    font-size: 13px;
}

.member-bar a {
    color: #2bbcc0;
    text-decoration: none;
}

.member-bar a:hover {
    text-decoration: underline;
}

.member-welcome {
    color: #1d1d1f;
    font-weight: 500;
}

/* 필수 입력 안내 */
.required-notice {
    font-size: 12px;
    color: #86868b;
    text-align: right;
    margin-bottom: 12px;
    padding-right: 4px;
}

/* 이전 주문 불러오기 */
.reorder-section {
    border: 2px dashed #2bbcc0;
    background: #f0fafa;
}

.reorder-desc {
    font-size: 13px;
    color: #6e6e73;
    margin-bottom: 12px;
}

.reorder-card {
    background: #fff;
    border: 1px solid #e8e8ed;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.reorder-card:hover {
    border-color: #2bbcc0;
    background: #f8fffe;
}

.reorder-card.active {
    border-color: #2bbcc0;
    background: #e8f8f8;
    box-shadow: 0 0 0 2px rgba(43, 188, 192, 0.2);
}

.reorder-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.reorder-card-header strong {
    font-size: 14px;
    color: #1d1d1f;
}

.reorder-date {
    font-size: 12px;
    color: #86868b;
}

.reorder-card-body {
    font-size: 13px;
    color: #6e6e73;
}

/* 에러 배너 */
.error-banner {
    background: #fff2f2;
    color: #ff3b30;
    border: 1px solid #ffcdd2;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 14px;
    text-align: center;
}

/* 상품 카드 */
.product-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* 주문 수량 섹션 내 상품 이미지 (width 100%) */
.product-image-full {
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    background: #f5f5f7;
    margin-bottom: 16px;
}

.product-image-full img {
    width: 100%;
    height: auto;
    display: block;
}

.product-name {
    font-size: 18px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 4px;
}

.product-desc {
    font-size: 13px;
    color: #86868b;
    margin-bottom: 10px;
}

.product-amount {
    font-size: 24px;
    font-weight: 700;
    color: #1d1d1f;
}

/* 폼 섹션 */
.form-section {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.form-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #1d1d1f;
}

.form-group {
    margin-bottom: 16px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #6e6e73;
    margin-bottom: 6px;
}

.required {
    color: #ff3b30;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d2d2d7;
    border-radius: 10px;
    font-size: 16px;
    color: #1d1d1f;
    background: #fff;
    transition: border-color 0.2s;
    -webkit-appearance: none;
}

.form-group input:focus {
    outline: none;
    border-color: #2bbcc0;
    box-shadow: 0 0 0 3px rgba(43, 188, 192, 0.15);
}

.form-group input::placeholder {
    color: #c7c7cc;
}

/* 주소 검색 */
.address-search {
    display: flex;
    gap: 8px;
}

.zipcode-input {
    flex: 1;
    max-width: 120px;
}

.address-btn {
    padding: 12px 16px;
    background: #2bbcc0;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    -webkit-appearance: none;
}

.address-btn:hover {
    background: #25a8ab;
}

/* 사이즈 뱃지 */
.size-badge {
    display: inline-block;
    background: #f0f9f9;
    border: 1px solid #2bbcc0;
    color: #1d1d1f;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    margin-bottom: 16px;
}

/* 시안 선택 (라디오 이미지) */
.design-selector {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-top: 8px;
}

.design-option {
    flex-shrink: 0;
    width: 130px;
    border: 2px solid #e8e8ed;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    text-align: center;
}

.design-option input[type="radio"] {
    display: none;
}

.design-option img {
    width: 100%;
    height: 90px;
    object-fit: cover;
}

.design-name {
    display: block;
    padding: 6px 4px;
    font-size: 11px;
    font-weight: 500;
    color: #6e6e73;
    line-height: 1.3;
}

.design-option.selected {
    border-color: #2bbcc0;
    box-shadow: 0 0 0 3px rgba(43, 188, 192, 0.2);
}

.design-option.selected .design-name {
    color: #2bbcc0;
    font-weight: 600;
}

.design-option:hover {
    border-color: #2bbcc0;
}

/* 사이즈 선택 (라디오) */
.size-selector {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.size-option {
    flex: 1;
    border: 2px solid #e8e8ed;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: border-color 0.2s;
    text-align: center;
}

.size-option input[type="radio"] {
    display: none;
}

.size-option.selected {
    border-color: #2bbcc0;
    background: #f0fafa;
}

.size-option:hover {
    border-color: #2bbcc0;
}

.size-option-inner strong {
    font-size: 14px;
    color: #1d1d1f;
}

.size-option.selected .size-option-inner strong {
    color: #2bbcc0;
}

/* 체크박스 그룹 */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

/* 유효성 검사 에러 */
.input-error {
    border-color: #ff3b30 !important;
    box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.1) !important;
}

.field-error {
    display: none;
    font-size: 12px;
    color: #ff3b30;
    margin-top: 4px;
    padding-left: 2px;
}

.field-error.show {
    display: block;
}

/* 인라인 폼 (수량 등) */
.form-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.form-inline label {
    margin-bottom: 0;
    font-size: 15px;
    font-weight: 500;
    color: #1d1d1f;
}

/* 수량 컨트롤 */
.quantity-control {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid #d2d2d7;
    border-radius: 10px;
    overflow: hidden;
}

.qty-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: #f5f5f7;
    font-size: 20px;
    font-weight: 500;
    color: #1d1d1f;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    -webkit-appearance: none;
}

.qty-btn:hover {
    background: #e8e8ed;
}

.qty-btn:active {
    background: #d2d2d7;
}

.quantity-control input[type="number"] {
    width: 48px;
    height: 40px;
    border: none;
    border-left: 1px solid #d2d2d7;
    border-right: 1px solid #d2d2d7;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
    background: #fff;
    -moz-appearance: textfield;
    padding: 0;
    border-radius: 0;
}

.quantity-control input[type="number"]::-webkit-inner-spin-button,
.quantity-control input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* 결제수단 선택 */

/* 알림톡 히어로 (크게, 상단) */
.payment-method-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px;
    border: 2px solid #e8e8ed;
    border-radius: 14px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.15s;
    position: relative;
    margin-bottom: 12px;
}

.payment-method-hero input[type="radio"] {
    display: none;
}

.payment-method-hero.selected {
    border-color: #fbbf24;
    background: #fffdf5;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.15);
}

.payment-method-hero:hover {
    border-color: #fbbf24;
}

.pm-hero-icon {
    font-size: 36px;
    flex-shrink: 0;
}

.pm-hero-info strong {
    display: block;
    font-size: 17px;
    color: #1d1d1f;
    margin-bottom: 4px;
}

.pm-hero-info span {
    font-size: 13px;
    color: #86868b;
    line-height: 1.4;
}

.pm-hero-badge {
    position: absolute;
    top: -10px;
    right: 16px;
    background: #fbbf24;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 10px;
}

/* 하단 2열 (무통장 / 간편결제) */
.payment-method-row {
    display: flex;
    gap: 10px;
}

.payment-method-row .payment-method {
    flex: 1;
}

.payment-method {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    border: 2px solid #e8e8ed;
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.15s;
    text-align: center;
}

.payment-method input[type="radio"] {
    display: none;
}

.payment-method.selected {
    border-color: #2bbcc0;
    background: #f0fafa;
}

.payment-method:hover {
    border-color: #2bbcc0;
}

.pm-icon {
    font-size: 28px;
}

.pm-info {
    text-align: center;
}

.pm-info strong {
    display: block;
    font-size: 14px;
    color: #1d1d1f;
    margin-bottom: 2px;
}

.pm-info span {
    font-size: 11px;
    color: #86868b;
}

.alimtalk-notice {
    background: #fffbea;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 12px 16px;
    margin-top: 12px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #92400e;
    line-height: 1.5;
}

/* 약관 동의 */
.agreement-section {
    padding: 20px 24px !important;
}

.agree-all {
    margin-bottom: 12px;
}

.agree-all .checkbox-label {
    font-size: 16px;
    font-weight: 600;
}

.agree-divider {
    height: 1px;
    background: #e8e8ed;
    margin-bottom: 12px;
}

.agree-item {
    margin-bottom: 10px;
}

.agree-item:last-of-type {
    margin-bottom: 0;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #1d1d1f;
    line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 1px;
    accent-color: #2bbcc0;
    cursor: pointer;
}

/* 보안 안내 */
.security-notice {
    text-align: center;
    font-size: 12px;
    color: #86868b;
    margin-top: 12px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.lock-icon {
    font-size: 14px;
}

/* 결제 요약 */
.summary {
    background: #fff;
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.summary h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #1d1d1f;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
    color: #6e6e73;
}

.summary-row.total {
    border-top: 1px solid #f0f0f0;
    margin-top: 8px;
    padding-top: 16px;
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
}

.total-amount {
    font-size: 20px;
    font-weight: 700;
    color: #1d1d1f;
}

/* 결제 버튼 */
.pay-button {
    display: block;
    width: 100%;
    padding: 16px;
    background: #2bbcc0;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    -webkit-appearance: none;
}

.pay-button:hover {
    background: #25a8ab;
}

.pay-button:active {
    background: #209396;
    transform: scale(0.98);
}

.pay-button:disabled {
    background: #c7c7cc;
    cursor: not-allowed;
    transform: none;
}

.notice {
    text-align: center;
    font-size: 12px;
    color: #86868b;
    margin-top: 12px;
}

/* 결과 페이지 */
.result-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px 24px;
    margin-bottom: 16px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.result-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #34c759;
    color: #fff;
    font-size: 32px;
    line-height: 64px;
    margin: 0 auto 20px;
}

.fail-icon {
    background: #ff3b30;
}

.result-card h2 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 24px;
    color: #1d1d1f;
}

.result-details {
    text-align: left;
    background: #f5f5f7;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e8e8ed;
    font-size: 14px;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: #86868b;
    flex-shrink: 0;
    margin-right: 16px;
}

.detail-value {
    color: #1d1d1f;
    font-weight: 500;
    text-align: right;
    word-break: break-all;
}

.detail-value.amount {
    font-weight: 700;
    color: #2bbcc0;
}

.result-notice {
    font-size: 13px;
    color: #86868b;
}

.error-message {
    font-size: 14px;
    color: #86868b;
    margin-bottom: 24px;
    padding: 0 16px;
}

.retry-button {
    display: inline-block;
    padding: 12px 32px;
    background: #2bbcc0;
    color: #fff;
    text-decoration: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
}

.retry-button:hover {
    background: #25a8ab;
}

/* 액션 버튼 */
.action-buttons {
    text-align: center;
    padding: 16px 0;
}

.home-button {
    display: inline-block;
    padding: 12px 24px;
    color: #2bbcc0;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.home-button:hover {
    text-decoration: underline;
}

/* 푸터 */
.footer {
    text-align: center;
    padding: 32px 0 16px;
    font-size: 12px;
    color: #86868b;
    line-height: 1.8;
}

.footer-company {
    font-size: 11px;
    color: #aeaeb2;
    margin-bottom: 4px;
}

.footer a {
    color: #2bbcc0;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* 시안 선택 카드 */
.select-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.select-card {
    display: block;
    background: #fff;
    border: 2px solid #e8e8ed;
    border-radius: 16px;
    padding: 24px;
    text-decoration: none;
    color: #1d1d1f;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.select-card:hover {
    border-color: #2bbcc0;
    box-shadow: 0 4px 12px rgba(43, 188, 192, 0.15);
}

.select-card.new-design:hover {
    border-color: #2bbcc0;
    box-shadow: 0 4px 12px rgba(43, 188, 192, 0.15);
}

.select-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.select-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.select-card p {
    font-size: 14px;
    color: #6e6e73;
    line-height: 1.5;
    margin-bottom: 12px;
}

.select-arrow {
    font-size: 13px;
    font-weight: 500;
    color: #2bbcc0;
}

.select-card.new-design .select-arrow {
    color: #2bbcc0;
}

/* 팝업 차단 안내 */
.popup-blocked-notice {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 10px;
    padding: 16px;
    margin-top: 16px;
    font-size: 13px;
    color: #5d4037;
    line-height: 1.6;
    text-align: center;
}

/* 로딩 스피너 (결제창 대기) */
.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e8e8ed;
    border-top: 4px solid #2bbcc0;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 0.8s linear infinite;
}

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

/* select 스타일 */
select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d2d2d7;
    border-radius: 10px;
    font-size: 16px;
    color: #1d1d1f;
    background: #fff;
    -webkit-appearance: none;
    appearance: none;
}

select:focus {
    outline: none;
    border-color: #2bbcc0;
    box-shadow: 0 0 0 3px rgba(43, 188, 192, 0.15);
}

/* ============================================================
   반응형 - 태블릿/데스크톱
   ============================================================ */
@media (min-width: 768px) {
    .container {
        padding: 40px 16px;
    }

    .header {
        padding: 32px 0 24px;
    }

    .product-amount {
        font-size: 36px;
    }
}
