/* ==========================================
   B-Square Mobile Responsive Stylesheet
   iPhone UX 기반 모바일 최적화 (Phase 16)
   기준: iPhone SE 375px ~ iPhone 15 Pro Max 430px
=========================================== */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');
@import url('./mobile_210px_optimize.css');

:root {
    --bg-color: #ffffff;
    --card-bg: #ffffff;
    --border-color: #e8e8e8;
    --accent-color: #ff5a5f;
    --text-primary: #1a1a1a;
    --text-secondary: #888888;
    --glass-bg: rgba(255, 255, 255, 0.92);
    --glass-border: rgba(0, 0, 0, 0.06);
    --glass-blur: blur(24px) saturate(180%);
    --card-radius: 16px;
    --btn-radius: 36px;
    --primary-font: 'Inter', 'Pretendard', -apple-system, sans-serif;
    --nav-icon-color: #1a1a1a;
    --hover-bg: #f5f5f5;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--primary-font);
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
    overflow-x: hidden;
    width: 100%;
}

/* Allow text selection for inputs and textareas */
input,
textarea,
[contenteditable] {
    user-select: auto;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

ul,
li {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
    transition: all 0.2s ease;
}

/* 터치 타겟 최소 크기 보장 (iOS HIG) */
button,
input,
select,
.btn-link {
    min-height: 44px;
    min-width: 44px;
}

/* ==========================================
   Responsive Display Utilities
=========================================== */
.desktop-only-flex {
    display: flex !important;
}

.mobile-only-flex {
    display: none !important;
}

.desktop-only {
    display: block !important;
}

.mobile-only {
    display: none !important;
}

@media (max-width: 768px) {
    .desktop-only-flex {
        display: none !important;
    }

    .mobile-only-flex {
        display: flex !important;
    }

    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: block !important;
    }

    /* Bottom nav needs grid, not block */
    nav.bottom-nav.mobile-only {
        display: grid !important;
        grid-template-columns: repeat(5, 1fr) !important;
    }
}

/* ==========================================
   1. HEADER
=========================================== */
.site-header {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1300px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    padding: 0;
    min-width: auto;
    min-height: auto;
}

.btn-mobile-menu {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    margin-right: auto;
}

.icon-bar {
    width: 100%;
    height: 2px;
    background-color: #333;
    border-radius: 2px;
}

.logo a {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    letter-spacing: -0.5px;
}

/* ==========================================
   Shared Shell Overrides
=========================================== */
.site-header {
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid #eee;
}

.header-inner {
    padding: 0.85rem 1rem;
}

.logo a {
    color: #1a1a1a;
}

.logo-image {
    height: 28px;
    max-width: 140px;
}

.user-profile-btn {
    background: #f5f5f5;
    border: 1px solid #e8e8e8;
}

.user-profile-btn:hover {
    background: #eee;
}

.btn-login-main {
    background: #1a1a1a;
    color: #ffffff;
}

.drawer-menu {
    background: #ffffff;
    color: #1a1a1a;
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.1);
}

.drawer-header {
    background: #ffffff;
    border-bottom: 1px solid #eee;
}

.drawer-title {
    color: #1a1a1a;
}

.drawer-close {
    color: #888;
}

.drawer-nav-item {
    color: #555;
}

.drawer-nav-item.active,
.drawer-nav-item:hover {
    background: #f5f5f5;
    color: #1a1a1a;
}

/* ==========================================
   3. FOOTER (Refined & Consolidated)
=========================================== */
.site-footer {
    background: #f8f8f8;
    border-top: 1px solid #eee;
    padding: 4rem 1.5rem 3rem;
    color: #888;
}

.footer-inner {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}

.footer-support {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.footer-support-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.footer-support-hours {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.6;
}

.btn-contact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 0.75rem 1.8rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
}

.footer-social-links {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}

.footer-social-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.85rem;
}

.footer-social-link .icon {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
}

.footer-links-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem 1.5rem;
}

.footer-link-column {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.footer-link-column h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.footer-link-column a {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.9rem;
    line-height: 1.4;
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-legal-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.85rem;
}

.footer-legal-links a strong {
    color: var(--text-primary);
    font-weight: 700;
}

.footer-company-name, .company-info strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
}

.footer-info-text {
    white-space: pre-line;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.8rem;
}

