/* ============================================================
   quotation-write.css - 견적 요청 페이지 (jj_quotation write.skin.php)
   모바일 퍼스트, 깔끔하게 재작성
   ============================================================ */

/* ---------- 공통 ---------- */
.quote-write-page {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 12px 60px;
    box-sizing: border-box;
}

.quote-write-header {
    margin-bottom: 20px;
}

.quote-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    color: var(--slate);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.quote-back-link:hover {
    color: var(--shop-accent);
}

.quote-write-header h1 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--dark);
    font-size: 20px;
    font-weight: 700;
}

/* ---------- 그리드 (모바일: 1열, 데스크톱: 2열) ---------- */
.quote-write-grid {
    display: block;
    width: 100%;
    box-sizing: border-box;
}

/* ---------- 왼쪽: 상품 목록 ---------- */
.quote-items-section {
    width: 100%;
    margin-bottom: 16px;
    padding: 16px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: var(--white);
    box-sizing: border-box;
}

.quote-items-section h2 {
    margin: 0 0 12px;
    color: var(--dark);
    font-size: 16px;
    font-weight: 700;
}

.quote-items-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quote-item-card {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px;
    border: 1px solid #f1f5f9;
    border-radius: 10px;
    box-sizing: border-box;
}

.quote-item-image {
    width: 48px;
    height: 48px;
    overflow: hidden;
    flex-shrink: 0;
    border-radius: 6px;
    background: #f1f5f9;
}

.quote-item-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.quote-item-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.quote-item-name {
    margin: 0;
    overflow: hidden;
    color: var(--dark);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* ★ 패키지 배지 */
.quote-package-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 12px;
    background: var(--shop-accent);
    color: var(--white);
    font-size: 10px;
    font-weight: 700;
    margin-left: 4px;
    vertical-align: middle;
    white-space: nowrap;
}

.quote-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin-top: 2px;
    color: var(--slate);
    font-size: 12px;
}

.quote-item-options {
    color: #94a3b8;
}

