:root {
    --primary-color: #333;
    --secondary-color: #f4f4f4;
    --accent-color: #8b5cf6;
    --text-color: #333;
    --white: #fff;
}

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

:root {
    --primary-color: #ffffff;
    --background-color: #121212;
    --card-bg: #1e1e1e;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --accent-color: #8b5cf6; /* Modern Violet */
    --accent-hover: #7c3aed;
    --border-color: #333333;
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-primary);
}

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

header {
    background-color: var(--card-bg);
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
    text-decoration: none;
}

.cart-icon {
    font-size: 1.2rem;
    cursor: pointer;
    background: #333;
    padding: 8px 12px;
    border-radius: 20px;
    transition: background 0.2s;
}

.cart-icon:hover {
    background: #444;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    padding: 40px 0;
}

.product-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0,0,0,0.5);
    border-color: var(--accent-color);
}

.product-image {
    width: 100%;
    height: 250px;
    object-fit: contain; /* Shows full image */
    margin-bottom: 15px;
    /* background-color: #000; Removed potentially ugly background */
    border-radius: 8px;
    padding: 10px;
}

.product-info h3 {
    margin: 10px 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.product-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 0; /* Removing button space */
}

/* Product Detail Page Styles */
.back-link {
    display: inline-block;
    color: var(--text-secondary);
    text-decoration: none;
    margin: 20px 0;
    font-size: 0.9rem;
}

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

.product-detail-layout {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
    background: var(--card-bg);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.product-detail-image-wrapper {
    flex: 1;
    min-width: 300px;
    /* max-width removed to allow equal column width */
    display: flex;
    justify-content: center;
    align-items: center;
}

.product-detail-image {
    max-width: 100%;
    width: auto; /* Allow image to be centered rather than forced full width */
    max-height: 400px; /* Limit height */
    border-radius: 12px;
    object-fit: contain;
}

.product-detail-info {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.product-detail-info h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.product-description {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 20px;
    white-space: pre-line;
}

.product-features-box {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    padding: 16px 18px;
    margin-bottom: 24px;
}

.product-features-title {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.product-features-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.product-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.feature-tick {
    color: #34d399;
    font-weight: 700;
    line-height: 1.4;
}

.product-price-large {
    font-size: 2rem;
    color: var(--accent-color);
    margin-bottom: 30px;
}

.add-to-cart-btn-large {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-weight: 600;
    width: fit-content;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.add-to-cart-btn-large:hover {
    background-color: var(--accent-hover);
}

/* Modal Styles - Dark Theme Adaptation */
.modal {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8); /* Darkened overlay */
    z-index: 1000;
}

.modal.hidden {
    display: none !important;
}

.hidden {
    display: none !important;
}

.modal-content {
    background-color: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 25px rgba(0,0,0,0.8);
    max-height: 90vh;
    overflow-y: auto;
    width: 90%;
    max-width: 500px;
}

.close-btn {
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
}

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

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

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

input {
    background-color: #2d2d2d !important;
    border: 1px solid #444 !important;
    color: white !important;
}

input:focus {
    border-color: var(--accent-color) !important;
    outline: none;
}

/* Ensure Stripe elements blend in slightly better, though they are iframes */
#address-element, #payment-element {
    margin-top: 10px;
}

.cart-item {
    border-bottom: 1px solid var(--border-color);
    padding: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-item-details h4 {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
}

.cart-item-details p {
    margin: 0;
    color: var(--text-secondary);
}

.cart-total {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
    text-align: right;
    font-size: 1.2rem;
}

.policy-link {
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: underline;
    transition: color 0.2s;
}

.policy-link:hover {
    color: var(--accent-color);
}

.policy-content h2, .policy-content h3 {
    color: var(--text-primary);
    margin-top: 20px;
    margin-bottom: 10px;
}

.policy-content p, .policy-content ul {
    margin-bottom: 15px;
    color: var(--text-secondary);
}

.remove-btn {
    background: transparent;
    color: #ef4444;
    border: 1px solid #ef4444;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.checkout-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    width: 100%;
    transition: background-color 0.2s, transform 0.1s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.checkout-btn:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px rgba(0,0,0,0.3);
}

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

.checkout-btn:disabled {
    background-color: #555;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.checkout-field-label {
    display: block;
    margin-bottom: 4px;
    font-weight: 700;
    color: var(--text-primary);
}

.checkout-field-help {
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.success-modal-content {
    max-width: 560px;
    padding: 28px;
    text-align: left;
}

.success-modal-content h2 {
    margin-bottom: 14px;
}

.success-modal-content p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.checkout-policy-consent {
    margin-top: 14px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.checkout-policy-consent input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-color);
    margin-right: 2px;
}

.checkout-policy-link {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: var(--text-secondary);
    text-decoration: underline;
    cursor: pointer;
    font: inherit;
}

.checkout-policy-link:hover {
    color: var(--accent-color);
}

/* Hero Section Styles */
.hero-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
    gap: 32px;
    max-width: 100%;
}

.hero-badge-container {
    display: flex;
    justify-content: center;
}

.badge-btn {
    background-color: #27272a; /* Zinc 800ish */
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 9999px;
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s;
}

.badge-btn:hover {
    background-color: #3f3f46;
}

.hero-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center;
    max-width: 800px;
    width: 100%;
}

.hero-title {
    font-size: 1.8rem;
    line-height: 1.2;
    font-weight: 400;
    letter-spacing: -0.02em;
    margin: 0;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

@media (min-width: 380px) {
    .hero-title {
        font-size: 2.2rem;
    }
}

@media (min-width: 480px) {
    .hero-title {
        font-size: 3rem;
        line-height: 1.1;
    }
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 4.5rem;
        flex-direction: column; /* Still stacked per design "This is something" then animated word */
    }
}

/* To match the design: "This is something" [Animated] are on the same line or wrapped naturally */
.hero-title span {
    display: inline-block;
}

.hero-static-text {
    color: #cffafe; /* Cyan 100 */
}

.hero-animated-wrapper {
    position: relative;
    display: block; /* content-based width, but children are absolute */
    width: 100%;
    overflow: hidden;
    height: 1.25em; /* Ensure height matches text slightly better */
    /* Removed fixed min-width to allow longer text */
}

.hero-animated-word {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    text-align: center;
    font-weight: 600;
    
    /* Default State: Hidden below */
    opacity: 0;
    transform: translateY(150px);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.5s ease;
}

/* Active State: Visible */
.hero-animated-word.active {
    opacity: 1;
    transform: translateY(0);
}

/* Exit State: Hidden above */
.hero-animated-word.exit-up {
    opacity: 0;
    transform: translateY(-150px);
}

/* Previous State (for cycling back): Hidden below or similar */
.hero-animated-word.exit-down {
    opacity: 0;
    transform: translateY(150px);
}

.hero-description {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 600px;
    text-align: center;
    margin: 0;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.store-badges-section {
    margin-top: 30px;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.store-badge-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.store-badge-image {
    height: 50px;
    width: auto;
    display: block;
}

.advantages-section {
    padding: 20px 0 10px;
}

.advantages-header {
    text-align: center;
    max-width: 760px;
    margin: 0 auto;
}

.advantages-header h2 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.advantages-header p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.advantages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    margin-top: 28px;
}

.adv-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 22px;
    text-align: center;
}

.adv-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid var(--border-color);
}

