/* ============================================ */
/* 설문형 견적 마법사                            */
/* ============================================ */
.qw {
    max-width: 860px;
    margin: 0 auto;
    padding: 20px 16px 100px;
    min-height: 70vh;
}

/* 진행률 바 */
.qw-progress {
    position: relative;
    margin-bottom: 32px;
    padding-top: 20px;
}
.qw-progress__bar {
    position: absolute;
    top: 36px;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, #4A6FA5, #6B8FC5);
    border-radius: 2px;
    transition: width 0.4s ease;
    z-index: 1;
}
.qw-progress__steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}
.qw-progress__steps::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background: #E0E5EC;
    border-radius: 2px;
    transform: translateY(-50%);
    z-index: -1;
}
.qw-step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #E0E5EC;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.3s;
    cursor: pointer;
}
.qw-step-dot.active {
    background: #4A6FA5;
    color: #fff;
    box-shadow: 0 2px 8px rgba(74,111,165,0.3);
}
.qw-step-dot.done {
    background: #5BAFA6;
    color: #fff;
}

/* 페이지 컨테이너 */
.qw-page {
    display: none;
    animation: qwFadeIn 0.35s ease;
}
.qw-page.active { display: block; }
@keyframes qwFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.qw-page__header {
    text-align: center;
    margin-bottom: 28px;
}
.qw-page__header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #2C3E50;
    margin: 0 0 6px;
}
.qw-page__header p {
    font-size: 0.95rem;
    color: #8899A6;
    margin: 0;
}

/* 카드 선택 */
.qw-cards {
    display: grid;
    gap: 12px;
}
.qw-cards--4col { grid-template-columns: repeat(4, 1fr); }
.qw-cards--5col { grid-template-columns: repeat(5, 1fr); }
.qw-cards--3col { grid-template-columns: repeat(3, 1fr); }

.qw-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px 12px;
    border: 2px solid #E8ECF1;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.qw-card i {
    font-size: 1.6rem;
    color: #4A6FA5;
    transition: transform 0.2s;
}
.qw-card span {
    font-size: 0.85rem;
    font-weight: 600;
    color: #444;
}
.qw-card:hover {
    border-color: #4A6FA5;
    background: #F0F4FA;
}
.qw-card:hover i { transform: scale(1.1); }
.qw-card.active {
    border-color: #4A6FA5;
    background: #4A6FA5;
    box-shadow: 0 4px 12px rgba(74,111,165,0.25);
}
.qw-card.active i, .qw-card.active span { color: #fff; }

.qw-card--sm {
    padding: 12px 8px;
    font-size: 0.85rem;
    font-weight: 600;
    flex-direction: row;
    gap: 0;
}
.qw-card--sm span { font-size: 0.85rem; }

/* 폼 필드 */
.qw-form { max-width: 640px; margin: 0 auto; }
.qw-form__row { margin-bottom: 18px; }
.qw-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: #3A4A5C;
    margin-bottom: 8px;
}
.qw-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #E0E5EC;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
    background: #fff;
}
.qw-input:focus {
    border-color: #4A6FA5;
    outline: none;
    box-shadow: 0 0 0 3px rgba(74,111,165,0.1);
}

