/* Base Styles (Desktop) */
.hero-section {
    display: flex;
    align-items: center;
    gap: 40px;
    max-width: 1280px;
    margin: 80px auto;
    position: relative;
}

/* 左側內容區 */
.hero-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
    justify-content: center;
    margin-left: 60px;
}

.hero-title {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hero-title-primary {
    font-family: var(--font-primary);
    font-size: 64px;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.2;
}

.hero-title-secondary {
    font-family: var(--font-secondary);
    font-size: 48px;
    font-weight: 700;
    color: var(--color-secondary);
    line-height: 1.3;
}

.hero-description {
    /* Description */

    font-family: 'DM Sans';
    font-style: normal;
    font-weight: 500;
    font-size: 20px;
    line-height: 33px;
    /* or 165% */
    text-align: justify;

    color: #000000;


    display: flex;
    max-width: 550px;
    flex-direction: column;
    gap: 20px;
}

.hero-text {
    font-family: var(--font-secondary);
    font-size: 1.1rem;
    color: var(--color-secondary);
    line-height: 1.8;
}

.hero-download-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: nowrap;
    width: 100%;
}

.download-btn {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 14px;
    height: 60px;
    min-width: 200px;
    max-width: 270px;
    padding: 0 28px;
    background: #000000;
    color: #FFFFFF;
    border-radius: 999px;
    text-decoration: none;
    font-family: var(--font-secondary);
    transition: all 0.3s ease;
}

.download-btn:hover {
    background: #333333;
    transform: translateY(-2px);
}

.download-btn i {
    font-size: 2rem;
}

.google-play-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.download-btn-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.download-btn-text-top {
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.85);
}

.download-btn-text-bottom {
    margin-top: 2px;
    font-size: 1.05rem;
    color: #FFFFFF;
}

.download-btn-google {
    background: #000000;
}

.download-btn-google:hover {
    background: #333333;
}

/* Google Play 图标使用官方品牌颜色 */
.google-play-icon path:nth-child(1) {
    fill: #4285F4;
}

.google-play-icon path:nth-child(2) {
    fill: #34A853;
}

.google-play-icon path:nth-child(3) {
    fill: #FBBC05;
}

.google-play-icon path:nth-child(4) {
    fill: #EA4335;
}

