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

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: #1E293B;
    background-color: #F8FAFC;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ==================== 헤더 ==================== */
.header {
    padding: 20px 0;
    border-bottom: 1px solid #E2E8F0;
    margin-bottom: 30px;
}

.logo-small {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2563EB;
    text-decoration: none;
}

/* ==================== 메인 페이지 ==================== */
.main-content {
    text-align: center;
    padding-top: 10vh;
    max-width: 800px;
    margin: 0 auto;
}

.logo {
    font-size: 3rem;
    font-weight: 700;
    color: #2563EB;
    margin-bottom: 10px;
}

.main-description {
    font-size: 1.1rem;
    color: #64748B;
    margin-bottom: 40px;
}

.search-form {
    display: flex;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto 16px;
}

.search-input {
    flex: 1;
    padding: 16px 24px;
    font-size: 1rem;
    border: 2px solid #E2E8F0;
    border-radius: 12px;
    outline: none;
    transition: all 0.3s;
    background: white;
}

.search-input:focus {
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-button {
    padding: 16px 32px;
    font-size: 1rem;
    font-weight: 600;
    background-color: #2563EB;
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.search-button:hover {
    background-color: #1D4ED8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* 인기 검색어 */
.popular-searches {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 50px;
    flex-wrap: wrap;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.popular-label {
    font-size: 0.85rem;
    color: #94A3B8;
    font-weight: 500;
}

.popular-tag {
    padding: 6px 14px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    font-size: 0.85rem;
    color: #64748B;
    text-decoration: none;
    transition: all 0.2s;
}

.popular-tag:hover {
    background: #EFF6FF;
    border-color: #3B82F6;
    color: #2563EB;
}

/* 퀵 메뉴 */
.quick-menu {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
}

.menu-card {
    background: white;
    padding: 30px 20px;
    border-radius: 16px;
    text-decoration: none;
    transition: all 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.menu-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.15);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1E293B;
    margin-bottom: 6px;
}

.card-desc {
    font-size: 0.9rem;
    color: #64748B;
}

/* ==================== 보험사 페이지 ==================== */
.insurance-page {
    display: flex;
    gap: 30px;
    min-height: 70vh;
}

.insurance-sidebar {
    width: 320px;
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.category-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 2px solid #F1F5F9;
    padding-bottom: 12px;
}

.tab-btn {
    flex: 1;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #64748B;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: #EFF6FF;
    color: #2563EB;
}

.company-list {
    max-height: 600px;
    overflow-y: auto;
}

.category-group {
    display: none;
}

.category-group[style*="display: block"] {
    display: block;
}

.company-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    margin-bottom: 8px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.company-item:hover {
    background: #F8FAFC;
}

.company-item.active {
    background: #EFF6FF;
    border-left: 3px solid #2563EB;
}

.company-item img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.company-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: #1E293B;
}

.company-note {
    font-size: 0.75rem;
    color: #94A3B8;
    margin-top: 2px;
    font-style: italic;
}

.insurance-detail {
    flex: 1;
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.detail-placeholder {
    text-align: center;
    padding: 100px 20px;
    color: #94A3B8;
}

.detail-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #F1F5F9;
}

.detail-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: 20px;
}

.detail-company-name {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1E293B;
}

.detail-body {
    margin-bottom: 30px;
}

.info-section {
    margin-bottom: 30px;
}

.info-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1E293B;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #F8FAFC;
    border-radius: 8px;
    margin-bottom: 10px;
}

.info-label {
    width: 120px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #64748B;
}

.info-value {
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
    color: #1E293B;
}

.info-value a {
    color: #2563EB;
    text-decoration: none;
}

.info-value a:hover {
    text-decoration: underline;
}

.link-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.link-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    background: #2563EB;
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s;
}

.link-btn:hover {
    background: #1D4ED8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.link-btn.secondary {
    background: white;
    color: #2563EB;
    border: 2px solid #2563EB;
}

.link-btn.secondary:hover {
    background: #EFF6FF;
}

/* ==================== 검색 결과 페이지 ==================== */
.result-content {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin: 0 auto;
}

.result-title {
    font-size: 2rem;
    color: #1E293B;
    font-weight: 700;
    margin-bottom: 10px;
}

.result-code {
    display: inline-block;
    padding: 6px 12px;
    background: #EFF6FF;
    color: #2563EB;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 30px;
}

.result-type {
    display: inline-block;
    padding: 6px 12px;
    background: #EFF6FF;
    color: #2563EB;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 30px;
}

.result-subtitle {
    font-size: 1rem;
    color: #64748B;
    margin-bottom: 30px;
    text-align: center;
}

.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 40px;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 24px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s;
}

.result-item:hover {
    border-color: #3B82F6;
    background: #F8FAFC;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.result-item .result-code {
    flex-shrink: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    padding: 12px 20px;
    border-radius: 8px;
    min-width: 100px;
    text-align: center;
    margin-bottom: 0;
}

.result-info {
    flex: 1;
}

.result-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1E293B;
    margin-bottom: 4px;
}

.result-name-en {
    font-size: 0.9rem;
    color: #64748B;
    font-style: italic;
}

.result-arrow {
    flex-shrink: 0;
    font-size: 1.5rem;
    color: #94A3B8;
    transition: all 0.3s;
}

.result-item:hover .result-arrow {
    color: #3B82F6;
    transform: translateX(4px);
}

/* 대분류 배지 */
.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: #F0F9FF;
    border: 1px solid #BFDBFE;
    border-radius: 8px;
    margin-bottom: 30px;
    font-size: 0.9rem;
}

.category-range {
    font-weight: 700;
    color: #2563EB;
    background: white;
    padding: 4px 10px;
    border-radius: 6px;
}

.category-text {
    color: #475569;
}

.category-link {
    color: #2563EB;
    text-decoration: none;
    font-weight: 600;
    margin-left: auto;
}

.category-link:hover {
    text-decoration: underline;
}

/* ==================== 간소화된 관련 질병 스타일 ==================== */
.subcodes-section {
    margin: 30px 0;
}

.subcodes-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1E293B;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #E2E8F0;
}

.code-group-simple {
    margin-bottom: 20px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #E2E8F0;
}

.code-simple-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: #F8FAFC;
    border-bottom: 1px solid #E2E8F0;
}

.code-simple-number {
    font-size: 0.95rem;
    font-weight: 700;
    color: #2563EB;
    background: #EFF6FF;
    padding: 6px 12px;
    border-radius: 6px;
    min-width: 75px;
    text-align: center;
}

.code-simple-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1E293B;
}

.code-simple-children {
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 8px;
}

.code-simple-child {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #F8FAFC;
    border-radius: 8px;
    border-left: 3px solid #E2E8F0;
}

.child-simple-code {
    font-size: 0.85rem;
    font-weight: 600;
    color: #2563EB;
    background: white;
    padding: 4px 10px;
    border-radius: 6px;
    min-width: 65px;
    text-align: center;
}

.child-simple-name {
    font-size: 0.85rem;
    color: #475569;
}

/* 서류 섹션 */
.documents-section {
    margin-bottom: 40px;
}

.documents-section h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #1E293B;
}

.document-list {
    list-style: none;
}