/* ★ 패키지 구성품 영역 */
.quote-package-components {
    margin-top: 6px;
    padding: 8px 10px;
    border-radius: 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.quote-package-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

.quote-package-component {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
    font-size: 12px;
    color: #334155;
    border-bottom: 1px dashed #e2e8f0;
}

.quote-package-component:last-child {
    border-bottom: none;
}

/* ★ 수정: 긴 구성품명 줄바꿈 허용 */
.quote-package-component .component-name {
    flex: 1;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.quote-package-component .component-qty {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--shop-accent);
}

.quote-package-component.excluded {
    color: #94a3b8;
}

.quote-package-component.excluded .component-qty {
    color: var(--rose);
    font-weight: 500;
    font-size: 11px;
}

.quote-item-price {
    flex-shrink: 0;
    color: #dc2626;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.quote-items-empty {
    padding: 30px 12px;
    color: #94a3b8;
    text-align: center;
}

.quote-items-empty .btn-goto-mall {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 18px;
    border-radius: 8px;
    background: var(--shop-accent);
    color: var(--white);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.quote-items-empty .btn-goto-mall:hover {
    filter: brightness(1.2);
}

.quote-items-summary {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
    color: var(--slate);
    font-size: 13px;
}

/* ---------- 오른쪽: 폼 ---------- */
.quote-form-section {
    width: 100%;
    padding: 16px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: var(--white);
    box-sizing: border-box;
}

.quote-form-section h2 {
    margin: 0 0 14px;
    color: var(--dark);
    font-size: 16px;
    font-weight: 700;
}

.quote-form-section form {
    width: 100%;
    box-sizing: border-box;
}

/* ---------- 필드 ---------- */
.quote-field {
    display: block;
    width: 100%;
    margin-bottom: 14px;
    box-sizing: border-box;
}

.quote-label {
    display: block;
    margin-bottom: 5px;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
}

.quote-required {
    color: var(--rose);
}

/* 모든 입력 필드 통일 */
.quote-field .frm_input,
.quote-field select.frm_input,
.quote-field textarea.frm_input {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 10px 12px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    background: var(--white) !important;
    color: var(--dark) !important;
    font-size: 14px !important;
    box-sizing: border-box !important;
}

.quote-field .frm_input:focus,
.quote-field select.frm_input:focus,
.quote-field textarea.frm_input:focus {
    border-color: var(--shop-accent) !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(var(--shop-accent-rgb), 0.1) !important;
}

.quote-field textarea.frm_input {
    min-height: 80px;
    resize: vertical;
}

/* ---------- 2컬럼 필드 ---------- */
.quote-row-2col {
    display: block;
    width: 100%;
    box-sizing: border-box;
}

/* ---------- 날짜 ---------- */
.quote-date-range {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
}

.quote-date-range input {
    flex: 1;
    min-width: 0;
}

.quote-date-sep {
    flex-shrink: 0;
    color: #94a3b8;
}

/* ---------- 전화번호 에러 메시지 ---------- */
.quote-phone-msg {
    margin: -10px 0 10px;
    color: #e53e3e;
    font-size: 12px;
}

/* ---------- 개인정보 동의 ---------- */
.quote-privacy {
    margin: 16px 0;
    color: var(--slate);
    font-size: 13px;
}

.quote-privacy label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.quote-privacy input[type="checkbox"] {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--shop-accent);
}

/* ---------- 제출 버튼 ---------- */
.quote-btn-submit {
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 10px;
    background: var(--shop-accent);
    color: var(--white);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition:
        background 0.2s,
        opacity 0.2s;
    box-sizing: border-box;
}

.quote-btn-submit:hover {
    filter: brightness(1.2);
}

.quote-btn-submit:focus {
    outline: 2px solid rgba(var(--shop-accent-rgb), 0.25);
    outline-offset: 2px;
}

.quote-btn-submit:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

/* ============================================================
   캡차 - jj_quotation에 맞게 적용
   ============================================================ */

.quote-captcha {
    width: 100%;
    margin-bottom: 14px;
    box-sizing: border-box;
}

/* 캡차 컨테이너 */
.quote-captcha #captcha,
.quote-captcha .captcha,
.quote-captcha fieldset.captcha {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 6px !important;

    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;

    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-sizing: border-box !important;
}

/*
 * fieldset 자체는 숨기지 않습니다.
 * 기본 fieldset의 최소 너비 때문에 모바일에서 넘치는 현상을 방지합니다.
 */
.quote-captcha fieldset {
    min-width: 0 !important;
}

/* 캡차 이미지 */
.quote-captcha #captcha_img {
    display: block !important;
    width: auto !important;
    max-width: 100% !important;
    height: 40px !important;

    flex: 0 0 auto !important;
    margin: 0 !important;

    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    background: var(--white) !important;
    box-sizing: border-box !important;
}

/* 캡차 입력창 */
.quote-captcha #captcha_key {
    flex: 1 1 100px !important;
    width: auto !important;
    min-width: 80px !important;
    max-width: 160px !important;
    height: 40px !important;

    margin: 0 !important;
    padding: 0 10px !important;

    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    background: var(--white) !important;

    color: var(--dark) !important;
    font-size: 14px !important;
    line-height: 38px !important;
    text-align: center !important;
    box-sizing: border-box !important;
}

.quote-captcha #captcha_key:focus {
    border-color: var(--shop-accent) !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(var(--shop-accent-rgb), 0.1) !important;
}

/* 새로고침 및 음성듣기 버튼 */
.quote-captcha #captcha_reload,
.quote-captcha #captcha_mp3 {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    flex: 0 0 44px !important;
    width: 44px !important;
    height: 40px !important;

    margin: 0 !important;
    padding: 0 !important;

    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    background: var(--white) !important;

    font-size: 0 !important;
    line-height: 1 !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
}

.quote-captcha #captcha_reload:hover,
.quote-captcha #captcha_mp3:hover {
    border-color: var(--shop-accent) !important;
    background: #f8fafc !important;
}

.quote-captcha #captcha_reload:focus,
.quote-captcha #captcha_mp3:focus {
    border-color: var(--shop-accent) !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(var(--shop-accent-rgb), 0.1) !important;
}

/* 버튼 내부의 "새로고침", "음성듣기" 텍스트 숨기기 */
.quote-captcha #captcha_reload span,
.quote-captcha #captcha_mp3 span {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* 새로고침 아이콘 */
.quote-captcha #captcha_reload::before {
    content: "\f021" !important;
    font-family:
        "Font Awesome 6 Free",
        "Font Awesome 5 Free" !important;
    font-weight: 900 !important;
}

/* 음성듣기 아이콘 */
.quote-captcha #captcha_mp3::before {
    content: "\f028" !important;
    font-family:
        "Font Awesome 6 Free",
        "Font Awesome 5 Free" !important;
    font-weight: 900 !important;
}