.adv-icon i {
    font-size: 1.35rem;
    color: var(--accent-color);
}

.adv-card h3 {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.adv-card p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
}

.btn-hero-outline, .btn-hero-primary {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-hero-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-hero-outline:hover {
    background: var(--card-bg);
}

.btn-hero-primary {
    background: var(--text-primary);
    color: var(--background-color);
    border: 1px solid var(--text-primary);
}

.btn-hero-primary:hover {
    opacity: 0.9;
}

.contact-page-section {
    max-width: 760px;
}

.contact-page-section h1 {
    margin-bottom: 20px;
}

.contact-info-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.contact-info-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.contact-label {
    min-width: 90px;
    font-weight: 600;
    color: var(--text-primary);
}

.contact-value {
    color: var(--text-secondary);
    min-height: 1.2em;
}

/* Navigation Toggle Header */
.header-left {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-toggle {
    display: flex;
    gap: 15px;
    font-size: 0.95rem;
    font-weight: 600;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

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

.nav-link.active {
    color: var(--accent-color);
    border-bottom: 2px solid var(--accent-color);
}

/* Teams Page Professional Hero */
.teams-hero {
    background: linear-gradient(135deg, #1e1e1e 0%, #121212 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 60px 40px;
    text-align: center;
    margin: 20px 0 40px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.teams-hero h1 {
    font-size: 2.8rem;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.teams-hero p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.6;
}

/* =========================================
   Mobile Responsive Adjustments
   ========================================= */
@media (max-width: 768px) {
    /* 頂部導覽列優化：自動斷行避免擁擠 */
    .header-content {
        flex-wrap: wrap;
        padding: 12px 15px;
    }
    
    .header-left {
        display: contents; /* 使 logo 與 nav 獨立融入父元素的 Flex 佈局 */
    }
    
    .logo {
        font-size: 1.25rem;
        order: 1; /* 標題靠左 */
    }
    
    .header-content > div:last-child {
        order: 2; /* 購物車與語言按鈕靠右 */
        gap: 10px !important;
    }
    
    .nav-toggle {
        order: 3; /* 個人與企業導覽推移至第二行置中顯示 */
        width: 100%;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid var(--border-color);
        justify-content: center;
        font-size: 0.95rem;
        gap: 20px;
    }
    
    /* 縮小手機版頂部按鈕 */
    .lang-btn {
        width: 32px !important;
        height: 32px !important;
        font-size: 12px !important;
    }
    
    .cart-icon {
        font-size: 0.95rem;
        padding: 6px 12px;
    }
    
    /* 產品介紹頁面與字體大小修正 */
    .product-detail-layout {
        padding: 25px 15px;
        gap: 20px;
    }
    
    .product-detail-image-wrapper, 
    .product-detail-info {
        min-width: 100%; /* 強制上下排列 */
    }
    
    .product-detail-info h1 {
        font-size: 1.6rem;
        line-height: 1.35;
        margin-bottom: 12px;
    }
    
    .product-description {
        font-size: 0.95rem;
        line-height: 1.5;
        margin-bottom: 15px;
    }
    
    .product-price-large {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }
    
    .add-to-cart-btn-large {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
    }
    
    /* Teams 頁面及產品方案（修正過大文字版面） */
    .teams-hero {
        padding: 30px 15px;
        margin: 10px 0 20px 0;
    }
    
    .teams-hero h1 {
        font-size: 1.6rem;
        line-height: 1.35;
        margin-bottom: 12px;
    }
    
    .teams-hero p {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
}