.document-item {
    padding: 20px;
    background: #F8FAFC;
    border-left: 4px solid #2563EB;
    margin-bottom: 12px;
    border-radius: 8px;
    transition: all 0.2s;
}

.document-item:hover {
    background: #EFF6FF;
    transform: translateX(4px);
}

.doc-name {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: #1E293B;
}

.doc-info {
    color: #64748B;
    font-size: 0.9rem;
    margin-top: 4px;
}

.doc-note {
    color: #DC2626;
    font-size: 0.9rem;
    margin-top: 8px;
}

.doc-category h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1E293B;
    margin-bottom: 12px;
}

.doc-category ul {
    list-style: none;
    margin-bottom: 20px;
}

.doc-category li {
    padding: 8px 0;
    color: #475569;
}

/* 액션 버튼 */
.action-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
}

.btn-action {
    flex: 1;
    padding: 14px 24px;
    background: #2563EB;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-action:hover {
    background: #1D4ED8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* 서류 없을 때 */
.no-documents {
    padding: 40px 20px;
    background: #FEF3C7;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 30px;
}

.no-documents p {
    color: #92400E;
    margin-bottom: 20px;
}

/* 보험사 링크 */
.insurance-links {
    margin: 40px 0;
    padding: 20px;
    background: #F8FAFC;
    border-radius: 12px;
    text-align: center;
}

.insurance-links h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: #1E293B;
}

.insurance-links a {
    color: #2563EB;
    text-decoration: none;
    font-weight: 600;
}

.insurance-links a:hover {
    text-decoration: underline;
}

/* 버튼 섹션 */
.back-section {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #E2E8F0;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.back-button {
    display: inline-block;
    padding: 12px 24px;
    background: #2563EB;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s;
}

.back-button:hover {
    background: #1D4ED8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.back-button.secondary {
    background: white;
    color: #2563EB;
    border: 2px solid #2563EB;
}

.back-button.secondary:hover {
    background: #EFF6FF;
    transform: translateY(-2px);
}

/* ==================== 카테고리 페이지 ==================== */
.category-content {
    max-width: 1000px;
    margin: 0 auto;
}

.category-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 2px solid #E2E8F0;
}

.category-title-main {
    font-size: 2rem;
    font-weight: 700;
    color: #2563EB;
    margin-bottom: 12px;
}

.category-description {
    font-size: 1.1rem;
    color: #64748B;
}

/* 대분류 보기 버튼 */
.show-categories-btn {
    margin-top: 20px;
    padding: 12px 24px;
    background: #2563EB;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.show-categories-btn:hover {
    background: #1D4ED8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* 전체 대분류 섹션 */
.all-categories-section {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.categories-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #E2E8F0;
}

.categories-header h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1E293B;
    margin: 0;
}

.close-categories-btn {
    width: 36px;
    height: 36px;
    background: #F1F5F9;
    border: none;
    border-radius: 8px;
    font-size: 1.2rem;
    color: #64748B;
    cursor: pointer;
    transition: all 0.2s;
}

.close-categories-btn:hover {
    background: #E2E8F0;
    color: #1E293B;
}

.category-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

.category-nav-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 18px;
    background: #F8FAFC;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s;
}

.category-nav-item:hover {
    background: #EFF6FF;
    border-color: #3B82F6;
    transform: translateX(4px);
}

.category-nav-item.active {
    background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
    border-color: #2563EB;
    border-width: 3px;
}

.nav-range {
    font-size: 0.95rem;
    font-weight: 700;
    color: #2563EB;
}

.nav-name {
    font-size: 0.85rem;
    color: #475569;
    line-height: 1.4;
}

.disease-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 40px;
}

.disease-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 24px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s;
}

.disease-item:hover {
    border-color: #3B82F6;
    background: #F8FAFC;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.disease-code {
    flex-shrink: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    padding: 10px 18px;
    border-radius: 8px;
    min-width: 90px;
    text-align: center;
}

.disease-info {
    flex: 1;
}

.disease-name {
    font-size: 1rem;
    font-weight: 600;
    color: #1E293B;
    margin-bottom: 4px;
}

.disease-name-en {
    font-size: 0.85rem;
    color: #64748B;
    font-style: italic;
}

.disease-arrow {
    flex-shrink: 0;
    font-size: 1.3rem;
    color: #94A3B8;
    transition: all 0.3s;
}

.disease-item:hover .disease-arrow {
    color: #3B82F6;
    transform: translateX(4px);
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #94A3B8;
}

.ad-section {
    margin: 40px 0;
    padding: 30px;
    background: #F8FAFC;
    border-radius: 12px;
    text-align: center;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94A3B8;
}

.error {
    color: #DC2626;
    margin-bottom: 20px;
    padding: 12px 20px;
    background: #FEE2E2;
    border-radius: 8px;
}

/* ==================== 필요서류 안내 페이지 ==================== */
.documents-guide-page {
    max-width: 900px;
    margin: 0 auto;
}

.guide-header {
    text-align: center;
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 3px solid #E2E8F0;
}

.guide-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #1E293B;
    margin-bottom: 12px;
}

.guide-description {
    font-size: 1.1rem;
    color: #64748B;
}

.search-section {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.search-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1E293B;
    margin-bottom: 16px;
}

.document-search-form {
    display: flex;
    gap: 12px;
}

.document-search-input {
    flex: 1;
    padding: 14px 20px;
    font-size: 1rem;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    outline: none;
    transition: all 0.3s;
}

.document-search-input:focus {
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.document-search-button {
    padding: 14px 28px;
    background: #2563EB;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.document-search-button:hover {
    background: #1D4ED8;
    transform: translateY(-2px);
}

.search-results {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #E2E8F0;
}

.search-results-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1E293B;
    margin-bottom: 16px;
}

.search-result-category {
    margin-bottom: 24px;
}

.result-category-name {
    font-size: 1rem;
    font-weight: 600;
    color: #2563EB;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #EFF6FF;
}

.result-documents {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.result-document {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #F8FAFC;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.result-document:hover {
    background: #EFF6FF;
    transform: translateX(4px);
}

.result-doc-name {
    font-size: 0.95rem;
    color: #475569;
}

.result-arrow {
    color: #94A3B8;
    font-size: 1.2rem;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #94A3B8;
}

/* 카테고리 선택 */
.category-selection {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.category-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1E293B;
    margin-bottom: 20px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: #F8FAFC;
    border: 2px solid #E2E8F0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.category-card:hover {
    background: #EFF6FF;
    border-color: #3B82F6;
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.15);
}

.category-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.category-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1E293B;
    text-align: center;
}

/* 카테고리 구분선 */
.category-divider {
    margin: 30px 0 20px;
    text-align: center;
    position: relative;
}

.category-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right, transparent, #E2E8F0, transparent);
}

.divider-text {
    position: relative;
    background: #F8FAFC;
    padding: 0 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #64748B;
}

/* 특수 카테고리 */
.special-category-grid {
    margin-top: 20px;
}

.special-category-card {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border: 2px solid #F59E0B;
}

.special-category-card:hover {
    background: linear-gradient(135deg, #FDE68A 0%, #FCD34D 100%);
    border-color: #D97706;
    box-shadow: 0 8px 16px rgba(245, 158, 11, 0.2);
}

/* 선택된 카테고리 섹션 */
.selected-category-section {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.category-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 3px solid #E2E8F0;
}

.selected-category-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1E293B;
}