.copyright {
    margin-top: 0.5rem;
    color: rgba(255, 255, 255, 0.15);
    font-size: 0.72rem;
}

/* ==========================================
   Shared Shell Overrides
=========================================== */
.site-header {
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid #eee;
}

.header-inner {
    padding: 0.85rem 1rem;
}

.logo a {
    color: #1a1a1a;
}

.logo-image {
    height: 28px;
    max-width: 140px;
}

.user-profile-btn {
    background: #f5f5f5;
    border: 1px solid #e8e8e8;
}

.user-profile-btn:hover {
    background: #eee;
}

.btn-login-main {
    background: #1a1a1a;
    color: #ffffff;
}

.drawer-menu {
    background: #ffffff;
    color: #1a1a1a;
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.1);
}

.drawer-header {
    background: #ffffff;
    border-bottom: 1px solid #eee;
}

.drawer-title {
    color: #1a1a1a;
}

.drawer-close {
    color: #888;
}

.drawer-nav-item {
    color: #555;
}

.drawer-nav-item.active,
.drawer-nav-item:hover {
    background: #f5f5f5;
    color: #1a1a1a;
}



.logo-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-image {
    display: block;
    width: auto;
    height: 28px;
    max-width: 140px;
    object-fit: contain;
}

.logo-text {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-link {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: color 0.2s;
}

.header-link:hover {
    color: var(--text-secondary);
}

select {
    background-color: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--btn-radius);
    padding: 0.4rem 1rem;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    outline: none;
}

option {
    background-color: #1a1a1a;
    color: #ffffff;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-profile-btn {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 0.4rem 1rem 0.4rem 0.4rem;
    border-radius: 30px;
    transition: all 0.3s;
}

.user-profile-btn:hover {
    background: var(--hover-bg);
    transform: translateY(-1px);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    border: 1px solid var(--border-color);
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-login-main {
    background: #1a1a1a;
    color: #ffffff;
    padding: 0.6rem 1.5rem;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.9rem;
}

.btn-login-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

/* ==========================================
   2. MAIN CONTENT
=========================================== */
.main-content {
    max-width: 1300px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

/* 2-1. Hero Section */
.hero-section {
    margin-bottom: 5rem;
}

.main-promo-banner {
    background: linear-gradient(135deg, #eaf2ff 0%, #f4f8ff 100%);
    border-radius: 16px;
    padding: 2.5rem 3rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.promo-content h2 {
    font-size: 1.8rem;
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.promo-content h2 strong {
    font-size: 2.2rem;
    font-weight: 800;
}

.promo-content p {
    font-size: 1rem;
    color: var(--text-secondary);
}

.main-ad-banner {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 100%);
    border: 1px solid #e0e6f0;
    border-radius: 16px;
    height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 3rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.main-ad-banner h2 {
    font-size: 3.5rem;
    color: rgba(0, 0, 0, 0.08);
    letter-spacing: 0.3em;
    font-weight: 900;
}

.banner-hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
    will-change: opacity, transform;
}

.banner-hero-slide.is-active {
    opacity: 1;
}

.banner-hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.banner-nav {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(16px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.banner-nav:hover {
    background: rgba(255, 255, 255, 0.16);
}

.banner-dot {
    transition: transform 0.2s ease, background 0.2s ease;
}

.banner-dot.active {
    transform: scale(1.15);
}

.category-grid ul {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 1.5rem;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.category-grid li a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.8rem;
    color: #555;
    padding: 0.8rem 0;
    border-radius: 12px;
    border: 1px solid transparent;
}

.category-grid li a:hover {
    background: #f5f5f5;
    color: #1a1a1a;
    border-color: #eee;
    transform: translateY(-2px);
    margin-bottom: 5rem;
}

.group-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2rem;
}

.class-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #eee;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.25s ease;
}

.class-card:hover {
    transform: translateY(-4px);
    border-color: #ddd;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.card-thumbnail {
    width: 100%;
    height: 200px;
    background-color: #222;
    position: relative;
    overflow: hidden;
}

.card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.class-card:hover .card-thumbnail img {
    transform: scale(1.08);
}

.card-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 2;
}

.badge-coupon {
    background: #ff4757;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.badge-discount {
    background: #ffffff;
    color: #ff4757;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 800;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-bookmark {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    z-index: 2;
    transition: transform 0.2s, background 0.2s;
}

.btn-bookmark:hover {
    transform: scale(1.1);
    background: rgba(0, 0, 0, 0.6);
}

.badge-award {
    position: absolute;
    bottom: 0;
    right: 0;
    background: linear-gradient(135deg, #a55eea, #8854d0);
    color: white;
    padding: 8px 12px;
    border-top-left-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
}

.placeholder-orange {
    background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 99%);
}

/* 추천 컬럼 (3열 카드) */
.recommend-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
}

.column {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 2rem;
    border: 1px solid var(--glass-border);
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1.2rem;
}

.column-header h4 {
    font-size: 1.25rem;
    font-weight: 700;
}

.list-item {
    display: flex;
    gap: 1.2rem;
    margin-bottom: 1.5rem;
    align-items: center;
    padding: 0.8rem;
    border-radius: 12px;
    transition: background 0.2s;
}

.list-item:hover {
    background: var(--glass-bg);
}

.item-thumbnail {
    width: 90px;
    height: 65px;
    border-radius: 10px;
    background-color: #222;
    flex-shrink: 0;
}

/* 카드 텍스트 정보 */
.card-info {
    padding: 1rem 1.2rem 1.2rem 1.2rem;
}

.card-info .category {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
}

.card-info .title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    line-height: 1.4;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.9rem;
}

.card-info .creator {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
    display: block;
}

.card-info .meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.card-info .rating {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #ffb100;
    font-weight: 700;
    font-size: 0.85rem;
}

.card-info .price-area {
    margin-top: 1rem;
    display: flex;
    align-items: baseline;
    gap: 8px;
    border-top: 1px solid var(--glass-border);
    padding-top: 0.8rem;
}

.card-info .original-price {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-decoration: line-through;
}

.card-info .current-price {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
}

/* 2-3. 하단 배너 */
.bottom-banner-section {
    margin-top: 3rem;
    padding: 0;
}

.bottom-banner-section .banner-bottom-shell {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025));
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 28px;
    padding: 1rem 3.25rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.24);
    overflow: hidden;
}

