/* 全域變數 (Global Variables) */
:root {
    /* 色彩 (Colors) */
    --bg-primary: #FDFBF7;
    /* 溫暖米白 */
    --bg-secondary: #F3F0EB;

    --text-primary: #2C3E50;
    --text-secondary: #64748B;
    --text-light: #94A3B8;

    --accent-color: #6B8E88;
    /* 鼠尾草綠 - 療癒感 */
    --accent-hover: #55726D;
    --accent-light: #E0E9E8;

    --card-bg: #FFFFFF;

    /* 裝飾 (Decoration) */
    --border-radius: 16px;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05);

    /* 字體 (Fonts) */
    --font-heading: 'Noto Sans TC', sans-serif;
    --font-body: 'Noto Sans TC', sans-serif;
    /* 若無法載入則使用系統字體 */
}

/* 重置 (Reset) */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

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

/* 導覽列 (Navbar) */
.navbar {
    background: rgba(253, 251, 247, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
}

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

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
    letter-spacing: 0.05em;
}

.logo img {
    height: 36px;
    width: auto;
    margin-right: 8px;
    vertical-align: middle;
}

.logo-sub {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-left: 0.5rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
    position: relative;
}

.nav-links a.active,
.nav-links a:hover {
    color: var(--accent-color);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.login-btn {
    border: 1px solid var(--accent-color);
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    color: var(--accent-color);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.login-btn:hover {
    background: var(--accent-color);
    color: white;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* 主視覺區塊 (Hero Section) */
.hero {
    padding: 6rem 0;
    background-color: #fff;
    position: relative;
    border-bottom: 1px solid #eee;
}

.hero::before {
    display: none;
}

.hero-layout {
    display: flex;
    align-items: center;
    gap: 4rem;
    justify-content: space-between;
}

@media (max-width: 992px) {
    .hero-layout {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }

    .hero-content-box {
        text-align: center;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-image-box {
        justify-content: center;
    }
}

.hero-content-box {
    flex: 1;
    text-align: left;
}

.hero-image-box {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.hero-featured-img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.page-title {
    font-size: 2.25rem;
    /* 32px is approx 2rem-2.25rem */
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #333;
    line-height: 1.3;
    text-shadow: none;
}

.page-subtitle {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 2rem;
    font-weight: 400;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.8rem 1.8rem;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s;
    text-decoration: none;
}

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

.btn-secondary {
    background-color: transparent;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.page-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0 auto;
    font-weight: 300;
}

/* 主要內容區 (Main Content) */
.main-content {
    padding: 2rem 2rem 6rem;
}

.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 3rem;
}

@media (max-width: 480px) {
    .course-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* 課程卡片 (Course Cards) */
.course-card {
    background: #fff;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    transition: all 0.3s ease;
    border: none;
    display: flex;
    flex-direction: column;
}

.course-card:hover {
    transform: none;
    box-shadow: none;
}

/* 課程卡片圖片 (Course Card Image) */
.course-img {
    width: 100%;
    aspect-ratio: 1 / 1.1;
    /* More vertical for "DM" feel */
    object-fit: contain;
    /* Changed from cover to avoid cropping */
    background-color: #f9f9f9;
    display: block;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.img-contain {
    object-fit: contain !important;
    aspect-ratio: auto !important;
}

/* 品牌識別 (Branding) */
/* 社交媒體與聯絡資訊增強 (Social Media & Contact Info Enhancements) */
.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-icon {
    width: 36px;
    height: 36px;
    background: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.social-icon:hover {
    transform: translateY(-3px);
    background: var(--accent-light);
    box-shadow: var(--shadow-md);
}

.social-icon img {
    width: 20px;
    height: 20px;
}

.contact-info p {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.contact-signage {
    max-width: 200px;
    border-radius: 8px;
    margin-top: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.meta-info {
    margin-top: auto;
    font-size: 0.85rem;
    color: #999;
    padding-top: 1rem;
    border-top: 1px dashed rgba(0, 0, 0, 0.05);
}

.tag {
    font-size: 0.75rem;
    color: var(--accent-color);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.course-card h3 {
    font-size: 1.17rem;
    /* approx 18.72px */
    margin-bottom: 0.8rem;
    font-weight: 700;
    color: #333;
}

.course-card p {
    font-size: 1rem;
    /* 16px */
    color: #333;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.read-more {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--accent-color);
    align-self: flex-start;
}

.read-more:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* 頁尾 (Footer) */
.site-footer {
    background-color: var(--bg-secondary);
    padding: 4rem 2rem 2rem;
    color: var(--text-secondary);
}

.footer-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.footer-section h4 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 1.2rem;
    font-weight: 500;
}

.footer-section p {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    max-width: 300px;
}

.newsletter-form {
    display: flex;
    gap: 0.5rem;
}

.newsletter-form input {
    padding: 0.6rem 1rem;
    border-radius: 4px;
    border: 1px solid #ccc;
    background: white;
    font-size: 0.9rem;
    flex-grow: 1;
}

.newsletter-form button {
    padding: 0.6rem 1.2rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.newsletter-form button:hover {
    background: var(--accent-hover);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

/* 關於我們頁面樣式 (About Page Styles) */
.about-content {
    padding-top: 0;
}

.about-section {
    padding: 4rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.about-section:last-child {
    border-bottom: none;
}

.about-section.alt-bg {
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: var(--border-radius);
    padding: 4rem 2rem;
    margin: 2rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2rem;
    font-weight: 300;
    color: var(--text-primary);
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}

.divider {
    width: 60px;
    height: 3px;
    background-color: var(--accent-color);
    margin: 0 auto;
    border-radius: 2px;
}

.text-content p {
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.8;
}

.feature-list {
    max-width: 800px;
    margin: 2rem auto;
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.feature-list li {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-secondary);
}

.feature-list li::before {
    content: '•';
    color: var(--accent-color);
    position: absolute;
    left: 0;
    font-weight: bold;
}

.split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

@media (max-width: 768px) {
    .split-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

.feature-img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: var(--border-radius);
    display: block;
    box-shadow: var(--shadow-md);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.service-item {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: transform 0.3s ease;
}

.service-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.service-item h3 {
    color: var(--accent-color);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.service-item p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* 場地租借藝廊 (Venue Gallery) */
.venue-gallery {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
    margin-top: 3rem;
}

.venue-item {
    background: #fff;
    padding: 10px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 450px;
    /* 控制統一高度 */
}

.venue-item img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.venue-item img:hover {
    transform: scale(1.02);
}

@media (max-width: 992px) {
    .venue-gallery {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* 響應式調整 (Responsive) */
@media (max-width: 768px) {

    .nav-links,
    .nav-actions {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    .hero {
        padding: 4rem 0 3rem;
    }

    .page-title {
        font-size: 2rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* 關於我們頁面 RWD */
    .split-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-section.alt-bg {
        padding: 2rem 1rem;
    }
}

/* 購物車側邊欄增強 (Cart Sidebar Enhancements) */
.cart-sidebar {
    position: fixed;
    right: -400px;
    top: 0;
    width: 350px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.active {
    right: 0;
}

.cart-header {
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-items {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.cart-item {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #f5f5f5;
}

.cart-item-info h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.cart-item-info p {
    margin: 4px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.cart-item-price {
    font-weight: 700;
    color: var(--accent-color);
}

.cart-item-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f8f9fa;
    padding: 2px 8px;
    border-radius: 4px;
}

.quantity-controls button {
    background: none;
    border: none;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0 4px;
}

.quantity-controls span {
    font-size: 0.9rem;
    min-width: 20px;
    text-align: center;
    font-weight: 500;
}

.remove-btn {
    background: none;
    border: none;
    color: #ff4757;
    font-size: 0.8rem;
    cursor: pointer;
}

.empty-cart-msg {
    text-align: center;
    color: #999;
    margin-top: 3rem;
}

.cart-footer {
    padding: 1.5rem;
    background: #fdfcfb;
    border-top: 1px solid #eee;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 700;
}

/* 按鈕反饋動畫 (Button Feedback) */
.add-to-cart-btn.added {
    background-color: #2ED573 !important;
    border-color: #2ED573 !important;
}

.cart-floating-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background: var(--accent-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(107, 142, 136, 0.3);
    z-index: 1000;
    transition: transform 0.2s;
}

.cart-floating-btn:hover {
    transform: scale(1.1);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    font-size: 0.75rem;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 5px;
    font-weight: 700;
}

/* 結帳頁面美化 (Checkout Page Aesthetics) */
.checkout-container {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 2.5rem;
    margin: 4rem auto;
    align-items: start;
}

@media (max-width: 992px) {
    .checkout-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

.checkout-card {
    background: white;
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f0f0;
}

.checkout-card h2,
.checkout-card h3 {
    margin-top: 0;
    margin-bottom: 2rem;
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    border-bottom: 2px solid #f8f9fa;
    padding-bottom: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 1rem;
    border: 1.5px solid #eee;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fafafa;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(107, 142, 136, 0.1);
}

.order-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #f5f5f5;
}

.order-summary-item:last-child {
    border-bottom: none;
}

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

.item-name {
    font-weight: 600;
    color: var(--text-primary);
}

.item-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

.item-price {
    font-weight: 700;
    color: var(--accent-color);
}

.checkout-total-row {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-label {
    font-size: 1.2rem;
    font-weight: 500;
}

.total-amount {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent-color);
    font-family: 'Outfit', sans-serif;
}

.place-order-btn {
    width: 100%;
    padding: 1.2rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.8rem;
}

.place-order-btn:hover {
    background: #5a7a74;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(107, 142, 136, 0.3);
}

.place-order-btn:active {
    transform: translateY(0);
}