.close-category-btn {
    width: 36px;
    height: 36px;
    background: #F1F5F9;
    border: none;
    border-radius: 8px;
    font-size: 1.2rem;
    color: #64748B;
    cursor: pointer;
    transition: all 0.2s;
}

.close-category-btn:hover {
    background: #E2E8F0;
    color: #1E293B;
}

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

.subcategory-tab {
    padding: 10px 20px;
    background: #F8FAFC;
    border: 2px solid #E2E8F0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #64748B;
    cursor: pointer;
    transition: all 0.2s;
}

.subcategory-tab:hover {
    background: #EFF6FF;
    border-color: #BFDBFE;
}

.subcategory-tab.active {
    background: #2563EB;
    border-color: #2563EB;
    color: white;
}

/* 공통서류 토글 */
.common-documents-toggle {
    padding: 16px 20px;
    background: #EFF6FF;
    border-radius: 10px;
    margin-bottom: 20px;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-weight: 600;
    color: #1E293B;
}

.toggle-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #2563EB;
}

.toggle-help {
    display: block;
    margin-top: 8px;
    margin-left: 32px;
    font-size: 0.85rem;
    color: #64748B;
}

/* 공통서류 안내 */
.common-notice {
    padding: 16px 20px;
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border-left: 4px solid #F59E0B;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 0.95rem;
    color: #92400E;
}

/* 서류 체크리스트 컨테이너 */
.document-checklist-container {
    margin-bottom: 24px;
}

.common-documents-section {
    margin-bottom: 24px;
}

.common-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1E293B;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #E2E8F0;
}

