/* ===== Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #0071e3;
    --primary-dark: #0077ed;
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --text-tertiary: #6e6e73;
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f7;
    --bg-tertiary: #fbfbfd;
    --border-color: #d2d2d7;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== Header ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.nav {
    display: flex;
    gap: 32px;
}

.nav-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    transition: var(--transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary);
}

.nav-link:hover::after {
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 8px 16px;
    width: 280px;
    transition: var(--transition);
}

.search-box:focus-within {
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.3);
}

.search-box input {
    border: none;
    background: none;
    outline: none;
    width: 100%;
    font-size: 14px;
    color: var(--text-primary);
}

.search-box input::placeholder {
    color: var(--text-secondary);
}

.search-btn {
    color: var(--text-secondary);
    padding: 4px;
    transition: var(--transition);
}

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

.icon-btn {
    position: relative;
    padding: 8px;
    color: var(--text-primary);
    transition: var(--transition);
}

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

.cart-count {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--primary);
    color: white;
    font-size: 10px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== Hero Section ===== */
.hero {
    margin-top: 64px;
    min-height: 600px;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    position: relative;
    overflow: hidden;
}

.hero-slider {
    position: relative;
    height: 600px;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.hero-slide.active {
    opacity: 1;
}

.hero-content {
    max-width: 500px;
    color: white;
}

.hero-tag {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 6px 16px;
    border-radius: var(--radius-lg);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 24px;
}

.hero-title {
    font-size: 56px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -2px;
    margin-bottom: 20px;
}

.hero-desc {
    font-size: 18px;
    line-height: 1.6;
    opacity: 0.9;
    margin-bottom: 32px;
}

.hero-btn {
    display: inline-block;
    background: white;
    color: #11998e;
    padding: 16px 32px;
    border-radius: var(--radius-xl);
    font-size: 16px;
    font-weight: 600;
    transition: var(--transition);
}

.hero-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.hero-image {
    position: relative;
}

.book-stack {
    position: relative;
    width: 400px;
    height: 500px;
}

.book {
    position: absolute;
    width: 200px;
    height: 280px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(145deg, #f8f8f8 0%, #e8e8e8 100%);
}

.book::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 8px;
    right: 8px;
    bottom: 8px;
    background: linear-gradient(135deg, #ff6b6b 0%, #feca57 100%);
    border-radius: var(--radius-sm);
}

.book-1 {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-5deg);
    z-index: 3;
    animation: float 3s ease-in-out infinite;
}

.book-1::before {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.book-2 {
    top: 45%;
    left: 40%;
    transform: translate(-50%, -50%) rotate(8deg);
    z-index: 2;
    animation: float 3s ease-in-out infinite 0.5s;
}

.book-2::before {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.book-3 {
    top: 55%;
    left: 60%;
    transform: translate(-50%, -50%) rotate(-12deg);
    z-index: 1;
    animation: float 3s ease-in-out infinite 1s;
}

.book-3::before {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

@keyframes float {
    0%, 100% { transform: translate(-50%, -50%) translateY(0) rotate(var(--rotate, 0deg)); }
    50% { transform: translate(-50%, -50%) translateY(-15px) rotate(var(--rotate, 0deg)); }
}

.book-1 { --rotate: -5deg; }
.book-2 { --rotate: 8deg; }
.book-3 { --rotate: -12deg; }

.hero-dots {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transition: var(--transition);
}

.dot.active {
    background: white;
    width: 32px;
    border-radius: 5px;
}

/* ===== Categories ===== */
.categories {
    padding: 60px 0;
    background: var(--bg-primary);
}

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

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.category-item:hover {
    background: var(--bg-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.category-icon {
    font-size: 32px;
}

.category-item span {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

/* ===== Section Styles ===== */
.section {
    padding: 80px 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 40px;
}

.section-header.center {
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.section-title {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 8px;
}

.section-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
}

.tab-buttons {
    display: flex;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 4px;
}

.tab-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.tab-btn.active {
    background: var(--bg-primary);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.view-all {
    font-size: 14px;
    font-weight: 500;
    color: var(--primary);
    transition: var(--transition);
}

.view-all:hover {
    opacity: 0.8;
}

.view-more {
    display: block;
    text-align: center;
    margin-top: 40px;
    font-size: 15px;
    font-weight: 500;
    color: var(--primary);
    transition: var(--transition);
}

.view-more:hover {
    opacity: 0.8;
}

/* ===== Book Grid ===== */
.book-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 24px;
}

.book-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
}

.book-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.book-cover {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
    background: var(--bg-secondary);
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.book-card:hover .book-cover img {
    transform: scale(1.05);
}

.book-rank {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 32px;
    height: 32px;
    background: var(--text-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
}

.book-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #ff3b30;
    color: white;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
}

.book-info {
    padding: 16px;
}

.book-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-author {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.book-price {
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-original {
    font-size: 13px;
    color: var(--text-tertiary);
    text-decoration: line-through;
}

.price-sale {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
}

.book-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
}

.stars {
    color: #ffc107;
    font-size: 12px;
}

.rating-count {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ===== Book Slider ===== */
.book-slider {
    position: relative;
}

.slider-track {
    display: flex;
    gap: 24px;
    overflow: hidden;
    scroll-behavior: smooth;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: var(--bg-primary);
    border-radius: 50%;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: var(--transition);
    z-index: 10;
}

.slider-btn:hover {
    background: var(--text-primary);
    color: white;
}

.slider-btn.prev {
    left: -24px;
}

.slider-btn.next {
    right: -24px;
}

.slider-track .book-card {
    flex: 0 0 calc((100% - 96px) / 5);
}

/* ===== Event Banner ===== */
.event-banner {
    padding: 40px 0;
}

.event-banner .container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.banner-card {
    position: relative;
    padding: 48px;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    overflow: hidden;
    color: white;
}

.banner-card.dark {
    background: linear-gradient(135deg, #1d1d1f 0%, #3d3d3f 100%);
}

.banner-content {
    position: relative;
    z-index: 2;
}

.banner-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    opacity: 0.8;
    margin-bottom: 16px;
}

.banner-title {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 12px;
}

.banner-desc {
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 24px;
}

.banner-btn {
    display: inline-block;
    padding: 12px 24px;
    background: white;
    color: #11998e;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
}

.banner-btn:hover {
    transform: scale(1.05);
}

.banner-btn.light {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    backdrop-filter: blur(10px);
}

.banner-deco {
    position: absolute;
    right: -50px;
    top: -50px;
}

.circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.circle.c1 {
    width: 200px;
    height: 200px;
    top: 0;
    right: 0;
}

.circle.c2 {
    width: 150px;
    height: 150px;
    top: 100px;
    right: 80px;
}

/* ===== Recommendations ===== */
.recommend-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.recommend-card {
    display: flex;
    gap: 24px;
    padding: 24px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    transition: var(--transition);
    cursor: pointer;
}

.recommend-card:hover {
    background: var(--bg-primary);
    box-shadow: var(--shadow-md);
}

.recommend-cover {
    flex-shrink: 0;
    width: 100px;
    height: 140px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-tertiary);
}

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

.recommend-info {
    display: flex;
    flex-direction: column;
}

.recommend-category {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
}

.recommend-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
}

.recommend-author {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: auto;
}

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

/* ===== Reviews ===== */
.reviews {
    background: var(--bg-secondary);
}

.review-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.review-card {
    background: var(--bg-primary);
    padding: 32px;
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.review-card:hover {
    box-shadow: var(--shadow-md);
}

.review-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.review-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 18px;
}

.review-user {
    flex: 1;
}

.review-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.review-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.review-rating {
    color: #ffc107;
    font-size: 14px;
}

.review-book {
    font-size: 13px;
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 12px;
}

.review-text {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-tertiary);
}

/* ===== Footer ===== */
.footer {
    background: var(--text-primary);
    color: white;
    padding: 80px 0 40px;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    padding-bottom: 48px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 32px;
}

.footer-brand .logo {
    color: white;
    margin-bottom: 16px;
    display: block;
}

.footer-desc {
    font-size: 14px;
    opacity: 0.7;
    line-height: 1.7;
    margin-bottom: 24px;
}

.social-links {
    display: flex;
    gap: 16px;
}

.social-link {
    font-size: 13px;
    opacity: 0.7;
    transition: var(--transition);
}

.social-link:hover {
    opacity: 1;
}

.footer-links {
    display: flex;
    gap: 80px;
}

.footer-column h4 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-column a {
    display: block;
    font-size: 14px;
    opacity: 0.7;
    margin-bottom: 12px;
    transition: var(--transition);
}

.footer-column a:hover {
    opacity: 1;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-bottom p {
    font-size: 13px;
    opacity: 0.5;
}

.footer-legal {
    display: flex;
    gap: 24px;
}

.footer-legal a {
    font-size: 13px;
    opacity: 0.7;
    transition: var(--transition);
}

.footer-legal a:hover {
    opacity: 1;
}

/* ===== Modal ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
    transform: scale(0.95);
    transition: var(--transition);
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: var(--transition);
    z-index: 10;
}

.modal-close:hover {
    background: var(--text-primary);
    color: white;
}

.modal-body {
    display: flex;
    gap: 40px;
    padding: 48px;
}

.modal-book-cover {
    flex-shrink: 0;
    width: 250px;
    height: 350px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
}

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

.modal-info {
    flex: 1;
}

.modal-category {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 12px;
}

.modal-title {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 12px;
}

.modal-author {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.modal-desc {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-tertiary);
    margin-bottom: 32px;
}

.modal-price {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.modal-price .price-original {
    font-size: 16px;
}

.modal-price .price-sale {
    font-size: 24px;
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.btn-cart, .btn-buy {
    flex: 1;
    padding: 16px 32px;
    border-radius: var(--radius-lg);
    font-size: 16px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-cart {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-cart:hover {
    background: var(--border-color);
}

.btn-buy {
    background: var(--primary);
    color: white;
}

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

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .category-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .book-grid {
        grid-template-columns: repeat(4, 1fr);
    }

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

    .footer-links {
        gap: 48px;
    }
}

@media (max-width: 768px) {
    .nav {
        display: none;
    }

    .search-box {
        width: 200px;
    }

    .hero-title {
        font-size: 40px;
    }

    .hero-image {
        display: none;
    }

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

    .book-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .event-banner .container {
        grid-template-columns: 1fr;
    }

    .recommend-grid {
        grid-template-columns: 1fr;
    }

    .review-grid {
        grid-template-columns: 1fr;
    }

    .footer-top {
        flex-direction: column;
        gap: 48px;
    }

    .footer-links {
        flex-wrap: wrap;
        gap: 32px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .modal-body {
        flex-direction: column;
        padding: 32px;
    }

    .modal-book-cover {
        width: 100%;
        height: 300px;
    }
}

@media (max-width: 480px) {
    .header-inner {
        height: 56px;
    }

    .logo {
        font-size: 20px;
    }

    .search-box {
        width: 140px;
    }

    .hero {
        min-height: 500px;
    }

    .hero-slider {
        height: 500px;
    }

    .hero-title {
        font-size: 32px;
    }

    .hero-desc {
        font-size: 15px;
    }

    .section {
        padding: 48px 0;
    }

    .section-title {
        font-size: 24px;
    }

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

    .category-item {
        padding: 16px 8px;
    }

    .category-icon {
        font-size: 24px;
    }

    .category-item span {
        font-size: 11px;
    }
}