/* 카테고리 아코디언 */
.qw-cat {
    border: 2px solid #E8ECF1;
    border-radius: 12px;
    margin-bottom: 10px;
    overflow: hidden;
    background: #fff;
    transition: border-color 0.2s;
}
.qw-cat.has-items { border-color: #4A6FA5; }
.qw-cat__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    cursor: pointer;
    transition: background 0.15s;
}
.qw-cat__header:hover { background: #F5F8FC; }
.qw-cat__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #3A4A5C;
}
.qw-cat__title i { color: #4A6FA5; font-size: 1.1rem; }
.qw-cat__right { display: flex; align-items: center; gap: 8px; }
.qw-cat__count {
    font-size: 0.8rem;
    font-weight: 700;
    color: #E8845C;
    display: none;
}
.qw-cat__count.show { display: inline; }
.qw-cat__arrow {
    font-size: 0.75rem;
    color: #999;
    transition: transform 0.25s;
}
.qw-cat.open .qw-cat__arrow { transform: rotate(180deg); }
.qw-cat__body {
    display: none;
    border-top: 1px solid #F0F0F0;
    padding: 10px 14px;
    background: #FAFBFD;
}
.qw-cat.open .qw-cat__body { display: block; }

/* 상품 아이템 */
.qw-products { display: flex; flex-direction: column; gap: 6px; }
.qw-product {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    transition: background 0.15s;
}
.qw-product:hover { background: #EFF3F8; }
.qw-product.selected { background: #E8F0FC; }
.qw-product__thumb {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    overflow: hidden;
    background: #eee;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 18px;
}
.qw-product__thumb img { width: 100%; height: 100%; object-fit: cover; }
.qw-product__info { flex: 1; min-width: 0; }
.qw-product__name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.qw-product__price { font-size: 0.8rem; color: #E8845C; font-weight: 700; }
.qw-product__qty {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.qw-qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #D0D5DD;
    border-radius: 6px;
    background: #fff;
    color: #555;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.qw-qty-btn:hover { border-color: #4A6FA5; color: #4A6FA5; }
.qw-qty-input {
    width: 44px;
    height: 28px;
    text-align: center;
    border: 1px solid #D0D5DD;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    -moz-appearance: textfield;
}
.qw-qty-input::-webkit-outer-spin-button,
.qw-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* 견적 요약 */
.qw-summary {
    background: #F5F8FC;
    border-radius: 12px;
    padding: 20px;
}
.qw-summary__section {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #E0E5EC;
}
.qw-summary__section:last-child { border-bottom: none; margin-bottom: 0; }
.qw-summary__title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #8899A6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.qw-summary__item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 0.9rem;
    color: #444;
}
.qw-summary__item strong { color: #2C3E50; }
.qw-summary__total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0 0;
    font-size: 1.1rem;
    font-weight: 800;
    color: #4A6FA5;
    border-top: 2px solid #4A6FA5;
    margin-top: 8px;
}

/* 버튼 */
.qw-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #fff;
    border-top: 1px solid #E8ECF1;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.05);
    z-index: 100;
    max-width: 860px;
    margin: 0 auto;
}
.qw-btn {
    padding: 12px 28px;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    font-family: inherit;
}
.qw-btn--primary { background: #4A6FA5; color: #fff; }
.qw-btn--primary:hover { background: #3A5F95; transform: translateY(-1px); }
.qw-btn--accent { background: #E8845C; color: #fff; }
.qw-btn--accent:hover { background: #D0744C; transform: translateY(-1px); }
.qw-btn--outline { background: #fff; color: #4A6FA5; border: 2px solid #4A6FA5; }
.qw-btn--outline:hover { background: #F0F4FA; }
.qw-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* 추천 세트 배너 */
.qw-recommend {
    background: linear-gradient(135deg, #FFF5EE 0%, #FFF0E5 100%);
    border: 2px solid #F0C8A8;
    border-radius: 14px;
    margin-bottom: 18px;
    overflow: hidden;
    animation: qwFadeIn 0.4s ease;
}
.qw-recommend__inner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
}
.qw-recommend__icon {
    width: 44px;
    height: 44px;
    background: #E8845C;
    color: #fff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.qw-recommend__text {
    flex: 1;
    min-width: 0;
}
.qw-recommend__text strong {
    display: block;
    font-size: 0.95rem;
    color: #2C3E50;
    margin-bottom: 2px;
}
.qw-recommend__text span {
    font-size: 0.8rem;
    color: #8899A6;
}
.qw-recommend__btn {
    padding: 10px 20px;
    background: #E8845C;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    flex-shrink: 0;
}
.qw-recommend__btn:hover {
    background: #D06A42;
    transform: translateY(-1px);
}
.qw-recommend__preview {
    display: none;
    padding: 0 20px 14px;
    font-size: 0.82rem;
    color: #666;
    line-height: 1.6;
}
.qw-recommend__preview.show { display: block; }
.qw-recommend__tag {
    display: inline-block;
    padding: 2px 8px;
    background: #fff;
    border: 1px solid #E0D5CC;
    border-radius: 6px;
    margin: 2px;
    font-size: 0.78rem;
    color: #555;
}

/* 반응형 */
@media (max-width: 768px) {
    .qw-cards--4col { grid-template-columns: repeat(2, 1fr); }
    .qw-cards--5col { grid-template-columns: repeat(3, 1fr); }
    .qw-cards--3col { grid-template-columns: repeat(3, 1fr); }
    .qw-page__header h2 { font-size: 1.25rem; }
    .qw-card { padding: 14px 10px; }
    .qw-card i { font-size: 1.3rem; }
    .qw-nav { padding: 10px 12px; }
}

@media (max-width: 480px) {
    .qw-cards--5col { grid-template-columns: repeat(2, 1fr); }
    .qw-card--sm { padding: 10px 6px; }
}