.section-divider {
    height: 2px;
    background: linear-gradient(to right, #E2E8F0, transparent);
    margin: 24px 0;
}

.checklist-items {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 18px;
    background: #F8FAFC;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.checklist-item:hover {
    background: #EFF6FF;
    border-color: #BFDBFE;
}

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

.checklist-item input[type="checkbox"]:checked+.item-content {
    opacity: 0.7;
}

.item-content {
    flex: 1;
}

.item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.item-name {
    font-size: 1rem;
    font-weight: 600;
    color: #1E293B;
}

.required-badge {
    padding: 4px 10px;
    background: #FEE2E2;
    color: #DC2626;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
}

.optional-badge {
    padding: 4px 10px;
    background: #DBEAFE;
    color: #2563EB;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
}

.item-description {
    font-size: 0.9rem;
    color: #64748B;
    line-height: 1.5;
}

/* 액션 버튼 */
.action-buttons-container {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 30px;
    padding-top: 24px;
    border-top: 2px solid #E2E8F0;
}

.action-btn {
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-btn.primary {
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.action-btn.primary:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.action-btn.secondary {
    background: white;
    color: #2563EB;
    border: 2px solid #2563EB;
}

.action-btn.secondary:hover:not(.disabled) {
    background: #EFF6FF;
    transform: translateY(-2px);
}

.action-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 링크 모달 */
.link-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.link-modal-content {
    background: white;
    padding: 40px;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.link-modal-content h3 {
    font-size: 1.5rem;
    color: #1E293B;
    margin-bottom: 24px;
    text-align: center;
}

.link-display {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.link-display input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #E2E8F0;
    border-radius: 8px;
    font-size: 0.95rem;
}

.copy-link-btn {
    padding: 12px 24px;
    background: #2563EB;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-link-btn:hover {
    background: #1D4ED8;
}

.link-info {
    padding: 16px;
    background: #F8FAFC;
    border-radius: 8px;
    margin-bottom: 20px;
}

.link-info p {
    margin: 8px 0;
    font-size: 0.95rem;
    color: #475569;
}

.close-modal-btn {
    width: 100%;
    padding: 14px;
    background: #F1F5F9;
    color: #1E293B;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.close-modal-btn:hover {
    background: #E2E8F0;
}

/* 토스트 메시지 */
.toast-message {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    padding: 16px 32px;
    background: #1E293B;
    color: white;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    transition: bottom 0.3s;
    z-index: 2000;
}

.toast-message.show {
    bottom: 40px;
}

/* ==================== 공유 체크리스트 페이지 ==================== */
.shared-checklist-page {
    max-width: 800px;
    margin: 0 auto;
}

.shared-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 3px solid #E2E8F0;
}

.shared-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1E293B;
    margin-bottom: 12px;
}

.shared-subtitle {
    font-size: 1.1rem;
    color: #64748B;
    margin-bottom: 20px;
}

.shared-info {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.info-item {
    padding: 8px 16px;
    background: #F8FAFC;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #475569;
}

.shared-checklist {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 40px;
}

.shared-item {
    padding: 20px;
    margin-bottom: 16px;
    background: #F8FAFC;
    border-left: 4px solid #2563EB;
    border-radius: 8px;
}

.shared-item:last-child {
    margin-bottom: 0;
}

.shared-item .item-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.item-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #2563EB;
    color: white;
    border-radius: 50%;
    font-size: 0.9rem;
    font-weight: 700;
}

/* 프로모션 섹션 */
.promotion-section {
    background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
    padding: 40px;
    border-radius: 16px;
    text-align: center;
}

.promotion-section h3 {
    font-size: 1.5rem;
    color: #1E293B;
    margin-bottom: 30px;
}

.promotion-features {
    display: flex;
    gap: 24px;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.feature-icon {
    font-size: 2.5rem;
}

.feature-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: #475569;
}

.promotion-button {
    display: inline-block;
    padding: 16px 40px;
    background: #2563EB;
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.promotion-button:hover {
    background: #1D4ED8;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

/* 에러 페이지 */
.error-page {
    text-align: center;
    padding: 80px 20px;
}

.error-icon {
    font-size: 5rem;
    margin-bottom: 24px;
}

.error-title {
    font-size: 1.8rem;
    color: #1E293B;
    margin-bottom: 16px;
}

.error-description {
    font-size: 1.1rem;
    color: #64748B;
    margin-bottom: 40px;
}

.error-button {
    display: inline-block;
    padding: 14px 32px;
    background: #2563EB;
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s;
}

.error-button:hover {
    background: #1D4ED8;
    transform: translateY(-2px);
}

/* 모바일 아코디언 */
.company-detail-mobile {
    background: #F8FAFC;
    border-left: 3px solid #2563EB;
    padding: 16px;
    margin: 0 0 8px 0;
    border-radius: 0 8px 8px 0;
    animation: slideDown 0.3s ease;
}

.mobile-detail-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mobile-contact {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-contact-btn {
    display: block;
    padding: 10px 16px;
    background: white;
    color: #2563EB;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    border: 1px solid #E2E8F0;
}

.mobile-contact-btn:active {
    background: #EFF6FF;
}

.mobile-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.mobile-link-btn {
    padding: 10px 12px;
    background: #2563EB;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
}

.mobile-link-btn:active {
    background: #1D4ED8;
}

/* ==================== 모바일 반응형 개선 ==================== */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }

    /* 메인 페이지 */
    .logo {
        font-size: 1.8rem;
    }

    .main-description {
        font-size: 0.95rem;
        margin-bottom: 30px;
    }

    .search-form {
        flex-direction: row;
        gap: 8px;
        margin-bottom: 12px;
    }

    .search-input {
        padding: 12px 16px;
        font-size: 0.9rem;
    }

    .search-button {
        padding: 12px 20px;
        font-size: 0.9rem;
        flex-shrink: 0;
        white-space: nowrap;
    }

    .popular-searches {
        margin-bottom: 30px;
        gap: 6px;
    }

    .popular-label {
        font-size: 0.75rem;
    }

    .popular-tag {
        padding: 4px 10px;
        font-size: 0.75rem;
    }

    /* 메인 메뉴 - 2x2 그리드 */
    .quick-menu {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        max-width: 100%;
    }

    .menu-card {
        padding: 18px 12px;
    }

    .card-icon {
        font-size: 1.8rem;
        margin-bottom: 8px;
    }

    .card-title {
        font-size: 0.85rem;
        margin-bottom: 4px;
    }

    .card-desc {
        font-size: 0.75rem;
    }

    /* 필요서류 안내 페이지 */
    .documents-guide-page {
        padding: 0;
    }

    .guide-header {
        text-align: center;
        margin-bottom: 30px;
        padding: 0;
    }

    .guide-title {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }

    .guide-description {
        font-size: 0.9rem;
    }

    /* 검색 섹션 - 박스 제거 */
    .search-section {
        background: transparent;
        padding: 0;
        box-shadow: none;
        margin-bottom: 24px;
    }

    .search-title {
        font-size: 1rem;
        margin-bottom: 12px;
        color: #1E293B;
    }

    .document-search-form {
        display: flex;
        flex-direction: row;
        gap: 8px;
    }

    .document-search-input {
        flex: 1;
        padding: 12px 16px;
        font-size: 0.9rem;
        border: 2px solid #E2E8F0;
    }

    .document-search-button {
        padding: 12px 20px;
        font-size: 0.9rem;
        flex-shrink: 0;
        white-space: nowrap;
    }

    /* 카테고리 선택 - 박스 제거 */
    .category-selection {
        background: transparent;
        padding: 0;
        box-shadow: none;
        margin-bottom: 24px;
    }

    .category-title {
        font-size: 1rem;
        margin-bottom: 12px;
        color: #1E293B;
    }

    .category-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .category-card {
        padding: 14px 8px;
        border-radius: 10px;
    }

    .category-icon {
        font-size: 1.6rem;
        margin-bottom: 6px;
    }

    .category-name {
        font-size: 0.75rem;
        line-height: 1.2;
    }

    /* 특수 카테고리 */
    .special-category-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* 선택된 카테고리 섹션 */
    .selected-category-section {
        padding: 20px 12px;
        border-radius: 12px;
    }

    .category-header-bar {
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    .selected-category-title {
        font-size: 1.2rem;
    }

    .close-category-btn {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    /* 서브카테고리 탭 */
    .subcategory-tabs {
        gap: 6px;
        margin-bottom: 16px;
    }

    .subcategory-tab {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    /* 공통서류 토글 */
    .common-documents-toggle {
        padding: 12px 14px;
        margin-bottom: 16px;
    }

    .toggle-label {
        font-size: 0.9rem;
        gap: 10px;
    }

    .toggle-label input[type="checkbox"] {
        width: 18px;
        height: 18px;
    }

    .toggle-help {
        font-size: 0.8rem;
        margin-left: 28px;
    }

    /* 체크리스트 */
    .checklist-items {
        gap: 10px;
    }

    .checklist-item {
        padding: 12px 14px;
        gap: 10px;
    }

    .checklist-item input[type="checkbox"] {
        width: 18px;
        height: 18px;
    }

    .item-name {
        font-size: 0.9rem;
    }

    .item-description {
        font-size: 0.8rem;
    }

    .required-badge,
    .optional-badge {
        padding: 3px 8px;
        font-size: 0.7rem;
    }

    /* 액션 버튼 */
    .action-buttons-container {
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 20px;
        padding-top: 16px;
    }

    .action-btn {
        flex: 1 1 calc(50% - 4px);
        padding: 12px 16px;
        font-size: 0.85rem;
        min-width: 0;
    }

    /* 검색 결과 */
    .search-results {
        margin-top: 16px;
        padding-top: 16px;
    }

    .search-results-title {
        font-size: 1rem;
        margin-bottom: 12px;
    }

    .result-category-name {
        font-size: 0.9rem;
        margin-bottom: 10px;
    }

    .result-document {
        padding: 10px 12px;
    }

    .result-doc-name {
        font-size: 0.85rem;
    }

    /* 링크 모달 */
    .link-modal-content {
        padding: 24px 16px;
        width: 95%;
    }

    .link-modal-content h3 {
        font-size: 1.2rem;
        margin-bottom: 20px;
    }

    .link-display {
        flex-direction: column;
        gap: 10px;
    }

    .link-display input {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .copy-link-btn {
        padding: 10px 20px;
        width: 100%;
    }

    .link-info p {
        font-size: 0.85rem;
    }

    /* 보험사 페이지 */
    .insurance-page {
        flex-direction: column;
    }

    .insurance-sidebar {
        width: 100%;
        position: static;
        margin-bottom: 20px;
        padding: 16px;
    }

    .category-tabs {
        gap: 6px;
        padding-bottom: 10px;
    }

    .tab-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .company-list {
        max-height: none;
    }

    .company-item {
        padding: 12px;
        margin-bottom: 6px;
    }

    .company-name {
        font-size: 0.85rem;
    }

    .insurance-detail {
        display: none;
    }

    /* 결과 페이지 */
    .result-content {
        padding: 20px 12px;
    }

    .result-title {
        font-size: 1.3rem;
    }

    .category-badge {
        flex-wrap: wrap;
        font-size: 0.8rem;
        padding: 10px 14px;
    }

    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 14px 12px;
    }

    .result-item .result-code {
        font-size: 0.9rem;
        padding: 6px 14px;
        min-width: 70px;
    }

    .result-name {
        font-size: 0.9rem;
    }

    .result-name-en {
        font-size: 0.8rem;
    }

    .result-arrow {
        display: none;
    }

    /* 질병 목록 */
    .disease-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 14px 12px;
    }

    .disease-code {
        font-size: 0.9rem;
        padding: 6px 12px;
        min-width: 65px;
    }

    .disease-name {
        font-size: 0.85rem;
    }

    .disease-name-en {
        font-size: 0.75rem;
    }

    .disease-arrow {
        display: none;
    }

    /* 관련 질병 */
    .code-simple-children {
        grid-template-columns: 1fr;
        padding: 10px;
        gap: 6px;
    }

    .code-simple-header {
        padding: 12px 14px;
    }

    .code-simple-number {
        font-size: 0.85rem;
        padding: 5px 10px;
        min-width: 65px;
    }

    .code-simple-name {
        font-size: 0.85rem;
    }

    .code-simple-child {
        padding: 8px 10px;
        gap: 8px;
    }

    .child-simple-code {
        font-size: 0.8rem;
        padding: 3px 8px;
        min-width: 60px;
    }

    .child-simple-name {
        font-size: 0.8rem;
    }

    /* 카테고리 페이지 */
    .category-nav-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .category-nav-item {
        padding: 12px 14px;
    }

    .nav-range {
        font-size: 0.85rem;
    }

    .nav-name {
        font-size: 0.8rem;
    }

    .show-categories-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
        font-size: 0.9rem;
    }

    .all-categories-section {
        padding: 16px 12px;
    }

    .categories-header h3 {
        font-size: 1.1rem;
    }

    .close-categories-btn {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    /* 뒤로가기 버튼 */
    .back-section {
        flex-direction: column;
        gap: 8px;
        margin-top: 30px;
    }

    .back-button {
        width: 100%;
        text-align: center;
        padding: 12px 20px;
        font-size: 0.9rem;
    }

    /* 공유 체크리스트 페이지 */
    .shared-title {
        font-size: 1.5rem;
    }

    .shared-subtitle {
        font-size: 1rem;
    }

    .shared-info {
        gap: 12px;
    }

    .info-item {
        font-size: 0.85rem;
        padding: 6px 12px;
    }

    .shared-checklist {
        padding: 20px 12px;
    }

    .shared-item {
        padding: 14px 12px;
        margin-bottom: 12px;
    }

    .item-number {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }

    .promotion-section {
        padding: 24px 16px;
    }

    .promotion-section h3 {
        font-size: 1.2rem;
        margin-bottom: 20px;
    }

    .promotion-features {
        gap: 16px;
    }

    .feature-icon {
        font-size: 2rem;
    }

    .feature-text {
        font-size: 0.85rem;
    }

    .promotion-button {
        padding: 12px 28px;
        font-size: 1rem;
    }
}

/* 작은 모바일 (380px 이하) */
@media (max-width: 380px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .action-btn {
        flex: 1 1 100%;
    }
}

/* 스크롤바 스타일 */
.company-list::-webkit-scrollbar {
    width: 6px;
}

.company-list::-webkit-scrollbar-track {
    background: #F1F5F9;
    border-radius: 3px;
}

.company-list::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 3px;
}

.company-list::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

/* ==================== 모달 스타일 ==================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 2px solid #E2E8F0;
}

.modal-header h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1E293B;
    margin: 0;
}

.modal-close {
    width: 36px;
    height: 36px;
    background: #F1F5F9;
    border: none;
    border-radius: 8px;
    font-size: 1.5rem;
    color: #64748B;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #E2E8F0;
    color: #1E293B;
}

.modal-tabs {
    display: flex;
    gap: 8px;
    padding: 16px 24px;
    border-bottom: 1px solid #E2E8F0;
    overflow-x: auto;
}

.modal-tab {
    padding: 8px 16px;
    background: #F8FAFC;
    border: 2px solid #E2E8F0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #64748B;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.modal-tab:hover {
    background: #EFF6FF;
    border-color: #BFDBFE;
}

.modal-tab.active {
    background: #2563EB;
    border-color: #2563EB;
    color: white;
}

.modal-actions {
    display: flex;
    gap: 8px;
    padding: 16px 24px;
    border-bottom: 1px solid #E2E8F0;
}

.modal-actions button {
    padding: 8px 16px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-actions button:hover {
    background: #F8FAFC;
    border-color: #CBD5E1;
}

.modal-checklist {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

.modal-checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: #F8FAFC;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 8px;
}

.modal-checklist-item:hover {
    background: #EFF6FF;
    border-color: #BFDBFE;
}

.modal-checklist-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: #2563EB;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    border-top: 2px solid #E2E8F0;
}

.modal-footer button {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.btn-secondary {
    background: white;
    color: #64748B;
    border: 2px solid #E2E8F0;
}

.btn-secondary:hover {
    background: #F8FAFC;
}

/* ==================== 플로팅 장바구니 버튼 ==================== */

.floating-cart-btn {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 16px 32px;
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
    z-index: 999;
    transition: all 0.3s;
    animation: bounceIn 0.5s;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: translateX(-50%) scale(0.3);
    }

    50% {
        transform: translateX(-50%) scale(1.05);
    }

    100% {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
}

.floating-cart-btn:hover {
    transform: translateX(-50%) translateY(-4px);
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.5);
}

/* ==================== 장바구니 오버레이 ==================== */

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    animation: fadeIn 0.2s;
}

.cart-content {
    background: white;
    border-radius: 16px;
    max-width: 700px;
    width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 3px solid #E2E8F0;
}

.cart-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1E293B;
    margin: 0;
}

.cart-close {
    width: 40px;
    height: 40px;
    background: #F1F5F9;
    border: none;
    border-radius: 8px;
    font-size: 1.5rem;
    color: #64748B;
    cursor: pointer;
    transition: all 0.2s;
}

.cart-close:hover {
    background: #E2E8F0;
    color: #1E293B;
}

.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.cart-category {
    margin-bottom: 24px;
    padding: 20px;
    background: #F8FAFC;
    border-radius: 12px;
    border-left: 4px solid #2563EB;
}

.cart-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 2px solid #E2E8F0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1E293B;
}

