/* ============================================
   프론트 CSS - 구글 스타일 클린 디자인
   파일명: css/front.css
   ============================================ */

/* --- CSS 변수 --- */
:root {
    --primary: #4285F4;       /* 구글 블루 */
    --primary-dark: #3367D6;
    --secondary: #5F6368;     /* 구글 그레이 */
    --text-primary: #202124;
    --text-secondary: #5F6368;
    --text-light: #80868B;
    --bg-white: #FFFFFF;
    --bg-light: #F8F9FA;
    --bg-hover: #F1F3F4;
    --border-color: #DFE1E5;
    --border-focus: #4285F4;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
    --shadow-hover: 0 2px 12px rgba(0,0,0,0.15);
    --radius: 8px;
    --radius-lg: 24px;
    --transition: all 0.2s ease;
    --max-width: 1200px;
}

/* --- 리셋 --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-primary);
    background: var(--bg-white);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; }

/* ============================================
   쿠키 동의 배너
   ============================================ */
.cookie-banner {
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #202124;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.cookie-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.cookie-text {
    font-size: 13px;
    line-height: 1.4;
    color: #E8EAED;
    flex: 1;
}

.cookie-btns {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.cookie-btn {
    padding: 6px 18px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Noto Sans KR', sans-serif;
}

.cookie-btn.accept {
    background: #4285F4;
    color: #fff;
}
.cookie-btn.accept:hover { background: #3367D6; }

.cookie-btn.decline {
    background: transparent;
    color: #9AA0A6;
    border: 1px solid #5F6368;
}
.cookie-btn.decline:hover { background: #303134; color: #E8EAED; }

@media (max-width: 600px) {
    .cookie-inner { padding: 8px 16px; gap: 10px; }
    .cookie-text { font-size: 12px; }
    .cookie-btn { padding: 5px 12px; font-size: 12px; }
}

/* ============================================
   헤더
   ============================================ */
.site-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    height: 64px;
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.header-logo a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

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

/* PC 모드(769px 이상)에서만 로고 30% 확대 : 36px -> 47px */
@media (min-width: 769px) {
    .header-logo img {
        height: 52px;
    }
}

/* 네비게이션 */
.header-nav { display: flex; align-items: center; gap: 4px; }

.header-nav a {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    white-space: nowrap;
}

.header-nav a:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.header-nav a.active {
    color: var(--primary);
    background: rgba(66, 133, 244, 0.08);
}

.btn-login {
    background: var(--bg-light) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 20px !important;
    padding: 8px 20px !important;
}

.btn-login:hover {
    background: var(--bg-hover) !important;
    border-color: #ccc !important;
}

/* 모바일 메뉴 토글 */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    color: var(--text-secondary);
}

/* ============================================
   메인 페이지 (구글 스타일)
   ============================================ */
.main-hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
    min-height: calc(100vh - 64px - 60px);
}

.hero-logo {
    text-align: center;
    margin-bottom: 36px;
}

.hero-logo img {
    height: 72px;
    width: auto;
    margin-bottom: 8px;
}

.hero-logo .hero-subtitle {
    font-size: 14px;
    color: var(--text-light);
    letter-spacing: 1px;
    font-weight: 400;
}

/* 채팅 입력 영역 */
.chat-search-box {
    width: 100%;
    max-width: 640px;
    margin-bottom: 28px;
}

.chat-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 6px 8px 6px 20px;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.chat-input-wrapper:hover {
    box-shadow: var(--shadow-hover);
}

.chat-input-wrapper:focus-within {
    box-shadow: var(--shadow-hover);
    border-color: var(--border-focus);
}

.chat-input-wrapper .chat-icon {
    color: var(--primary);
    font-size: 20px;
    margin-right: 12px;
    flex-shrink: 0;
}

#chatInput, #chatInputBottom {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    font-family: inherit;
    color: var(--text-primary);
    background: transparent;
    padding: 10px 0;
    min-width: 0;
}

#chatInput::placeholder, #chatInputBottom::placeholder { color: var(--text-light); }

.chat-send-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    font-size: 18px;
    margin-left: 8px;
}

.chat-send-btn:hover { background: var(--primary-dark); transform: scale(1.05); }
.chat-send-btn:disabled { background: #ccc; cursor: not-allowed; transform: none; }

/* 추천 질문 카드 */
.suggest-cards {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 680px;
}

.suggest-card {
    padding: 10px 18px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.suggest-card:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--primary);
}