.banner-bottom-stage {
    position: relative;
    min-height: 220px;
}

.banner-bottom-slide {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(86vw, 1000px);
    aspect-ratio: 16 / 3;
    border-radius: 22px;
    overflow: hidden;
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
    opacity: 0;
    transform: translate3d(-50%, -50%, 0) scale(0.86);
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.6s ease, filter 0.6s ease;
    will-change: transform, opacity, filter;
}

.banner-bottom-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #111;
}

.banner-bottom-shell .banner-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.banner-bottom-shell .banner-nav-prev {
    left: 0.5rem;
}

.banner-bottom-shell .banner-nav-next {
    right: 0.5rem;
}

/* ==========================================
   Bottom Navigation (Mobile Only - iOS Tab Bar)
=========================================== */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid #eee;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom, 12px);
}

.bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #aaa;
    font-size: 0.7rem;
    font-weight: 500;
    gap: 3px;
    padding: 0.6rem 0;
    text-decoration: none;
}

.bottom-nav .nav-item .icon {
    font-size: 1.3rem;
}

.bottom-nav .nav-item.active {
    color: #1a1a1a;
    font-weight: 700;
}

.bottom-nav .nav-item.active .icon {
    transform: scale(1.1);
}

/* ==========================================
   3. FOOTER
=========================================== */
.site-footer {
    background-color: #f8f8f8;
    border-top: 1px solid #eee;
    padding: 5rem 2rem 3rem;
    color: #888;
    font-size: 0.9rem;
}

.footer-top {
    max-width: 1300px;
    margin: 0 auto 4rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 100%;
}

.footer-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--text-primary);
}

.footer-logo-image {
    width: auto;
    height: 30px;
    max-width: 150px;
    object-fit: contain;
}

.footer-brand-text {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.footer-slogan {
    margin: 0;
    opacity: 0.75;
}

.footer-links {
    min-width: 180px;
}

.footer-links h4 {
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 0.85rem;
    font-weight: 700;
}

.social-links {
    display: flex;
    gap: 3rem;
    flex-wrap: wrap;
}

.social-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
}

.social-icon .icon {
    font-size: 1.8rem;
    color: var(--text-primary);
    opacity: 0.8;
}

.social-icon p {
    font-weight: 500;
}

.cs-center h4 {
    color: var(--text-primary);
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
    font-weight: 700;
}

