/* ============================================
   중세국어(훈민정음/옛한글) 지원 폰트 설정
   ============================================ */

/* 나눔명조옛한글 - 서버 로컬 호스팅 + 로컬 폰트 폴백 */
/* 나눔명조옛한글 - 서버 로컬 호스팅 + 로컬 폰트 폴백 */
@font-face {
    font-family: 'NanumMyeongjoYetHangul';
    src: url('/kshop/assets/fonts/NanumMyeongjo-YetHangul.ttf') format('truetype'),
        local('NanumMyeongjo YetHangul'),
        local('NanumMyeongjoYetHangul'),
        local('나눔명조 옛한글'),
        local('나눔명조옛한글');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* 나눔바른고딕옛한글 - 서버 로컬 호스팅 + 로컬 폰트 폴백 */
@font-face {
    font-family: 'NanumBarunGothicYetHangul';
    src: url('/kshop/assets/fonts/NanumBarunGothic-YetHangul.woff2') format('woff2'),
        url('/kshop/assets/fonts/NanumBarunGothic-YetHangul.woff') format('woff'),
        url('/kshop/assets/fonts/NanumBarunGothic-YetHangul.ttf') format('truetype'),
        local('NanumBarunGothic YetHangul'),
        local('NanumBarunGothicYetHangul'),
        local('나눔바른고딕 옛한글'),
        local('나눔바른고딕옛한글');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* 함초롬바탕LVT - 한글과컴퓨터에서 제공하는 옛한글 특화 폰트 */
@font-face {
    font-family: 'HCRBatangLVT';
    src: local('HCR Batang LVT'),
        local('HCRBatangLVT'),
        local('함초롬바탕LVT'),
        local('함초롬바탕 LVT'),
        local('HCR Batang');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* 은바탕 폰트 - 옛한글 지원 (로컬) */
@font-face {
    font-family: 'UnBatang';
    src: local('UnBatang'),
        local('은 바탕'),
        local('은바탕'),
        local('UnBatang-Regular');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Color Palette */
    --primary-color: #6366f1;
    /* 옛한글 전용 폰트 스택 */
    --font-family-oldkorean: 'NanumMyeongjoYetHangul', '나눔명조옛한글', 'HCRBatangLVT', '함초롬바탕LVT', 'UnBatang', '은바탕', 'Batang', '바탕', serif;
    --primary-hover: #4f46e5;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-dark: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    --gradient-card: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);

    /* Background */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-dark: #0f172a;

    /* Text */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-white: #ffffff;

    /* Border */
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;

    /* Shadow */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.12);

    /* Transition */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Header */
.site-header {
    background: #ffffff;
    color: var(--text-primary);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.08);
    border-bottom: 2px solid #e0e7ff;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-icon {
    font-size: 2rem;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Search Bar */
.search-bar {
    flex: 1;
    max-width: 500px;
    margin: 0 40px;
}

.search-bar form {
    display: flex;
    background: #f8fafc;
    border-radius: 50px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    transition: var(--transition-normal);
}

.search-bar form:focus-within {
    background: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-bar input {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
}

.search-bar input::placeholder {
    color: #94a3b8;
}

.search-bar button {
    padding: 12px 20px;
    background: var(--primary-color);
    border: none;
    color: var(--text-white);
    cursor: pointer;
    transition: var(--transition-fast);
}

.search-bar button:hover {
    background: var(--primary-hover);
}

/* User Actions */
.user-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0e7ff 100%);
    border-radius: 50px;
    border: 1px solid #c7d2fe;
}

.user-name {
    font-weight: 600;
}

.user-points {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #fbbf24;
    font-weight: 700;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-normal);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--text-white);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-outline {
    background: transparent;
    border: 2px solid #c7d2fe;
    color: var(--primary-color);
}

.btn-outline:hover {
    background: #f0f9ff;
    border-color: var(--primary-color);
}

.btn-success {
    background: var(--success-color);
    color: var(--text-white);
}

.btn-danger {
    background: var(--danger-color);
    color: var(--text-white);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* Subject Tabs */
.subject-tabs {
    background: linear-gradient(135deg, #f8fafc 0%, #f0f9ff 100%);
    border-top: 1px solid #e0e7ff;
}

.subject-tabs-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    gap: 4px;
}

.subject-tab {
    padding: 14px 24px;
    color: #64748b;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    border-bottom: 3px solid transparent;
    transition: var(--transition-fast);
}

.subject-tab:hover {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.08);
}

.subject-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.subject-tab.coming-soon {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Category Bar */
.category-bar {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
}

.category-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.category-chip {
    padding: 8px 18px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition-fast);
    border: 2px solid transparent;
}

.category-chip:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--primary-color);
}

.category-chip.active {
    background: var(--gradient-primary);
    color: var(--text-white);
}

/* Main Content */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* Hero Banner */
.hero-banner {
    background: var(--gradient-primary);
    border-radius: 20px;
    padding: 48px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
    color: var(--text-white);
}

.hero-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 12px;
    position: relative;
}