/* ============================================
   채팅 대화창 (결과 표시)
   ============================================ */
.chat-container {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 20px 24px;
    flex: 1;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 24px;
}

.chat-message {
    display: flex;
    gap: 12px;
    animation: fadeIn 0.3s ease;
}

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

.chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.chat-avatar.user-avatar {
    background: var(--primary);
    color: white;
}

.chat-avatar.ai-avatar {
    background: #E8F0FE;
    color: var(--primary);
}

.chat-bubble {
    flex: 1;
    line-height: 1.7;
    font-size: 15px;
}

.chat-bubble.user-bubble {
    background: var(--bg-light);
    padding: 12px 16px;
    border-radius: 12px 12px 12px 4px;
}

.chat-bubble.ai-bubble { padding: 4px 0; color: var(--text-primary); }

.chat-bubble.ai-bubble p { margin-bottom: 8px; }
.chat-bubble.ai-bubble p:last-child { margin-bottom: 0; }

/* 제품 카드 (AI 추천 결과에 포함) */
.product-recommend-card {
    display: flex;
    gap: 16px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px;
    margin: 12px 0;
    transition: var(--transition);
}

.product-recommend-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.product-recommend-card img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 6px;
    background: white;
}

.product-recommend-info h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.product-recommend-info p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 2px !important;
}

/* 하단 고정 채팅 입력 (대화 모드) - 메인 입력창과 동일 스타일 */
.chat-input-fixed {
    position: sticky;
    bottom: 0;
    background: var(--bg-white);
    padding: 20px 24px 28px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
}

.chat-input-fixed .chat-input-wrapper {
    width: 100%;
    max-width: 640px;
}

/* 로딩 표시 */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--text-light);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* 단계별 상태 스테퍼 */
.status-stepper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 8px 0;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-light);
    opacity: 0.4;
    transition: all 0.4s ease;
}

.step-item.active {
    color: var(--primary);
    opacity: 1;
    font-weight: 500;
}

.step-item.done {
    color: #16A34A;
    opacity: 0.65;
}

.step-item.done .step-icon::after {
    content: ' \2713';
    font-size: 11px;
}

.step-item .step-icon {
    font-size: 16px;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.step-item .step-text {
    line-height: 1.4;
}

.step-item .dots {
    display: inline-block;
    min-width: 18px;
    text-align: left;
    font-weight: 700;
    letter-spacing: 1px;
}

/* ============================================
   제품 목록 (쇼핑몰 스타일)
   ============================================ */
.page-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 32px 24px;
    flex: 1;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
}

/* 카테고리 탭 */
.category-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.category-tab {
    padding: 8px 20px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-white);
    text-decoration: none;
}

.category-tab:hover, .category-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 제품 그리드 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.product-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.product-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    color: inherit;
}

.product-card-img {
    width: 100%;
    height: 200px;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 16px;
}

.product-card-img img {
    max-height: 100%;
    object-fit: contain;
}

.product-card-img .no-img {
    font-size: 48px;
    color: var(--text-light);
}

.product-card-body { padding: 16px; }

.product-card-cat {
    font-size: 12px;
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 4px;
}

.product-card-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-spec {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ============================================
   제품 상세
   ============================================ */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.product-detail-img {
    background: var(--bg-light);
    border-radius: var(--radius);
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.product-detail-img img { max-height: 360px; object-fit: contain; }
.product-detail-img .no-img { font-size: 100px; color: var(--text-light); }

.product-detail-info { padding: 20px 0; }

.product-detail-cat {
    font-size: 13px;
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 8px;
}

.product-detail-name {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    line-height: 1.3;
}

.product-detail-meta {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.product-detail-meta .meta-row {
    display: flex;
    font-size: 14px;
}

.meta-row .meta-label {
    width: 80px;
    color: var(--text-light);
    flex-shrink: 0;
}

.meta-row .meta-value {
    color: var(--text-primary);
    font-weight: 500;
}

.product-detail-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.btn-inquiry {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-inquiry:hover { background: var(--primary-dark); color: white; }

.product-detail-desc {
    padding: 32px 0;
}

.product-detail-desc h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--text-primary);
}

.product-detail-desc .desc-content {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-secondary);
    white-space: pre-line;
}

/* ============================================
   로그인 / 회원가입 폼
   ============================================ */
.auth-page {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.auth-box {
    width: 100%;
    max-width: 420px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 48px 40px;
}

.auth-box h2 {
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
}

.auth-box .auth-desc {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 32px;
}

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    background: var(--bg-white);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
}

.btn-submit {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.btn-submit:hover { background: var(--primary-dark); }

.auth-link {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-link a { font-weight: 600; }

/* ============================================
   회사소개
   ============================================ */
.company-hero {
    background: var(--bg-light);
    padding: 80px 24px;
    text-align: center;
}

.company-hero h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
}

.company-hero p {
    font-size: 16px;
    color: var(--text-secondary);
}

.company-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 24px;
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-secondary);
    text-align: center;
}