.cart-category-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px;
    transition: all 0.2s;
}

.btn-icon:hover {
    transform: scale(1.2);
}

.cart-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cart-items li {
    padding: 8px 0;
    color: #475569;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

.cart-badge.required {
    background: #FEE2E2;
    color: #DC2626;
}

.cart-badge.optional {
    background: #DBEAFE;
    color: #2563EB;
}

.add-common-section {
    text-align: center;
    padding: 24px;
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border-radius: 12px;
    margin-top: 16px;
}

.btn-add-common {
    padding: 12px 24px;
    background: #F59E0B;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 8px;
}

.btn-add-common:hover {
    background: #D97706;
    transform: translateY(-2px);
}

.add-common-section small {
    display: block;
    color: #92400E;
    font-size: 0.85rem;
}

.cart-footer {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    border-top: 3px solid #E2E8F0;
    flex-wrap: wrap;
}

.btn-action {
    flex: 1;
    min-width: 120px;
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-action.primary {
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-action.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.btn-action.secondary {
    background: white;
    color: #2563EB;
    border: 2px solid #2563EB;
}

.btn-action.secondary:hover {
    background: #EFF6FF;
    transform: translateY(-2px);
}

/* ==================== 모바일 반응형 - 모달 ==================== */

@media (max-width: 768px) {

    .modal-content,
    .cart-content {
        width: 95%;
        max-height: 90vh;
    }

    .modal-header,
    .cart-header {
        padding: 16px;
    }

    .modal-header h3,
    .cart-header h2 {
        font-size: 1.1rem;
    }

    .modal-close,
    .cart-close {
        width: 32px;
        height: 32px;
        font-size: 1.2rem;
    }

    .modal-tabs {
        padding: 12px 16px;
    }

    .modal-tab {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .modal-actions {
        padding: 12px 16px;
    }

    .modal-actions button {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .modal-checklist,
    .cart-body {
        padding: 12px 16px;
    }

    .modal-checklist-item {
        padding: 10px 12px;
        gap: 10px;
    }

    .modal-checklist-item input[type="checkbox"] {
        width: 18px;
        height: 18px;
    }

    .item-name {
        font-size: 0.85rem;
    }

    .item-description {
        font-size: 0.75rem;
    }

    .modal-footer,
    .cart-footer {
        padding: 16px;
        flex-direction: column;
    }

    .modal-footer button,
    .btn-action {
        width: 100%;
        padding: 12px 16px;
        font-size: 0.9rem;
    }

    .floating-cart-btn {
        bottom: 16px;
        padding: 12px 24px;
        font-size: 0.9rem;
        width: calc(100% - 32px);
        max-width: 400px;
    }

    .cart-category {
        padding: 16px;
        margin-bottom: 16px;
    }

    .cart-category-header {
        font-size: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .cart-items li {
        font-size: 0.85rem;
        padding: 6px 0;
    }

    .add-common-section {
        padding: 16px;
    }

    .btn-add-common {
        width: 100%;
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

/* ==================== 전체 레이아웃 최대 폭 설정 ==================== */

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==================== 메인 헤더 ==================== */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: white;
    border-bottom: 2px solid #E2E8F0;
    max-width: 800px;
    margin: 0 auto;
}

.page-header-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1E293B;
}

.page-header-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    color: white;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.page-header-logo:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

/* 모바일에서만 헤더 고정 */
@media (max-width: 768px) {
    .page-header {
        padding: 12px 18px;
        position: sticky;
        top: 0;
        z-index: 1000;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    }

    .page-header-title {
        font-size: 1.1rem;
    }

    .page-header-logo {
        padding: 6px 12px;
        font-size: 0.8rem;
        border-radius: 16px;
    }
}

/* ==================== 서브카테고리 선택 모달 ==================== */

.subcategory-selection-modal {
    max-width: 600px;
}

.subcategory-selection-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.selection-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1E293B;
    margin-bottom: 20px;
    text-align: center;
}

.subcategory-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.subcategory-option {
    cursor: pointer;
}

.subcategory-option input[type="checkbox"] {
    display: none;
}

.option-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    background: #F8FAFC;
    border: 3px solid #E2E8F0;
    border-radius: 12px;
    transition: all 0.3s;
    min-height: 100px;
}

.subcategory-option input[type="checkbox"]:checked+.option-card {
    background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
    border-color: #2563EB;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.option-card:hover {
    border-color: #BFDBFE;
    background: #EFF6FF;
    transform: translateY(-2px);
}

.option-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.option-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1E293B;
    text-align: center;
    line-height: 1.3;
}

.selection-hint {
    padding: 14px 18px;
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border-left: 4px solid #F59E0B;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #92400E;
    line-height: 1.5;
}

/* 모달 푸터 고정 */
.modal-footer-sticky {
    position: sticky;
    bottom: 0;
    background: white;
    border-top: 2px solid #E2E8F0;
    padding: 16px 20px;
    margin: 0;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

/* 선택된 서브카테고리 정보 표시 */
.selected-subcategories-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #EFF6FF;
    border-bottom: 2px solid #BFDBFE;
    flex-wrap: wrap;
}

.info-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1E293B;
}

.subcategory-badge {
    display: inline-block;
    padding: 4px 12px;
    background: white;
    color: #2563EB;
    border: 2px solid #2563EB;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ==================== 헤더 버튼 레이아웃 (PC: 별도 행, 모바일: 한 줄) ==================== */

/* PC: 기본 레이아웃 (별도 행) */
.modal-header-with-actions {
    display: block;
}

.modal-header-with-actions>.modal-close {
    position: absolute;
    top: 20px;
    right: 24px;
    font-size: 2rem;
    color: #64748B;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
}

.modal-title-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 60px 12px 24px;
    /* 오른쪽 여백 (닫기 버튼 공간) */
}

.modal-category-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.category-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.category-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1E293B;
}

.modal-header-actions {
    display: flex;
    gap: 8px;
    padding: 0 24px 12px 24px;
    border-bottom: 2px solid #E2E8F0;
}

.header-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #F1F5F9;
    border: 2px solid #E2E8F0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.header-action-btn:hover {
    background: #E2E8F0;
    border-color: #CBD5E1;
    transform: translateY(-1px);
}