.btn-contact {
    margin-top: 1.2rem;
    background: var(--glass-bg);
    color: var(--text-primary);
    padding: 0.8rem 2rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    font-weight: 600;
}

.btn-contact:hover {
    background: var(--glass-border);
}

.footer-bottom {
    max-width: 1300px;
    margin: 0 auto;
    border-top: 1px solid var(--glass-border);
    padding-top: 3rem;
}

.footer-nav {
    display: flex;
    gap: 2.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.footer-nav a:hover {
    color: var(--text-primary);
}

.footer-info-text {
    white-space: pre-line;
    line-height: 1.7;
    opacity: 0.8;
}

.company-info strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.company-info p {
    margin-bottom: 0.5rem;
    opacity: 0.7;
}

.copyright {
    margin-top: 2rem;
    opacity: 0.4;
    font-size: 0.8rem;
}

/* ==========================================
   4. DRAWER MENU (Hamburger 사이드 메뉴)
=========================================== */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.drawer-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 90%;
    max-width: 480px;
    height: 100%;
    background: #ffffff;
    z-index: 1100;
    transition: left 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.1);
}

.drawer-menu.active {
    left: 0;
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: #ffffff;
}

.drawer-search {
    flex: 1;
    display: flex;
    background: var(--hover-bg);
    border-radius: 8px;
    padding: 0.6rem 1rem;
    margin-right: 1rem;
}

.drawer-search input {
    border: none;
    background: transparent;
    width: 100%;
    outline: none;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.drawer-search button {
    color: var(--text-secondary);
}

.btn-close-drawer {
    font-size: 1.5rem;
    color: var(--text-primary);
    padding: 0.5rem;
}

.drawer-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.drawer-main-categories {
    width: 130px;
    background: var(--hover-bg);
    overflow-y: auto;
    border-right: 1px solid var(--border-color);
}

.drawer-main-categories li {
    padding: 1.2rem 1.2rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 500;
}

.drawer-main-categories li.divider {
    padding: 1.5rem 1.2rem 0.5rem;
    font-size: 0.8rem;
    color: #999;
}

.drawer-main-categories li.active {
    background: #ffffff;
    color: var(--text-primary);
    font-weight: 700;
    border-left: 3px solid #ff3e41;
}

.drawer-sub-categories {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    background: #ffffff;
}

.drawer-banner {
    background: linear-gradient(135deg, #ff3e41, #ff6b81);
    color: #fff;
    padding: 1.2rem;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.drawer-banner p {
    font-size: 0.9rem;
    line-height: 1.4;
}

.drawer-banner p strong {
    font-size: 1.1rem;
}

.sub-category-group {
    margin-bottom: 2rem;
}

.group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.drawer-card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    text-align: center;
}

.drawer-card .thumbnail {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-color);
}

.drawer-card .label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: block;
}

.mt-3 {
    margin-top: 2rem;
}

/* ==========================================
   5. RESPONSIVE MEDIA QUERIES
   iPhone UX 기반 모바일 반응형
=========================================== */

/* --- 5-1. Tablet (max-width: 1024px) --- */
@media (max-width: 1024px) {
    .category-grid ul {
        grid-template-columns: repeat(5, 1fr);
    }

    .card-grid,
    .large-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .drawer-card-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .recommend-columns {
        grid-template-columns: 1fr;
    }
}