/* ============================================
   푸터
   ============================================ */
.site-footer {
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
    padding: 20px 24px;
    font-size: 13px;
    color: var(--text-light);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
}

.footer-admin {
    font-size: 12px;
    color: #9AA0A6;
    border: 1px solid #DFE1E5;
    padding: 4px 12px;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s ease;
}
.footer-admin:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: #F0F4FF;
}

/* ============================================
   페이징
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 32px;
}

.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.pagination a:hover { background: var(--bg-hover); }
.pagination .active { background: var(--primary); color: white; font-weight: 600; }

/* ============================================
   알림 메시지
   ============================================ */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 16px;
}
.alert-error { background: #FEE2E2; color: #DC2626; border: 1px solid #FECACA; }
.alert-success { background: #DCFCE7; color: #16A34A; border: 1px solid #BBF7D0; }

/* ============================================
   반응형
   ============================================ */
@media (max-width: 1024px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .mobile-menu-btn { display: block; }

    .header-nav {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-white);
        border-bottom: 1px solid var(--border-color);
        flex-direction: column;
        padding: 12px;
        box-shadow: var(--shadow-md);
    }

    .header-nav.open { display: flex; }
    .header-nav a { padding: 12px 16px; }

    .product-grid { grid-template-columns: repeat(2, 1fr); }

    .product-detail {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .product-detail-img { min-height: 280px; }
    .product-detail-name { font-size: 22px; }

    .hero-logo img { height: 56px; }

    .auth-box { padding: 32px 24px; }
}

@media (max-width: 480px) {
    .product-grid { grid-template-columns: 1fr; }
    .suggest-cards { flex-direction: column; align-items: center; }
    .hero-logo img { height: 48px; }
    .chat-input-wrapper { padding: 4px 6px 4px 14px; }
}

/* ============================================
   [신규 v3] AI 채팅 - 제품 추천 표
   PC   : 테이블
   모바일: 카드형 (768px 이하)
   ============================================ */

.prod-table-wrap {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.prod-table-loading {
    padding: 20px;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
}

/* --- 표 상단 (제목 + 견적버튼) --- */
.prod-table-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 8px;
    flex-wrap: wrap;
}

.prod-table-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.prod-table-title b { color: var(--primary); }

.prod-quote-btn {
    padding: 7px 14px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s;
}

.prod-quote-btn:hover { opacity: .85; }

/* ============================================
   PC 테이블
   ============================================ */
.prod-table-pc { display: block; }
.prod-card-mo  { display: none; }

.prod-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.prod-table thead th {
    background: #f9fafb;
    color: #6b7280;
    font-weight: 600;
    font-size: 13px;
    padding: 12px 8px;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.prod-table tbody td {
    padding: 12px 8px;
    text-align: center;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.prod-table tbody tr:last-child td { border-bottom: none; }
.prod-table tbody tr:hover { background: #fafbfc; }

/* --- 컬럼 폭 --- */
.prod-table .col-chk   { width: 44px; }
.prod-table .col-no    { width: 50px;  color: #9ca3af; }
.prod-table .col-img   { width: 70px; }
.prod-table .col-cat   { width: 90px;  color: #6b7280; }
.prod-table .col-name  { text-align: left; font-weight: 500; color: var(--text-primary); }
.prod-table .col-model { width: 110px; color: #6b7280; }
.prod-table .col-etc   { width: 120px; }

.prod-table .col-img img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #f3f4f6;
}

.prod-table .no-img { color: #d1d5db; }

.prod-table input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* --- 제품보러가기 링크 --- */
.prod-link {
    display: inline-block;
    padding: 5px 12px;
    background: var(--primary);
    color: #fff !important;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
}

.prod-link:hover { opacity: .85; }

/* ============================================
   페이징
   ============================================ */
.prod-paging {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.pg-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    color: #6b7280;
    cursor: pointer;
    transition: all .15s;
}

.pg-btn:hover:not(.disabled):not(.on) {
    border-color: var(--primary);
    color: var(--primary);
}

.pg-btn.on {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
    cursor: default;
}

.pg-btn.disabled {
    color: #d1d5db;
    cursor: not-allowed;
}

/* ============================================
   마크다운 스타일 (AI 답변 본문)
   ============================================ */
.ai-bubble .md-head {
    display: block;
    margin: 12px 0 6px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.ai-bubble .md-hr {
    margin: 12px 0;
    border: none;
    border-top: 1px solid #f3f4f6;
}

/* ============================================
   모바일 세로모드 (768px 이하)
   → 항목이 7개라 표는 가로스크롤 발생 → 카드형으로 전환
   ============================================ */
@media (max-width: 768px) {

    .prod-table-pc { display: none; }
    .prod-card-mo  { display: block; }

    .prod-table-head {
        flex-direction: column;
        align-items: stretch;
    }

    .prod-quote-btn { width: 100%; padding: 10px; }

    /* --- 제품 카드 --- */
    .prod-card {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        padding: 12px;
        margin-bottom: 8px;
        background: #fff;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
    }

    .prod-card:last-child { margin-bottom: 0; }

    .pc-chk { padding-top: 2px; }

    .pc-chk input[type="checkbox"] {
        width: 18px;
        height: 18px;
        accent-color: var(--primary);
    }

    .pc-img {
        flex-shrink: 0;
        width: 56px;
        height: 56px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #f9fafb;
        border-radius: 6px;
        overflow: hidden;
    }

    .pc-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .pc-img .no-img { color: #d1d5db; font-size: 12px; }

    .pc-info { flex: 1; min-width: 0; }

    .pc-top {
        display: flex;
        align-items: center;
        gap: 6px;
        margin-bottom: 3px;
    }

    .pc-no {
        font-size: 11px;
        color: #9ca3af;
    }

    .pc-cat {
        display: inline-block;
        padding: 2px 6px;
        background: #f3f4f6;
        border-radius: 4px;
        font-size: 11px;
        color: #6b7280;
    }

    .pc-name {
        font-size: 14px;
        font-weight: 600;
        color: var(--text-primary);
        line-height: 1.4;
        margin-bottom: 2px;
        word-break: keep-all;
    }

    .pc-model {
        font-size: 12px;
        color: #9ca3af;
        margin-bottom: 8px;
    }

    .pc-link {
        display: inline-block;
        padding: 5px 12px;
        background: var(--primary);
        color: #fff !important;
        border-radius: 12px;
        font-size: 12px;
        font-weight: 600;
        text-decoration: none;
    }

    .prod-paging { gap: 3px; }
    .pg-btn { min-width: 30px; height: 30px; font-size: 12px; }
}

/* ============================================
   [v3.3] 상단 메뉴 - 새 대화 버튼
   회원가입 버튼(.btn-login)과 동일한 디자인
   ============================================ */
.header-nav a.btn-newchat {
    padding: 8px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    background: #fff;
    transition: all .2s;
    white-space: nowrap;
}

.header-nav a.btn-newchat:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .header-nav a.btn-newchat {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* ============================================
   [v3.4] 제품표 행 전체 클릭 가능 처리
   - 행/카드 어디를 눌러도 제품 상세로 이동
   - 체크박스 영역만 예외
   ============================================ */

/* --- PC 테이블 행 --- */
.prod-table tbody tr.prod-row {
    cursor: pointer;
}

.prod-table tbody tr.prod-row:hover {
    background: #f5f8ff;
}

/* 체크박스 셀은 기본 커서 유지 */
.prod-table tbody tr.prod-row .col-chk {
    cursor: default;
}

.prod-table tbody tr.prod-row .col-chk input[type="checkbox"] {
    cursor: pointer;
}

/* --- 비고 링크 (span으로 변경됨) --- */
.prod-table .prod-link {
    display: inline-block;
    padding: 5px 12px;
    background: var(--primary);
    color: #fff;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: opacity .2s;
}

.prod-table tbody tr.prod-row:hover .prod-link {
    opacity: .85;
}

/* --- 모바일 카드 --- */
@media (max-width: 768px) {

    .prod-card {
        cursor: pointer;
        transition: background .15s;
    }

    .prod-card:active {
        background: #f5f8ff;
    }

    /* 체크박스 영역은 기본 커서 유지 */
    .prod-card .pc-chk {
        cursor: default;
    }

    .prod-card .pc-chk input[type="checkbox"] {
        cursor: pointer;
    }

    /* 제품보러가기 (span으로 변경됨) */
    .prod-card .pc-link {
        display: inline-block;
        padding: 5px 12px;
        background: var(--primary);
        color: #fff;
        border-radius: 12px;
        font-size: 12px;
        font-weight: 600;
        cursor: pointer;
    }
}

/* ============================================
   [v3.5] 새 대화 버튼 - PC / 모바일 분기 배치
   PC   : 네비게이션 안 (회사소개 왼쪽)
   모바일: 네비게이션 밖 (햄버거 버튼 왼쪽에 항상 노출)
   ============================================ */

/* --- 모바일 우측 영역 (새대화 + 햄버거) --- */
.header-right-mo {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- PC(769px 이상) : nav 안의 버튼만 표시 --- */
.btn-newchat-pc { display: inline-block; }
.btn-newchat-mo { display: none; }

/* ============================================
   모바일 (768px 이하)
   ============================================ */
@media (max-width: 768px) {

    /* nav 안의 새대화 버튼 숨김 (햄버거 메뉴 내부) */
    .btn-newchat-pc { display: none !important; }

    /* 햄버거 왼쪽 새대화 버튼 항상 노출 */
    .btn-newchat-mo {
        display: inline-block !important;
        padding: 7px 12px;
        border: 1px solid #e5e7eb;
        border-radius: 20px;
        font-size: 13px;
        font-weight: 500;
        color: var(--text-primary);
        background: #fff;
        white-space: nowrap;
        text-decoration: none;
    }

    .btn-newchat-mo:active {
        border-color: var(--primary);
        color: var(--primary);
    }
}

/* ============================================
   초소형 화면 (480px 이하) - 텍스트 축약
   ============================================ */
@media (max-width: 480px) {

    .btn-newchat-mo {
        padding: 7px 10px;
        font-size: 12px;
    }

    .header-right-mo { gap: 6px; }
}

/* ============================================
   [v4] 견적 요청 레이어 팝업
   ============================================ */

.quote-layer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

/* --- 배경 딤 --- */
.quote-dim {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, .5);
}

/* --- 팝업 박스 --- */
.quote-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 92%;
    max-width: 620px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,.25);
    overflow: hidden;
}

.quote-loading {
    padding: 60px 20px;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
}

/* --- 헤더 --- */
.quote-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.quote-head h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

.quote-close {
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 6px;
    transition: all .15s;
}

.quote-close:hover {
    background: #f3f4f6;
    color: #374151;
}

/* --- 바디 (스크롤) --- */
.quote-body {
    padding: 18px 20px;
    overflow-y: auto;
    flex: 1;
}

.quote-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.quote-section-title b { color: var(--primary); }

/* ============================================
   제품 아이템
   ============================================ */
.quote-items {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.quote-item {
    padding: 12px;
    border-bottom: 1px solid #f3f4f6;
}

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

/* --- 1줄: 이미지 + 제품명 + 단가 + 삭제 --- */
.qi-row1 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qi-img {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    border-radius: 6px;
    overflow: hidden;
}

.qi-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.qi-img .no-img { color: #d1d5db; font-size: 12px; }

.qi-info {
    flex: 1;
    min-width: 0;
}

.qi-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    word-break: keep-all;
}

.qi-model {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 2px;
}

.qi-price {
    flex-shrink: 0;
    text-align: right;
}

.qi-unit {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.qi-inquiry {
    display: inline-block;
    padding: 3px 8px;
    background: #fef3c7;
    color: #92400e;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.qi-del {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    color: #d1d5db;
    cursor: pointer;
    border-radius: 4px;
}

.qi-del:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* --- 2줄: 수량 + 금액 --- */
.qi-row2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #f3f4f6;
    gap: 10px;
}

.qi-qty {
    display: flex;
    align-items: center;
    gap: 5px;
}

.qi-label {
    font-size: 12px;
    color: #6b7280;
    margin-right: 3px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 5px;
    font-size: 15px;
    color: #6b7280;
    cursor: pointer;
    line-height: 1;
}

.qty-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.qty-input {
    width: 52px;
    height: 28px;
    text-align: center;
    border: 1px solid #e5e7eb;
    border-radius: 5px;
    font-size: 13px;
    color: var(--text-primary);
}

/* 수량 input의 스피너 제거 */
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.qty-input { -moz-appearance: textfield; }

.qi-amount {
    text-align: right;
}

.qi-amt-label {
    font-size: 12px;
    color: #6b7280;
}

.qi-amt-val {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

.qi-amt-inquiry {
    font-size: 12px;
    color: #92400e;
}

/* ============================================
   합계
   ============================================ */
.quote-total {
    margin-top: 14px;
    padding: 14px 16px;
    background: #f9fafb;
    border-radius: 8px;
}

.qt-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
}

.qt-label {
    font-size: 13px;
    color: #6b7280;
}

.qt-val {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.qt-main {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
}

.qt-main .qt-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.qt-amount {
    font-size: 19px;
    font-weight: 700;
    color: var(--primary);
}

.qt-notice {
    margin-top: 10px;
    padding: 9px 11px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    font-size: 12px;
    color: #92400e;
    line-height: 1.5;
}

/* ============================================
   요청자 정보 폼
   ============================================ */
.quote-form { display: block; }

.qf-row {
    margin-bottom: 10px;
}

.qf-row label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 5px;
}

.qf-row .req { color: #dc2626; }

.qf-row input[type="text"],
.qf-row textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-primary);
    font-family: inherit;
    box-sizing: border-box;
}

.qf-row input[type="text"]:focus,
.qf-row textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.qf-row textarea {
    resize: vertical;
    min-height: 66px;
}

/* ============================================
   푸터 버튼
   ============================================ */
.quote-foot {
    display: flex;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid #e5e7eb;
    background: #fff;
    flex-shrink: 0;
}

.qbtn {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    border: 1px solid transparent;
}

.qbtn-cancel {
    background: #fff;
    border-color: #e5e7eb;
    color: #6b7280;
}

.qbtn-cancel:hover {
    background: #f9fafb;
}

.qbtn-submit {
    background: var(--primary);
    color: #fff;
    flex: 2;
}

.qbtn-submit:hover { opacity: .88; }

.qbtn-submit:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* ============================================
   모바일 대응
   ============================================ */
@media (max-width: 768px) {

    .quote-box {
        width: 100%;
        max-width: none;
        max-height: 100%;
        height: 100%;
        top: 0;
        left: 0;
        transform: none;
        border-radius: 0;
    }

    .quote-body { padding: 16px; }

    .qi-row1 { gap: 8px; }

    .qi-img {
        width: 46px;
        height: 46px;
    }

    .qi-name  { font-size: 13px; }
    .qi-unit  { font-size: 13px; }

    .qi-row2 {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .qi-qty { justify-content: flex-start; }

    .qi-amount {
        text-align: right;
        padding-top: 4px;
        border-top: 1px dashed #f3f4f6;
    }

    .qt-amount { font-size: 17px; }
}

/* ============================================
   [v4.1] 선택 개수 표시 (페이지 통합)
   ============================================ */
.prod-checked-cnt {
    font-size: 13px;
    font-weight: 500;
    color: var(--primary);
    margin-left: 4px;
}

/* ============================================
   [v4.3] 견적 팝업 - 부가세 선택
   ============================================ */
.qf-radio {
    display: flex;
    gap: 18px;
    padding: 4px 0;
}

.qf-radio label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0;
    font-size: 14px;
    font-weight: 400;
    color: var(--text-primary);
    cursor: pointer;
}

.qf-radio input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* ============================================
   [v4.3] 견적 요청 완료 화면
   ============================================ */
.quote-box-done { max-width: 480px; }

.qdone-wrap {
    text-align: center;
    padding: 20px 10px;
}

.qdone-icon {
    font-size: 48px;
    margin-bottom: 14px;
}

.qdone-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.qdone-no {
    display: inline-block;
    padding: 8px 20px;
    background: #f0f4ff;
    border: 1px solid #dbe4ff;
    border-radius: 20px;
    font-size: 15px;
    color: var(--primary);
    margin-bottom: 18px;
}

.qdone-no b { font-weight: 700; }

.qdone-desc {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.7;
    margin-bottom: 18px;
}

.qdone-contact {
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
    font-size: 13px;
    color: #6b7280;
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .quote-box-done {
        max-width: none;
        height: auto;
        max-height: 100%;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 92%;
        border-radius: 12px;
    }

    .qdone-icon { font-size: 40px; }
    .qdone-title { font-size: 16px; }
}