.header-action-btn:active {
    transform: translateY(0);
}

/* PC: 이모지 숨김, 텍스트만 */
.header-action-btn .btn-icon {
    display: none;
}

.header-action-btn .btn-text-full {
    display: inline;
}

/* ==================== 배지 레이아웃 개선 ==================== */

.item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.item-name {
    flex: 1;
    min-width: 0;
    word-break: keep-all;
    overflow-wrap: break-word;
    line-height: 1.4;
}

.required-badge,
.optional-badge {
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
    align-self: flex-start;
}

.required-badge {
    background: #FEE2E2;
    color: #DC2626;
    border: 1px solid #FECACA;
}

.optional-badge {
    background: #DBEAFE;
    color: #2563EB;
    border: 1px solid #BFDBFE;
}

/* 체크리스트 아이템 */
.modal-checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-checklist-item:hover {
    background: #F8FAFC;
    border-color: #CBD5E1;
}

.modal-checklist-item input[type="checkbox"] {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
}

.item-content {
    flex: 1;
    min-width: 0;
}

/* 설명 영역 (숨김 처리, 추후 활성화 가능) */
.item-description {
    display: none;
    margin-top: 8px;
    padding: 8px 12px;
    background: #F8FAFC;
    border-left: 3px solid #BFDBFE;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #64748B;
    line-height: 1.4;
}

/* ==================== 토스트 메시지 중앙 배치 (작게 수정) ==================== */

.toast-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(30, 41, 59, 0.95);
    color: white;
    padding: 10px 20px;
    /* 작게 조정 */
    border-radius: 10px;
    font-size: 0.95rem;
    /* 작게 조정 */
    font-weight: 600;
    z-index: 12000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    white-space: nowrap;
    /* 한 줄로 */
    width: auto;
    /* 글씨 크기만큼만 */
}

.toast-message.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* ==================== 모바일 반응형 ==================== */