.hero-brands {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.brand-logo {
    width: auto;
    opacity: 0.8;
    transition: opacity 0.3s ease;
    vertical-align: middle;
}

.brand-logo:hover {
    opacity: 1;
}

/* 平板手機專用品牌 LOGO - 顯示在最下方，滿寬 */
.hero-brands-tablet-bottom {
    display: none;
    /* 桌面版預設隱藏 */
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-top: 20px;
    margin-bottom: 40px;
}

.hero-phone-image {
    margin-right: 60px;
    width: 100%;
    max-width: 320px;
    height: auto;
    object-fit: contain;
}

/* Laptop/Small Desktop (<= 1200px) */
/* 1200px以下就放棄左右 margin */
@media (max-width: 1200px) {
    .hero-content {
        margin-left: 20px;
    }

    .hero-phone-image {
        margin-right: 20px;
    }
}

@media (max-width: 960px) {
    .hero-content {
        margin-left: 0px;
    }

    .hero-phone-image {
        margin-right: 0px;
    }

    /* 按鈕內部間距微調 - 讓按鈕更緊湊 */
    .download-btn {
        gap: 8px;
        /* 減少 Icon 與文字的間距 */
        padding: 0 12px;
        /* 減少左右內距 */
    }

    /* 縮小 Icon */
    .download-btn i {
        font-size: 1.5rem;
    }

    .google-play-icon {
        width: 24px;
        height: 24px;
    }

    /* 縮小按鈕文字 */
    .download-btn-text-top {
        font-size: 0.6rem;
    }

    .download-btn-text-bottom {
        font-size: 0.9rem;
    }
}


/* Tablet Layout (768px - 1024px) */
/* 平板版保持左右佈局，但縮小間距與尺寸 */
@media (max-width: 1024px) {
    .hero-section {
        gap: 30px;
        margin: 60px auto;
        /* 確保維持 Row 佈局 */
        flex-direction: row;
        text-align: left;
    }

    .hero-brands {
        gap: 0;
    }

    .hero-content {
        /* margin-left: 0; 由 1200px 規則繼承 */
        display: flex;
        /* 確保是 Flex */
    }

    .hero-phone-image {
        /* margin-right: 0; 由 1200px 規則繼承 */
        max-width: 280px;
        /* 稍微縮小圖片 */
    }

    /* 平板字體調整 */
    .hero-title-primary {
        font-size: 48px;
    }

    .hero-title-secondary {
        font-size: 36px;
    }
}

/* 900px 以下隱藏原本的 brands，顯示底部的 brands */
@media (max-width: 900px) {
    .hero-brands {
        display: none !important;
    }

    .hero-brands-tablet-bottom {
        display: flex;
    }

    .download-btn {
        gap: 8px;
    }
}

/* H2 响应式字体大小 - 針對通用標題 */
@media (min-width: 768px) and (max-width: 1023px) {

    .text-5xl,
    .text-4xl,
    .text-3xl {
        font-size: 40px !important;
    }
}

/* Mobile Layout (< 768px) */
/* 手機版使用垂直堆疊與三明治排序 */
@media (max-width: 767px) {
    .hero-section {
        flex-direction: column;
        gap: 40px;
        margin: 40px auto;
        text-align: center;
        padding: 0 20px;
        /* 增加左右內距避免貼邊 */
    }

    .hero-content {
        /* 關鍵：使用 contents 讓子元素直接參與 hero-section 的 flex 佈局 */
        display: contents;
        margin-left: 0;
    }

    /* 重排順序 */
    /* 1. 標題 */
    .hero-title {
        order: 1;
        align-items: center;
        /* 讓標題文字居中 */
        width: 100%;
    }

    /* 2. 上方描述 */
    .hero-description-top {
        order: 2;
        width: 100%;
        max-width: 100%;
        align-items: center;
        /* 讓文字內容居中 */
    }

    /* 3. 手機圖片 */
    .hero-phone {
        order: 3;
        width: 100%;
        display: flex;
        justify-content: center;
        margin: 0;
    }

    .hero-phone-image {
        margin: 0;
        max-width: 260px;
        /* 手機版更小一點 */
    }

    /* 4. 下方描述 */
    .hero-description-bottom {
        order: 4;
        width: 100%;
        max-width: 100%;
        align-items: center;
    }

    /* 5. 下載按鈕 */
    .hero-download-buttons {
        order: 5;
        width: 100%;
        justify-content: space-between;
        /* 改為 space-between 確保撐開 */
        flex-wrap: nowrap;
        gap: 10px;
        /* 再次微調間距 */
        padding: 0 5px;
        /* 稍微縮減容器內距 */
    }

    .download-btn {
        flex: 1 1 0;
        /* flex-grow: 1, flex-shrink: 1, flex-basis: 0 確保完全均分 */
        width: 50%;
        /* 強制寬度計算 */
        min-width: 0;
        padding: 0 8px;
        /* 極限內距 */
        height: 56px;
        max-width: none;
        /* 移除任何最大寬度限制 */
    }

    .download-btn i {
        font-size: 1.6rem;
        /* 縮小 Icon */
    }

    .google-play-icon {
        width: 26px;
        height: 26px;
    }

    .download-btn-text-top {
        font-size: 0.65rem;
        /* 縮小上方文字 */
    }

    .download-btn-text-bottom {
        font-size: 0.95rem;
        /* 調整下方文字 */
    }

    /* 6. 品牌 Logo */
    /* 注意：因為有了全域的 900px 規則，這裡其實可以不用再寫 .hero-brands 的隱藏，但為了明確順序保留 */
    .hero-brands {
        display: none !important;
    }

    /* 底部品牌 Logo 樣式微調 (如果需要) */
    .hero-brands-tablet-bottom {
        margin-top: 10px;
    }

    /* Mobile Font Sizes */
    .hero-title-primary {
        font-size: 40px;
        /* 手機版再小一點 */
    }

    .hero-title-secondary {
        font-size: 28px;
    }

    .text-5xl,
    .text-4xl,
    .text-3xl {
        font-size: 28px !important;
    }

    h2 {
        text-align: center !important;
    }

    .banner-img {
        margin: 0 auto;
    }
}

.banner-img {
    margin: 80px auto;
    max-width: 1280px;
}

/* 手機動畫樣式預留 */
#hero-phone {
    transition: transform 0.1s ease-out, opacity 0.1s ease-out;
    will-change: transform, opacity;
}