.hero-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    position: relative;
}

/* Product Grid */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title .icon {
    font-size: 1.8rem;
}

.view-all {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.view-all:hover {
    text-decoration: underline;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.product-card {
    background: var(--bg-primary);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
    border: 1px solid var(--border-light);
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
}

.product-thumb {
    height: 180px;
    background: var(--gradient-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--primary-color);
    position: relative;
    overflow: hidden;
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    background: var(--accent-color);
    color: var(--text-white);
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 4px;
}

.product-info {
    padding: 20px;
}

.product-category {
    font-size: 0.8rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 8px;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.price-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary-color);
}

.price-unit {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.product-actions {
    display: flex;
    gap: 8px;
}

.product-actions .btn {
    flex: 1;
    justify-content: center;
}

/* Footer */
.site-footer {
    background: linear-gradient(135deg, #f8fafc 0%, #f0f9ff 100%);
    color: var(--text-secondary);
    padding: 48px 24px;
    margin-top: 60px;
    border-top: 2px solid #e0e7ff;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 24px;
}

.footer-links a {
    color: #64748b;
    text-decoration: none;
    transition: var(--transition-fast);
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-copyright {
    font-size: 0.85rem;
    color: #94a3b8;
}

/* Login/Register Forms */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-dark);
    padding: 24px;
}

.auth-card {
    background: var(--bg-primary);
    border-radius: 20px;
    padding: 48px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-xl);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-secondary);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    transition: var(--transition-fast);
    background: var(--bg-secondary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-primary);
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.error-message {
    background: #fef2f2;
    color: var(--danger-color);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.success-message {
    background: #ecfdf5;
    color: var(--success-color);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-secondary);
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

/* ============================================
   모바일 메뉴 컴포넌트
   ============================================ */

/* 햄버거 버튼 */
.hamburger-btn {
    display: none;
    /* 데스크탑에서 숨김 */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.hamburger-btn:hover {
    background: var(--bg-tertiary);
}

.hamburger-line {
    display: block;
    width: 22px;
    height: 2.5px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger-btn.active .hamburger-line:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
}

/* 모바일 헤더 아이콘 영역 */
.mobile-header-icons {
    display: none;
    /* 데스크탑에서 숨김 */
    align-items: center;
    gap: 4px;
}

.mobile-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.mobile-icon-btn:hover {
    background: var(--bg-tertiary);
}

.cart-badge-mobile {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #ef4444;
    color: white;
    font-size: 0.6rem;
    padding: 1px 5px;
    border-radius: 10px;
    font-weight: 700;
}

/* 모바일 오버레이 */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    opacity: 1;
}

/* 모바일 드로어 헤더 */
.mobile-drawer-header {
    display: none;
    /* 데스크탑에서 숨김 */
}

/* 모바일 사용자 카드 */
.mobile-user-card {
    display: none;
    /* 데스크탑에서 숨김 */
}

/* 모바일 내비게이션 링크 */
.mobile-nav-links {
    display: none;
    /* 데스크탑에서 숨김 */
}

/* 데스크탑 전용 표시 */
.desktop-only {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============================================
   Responsive 반응형 스타일
   ============================================ */

@media (max-width: 768px) {

    /* --- 헤더 --- */
    .header-container {
        flex-wrap: nowrap;
        height: 56px;
        padding: 0 12px;
        gap: 8px;
    }

    .logo {
        gap: 8px;
    }

    .logo-icon {
        font-size: 1.5rem;
    }

    .logo-text {
        font-size: 1.1rem;
    }

    /* 검색바: 모바일에서 축소 */
    .search-bar {
        flex: 1;
        margin: 0 8px;
        max-width: none;
    }

    .search-bar input {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .search-bar button {
        padding: 8px 14px;
    }

    /* 모바일 아이콘 표시 */
    .mobile-header-icons {
        display: flex;
    }

    /* 햄버거 버튼 표시 */
    .hamburger-btn {
        display: flex;
    }

    /* 데스크탑 전용 요소 숨김 */
    .desktop-only {
        display: none !important;
    }

    /* --- user-actions → 모바일 드로어 --- */
    .user-actions {
        position: fixed;
        top: 0;
        right: -300px;
        width: 280px;
        height: 100vh;
        background: #ffffff;
        z-index: 1999;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0;
        box-shadow: -4px 0 30px rgba(0, 0, 0, 0.15);
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
    }

    .user-actions.mobile-open {
        right: 0;
    }

    .mobile-overlay {
        display: block;
        pointer-events: none;
    }

    .mobile-overlay.active {
        pointer-events: auto;
    }

    /* 드로어 헤더 */
    .mobile-drawer-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 20px;
        border-bottom: 1px solid var(--border-color);
        background: linear-gradient(135deg, #f8fafc 0%, #f0f9ff 100%);
    }

    .mobile-close-btn {
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: 1px solid var(--border-color);
        border-radius: 50%;
        font-size: 1rem;
        cursor: pointer;
        color: var(--text-secondary);
        transition: all 0.2s ease;
    }

    .mobile-close-btn:hover {
        background: var(--bg-tertiary);
        color: var(--text-primary);
    }

    /* 모바일 사용자 카드 */
    .mobile-user-card {
        display: block;
        padding: 16px 20px;
        border-bottom: 1px solid var(--border-color);
    }

    .mobile-user-card .user-info {
        width: 100%;
        justify-content: space-between;
        border-radius: 12px;
    }

    /* 알림 벨 (드로어 내부) */
    .user-actions .notification-bell {
        padding: 12px 20px;
        font-size: 1.1rem;
        border-bottom: 1px solid var(--border-light);
    }

    .user-actions .notification-popup {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 60vh;
        border-radius: 16px 16px 0 0;
    }

    /* 모바일 내비게이션 링크 */
    .mobile-nav-links {
        display: flex;
        flex-direction: column;
        padding: 8px 0;
    }

    .mobile-nav-link {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px 20px;
        color: var(--text-primary);
        text-decoration: none;
        font-size: 0.95rem;
        font-weight: 500;
        transition: background 0.15s ease;
        border-bottom: 1px solid var(--border-light);
    }

    .mobile-nav-link:hover,
    .mobile-nav-link:active {
        background: var(--bg-secondary);
    }

    .mobile-nav-link-danger {
        color: var(--danger-color);
    }

    .mobile-nav-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 20px;
        height: 20px;
        padding: 0 6px;
        background: #ef4444;
        color: white;
        font-size: 0.7rem;
        font-weight: 700;
        border-radius: 10px;
    }

    /* 데스크탑용 장바구니/버튼 숨김 */
    .user-actions .cart-icon.desktop-only,
    .user-actions .btn.desktop-only {
        display: none !important;
    }

    /* --- subject-tabs 가로 스크롤 --- */
    .subject-tabs-container {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding: 0 12px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .subject-tabs-container::-webkit-scrollbar {
        display: none;
    }

    .subject-tab {
        white-space: nowrap;
        padding: 12px 16px;
        font-size: 0.85rem;
        flex-shrink: 0;
    }

    /* --- 히어로 배너 모바일 --- */
    .hero-banner {
        padding: 32px 24px;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .hero-carousel {
        border-radius: 12px;
        margin-bottom: 20px;
    }

    .hero-slide {
        padding: 24px 16px !important;
        min-height: 140px !important;
    }

    .hero-slide h1 {
        font-size: 1.2rem !important;
    }

    .hero-slide h2 {
        font-size: 1.1rem !important;
    }

    .hero-slide p {
        font-size: 0.85rem !important;
    }

    /* --- 상품 그리드 --- */
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .product-info {
        padding: 14px;
    }

    .product-title {
        font-size: 0.95rem;
    }

    /* --- 메인 컨테이너 --- */
    .main-container {
        padding: 20px 12px;
    }

    /* --- 카테고리 바 --- */
    .category-container {
        padding: 0 12px;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .category-container::-webkit-scrollbar {
        display: none;
    }

    .category-chip {
        white-space: nowrap;
        flex-shrink: 0;
        padding: 6px 14px;
        font-size: 0.8rem;
    }

    /* --- 과목 선택 버튼 --- */
    .subject-selector .subject-btn {
        min-width: 120px !important;
        padding: 14px 24px !important;
        font-size: 1.1rem !important;
    }

    /* --- 이용 안내 배너 --- */
    .section-header {
        margin-bottom: 16px;
    }

    .section-title {
        font-size: 1.2rem;
    }

    .section-title .icon {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr;
    }

    .search-bar {
        margin: 0 4px;
    }

    .logo-text {
        font-size: 1rem;
    }

    .hero-slide h1 {
        font-size: 1rem !important;
    }

    .hero-slide h2 {
        font-size: 0.95rem !important;
    }

    /* 과목 버튼 더 작게 */
    .subject-selector .subject-btn {
        min-width: 100px !important;
        padding: 12px 18px !important;
        font-size: 1rem !important;
        border-radius: 12px !important;
    }
}

/* ============================================
   옛한글(중세국어) 콘텐츠 폰트 강제 적용
   - 상품 제목 및 콘텐츠 영역에서 옛한글이 네모로 표시되지 않도록
   - 옛한글 폰트가 적용되도록 !important로 재정의
   ============================================ */

.product-title,
.product-title *,
.product-info .content-text,
.product-info .content-text *,
.content-body,
.content-body *,
.product-content,
.product-content *,
.preview-content,
.preview-content * {
    font-family: 'NanumMyeongjoYetHangul', '나눔명조옛한글', 'HCRBatangLVT', '함초롬바탕LVT', 'UnBatang', '은바탕', 'Batang', '바탕', 'Noto Serif KR', serif !important;
    -webkit-font-feature-settings: "ccmp", "ljmo", "vjmo", "tjmo";
    font-feature-settings: "ccmp", "ljmo", "vjmo", "tjmo";
    text-rendering: optimizeLegibility;
}