@media (max-width: 768px) {

    /* 컨테이너 */
    .container {
        padding: 0 16px;
    }

    /* 서브카테고리 모달 */
    .subcategory-selection-modal {
        width: 95%;
        max-width: 100%;
        max-height: 85vh;
    }

    .subcategory-selection-body {
        padding: 16px;
        max-height: calc(85vh - 180px);
    }

    .selection-title {
        font-size: 1rem;
        margin-bottom: 16px;
    }

    .subcategory-options {
        grid-template-columns: repeat(3, 1fr);
        /* 3개씩 */
        gap: 8px;
    }

    .option-card {
        padding: 14px 10px;
        min-height: 80px;
    }

    .option-icon {
        font-size: 1.4rem;
        margin-bottom: 4px;
    }

    .option-name {
        font-size: 0.8rem;
    }

    .selection-hint {
        padding: 12px 14px;
        font-size: 0.85rem;
    }

    .selected-subcategories-info {
        padding: 10px 14px;
    }

    .subcategory-badge {
        padding: 3px 10px;
        font-size: 0.8rem;
    }

    /* 모바일: 헤더와 버튼을 한 줄로 */
    .modal-header-with-actions {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 14px 16px;
    }

    .modal-header-with-actions>.modal-close {
        position: static;
        font-size: 1.8rem;
        width: auto;
        height: auto;
    }

    .modal-title-group {
        display: flex;
        align-items: center;
        gap: 10px;
        flex: 1;
        min-width: 0;
        padding: 0;
    }

    .category-icon {
        font-size: 1.1rem;
    }

    .category-name {
        font-size: 0.95rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .modal-header-actions {
        display: flex;
        gap: 6px;
        padding: 0;
        border: none;
        flex-shrink: 0;
    }

    .header-action-btn {
        padding: 6px 8px;
        min-width: 36px;
        justify-content: center;
    }

    /* 모바일: 아이콘만, 텍스트 숨김 */
    .header-action-btn .btn-icon {
        display: inline;
        font-size: 1.2rem;
    }

    .header-action-btn .btn-text-full {
        display: none;
    }

    /* 배지 */
    .required-badge,
    .optional-badge {
        padding: 3px 8px;
        font-size: 0.75rem;
    }

    /* 체크리스트 아이템 */
    .modal-checklist-item {
        padding: 12px 14px;
        gap: 10px;
    }

    .item-name {
        font-size: 0.9rem;
    }

    /* 토스트 */
    .toast-message {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {

    /* 서브카테고리 옵션 - 3개씩 유지 */
    .subcategory-options {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .option-card {
        padding: 12px 8px;
        min-height: 70px;
    }

    .option-icon {
        font-size: 1.2rem;
        margin-bottom: 3px;
    }

    .option-name {
        font-size: 0.75rem;
        line-height: 1.2;
    }

    /* 헤더 */
    .modal-header-with-actions {
        padding: 12px 14px;
    }

    .category-name {
        font-size: 0.85rem;
    }

    .header-action-btn {
        padding: 5px 7px;
        min-width: 32px;
    }

    .header-action-btn .btn-icon {
        font-size: 1.1rem;
    }

    /* 토스트 */
    .toast-message {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
}

/* ==================== 장바구니 배지 스타일 통일 ==================== */

.cart-badge.required {
    background: #FEE2E2;
    color: #DC2626;
    border: 1px solid #FECACA;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-left: 8px;
}

.cart-badge.optional {
    background: #DBEAFE;
    color: #2563EB;
    border: 1px solid #BFDBFE;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-left: 8px;
}

/* ==================== z-index 우선순위 ==================== */

/* 토스트 - 최상위 */
.toast-message {
    z-index: 12000 !important;
}

/* 링크 모달 - 장바구니보다 위 */
.link-modal {
    z-index: 11000 !important;
}

/* 장바구니 모달 */
.cart-overlay {
    z-index: 10000;
}

/* 일반 모달 */
.modal-overlay {
    z-index: 9000;
}

/* 헤더 (sticky) */
.page-header {
    z-index: 1000;
}

/* ==================== 전체 레이아웃 최대 폭 설정 ==================== */

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==================== 메인 헤더 ==================== */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: white;
    border-bottom: 2px solid #E2E8F0;
    max-width: 800px;
    margin: 0 auto;
}

.page-header-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1E293B;
}

.page-header-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    color: white;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.page-header-logo:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

/* 모바일에서만 헤더 고정 */
@media (max-width: 768px) {
    .page-header {
        padding: 12px 18px;
        position: sticky;
        top: 0;
        z-index: 1000;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    }

    .page-header-title {
        font-size: 1.1rem;
    }

    .page-header-logo {
        padding: 6px 12px;
        font-size: 0.8rem;
        border-radius: 16px;
    }
}

/* ==================== 서브카테고리 선택 모달 ==================== */

.subcategory-selection-modal {
    max-width: 600px;
}

.subcategory-selection-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.selection-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1E293B;
    margin-bottom: 20px;
    text-align: center;
}

.subcategory-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.subcategory-option {
    cursor: pointer;
}

.subcategory-option input[type="checkbox"] {
    display: none;
}

.option-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    background: #F8FAFC;
    border: 3px solid #E2E8F0;
    border-radius: 12px;
    transition: all 0.3s;
    min-height: 100px;
}

.subcategory-option input[type="checkbox"]:checked+.option-card {
    background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
    border-color: #2563EB;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.option-card:hover {
    border-color: #BFDBFE;
    background: #EFF6FF;
    transform: translateY(-2px);
}

.option-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.option-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1E293B;
    text-align: center;
    line-height: 1.3;
}

.selection-hint {
    padding: 14px 18px;
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border-left: 4px solid #F59E0B;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #92400E;
    line-height: 1.5;
}

/* 모달 푸터 고정 */
.modal-footer-sticky {
    position: sticky;
    bottom: 0;
    background: white;
    border-top: 2px solid #E2E8F0;
    padding: 16px 20px;
    margin: 0;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

/* 선택된 서브카테고리 정보 표시 */
.selected-subcategories-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #EFF6FF;
    border-bottom: 2px solid #BFDBFE;
    flex-wrap: wrap;
}

.info-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1E293B;
}

.subcategory-badge {
    display: inline-block;
    padding: 4px 12px;
    background: white;
    color: #2563EB;
    border: 2px solid #2563EB;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ==================== 헤더 버튼 레이아웃 (PC: 별도 행, 모바일: 한 줄) ==================== */

/* PC: 기본 레이아웃 (별도 행) */
.modal-header-with-actions {
    display: block;
}

.modal-header-with-actions>.modal-close {
    position: absolute;
    top: 20px;
    right: 24px;
    font-size: 2rem;
    color: #64748B;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
}

.modal-title-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 60px 12px 24px;
    /* 오른쪽 여백 (닫기 버튼 공간) */
}

.modal-category-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.category-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.category-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1E293B;
}

.modal-header-actions {
    display: flex;
    gap: 8px;
    padding: 0 24px 12px 24px;
    border-bottom: 2px solid #E2E8F0;
}

.header-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #F1F5F9;
    border: 2px solid #E2E8F0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.header-action-btn:hover {
    background: #E2E8F0;
    border-color: #CBD5E1;
    transform: translateY(-1px);
}

.header-action-btn:active {
    transform: translateY(0);
}

/* PC: 이모지 숨김, 텍스트만 */
.header-action-btn .btn-icon {
    display: none;
}

.header-action-btn .btn-text-full {
    display: inline;
}

/* ==================== 배지 레이아웃 개선 ==================== */

.item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.item-name {
    flex: 1;
    min-width: 0;
    word-break: keep-all;
    overflow-wrap: break-word;
    line-height: 1.4;
}

.required-badge,
.optional-badge {
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
    align-self: flex-start;
}

.required-badge {
    background: #FEE2E2;
    color: #DC2626;
    border: 1px solid #FECACA;
}

.optional-badge {
    background: #DBEAFE;
    color: #2563EB;
    border: 1px solid #BFDBFE;
}

/* 체크리스트 아이템 */
.modal-checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-checklist-item:hover {
    background: #F8FAFC;
    border-color: #CBD5E1;
}

.modal-checklist-item input[type="checkbox"] {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
}

.item-content {
    flex: 1;
    min-width: 0;
}

/* 설명 영역 (숨김 처리, 추후 활성화 가능) */
.item-description {
    display: none;
    margin-top: 8px;
    padding: 8px 12px;
    background: #F8FAFC;
    border-left: 3px solid #BFDBFE;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #64748B;
    line-height: 1.4;
}

/* ==================== 모달 푸터 버튼 1줄 ==================== */