/* 캡차 버튼 아이콘 공통 */
.quote-captcha #captcha_reload::before,
.quote-captcha #captcha_mp3::before {
    display: inline-block !important;
    color: var(--slate) !important;
    font-size: 18px !important;
    line-height: 1 !important;
}

/*
 * 캡차의 fieldset은 유지하고,
 * 화면에 불필요한 legend와 안내문만 숨깁니다.
 */
.quote-captcha legend,
.quote-captcha #captcha_info {
    display: none !important;
}

/* ---------- 600px 이상: 입력 필드 2열 ---------- */
@media (min-width: 600px) {
    .quote-row-2col {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 12px;
    }
}

/* ---------- 모바일 최적화 ---------- */
@media (max-width: 480px) {
    .quote-date-range input.frm_input {
        height: 34px !important;
        min-height: 34px !important;
        padding: 0 8px !important;
        border-radius: 8px !important;
        font-size: 16px !important;
        line-height: normal !important;
        box-sizing: border-box !important;
    }
    /* Chrome, Edge, Safari, 모바일 브라우저의 날짜 텍스트 영역 */
    .quote-date-range input[type="date"].frm_input::-webkit-datetime-edit {
        height: 32px !important;
        padding: 0 !important;
        line-height: 32px !important;
    }

    /* Safari 및 iOS 날짜 값 수직 정렬 보정 */
    .quote-date-range input[type="date"].frm_input::-webkit-date-and-time-value {
        min-height: 32px !important;
        margin: 0 !important;
        padding: 0 !important;
        line-height: 32px !important;
        text-align: left !important;
    }
    /* 달력 아이콘 영역 정렬 */
    .quote-date-range input[type="date"].frm_input::-webkit-calendar-picker-indicator {
        margin: 0 !important;
        padding: 2px !important;
        align-self: center !important;
    }

    .quote-write-page {
        padding: 12px 0 40px;
    }

    .quote-items-section,
    .quote-form-section {
        padding: 12px;
        border-radius: 12px;
    }

    .quote-item-card {
        gap: 8px;
        padding: 8px;
    }

    .quote-item-image {
        width: 40px;
        height: 40px;
    }

    .quote-item-name {
        font-size: 13px;
    }

    /* ★ 모바일 패키지 구성품 */
    .quote-package-components {
        padding: 6px 8px;
    }
    .quote-package-component {
        font-size: 11px;
        padding: 2px 0;
    }
    .quote-package-component .component-qty {
        font-size: 11px;
    }

    .quote-field .frm_input,
    .quote-field select.frm_input,
    .quote-field textarea.frm_input {
        padding: 8px 10px !important;
        font-size: 16px !important;
    }

    /* 모바일 캡차 컨테이너 */
    .quote-captcha #captcha,
    .quote-captcha .captcha,
    .quote-captcha fieldset.captcha {
        gap: 4px !important;
    }

    /* 모바일 캡차 이미지 */
    .quote-captcha #captcha_img {
        height: 42px !important;
    }

    /* 모바일 캡차 입력창 */
    .quote-captcha #captcha_key {
        flex: 1 1 70px !important;
        min-width: 60px !important;
        max-width: 120px !important;
        height: 42px !important;
        padding: 0 6px !important;
        font-size: 16px !important;
        line-height: 34px !important;
    }

    /* 모바일 캡차 버튼 */
    .quote-captcha #captcha_reload,
    .quote-captcha #captcha_mp3 {
        flex-basis: 42px !important;
        width: 42px !important;
        height: 42px !important;
    }

    .quote-captcha #captcha_reload::before,
    .quote-captcha #captcha_mp3::before {
        font-size: 16px !important;
    }

    .quote-btn-submit {
        height: 44px;
        font-size: 14px;
    }
}

/* ---------- 데스크톱 ---------- */
@media (min-width: 820px) {
    .quote-write-page {
        padding: 24px 20px 80px;
    }

    .quote-write-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 420px;
        gap: 24px;
        align-items: start;
    }

    .quote-items-section,
    .quote-form-section {
        padding: 24px;
    }

    .quote-items-section {
        margin-bottom: 0;
    }

    .quote-write-header h1 {
        font-size: 24px;
    }

    .quote-captcha #captcha_key {
        max-width: 150px !important;
    }
}