:root {
    /* 파란색 테마 및 공통 변수 */
    --primary-color: #0346f2; 
    --primary-hover: #0231b3;
    --secondary-color: #1e3a8a;
    --border-color: #e2e8f0;
    --text-muted: #64748b;
    --bg-dark: #0f172a;
    --max-width: 1280px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
    font-family: 'ptbd', 'Pretendard', 'Noto Sans KR', sans-serif; 
    background-color: #f8fafc; 
    color: #222; 
    line-height: 1.5; 
    -webkit-user-select: none; 
    -moz-user-select: none; 
    -ms-user-select: none; 
    user-select: none; 
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { -webkit-user-drag: none; user-drag: none; }

/* Font Setting */
@font-face { 
    font-family: 'ptbd'; 
    src: url('평택반도체 Regular.ttf') format('truetype'); 
    font-weight: normal; 
    font-style: normal; 
}


/* ================= Header ================= */
.site-header { position: sticky; top: 0; left: 0; width: 100%; z-index: 100; background: #fff; border-bottom: 1px solid #e5e5e5; height: auto; margin: 0; }
.header-inner { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; height: 60px; display: flex; justify-content: space-between; align-items: center; }
.header-left { display: flex; align-items: center; gap: 15px; }
.logo { font-size: 22px; font-weight: 900; color: #000; letter-spacing: -1px; white-space: nowrap; }

.header-right { display: flex; align-items: center; gap: 15px; font-size: 14px; font-weight: 600; }
.btn-login-sm { background: #111; color: #fff; padding: 6px 14px; border-radius: 4px; font-size: 13px; }

/* Toggle Button */
.site-toggle-btn { display: inline-flex; align-items: center; text-decoration: none; user-select: none; }
.toggle-track { position: relative; display: flex; align-items: center; justify-content: space-between; width: 126px; height: 32px; padding: 3px; border-radius: 20px; background-color: #cbd5e1; box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.12); transition: background-color 0.35s ease; cursor: pointer; }
.toggle-label { position: relative; z-index: 2; width: 50%; text-align: center; font-size: 11px; font-weight: 800; letter-spacing: -0.3px; transition: color 0.3s ease; }
.toggle-knob { position: absolute; top: 3px; left: 3px; z-index: 1; width: 59px; height: 26px; background-color: #ffffff; border-radius: 14px; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }

.site-toggle-btn.active-right .toggle-track { background-color: var(--primary-color); }
.site-toggle-btn.active-right .toggle-knob { transform: translateX(61px); }
.site-toggle-btn.active-right .toggle-label.right { color: #1e293b; }
.site-toggle-btn.active-right .toggle-label.left { color: rgba(255, 255, 255, 0.9); }

.site-toggle-btn.active-left .toggle-track { background-color: #cbd5e1; }
.site-toggle-btn.active-left .toggle-knob { transform: translateX(0); }
.site-toggle-btn.active-left .toggle-label.left { color: #1e293b; }
.site-toggle-btn.active-left .toggle-label.right { color: #64748b; }

/* ================= 서브 메뉴 ================= */
.sub-menu-nav { background: #fff; border-bottom: 1px solid #e2e8f0; }
.sub-menu-inner { max-width: var(--max-width); margin: 0 auto; display: flex; justify-content: center; align-items: center; gap: 20px; padding: 10px 20px; }
.sub-menu-inner a { font-size: 15px; font-weight: 700; color: #0099e6; display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 8px; transition: background-color 0.2s ease, color 0.2s ease;; }
.sub-menu-inner a i { font-size: 18px; color: #0073df; transition: color 0.2s ease; }
.sub-menu-inner a:hover { background-color: #7ac3e7; color: #ffffff; }
.sub-menu-inner a:hover i { color: #ffffff; }

/* ================= Main Container & 상품 목록 ================= */
.main-container { max-width: var(--max-width); margin: 30px auto; padding: 0 16px; display: flex; flex-direction: column; gap: 36px; }

.hero-banner { 
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); 
    color: #fff; 
    border-radius: 14px; 
    padding: 40px 48px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.15);
}
.hero-text h2 { font-size: 28px; font-weight: 800; margin-bottom: 10px; white-space: pre-line; line-height: 1.35; }
.hero-text p { color: #94a3b8; font-size: 15px; margin-bottom: 20px; }

.section-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: flex-end; 
    border-bottom: 2px solid var(--bg-dark); 
    padding-bottom: 12px; 
    margin-bottom: 20px; 
}
.section-title { font-size: 22px; font-weight: 800; color: var(--bg-dark); display: flex; align-items: center; gap: 8px; }
.count-badge { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.count-badge strong { color: var(--primary-color); font-weight: 800; }

.product-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); 
    gap: 22px; 
}
.product-card { 
    display: flex;
    flex-direction: column;
    text-decoration: none; 
    color: inherit; 
    background: #fff; 
    border: 1px solid var(--border-color); 
    border-radius: 10px; 
    overflow: hidden; 
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease; 
}
.product-card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08); 
    border-color: var(--primary-color); 
}

.product-img-wrap { 
    width: 100%; 
    height: 220px; 
    background-color: #f8fafc; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    overflow: hidden;
    border-bottom: 1px solid #f1f5f9;
    position: relative;
}
.product-img-wrap img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    transition: transform 0.3s ease;
}
.product-card:hover .product-img-wrap img { transform: scale(1.04); }
.fallback-icon { color: #cbd5e1; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }

.product-info { padding: 18px; flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.product-tags { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.tag { font-size: 11px; padding: 3px 8px; border-radius: 4px; font-weight: 700; }
.tag-blue { background: #dbeafe; color: #1e40af; }
.tag-red { background: #fee2e2; color: #991b1b; }
.tag-gray, .tag-category { background: #f1f5f9; color: #475569; }

.product-name { font-size: 16px; font-weight: 700; margin-bottom: 8px; color: #0f172a; line-height: 1.35; }
.product-specs { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; min-height: 38px; line-height: 1.4; word-break: keep-all; }
.product-price-box { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px dashed #e2e8f0; padding-top: 12px; margin-top: auto; }
.price-label { font-size: 12px; color: var(--text-muted); }
.product-price { font-size: 20px; font-weight: 800; color: var(--primary-color); }

.no-data-msg { text-align: center; padding: 60px 20px; color: #64748b; background: #fff; border-radius: 10px; border: 1px dashed #cbd5e1; grid-column: 1 / -1; }

/* ================= 상품 상세 페이지 (detail.php) ================= */
.detail-container { max-width: var(--max-width); margin: 30px auto; padding: 0 16px; }

.product-top-section { 
    display: grid; 
    grid-template-columns: 1fr 1.2fr; 
    gap: 40px; 
    background: #fff; 
    padding: 32px; 
    border-radius: 12px; 
    border: 1px solid var(--border-color); 
    margin-bottom: 30px; 
}

/* 상세페이지 슬라이더 */
.detail-img-box { 
    position: relative; 
    background: #f8fafc; 
    border-radius: 8px; 
    border: 1px solid #e2e8f0; 
    height: 360px; 
    color: #94a3b8; 
    overflow: hidden; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}
.slider-container { width: 100%; height: 100%; position: relative; overflow: hidden; }
.slider-wrapper { display: flex; width: 100%; height: 100%; transition: transform 0.3s ease-in-out; }
.slide { min-width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 16px; box-sizing: border-box; }
.slide img { max-width: 100%; max-height: 100%; object-fit: contain; }

.slider-btn { 
    position: absolute; 
    top: 50%; 
    transform: translateY(-50%); 
    background: rgba(15, 23, 42, 0.5); 
    color: #fff; 
    border: none; 
    width: 38px; 
    height: 38px; 
    border-radius: 50%; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    transition: background 0.2s; 
    z-index: 10; 
    font-size: 16px; 
}
.slider-btn:hover { background: rgba(15, 23, 42, 0.8); }
.prev-btn { left: 12px; }
.next-btn { right: 12px; }

.slider-dots { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; z-index: 10; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(0, 0, 0, 0.2); cursor: pointer; transition: background 0.2s, transform 0.2s; }
.dot.active { background: var(--primary-color); transform: scale(1.25); }

.detail-info-box { display: flex; flex-direction: column; justify-content: space-between; }
.detail-title { font-size: 24px; font-weight: 800; color: #0f172a; margin-bottom: 12px; }
.detail-sub-specs { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; line-height: 1.6; }
.detail-price-box { background: #f1f5f9; padding: 20px; border-radius: 8px; margin-bottom: 24px; }
.detail-price-title { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.detail-price { font-size: 28px; font-weight: 800; color: var(--primary-color); }

.action-btn-group { display: flex; gap: 12px; }
.btn-buy { 
    flex: 1; 
    background: var(--primary-color); 
    color: #fff; 
    border: none; 
    outline: none; 
    padding: 16px; 
    border-radius: 8px; 
    font-weight: 700; 
    font-size: 16px; 
    text-decoration: none; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 8px; 
    font-family: inherit; 
    transition: background 0.2s; 
}
.btn-buy:hover { background: var(--primary-hover); }
.btn-consult { 
    flex: 1; 
    background: #0f172a; 
    color: #fff; 
    text-align: center; 
    padding: 16px; 
    border-radius: 8px; 
    font-weight: 700; 
    font-size: 16px; 
    text-decoration: none; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 8px; 
}

/* 상세페이지 하단 구성표 */
.spec-section { background: #fff; border-radius: 12px; border: 1px solid var(--border-color); padding: 32px; }
.spec-section-title { 
    font-size: 20px; 
    font-weight: 800; 
    color: #0f172a; 
    margin-bottom: 20px; 
    border-bottom: 2px solid var(--primary-color); 
    padding-bottom: 10px; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
}
.spec-section .spec-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.spec-section .spec-table th { width: 180px; background: #f8fafc; text-align: left; padding: 16px 20px; font-weight: 700; font-size: 14px; color: #334155; border-bottom: 1px solid #e2e8f0; }
.spec-section .spec-table td { padding: 16px 20px; font-size: 14px; color: #0f172a; border-bottom: 1px solid #e2e8f0; font-weight: 500; text-align: left; }
.spec-icon { color: var(--primary-color); margin-right: 8px; width: 18px; text-align: center; }

/* ================= 게임 사양표 (specs.php) ================= */
.specs-container { max-width: var(--max-width); margin: 30px auto; padding: 0 16px; display: flex; flex-direction: column; gap: 24px; }

.specs-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #fff;
    padding: 36px 40px;
    border-radius: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.15);
}
.specs-header-text h2 { font-size: 26px; font-weight: 800; margin-bottom: 8px; }
.specs-header-text p { color: #94a3b8; font-size: 14px; }

.filter-card {
    background: #fff;
    padding: 20px 24px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.search-input-wrap { position: relative; flex: 1; max-width: 400px; }
.search-input-wrap input {
    width: 100%;
    padding: 10px 40px 10px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}
.search-input-wrap input:focus { border-color: var(--primary-color); }
.search-input-wrap i { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: #94a3b8; }

.legend-box { display: flex; gap: 12px; align-items: center; font-size: 13px; }

.badge-spec { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 800; text-align: center; }
.badge-ultra { background-color: #f3e8ff; color: #6b21a8; border: 1px solid #d8b4fe; }
.badge-high { background-color: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.badge-recommended { background-color: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.badge-playable { background-color: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }

.table-wrapper {
    background: #fff;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.03);
}
.spec-table { width: 100%; border-collapse: collapse; text-align: center; font-size: 14px; min-width: 800px; }
.spec-table th, .spec-table td { padding: 14px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.spec-table thead th { background-color: #f8fafc; color: #1e293b; font-weight: 700; border-bottom: 2px solid var(--border-color); font-size: 16px; }

.option-header-box { text-align: center; padding: 4px 0; }
.option-title { white-space: nowrap; font-size: 14x; font-weight: 800; }
.option-sub { white-space: nowrap; font-size: 11px; color: #64748b; font-weight: 400; margin-top: 3px; }

.spec-table tbody tr:hover { background-color: #f8fafc; }
.game-title-cell { white-space: nowrap; text-align: left; font-weight: 700; color: #0f172a; padding-left: 20px !important; }

.specs-container .notice-box {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    padding: 16px 20px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
}

/* ================= 구매 안내 및 FAQ (info.php) ================= */
.info-container { max-width: var(--max-width); margin: 30px auto; padding: 0 16px; display: flex; flex-direction: column; gap: 30px; }

.info-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #fff;
    padding: 40px 48px;
    border-radius: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.15);
}
.info-header-text h2 { font-size: 26px; font-weight: 800; margin-bottom: 8px; }
.info-header-text p { color: #94a3b8; font-size: 14px; }
.info-header-icon { font-size: 60px; opacity: 0.2; }

.category-tabs { display: flex; gap: 8px; flex-wrap: wrap; border-bottom: 2px solid var(--border-color); padding-bottom: 12px; }
.tab-btn {
    background: #fff;
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}
.tab-btn:hover, .tab-btn.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.faq-board {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02);
}
.faq-header-row {
    display: grid;
    grid-template-columns: 120px 1fr 40px;
    background-color: #f8fafc;
    padding: 14px 24px;
    font-weight: 800;
    color: #334155;
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
}
.faq-item { border-bottom: 1px solid #f1f5f9; }
.faq-item:last-child { border-bottom: none; }
.faq-question {
    display: grid;
    grid-template-columns: 120px 1fr 40px;
    padding: 18px 24px;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
}
.faq-question:hover { background-color: #f8fafc; }
.faq-type { font-size: 13px; font-weight: 700; color: #475569; }
.faq-title { font-size: 15px; font-weight: 600; color: #0f172a; }
.faq-icon { text-align: right; color: #94a3b8; transition: transform 0.3s ease; }
.faq-answer {
    display: none;
    background-color: #f8fafc;
    padding: 20px 24px 20px 144px;
    font-size: 14px;
    color: #334155;
    line-height: 1.7;
    border-top: 1px dashed #e2e8f0;
}
.faq-item.active .faq-answer { display: block; }
.faq-item.active .faq-icon { transform: rotate(180deg); color: var(--primary-color); }

/* ================= 주문 완료 / 영수증 (complete.php) ================= */
.complete-container { max-width: 600px; margin: 60px auto; padding: 0 16px; }
.receipt-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}
.receipt-header { background: #f8fafc; padding: 40px 20px; text-align: center; border-bottom: 2px dashed #cbd5e1; }
.receipt-header i { color: #10b981; font-size: 48px; margin-bottom: 16px; }
.receipt-header h1 { font-size: 24px; font-weight: 800; color: #0f172a; margin: 0 0 8px 0; }
.receipt-header p { color: #64748b; font-size: 15px; margin: 0; }
.receipt-body { padding: 30px 40px; }

.info-row { display: flex; justify-content: space-between; padding: 16px 0; border-bottom: 1px solid #f1f5f9; }
.info-row:last-child { border-bottom: none; }
.info-label { color: #64748b; font-size: 14px; font-weight: 600; flex-shrink: 0; width: 120px; }
.info-value { color: #1e293b; font-size: 15px; font-weight: 700; text-align: right; word-break: keep-all; }
.info-value.primary { color: var(--primary-color); }
.info-value.memo { font-weight: 500; color: #475569; text-align: left; }
.receive-type-visit { color: var(--primary-color); font-weight: 700; }

.total-amount-box {
    background: #f1f5f9;
    margin-top: 20px;
    padding: 24px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.total-label { font-size: 16px; font-weight: 800; color: #0f172a; }
.total-price { font-size: 24px; font-weight: 800; color: var(--primary-color); }

/* ================= A/S 안내 페이지 (as-notice.php) ================= */
.as-container { 
    max-width: var(--max-width); 
    margin: 30px auto; 
    padding: 0 16px; 
    display: flex; 
    flex-direction: column; 
    gap: 30px; 
}

.as-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #fff;
    padding: 40px 48px;
    border-radius: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.15);
}
.as-header-text h2 { font-size: 26px; font-weight: 800; margin-bottom: 8px; }
.as-header-text p { color: #94a3b8; font-size: 14px; }
.as-header-icon { font-size: 60px; opacity: 0.2; }

.policy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}
.policy-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 24px 20px;
    text-align: center;
}
.policy-icon {
    width: 50px;
    height: 50px;
    background: #eff6ff;
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 20px;
}
.policy-title { font-size: 15px; font-weight: 700; color: #0f172a; margin-bottom: 6px; }
.policy-desc { font-size: 12px; color: var(--text-muted); line-height: 1.4; }

.as-content-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.notice-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 32px 28px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02);
}
.notice-title { 
    font-size: 18px; 
    font-weight: 800; 
    color: #0f172a; 
    margin-bottom: 20px; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    border-bottom: 2px solid #f1f5f9; 
    padding-bottom: 14px; 
}
.notice-title i { color: var(--primary-color); }

.as-container .notice-box {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-left: 4px solid #ef4444;
    padding: 18px;
    border-radius: 8px;
    margin-bottom: 24px;
}
.notice-box-title {
    font-weight: 800;
    color: #991b1b;
    font-size: 15px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.notice-box-text {
    font-size: 13px;
    color: #7f1d1d;
    line-height: 1.6;
    margin: 0;
}
.notice-description {
    font-size: 14px;
    color: #334155;
    line-height: 1.7;
    margin-bottom: 28px;
}

.info-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    height: fit-content;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.info-card-header {
    font-weight: 800;
    font-size: 16px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}
.info-item { display: flex; gap: 12px; align-items: flex-start; }
.info-item i { font-size: 20px; color: var(--primary-color); margin-top: 2px; }
.info-item-title { font-size: 14px; font-weight: 800; color: #0f172a; }
.info-item-desc { font-size: 13px; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }
.info-item-desc.highlight { font-weight: 700; color: var(--primary-color); }

/* ================= 공통 버튼 & 폼 컴포넌트 ================= */
.btn-primary { 
    display: inline-block; 
    background-color: var(--primary-color); 
    color: #fff; 
    padding: 10px 24px; 
    border-radius: 6px; 
    font-weight: 700; 
    text-decoration: none; 
    font-size: 14px;
    transition: background 0.2s ease;
}
.btn-primary:hover { background-color: var(--primary-hover); }

.btn-group { display: flex; gap: 10px; flex-wrap: wrap; }
.receipt-card .btn-group { margin-top: 30px; padding: 0 40px 40px 40px; }

.btn-action, .contact-btn {
    flex: 1;
    min-width: 140px;
    padding: 14px 10px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.contact-btn { min-width: 160px; padding: 16px; font-size: 15px; gap: 8px; }

.btn-action:hover, .contact-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.btn-phone { background-color: #0f172a; color: #ffffff; }
.btn-naver { background-color: #03C75A; color: #ffffff; }
.btn-kakao { background-color: #FEE500; color: #191919; }
.btn-cart {
    flex: 1;
    background: #475569;
    color: #fff;
    border: none;
    padding: 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
}
.btn-cart:hover { background: #334155; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 700; color: #334155; margin-bottom: 6px; }
.form-group label .required { color: #ef4444; }
.form-group input, .form-group select, .form-group textarea { 
    width: 100%; 
    padding: 10px 12px; 
    border: 1px solid #cbd5e1; 
    border-radius: 6px; 
    font-size: 14px; 
    outline: none; 
    transition: border-color 0.2s; 
    box-sizing: border-box; 
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary-color); }

/* ================= 모달 (Modals & Dialogs) ================= */
.modal-overlay { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh; 
    background: rgba(15, 23, 42, 0.6); 
    backdrop-filter: blur(4px); 
    z-index: 1000; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    padding: 16px;
    opacity: 0; 
    visibility: hidden; 
    transition: opacity 0.3s ease; 
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal-container, .modal-content { 
    background: #fff; 
    width: 100%; 
    max-width: 500px; 
    max-height: 85vh; 
    border-radius: 12px; 
    overflow: hidden; 
    display: flex; 
    flex-direction: column; 
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2); 
    transform: translateY(20px); 
    transition: transform 0.3s ease; 
    animation: modalFadeIn 0.2s ease-out;
}
.modal-overlay.active .modal-container { transform: translateY(0); }

/* 예약 모달 전용 스코프 (다른 페이지 모달 영향 Zero) */
#reservationModal .modal-content {
    max-height: 90vh; /* 화면 높이의 최대 90% */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#reservationModal .modal-body {
    flex: 1;
    overflow-y: auto; /* 본문 영역만 독립 스크롤 */
    -webkit-overflow-scrolling: touch; /* 모바일 부드러운 스크롤 */
}

#reservationModal .modal-footer {
    flex-shrink: 0; /* 버튼 영역 높이 고정 */
}

@keyframes modalFadeIn { 
    from { opacity: 0; transform: translateY(10px); } 
    to { opacity: 1; transform: translateY(0); } 
}

.modal-header { padding: 18px 20px; background: var(--secondary-color); color: #fff; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #e2e8f0; }
.modal-header h3, .modal-title { font-size: 18px; font-weight: 800; color: #fff; margin: 0; display: flex; align-items: center; gap: 8px; }
.modal-close { background: none; border: none; color: #fff; font-size: 24px; cursor: pointer; opacity: 0.8; transition: opacity 0.2s; }
.modal-close:hover { opacity: 1; }

.modal-body { padding: 20px; overflow-y: auto; font-size: 14px; line-height: 1.6; color: #333; text-align: left; }

.reserved-product-card { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 14px; margin-bottom: 18px; }
.reserved-product-card .p-label { font-size: 11px; color: #64748b; font-weight: 700; margin-bottom: 4px; }
.reserved-product-card .p-title { font-size: 15px; font-weight: 700; color: #0f172a; }
.reserved-product-card .p-price { font-size: 16px; font-weight: 800; color: var(--primary-color); margin-top: 4px; }

.terms-section { margin-top: 18px; background: #f8fafc; padding: 12px; border-radius: 6px; border: 1px solid #e2e8f0; }
.terms-box { font-size: 11px; color: #64748b; line-height: 1.5; max-height: 80px; overflow-y: auto; margin-bottom: 10px; background: #fff; padding: 8px; border: 1px solid #e2e8f0; border-radius: 4px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #1e293b; cursor: pointer; }
.checkbox-label input { width: 16px; height: 16px; cursor: pointer; }

.modal-footer { padding: 14px 20px; background: #f8fafc; border-top: 1px solid #e2e8f0; display: flex; gap: 10px; justify-content: flex-end; }
.btn-cancel { padding: 10px 18px; border: 1px solid #cbd5e1; background: #fff; border-radius: 6px; font-size: 14px; font-weight: 700; color: #475569; cursor: pointer; }
.btn-submit { padding: 10px 20px; border: none; background: var(--primary-color); border-radius: 6px; font-size: 14px; font-weight: 700; color: #fff; cursor: pointer; transition: background 0.2s; }
.btn-submit:hover { background: var(--primary-hover); }

/* ================= Footer ================= */
.site-footer { background: #fff; color: #000; padding: 40px 0 20px; font-size: 12px; margin-top: 60px; border-top: 1px solid #e2e8f0; }
.footer-inner { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
.footer-links { display: flex; gap: 20px; border-bottom: 1px solid #000; padding-bottom: 15px; margin-bottom: 20px; flex-wrap: wrap; }
.footer-links a.highlight { color: #000; font-weight: 700; }
.footer-info { line-height: 1.8; margin-bottom: 15px; }

/* ================= 주문 내역 및 비회원 조회 (history.php) ================= */
.history-container { 
    max-width: var(--max-width); 
    margin: 0 auto; 
    padding: 40px 16px;
    display: flex; 
    flex-direction: column; 
    justify-content: center;
    min-height: calc(100vh - 310px); 
    gap: 30px; 
}

/* 검색 카드 & 폼 충돌 방지 스코프 처리 */
.search-card { 
    background: #fff; 
    border: 1px solid var(--border-color); 
    border-radius: 14px; 
    padding: 40px 36px; 
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01); 
    max-width: 580px; 
    margin: 0 auto; 
    width: 100%; 
}
.search-card h3 { 
    font-size: 20px; 
    font-weight: 800; 
    color: #0f172a; 
    margin-bottom: 8px; 
    text-align: center; 
}
.search-card p { 
    font-size: 13px; 
    color: var(--text-muted); 
    margin-bottom: 24px; 
    text-align: center; 
}
.search-card .form-group { 
    margin-bottom: 16px; 
}
.search-card .form-group label { 
    display: block; 
    font-size: 13px; 
    font-weight: 700; 
    color: #334155; 
    margin-bottom: 6px; 
}
.search-card .form-group input { 
    width: 100%; 
    padding: 12px 16px; 
    border: 1px solid var(--border-color); 
    border-radius: 8px; 
    font-size: 14px; 
    outline: none; 
    transition: border-color 0.2s; 
}
.search-card .form-group input:focus { 
    border-color: var(--primary-color); 
}

.btn-search { 
    width: 100%; 
    padding: 14px; 
    background-color: var(--primary-color); 
    color: #fff; 
    font-weight: 800; 
    font-size: 15px; 
    border: none; 
    border-radius: 8px; 
    cursor: pointer; 
    transition: background-color 0.2s; 
}
.btn-search:hover { 
    background-color: var(--primary-hover); 
}

/* 주문 리스트 카드 */
.order-list-section { 
    display: flex; 
    flex-direction: column; 
    gap: 20px; 
}
.order-card { 
    background: #fff; 
    border: 1px solid var(--border-color); 
    border-radius: 12px; 
    overflow: hidden; 
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02); 
}
.order-card-header { 
    background-color: #f8fafc; 
    padding: 18px 24px; 
    border-bottom: 1px solid var(--border-color); 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    flex-wrap: wrap; 
    gap: 12px; 
}
.order-no { 
    font-size: 15px; 
    font-weight: 800; 
    color: #0f172a; 
}
.order-date { 
    font-size: 13px; 
    color: var(--text-muted); 
}

/* 진행 상태 배지 */
.order-status-badge { 
    padding: 6px 14px; 
    border-radius: 20px; 
    font-size: 13px; 
    font-weight: 800; 
    display: inline-flex; 
    align-items: center; 
    gap: 6px; 
}
.status-paid { background: #e0f2fe; color: #0369a1; }
.status-preparing { background: #fef3c7; color: #b45309; }
.status-completed { background: #dcfce7; color: #15803d; }
.status-cancelled { background: #fee2e2; color: #b91c1c; }

/* 진행상황 프로그레스 바 */
.progress-tracker-wrapper { 
    background: #f8fafc; 
    border-bottom: 1px solid #f1f5f9; 
    padding: 20px 24px; 
}
.progress-tracker { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    position: relative; 
    max-width: 650px; 
    margin: 0 auto; 
}
.progress-tracker::before { 
    content: ''; 
    position: absolute; 
    top: 18px; 
    left: 15%; 
    right: 15%; 
    height: 3px; 
    background: #e2e8f0; 
    z-index: 1; 
}
.step-item { 
    position: relative; 
    z-index: 2; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 6px; 
    flex: 1; 
    text-align: center; 
}
.step-icon-box { 
    width: 38px; 
    height: 38px; 
    border-radius: 50%; 
    background: #fff; 
    color: #94a3b8; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 14px; 
    border: 2px solid #cbd5e1; 
    transition: all 0.2s; 
}
.step-text { 
    font-size: 12px; 
    font-weight: 600; 
    color: #64748b; 
}

.step-item.active .step-icon-box { 
    background: var(--primary-color); 
    color: #fff; 
    border-color: var(--primary-color); 
    box-shadow: 0 0 0 4px rgba(3, 70, 242, 0.15); 
}
.step-item.active .step-text { 
    color: var(--primary-color); 
    font-weight: 800; 
}
.step-item.done .step-icon-box { 
    background: #10b981; 
    color: #fff; 
    border-color: #10b981; 
}
.step-item.done .step-text { 
    color: #10b981; 
    font-weight: 700; 
}

.cancelled-alert { 
    background: #fef2f2; 
    border: 1px solid #fca5a5; 
    color: #991b1b; 
    padding: 12px 16px; 
    border-radius: 8px; 
    font-size: 13px; 
    font-weight: 700; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    margin: 0 24px 16px 24px; 
}

/* 주문 상세 및 배송 정보 */
.order-card-body { 
    padding: 24px; 
    display: grid; 
    grid-template-columns: 2fr 1fr; 
    gap: 24px; 
}
.info-table { 
    width: 100%; 
    border-collapse: collapse; 
    font-size: 14px; 
}
.info-table th { 
    width: 110px; 
    text-align: left; 
    padding: 8px 0; 
    color: var(--text-muted); 
    font-weight: 600; 
    vertical-align: top; 
}
.info-table td { 
    padding: 8px 0; 
    color: #0f172a; 
    font-weight: 500; 
}

.tracking-badge { 
    display: inline-flex; 
    align-items: center; 
    gap: 8px; 
    background: #f0f9ff; 
    border: 1px solid #bae6fd; 
    padding: 6px 12px; 
    border-radius: 6px; 
    font-size: 13px; 
    font-weight: 700; 
    color: #0369a1; 
}
.btn-track { 
    background: #0284c7; 
    color: #fff; 
    border: none; 
    padding: 4px 10px; 
    border-radius: 4px; 
    text-decoration: none; 
    font-size: 12px; 
    font-weight: 600; 
    margin-left: 6px; 
    display: inline-flex; 
    align-items: center; 
    gap: 4px; 
}
.btn-track:hover { 
    background: #0369a1; 
    color: #fff; 
}

.payment-summary { 
    background: #f8fafc; 
    padding: 20px; 
    border-radius: 8px; 
    display: flex; 
    flex-direction: column; 
    justify-content: space-between; 
    border: 1px solid #f1f5f9; 
}
.price-total { 
    font-size: 22px; 
    font-weight: 800; 
    color: var(--primary-color); 
}
.no-result { 
    text-align: center; 
    padding: 50px 20px; 
    background: #fff; 
    border-radius: 12px; 
    border: 1px dashed var(--border-color); 
    color: var(--text-muted); 
}

/* 주문 내역 반응형 스타일 병합 */
@media (max-width: 768px) {
    .order-card-body { 
        grid-template-columns: 1fr; 
    }
}

@media (max-width: 480px) {
    .progress-tracker-wrapper { 
        padding: 16px 8px; 
    }
    .step-icon-box { 
        width: 32px; 
        height: 32px; 
        font-size: 12px; 
    }
    .step-text { 
        font-size: 10px; 
        word-break: keep-all; 
    }
    .progress-tracker::before { 
        top: 15px; 
    }
    .info-table th { 
        width: 85px; 
        font-size: 13px; 
    }
    .info-table td { 
        font-size: 13px; 
    }
}

/* ================= 반응형 (Media Queries) ================= */

/* 1100px 이하 태블릿/데스크톱 중간 레이아웃 */
@media (max-width: 1100px) {
  .recommended-grid { grid-template-columns: repeat(4, 1fr); }
  .side-event-banner { display: none; }
  .card-grid-5 { grid-template-columns: repeat(3, 1fr); }
}

/* 868px 이하 Layout */
@media (max-width: 868px) {
  .as-content-layout { grid-template-columns: 1fr; }
}

/* 768px 이하 모바일 디바이스 최적화 */
@media (max-width: 768px) {
  .site-header { height: auto; min-height: 60px; padding: 6px 0; }
  .header-inner { padding: 0 10px; gap: 6px; }
  .header-left { gap: 6px; flex-shrink: 0; }
  .logo { font-size: 16px; }
  .header-right { gap: 4px; }

  /* 헤더 우측 토글 버튼 크기 축소 */
  .site-toggle-btn .toggle-track { width: 95px; height: 28px; }
  .site-toggle-btn .toggle-knob { width: 44px; height: 22px; }
  .site-toggle-btn.active-right .toggle-knob { transform: translateX(45px); }
  .toggle-label { font-size: 10px; }

  /* 우측 버튼 패딩 및 폰트 축소 */
  .btn-remote-sm, .btn-login-sm { padding: 5px 8px; font-size: 11px; white-space: nowrap; }

  .sub-menu-inner { gap: 15px; padding: 12px 10px; overflow-x: auto; white-space: nowrap; justify-content: flex-start; }
  .sub-menu-inner a { font-size: 14px; }

  .main-container { margin: 16px auto; padding: 0 12px; gap: 24px; }

  .hero-banner { padding: 24px 20px; flex-direction: column; align-items: flex-start; }
  .hero-banner > div:last-child { display: none; }
  .hero-text h2 { font-size: 20px; line-height: 1.35; margin-bottom: 8px; }
  .hero-text p { font-size: 13px; margin-bottom: 16px; }
  .btn-primary { padding: 10px 18px; font-size: 13px; width: 100%; text-align: center; }

  .section-header { flex-direction: column; align-items: flex-start; gap: 6px; }
  .section-title { font-size: 18px; }
  .count-badge { font-size: 12px; }

  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .product-img-wrap { height: 140px; }
  .product-img-wrap img { padding: 0px; }
  .product-info { padding: 10px; }
  .product-tags { gap: 4px; margin-bottom: 6px; }
  .tag { font-size: 10px; padding: 2px 6px; }
  .product-name { font-size: 13px; line-height: 1.3; margin-bottom: 6px; height: 34px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .product-specs { display: none; }
  .product-price-box { flex-direction: column; align-items: flex-start; gap: 2px; padding-top: 8px; }
  .price-label { font-size: 10px; }
  .product-price { font-size: 15px; }

  /* 상세페이지 모바일 (detail.php) */
  .product-top-section { grid-template-columns: 1fr; padding: 20px; gap: 20px; }
  .detail-img-box { height: 260px; }
  .detail-title { font-size: 20px; }
  .detail-price { font-size: 24px; }
  .spec-section { padding: 20px 16px; }
  .spec-section .spec-table th { width: 110px; padding: 12px 10px; font-size: 13px; }
  .spec-section .spec-table td { padding: 12px 10px; font-size: 13px; }

  /* 주문 내역 모바일 (history.php) */
  .order-card-body { grid-template-columns: 1fr; }

  /* 사양표 모바일 */
  .specs-container { margin: 16px auto; padding: 0 12px; gap: 16px; }
  .specs-header { padding: 24px 20px; flex-direction: column; align-items: flex-start; }
  .specs-header > div:last-child { display: none; }
  .specs-header-text h2 { font-size: 20px; line-height: 1.35; }
  .specs-header-text p { font-size: 13px; }
  .filter-card { flex-direction: column; align-items: stretch; padding: 16px; gap: 12px; }
  .search-input-wrap { max-width: 100%; width: 100%; }
  .search-input-wrap input { font-size: 13px; padding: 10px 36px 10px 14px; }
  .legend-box { flex-wrap: wrap; gap: 6px 8px; font-size: 12px; justify-content: flex-start; }
  .badge-spec { padding: 3px 8px; font-size: 11px; }
  .table-wrapper { border-radius: 8px; -webkit-overflow-scrolling: touch; }
  .spec-table { min-width: 720px; font-size: 12px; }
  .spec-table th, .spec-table td { padding: 10px 6px; }
  .option-title { font-size: 12px; }
  .option-sub { font-size: 10px; }
  .game-title-cell { padding-left: 12px !important; font-size: 13px; }
  .specs-container .notice-box { padding: 12px 16px; font-size: 12px; line-height: 1.5; }

  /* FAQ 모바일 */
  .info-header { padding: 24px 20px; flex-direction: column; align-items: flex-start; gap: 12px; }
  .info-header-icon { display: none; }
  .info-header-text h2 { font-size: 20px; }
  .info-header-text p { font-size: 13px; }
  .tab-btn { padding: 8px 14px; font-size: 13px; }
  .faq-header-row, .faq-question { grid-template-columns: 90px 1fr 30px; padding: 14px 16px; }
  .faq-answer { padding: 16px; }

  /* 주문완료 영수증 모바일 */
  .receipt-card .btn-group { flex-direction: column; padding: 0 20px 30px 20px; }
  .btn-action { width: 100%; }
  .receipt-body { padding: 20px; }

  /* A/S 안내 모바일 */
  .as-container { margin: 16px auto; padding: 0 12px; gap: 20px; }
  .as-header { padding: 24px 20px; flex-direction: column; align-items: flex-start; }
  .as-header-icon { display: none; }
  .as-header-text h2 { font-size: 20px; line-height: 1.3; }
  .as-header-text p { font-size: 13px; }

  .policy-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .policy-card { padding: 16px 12px; }
  .policy-card:last-child { grid-column: span 2; }
  .policy-icon { width: 40px; height: 40px; font-size: 16px; margin-bottom: 8px; }
  .policy-title { font-size: 13px; }
  .policy-desc { font-size: 11px; line-height: 1.35; }

  .notice-card { padding: 20px 16px; }
  .notice-title { font-size: 16px; margin-bottom: 16px; padding-bottom: 10px; }
  .as-container .notice-box { padding: 14px 12px; margin-bottom: 18px; }
  .notice-box-title { font-size: 14px; }
  .notice-box-text { font-size: 12px; line-height: 1.5; }
  .notice-description { font-size: 13px; margin-bottom: 20px; }

  .as-container .btn-group { flex-direction: column; gap: 8px; }
  .contact-btn { width: 100%; min-width: unset; padding: 14px 12px; font-size: 14px; }
  .info-card { padding: 20px 16px; gap: 16px; }
}

/* 480px 이하 극소형 스마트폰 최적화 */
@media (max-width: 480px) {
  .progress-tracker-wrapper { padding: 16px 8px; }
  .step-icon-box { width: 32px; height: 32px; font-size: 12px; }
  .step-text { font-size: 10px; word-break: keep-all; }
  .progress-tracker::before { top: 15px; }
  .info-table th { width: 85px; font-size: 13px; }
  .info-table td { font-size: 13px; }
}