.modal-footer {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    background: #F8FAFC;
    border-top: 2px solid #E2E8F0;
}

.btn-primary {
    flex: 1;
    padding: 12px 20px;
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    padding: 12px 20px;
    background: white;
    color: #64748B;
    border: 2px solid #E2E8F0;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* ==================== 장바구니 액션 버튼 1줄 ==================== */

.cart-footer {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    background: #F8FAFC;
    border-top: 2px solid #E2E8F0;
    flex-wrap: wrap;
}

.btn-action {
    flex: 1;
    min-width: 120px;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-action.primary {
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    color: white;
}

.btn-action.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-action.secondary {
    background: white;
    color: #64748B;
    border: 2px solid #E2E8F0;
}

.btn-action.secondary:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 모바일: 인쇄 버튼 숨김 */
@media (max-width: 768px) {
    .btn-action.secondary:last-child {
        display: none;
    }
}

/* ==================== 토스트 메시지 (작게 수정) ==================== */

.toast-message {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) scale(0.9) !important;
    background: rgba(30, 41, 59, 0.95) !important;
    color: white !important;
    padding: 10px 20px !important;
    border-radius: 8px !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    z-index: 12000 !important;
    opacity: 0 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3) !important;
    pointer-events: none !important;
    white-space: nowrap !important;
    width: auto !important;
    max-width: 280px !important;
    min-width: auto !important;
    height: auto !important;
}

.toast-message.show {
    opacity: 1 !important;
    transform: translate(-50%, -50%) scale(1) !important;
}

/* ==================== 전화번호 복사 버튼 ==================== */

.copy-phone-btn {
    margin-left: 8px;
    padding: 4px 12px;
    background: #EFF6FF;
    color: #2563EB;
    border: 1px solid #BFDBFE;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-phone-btn:hover {
    background: #DBEAFE;
    border-color: #93C5FD;
}

.copy-phone-btn:active {
    transform: scale(0.95);
}

/* 모바일 연락처 복사 버튼 */
.mobile-contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.mobile-contact-btn {
    flex: 1;
}

.copy-phone-btn-mobile {
    padding: 8px 16px;
    background: #EFF6FF;
    color: #2563EB;
    border: 1px solid #BFDBFE;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.copy-phone-btn-mobile:hover {
    background: #DBEAFE;
    border-color: #93C5FD;
}

.copy-phone-btn-mobile:active {
    transform: scale(0.95);
}

/* ==================== 모바일 반응형 ==================== */

@media (max-width: 768px) {

    /* 컨테이너 */
    .container {
        padding: 0 16px;
    }

    /* 서브카테고리 모달 */
    .subcategory-selection-modal {
        width: 95%;
        max-width: 100%;
        max-height: 85vh;
    }

    .subcategory-selection-body {
        padding: 16px;
        max-height: calc(85vh - 180px);
    }

    .selection-title {
        font-size: 1rem;
        margin-bottom: 16px;
    }

    .subcategory-options {
        grid-template-columns: repeat(3, 1fr);
        /* 3개씩 */
        gap: 8px;
    }

    .option-card {
        padding: 14px 10px;
        min-height: 80px;
    }

    .option-icon {
        font-size: 1.4rem;
        margin-bottom: 4px;
    }

    .option-name {
        font-size: 0.8rem;
    }

    .selection-hint {
        padding: 12px 14px;
        font-size: 0.85rem;
    }

    .selected-subcategories-info {
        padding: 10px 14px;
    }

    .subcategory-badge {
        padding: 3px 10px;
        font-size: 0.8rem;
    }

    /* 모바일: 헤더와 버튼을 한 줄로 */
    .modal-header-with-actions {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 14px 16px;
    }

    .modal-header-with-actions>.modal-close {
        position: static;
        font-size: 1.8rem;
        width: auto;
        height: auto;
    }

    .modal-title-group {
        display: flex;
        align-items: center;
        gap: 10px;
        flex: 1;
        min-width: 0;
        padding: 0;
    }

    .category-icon {
        font-size: 1.1rem;
    }

    .category-name {
        font-size: 0.95rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .modal-header-actions {
        display: flex;
        gap: 6px;
        padding: 0;
        border: none;
        flex-shrink: 0;
    }

    .header-action-btn {
        padding: 6px 8px;
        min-width: 36px;
        justify-content: center;
    }

    /* 모바일: 아이콘만, 텍스트 숨김 */
    .header-action-btn .btn-icon {
        display: inline;
        font-size: 1.2rem;
    }

    .header-action-btn .btn-text-full {
        display: none;
    }

    /* 배지 */
    .required-badge,
    .optional-badge {
        padding: 3px 8px;
        font-size: 0.75rem;
    }

    /* 체크리스트 아이템 */
    .modal-checklist-item {
        padding: 12px 14px;
        gap: 10px;
    }

    .item-name {
        font-size: 0.9rem;
    }

    /* 모달 푸터 */
    .modal-footer {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }

    /* 토스트 */
    .toast-message {
        padding: 8px 16px !important;
        font-size: 0.85rem !important;
        max-width: 240px !important;
    }
}

@media (max-width: 480px) {

    /* 서브카테고리 옵션 - 3개씩 유지 */
    .subcategory-options {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .option-card {
        padding: 12px 8px;
        min-height: 70px;
    }

    .option-icon {
        font-size: 1.2rem;
        margin-bottom: 3px;
    }

    .option-name {
        font-size: 0.75rem;
        line-height: 1.2;
    }

    /* 헤더 */
    .modal-header-with-actions {
        padding: 12px 14px;
    }

    .category-name {
        font-size: 0.85rem;
    }

    .header-action-btn {
        padding: 5px 7px;
        min-width: 32px;
    }

    .header-action-btn .btn-icon {
        font-size: 1.1rem;
    }

    /* 토스트 */
    .toast-message {
        padding: 8px 14px !important;
        font-size: 0.8rem !important;
        max-width: 220px !important;
    }
}

/* ==================== 장바구니 배지 스타일 통일 ==================== */

.cart-badge.required {
    background: #FEE2E2;
    color: #DC2626;
    border: 1px solid #FECACA;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-left: 8px;
}

.cart-badge.optional {
    background: #DBEAFE;
    color: #2563EB;
    border: 1px solid #BFDBFE;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-left: 8px;
}

/* ==================== z-index 우선순위 ==================== */

/* 토스트 - 최상위 */
.toast-message {
    z-index: 12000 !important;
}

/* 링크 모달 - 장바구니보다 위 */
.link-modal {
    z-index: 11000 !important;
}

/* 장바구니 모달 */
.cart-overlay {
    z-index: 10000;
}

/* 일반 모달 */
.modal-overlay {
    z-index: 9000;
}

/* 헤더 (sticky) */
.page-header {
    z-index: 1000;
}

/* ==================== PC에서 전화번호 복사 버튼 숨김 ==================== */

/* PC (769px 이상)에서 복사 버튼 숨김 */
@media (min-width: 769px) {
    .copy-phone-btn {
        display: none !important;
    }
}

/* 모바일에서만 복사 버튼 표시 */
@media (max-width: 768px) {
    .copy-phone-btn {
        display: inline-block !important;
    }

    .copy-phone-btn-mobile {
        display: inline-block !important;
    }
}