/* --- 5-2. Mobile Phone (max-width: 768px) --- */
@media (max-width: 768px) {

    /* ===== HEADER (iPhone 스타일) ===== */
    .header-inner {
        padding: 0.6rem 1rem;
    }

    .main-nav {
        display: none;
    }

    .search-bar {
        display: none;
    }

    .header-right .header-link {
        display: none;
    }

    .header-utils {
        display: none;
    }

    .btn-hamburger {
        display: flex;
    }

    .btn-mobile-menu {
        display: flex !important;
    }

    .header-right {
        gap: 0.8rem;
    }

    .logo a {
        font-size: 1.2rem;
    }

    .user-profile-btn {
        padding: 0.3rem 0.6rem 0.3rem 0.3rem;
    }

    .user-name {
        display: none;
    }

    .user-avatar {
        width: 28px;
        height: 28px;
    }

    .btn-login-main {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    /* ===== MAIN CONTENT ===== */
    .main-content {
        padding: 1.5rem 1rem;
    }

    .hero-section {
        margin-bottom: 2rem;
    }

    .main-promo-banner {
        padding: 1.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        border-radius: 16px;
    }

    .promo-content h2 {
        font-size: 1.3rem;
    }

    .promo-content h2 strong {
        font-size: 1.6rem;
    }

    .main-ad-banner {
        height: 200px;
        border-radius: 16px;
        margin-bottom: 2rem;
    }

    .main-ad-banner h2 {
        font-size: 2rem;
    }

    /* 카테고리 그리드 -> 2행 5열 */
    .category-grid ul {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.8rem;
    }

    .category-grid li a {
        font-size: 0.75rem;
        padding: 0.6rem 0;
        gap: 0.5rem;
    }

    .category-grid .icon {
        font-size: 1.5rem;
        padding: 0.7rem;
        border-radius: 14px;
    }

    /* 카드 그리드 -> 2열 */
    .card-grid,
    .large-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .card-thumbnail {
        height: 160px;
    }

    .card-info .title {
        font-size: 0.95rem;
        height: auto;
    }

    .card-info .current-price {
        font-size: 1.05rem;
    }

    .class-card {
        border-radius: 16px;
    }

    .class-card:hover {
        transform: none;
    }

    .group-title {
        font-size: 1.4rem;
        margin-bottom: 1.2rem;
    }

    .class-group {
        margin-bottom: 3rem;
    }

    /* 추천 3컬럼 -> 1컬럼 */
    .recommend-columns {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .column {
        padding: 1.2rem;
        border-radius: 16px;
    }

    /* 하단 배너 */
    .bottom-banner-section {
        padding: 0;
        margin-top: 2rem;
    }

    .bottom-banner-section .banner-bottom-shell {
        padding: 0.85rem 1rem;
        border-radius: 20px;
    }

    .banner-bottom-stage {
        min-height: 180px;
    }

    /* ===== BOTTOM NAV (iOS 탭바 스타일) ===== */
    .bottom-nav {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        padding: 0.4rem 0;
        padding-bottom: calc(0.4rem + env(safe-area-inset-bottom));
    }

    .bottom-nav .nav-item {
        font-size: 0.7rem;
        gap: 3px;
        padding: 0.5rem 0;
    }

    .bottom-nav .nav-item .icon {
        font-size: 1.3rem;
    }

    /* ===== FOOTER ===== */
    .site-footer {
        padding: 3rem 1.5rem;
        padding-bottom: calc(5rem + env(safe-area-inset-bottom));
    }

    .footer-top {
        flex-direction: column;
        gap: 2rem;
        margin-bottom: 2rem;
    }

    .social-links {
        gap: 2rem;
        flex-wrap: wrap;
    }

    .footer-nav {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .footer-bottom {
        padding-top: 2rem;
    }

    .company-info p {
        font-size: 0.8rem;
    }

    /* ===== DRAWER (iPhone 슬라이드 메뉴) ===== */
    .drawer-menu {
        width: 85%;
        max-width: 360px;
    }

    .drawer-card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- 5-3. Small Phone (max-width: 480px) --- */
@media (max-width: 480px) {

    .main-content {
        padding: 1.2rem 0.8rem;
    }

    /* 카드 -> 단일 열 */
    .card-grid,
    .large-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .card-thumbnail {
        height: 200px;
    }

    .class-card {
        border-radius: 16px;
    }

    /* 카테고리 4열 */
    .category-grid ul {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.6rem;
    }

    .category-grid li a {
        font-size: 0.7rem;
        padding: 0.4rem 0;
    }

    .category-grid .icon {
        font-size: 1.4rem;
        padding: 0.7rem;
    }

    .promo-content h2 {
        font-size: 1.15rem;
    }

    .promo-content h2 strong {
        font-size: 1.5rem;
    }

    .main-ad-banner {
        height: 180px;
        border-radius: 12px;
    }

    .group-title {
        font-size: 1.25rem;
    }

    .drawer-card-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .bottom-banner-section {
        padding: 0;
    }

    .bottom-banner-section .banner-bottom-shell {
        padding: 0.75rem 0.9rem;
    }
}

/* --- 5-4. iPhone SE / Small Phone (max-width: 375px) --- */
@media (max-width: 375px) {

    .header-inner {
        padding: 0.5rem 0.8rem;
    }

    .logo a {
        font-size: 1.1rem;
    }

    .btn-login-main {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    .main-content {
        padding: 1rem 0.7rem;
    }

    .category-grid ul {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 0.5rem;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }

    .category-grid ul::-webkit-scrollbar {
        display: none;
    }

    .category-grid li {
        flex: 0 0 auto;
        scroll-snap-align: start;
    }

    .category-grid li a {
        white-space: nowrap;
        font-size: 0.7rem;
    }

    .main-ad-banner {
        height: 160px;
    }

    .main-ad-banner h2 {
        font-size: 1.8rem;
    }

    .group-title {
        font-size: 1.15rem;
        margin-bottom: 1rem;
    }

    .card-thumbnail {
        height: 180px;
    }

    .card-info {
        padding: 0.6rem 0.8rem 0.8rem;
    }

    .card-info .title {
        font-size: 0.9rem;
    }

    .card-info .current-price {
        font-size: 1rem;
    }

    .bottom-nav .nav-item {
        font-size: 0.65rem;
    }

    .bottom-nav .nav-item .icon {
        font-size: 1.1rem;
    }
}

/* --- 5-5. Micro Mobile (max-width: 320px) --- */
@media (max-width: 320px) {
    .main-content {
        padding: 1rem 0.6rem;
    }

    .header-inner {
        padding: 0.5rem 0.6rem;
    }

    .logo a {
        font-size: 1rem;
    }

    .promo-content h2 {
        font-size: 1rem;
    }

    .promo-content h2 strong {
        font-size: 1.2rem;
    }

    .category-grid .icon {
        font-size: 1.2rem;
        padding: 0.5rem;
        border-radius: 10px;
    }

    .card-thumbnail {
        height: 150px;
    }

    .card-info .title {
        font-size: 0.85rem;
    }

    .card-info .category {
        font-size: 0.65rem;
    }

    .bottom-nav .nav-item {
        font-size: 0.6rem;
        padding: 0.5rem 0;
    }

    .bottom-nav .nav-item .icon {
        font-size: 1rem;
    }

    .drawer-header {
        padding: 0.8rem;
    }

    .drawer-main-categories {
        width: 80px;
    }

    .drawer-main-categories li {
        padding: 0.8rem 0.5rem;
        font-size: 0.7rem;
    }

    .drawer-sub-categories {
        padding: 0.8rem;
    }

    .drawer-card-grid {
        grid-template-columns: 1fr;
    }

    .site-footer {
        padding: 2rem 0.8rem;
        padding-bottom: calc(5rem + env(safe-area-inset-bottom));
        font-size: 0.75rem;
    }

    .social-links {
        gap: 1.5rem;
    }

    .social-icon .icon {
        font-size: 1.2rem;
    }

    .cs-center h4 {
        font-size: 1rem;
    }

    .footer-nav {
        flex-direction: column;
        gap: 0.8rem;
    }

    .company-info p {
        font-size: 0.7rem;
    }

    .column {
        padding: 1rem;
    }

    .column-header h4 {
        font-size: 1rem;
    }

    .main-ad-banner {
        height: 140px;
        margin-bottom: 1.5rem;
    }

    .main-ad-banner h2 {
        font-size: 1.6rem;
    }

    .bottom-banner-section {
        padding: 0;
    }

    .bottom-banner-section .banner-bottom-shell {
        padding: 0.65rem 0.75rem;
        border-radius: 16px;
    }
}

/* --- 5-6. Ultra-Small (max-width: 210px) --- */
@media (max-width: 210px) {
    body {
        font-size: 11px;
        line-height: 1.4;
    }

    .header-inner {
        padding: 0.4rem 0.5rem;
    }

    .logo a {
        font-size: 0.85rem;
        gap: 0.2rem;
    }

    .header-right,
    .header-utils {
        display: none !important;
    }

    .btn-hamburger {
        width: 20px;
        height: 14px;
    }

    .category-grid ul {
        gap: 0.3rem;
    }

    .category-grid li a {
        font-size: 0;
        gap: 0;
        padding: 0.3rem 0;
    }

    .category-grid .icon {
        font-size: 1rem;
        padding: 0.3rem;
        border-radius: 8px;
    }

    .main-content {
        padding: 0.8rem 0.4rem;
    }

    .hero-section {
        margin-bottom: 1.5rem;
    }

    .main-ad-banner {
        height: 100px;
        border-radius: 8px;
        margin-bottom: 0.8rem;
    }

    .main-ad-banner h2 {
        font-size: 1.2rem;
    }

    .group-title {
        font-size: 1rem;
        margin-bottom: 0.6rem;
    }

    .card-grid,
    .large-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .class-card {
        border-radius: 10px;
    }

    .card-thumbnail {
        height: 100px;
    }

    .card-info {
        padding: 0.4rem 0.5rem 0.6rem;
    }

    .card-info .title {
        font-size: 0.75rem;
        height: auto;
    }

    .card-info .category {
        font-size: 0.6rem;
    }

    .card-info .creator {
        font-size: 0.6rem;
    }

    .card-info .meta {
        font-size: 0.6rem;
        gap: 4px;
    }

    .card-info .current-price {
        font-size: 0.8rem;
    }

    .card-info .original-price {
        font-size: 0.6rem;
    }

    .card-info .price-area {
        margin-top: 0.4rem;
        padding-top: 0.4rem;
        gap: 4px;
    }

    .card-badges {
        top: 4px;
        left: 4px;
    }

    .badge-coupon,
    .badge-discount {
        font-size: 0.55rem;
        padding: 2px 4px;
    }

    .btn-bookmark {
        width: 22px;
        height: 22px;
        font-size: 0.7rem;
        top: 4px;
        right: 4px;
    }

    .bottom-nav .nav-item .label {
        display: none;
    }

    .bottom-nav .nav-item {
        padding: 0.5rem 0;
    }

    .bottom-nav .nav-item .icon {
        font-size: 0.9rem;
    }

    .drawer-menu {
        width: 100%;
        max-width: 100%;
    }

    .drawer-main-categories {
        width: 60px;
    }

    .drawer-main-categories li {
        padding: 0.6rem 0.3rem;
        font-size: 0.6rem;
    }

    .drawer-sub-categories {
        padding: 0.5rem;
    }

    .column {
        padding: 0.6rem;
        border-radius: 10px;
    }

    .column-header h4 {
        font-size: 0.8rem;
    }

    .list-item {
        gap: 0.5rem;
        padding: 0.4rem;
    }

    .item-thumbnail {
        width: 50px;
        height: 40px;
        border-radius: 4px;
    }

    .item-info .title {
        font-size: 0.65rem;
    }

    .item-info .rating {
        font-size: 0.6rem;
    }

    .bottom-banner-section {
        padding: 0;
        margin-top: 1rem;
    }

    .bottom-banner-section .banner-bottom-shell {
        padding: 0.55rem 0.5rem;
        border-radius: 14px;
    }

    .site-footer {
        padding: 1.5rem 0.4rem 4rem;
        font-size: 0.65rem;
    }

    .footer-top {
        margin-bottom: 1rem;
    }

    .social-links {
        gap: 0.8rem;
    }

    .social-icon .icon {
        font-size: 1rem;
    }

    .social-icon p {
        font-size: 0.6rem;
    }

    .cs-center h4 {
        font-size: 0.8rem;
    }

    .cs-center p {
        font-size: 0.6rem;
    }

    .btn-contact {
        padding: 0.4rem 0.8rem;
        font-size: 0.65rem;
    }

    .footer-nav {
        gap: 0.5rem;
    }

    .footer-nav a {
        font-size: 0.6rem;
    }

    .company-info strong {
        font-size: 0.75rem;
    }

    .company-info p {
        font-size: 0.55rem;
    }

    .copyright {
        margin-top: 0.8rem;
        font-size: 0.55rem;
    }
}

/* EMERGENCY FIX FOR CATEGORY OVERFLOW */
.home-category-shell { padding: 1rem 0; margin-bottom: 2.5rem; }
.home-category-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.8rem; padding: 0 0.5rem; }
.home-category-icon { width: 48px; height: 48px; background: #f8f8f8; border-radius: 14px; display: flex; align-items: center; justify-content: center; padding: 10px; color: var(--text-primary); }
.home-category-icon svg { width: 24px !important; height: 24px !important; display: block; max-width: 100%; max-height: 100%; }
.home-category-label { font-size: 0.75rem; font-weight: 600; color: var(--text-primary); text-align: center; }
.home-category-item { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; text-decoration: none; }

