/* ========== 全部 CSS ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}
body {
    /* 自訂背景圖片 */
    background: #1a1a1a;
    color: #fff;
    font-size: 14px;
    padding-bottom: 80px;
    overflow-x: hidden;
    line-height: 1.5;
}

/* 頂部導航 */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #242424;
    position: sticky;
    top: 0;
    z-index: 999;
    gap: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
.logo {
    font-size: 18px;
    font-weight: bold;
    color: #ff8c00;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.menu-btn {
    font-size: 18px;
    cursor: pointer;
    width: 30px;
}
.search-box {
    flex: 1;
    position: relative;
    max-width: 400px;
}
.search-input {
    width: 100%;
    /* 👇 關鍵修改：防止手機瀏覽器自動放大 */
    font-size: 16px !important;
    padding: 8px 12px 8px 36px;
    background: #333;
    border: 1px solid #444;
    border-radius: 24px; /* 更圓潤 */
    color: #fff;
    outline: none;
    transition: all 0.3s;
    appearance: none;
    -webkit-appearance: none; /* 去除 iOS 默認樣式 */
}
.search-input:focus {
    border-color: #ff8c00;
    background: #3a3a3a;
}
.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #ff8c00;
}
.nav-actions {
    display: flex;
    gap: 8px;
}
.nav-btn {
    padding: 6px 10px;
    border: 1px solid #ff8c00;
    border-radius: 4px;
    color: #ff8c00;
    text-decoration: none;
    font-size: 12px;
    white-space: nowrap;
    transition: all 0.3s;
}
.nav-btn:hover {
    background: #ff8c00;
    color: #fff;
}

/* 👇 新增：搜尋下拉樣式 */
.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    margin-top: 5px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.search-dropdown.show {
    display: block;
}
.search-result-item {
    padding: 10px 15px;
    color: #fff;
    text-decoration: none;
    display: block;
    border-bottom: 1px solid #3a3a3a;
    transition: background 0.2s;
}
.search-result-item:last-child {
    border-bottom: none;
}
.search-result-item:hover,
.search-result-item:focus {
    background: #ff8c00;
    color: #fff;
    outline: none;
}

/* 玻璃態側邊導航 */
.sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    width: 280px;
    height: 100vh;
    z-index: 1000;
    background: rgba(24, 24, 24, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding-top: 70px;
    transition: left 0.3s ease;
    text-align: left;
    border-right: 1px solid rgba(255, 140, 0, 0.2);
    box-shadow: 3px 0 8px rgba(0, 0, 0, 0.2);
}
.sidebar.active {
    left: 0;
}
.sidebar .nav-group {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 140, 0, 0.1);
}
.sidebar .nav-group-title {
    padding: 8px 20px;
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.sidebar a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #f5f5f5;
    text-decoration: none;
    font-size: 14px;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    gap: 12px;
}
.sidebar a i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    color: #ff8c00;
}
.sidebar a:hover,
.sidebar a.active {
    background: rgba(255, 140, 0, 0.15);
    border-left-color: #ff8c00;
    color: #fff;
}

/* 輪播圖 —— 修復重點區域 */
.carousel {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #242424;
}
@media (min-width: 768px) {
    .carousel {
        height: 300px;
    }
}
.carousel-inner {
    display: flex;
    width: 300%;
    height: 100%;
    transition: transform 0.5s ease-in-out;
}
.carousel-item {
    /* 每個項目佔 carousel-inner 的 1/3，等於顯示區寬度 */
    flex: 0 0 33.3333%;
    width: 33.3333%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    overflow: hidden; /* 👈 關鍵修復 */
}
.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* 👈 關鍵：圖片填滿不變形 */
    display: block;
    flex-shrink: 0;
}
.carousel-indicators {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}
.carousel-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #555;
    cursor: pointer;
    transition: background 0.3s;
}
.carousel-indicator.active {
    background: #ff8c00;
}

/* 核心業務入口 */
.services {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 15px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
@media (min-width: 768px) {
    .services {
        grid-template-columns: repeat(4, 1fr);
    }
}
.service-card {
    background: #242424;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    background: rgba(255, 140, 0, 0.1);
}
.service-icon {
    font-size: 36px;
    color: #ff8c00;
    margin-bottom: 15px;
}
.service-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #fff;
}
.service-desc {
    font-size: 13px;
    color: #ccc;
    line-height: 1.4;
}

/* 商品區域 */
.hot-products {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 15px;
}
.section-title {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #ff8c00;
    padding-bottom: 10px;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    gap: 10px;
}
.see-more {
    margin-left: auto;
    font-size: 12px;
    color: #ff8c00;
    text-decoration: none;
    padding: 4px 8px;
    border: 1px solid #ff8c00;
    border-radius: 4px;
    transition: all 0.3s;
}
.see-more:hover {
    background: #ff8c00;
    color: #fff;
}
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}
@media (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}
.product-card {
    background: #242424;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}
.product-card-img {
    height: 140px;
    background: #2d2d2d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: #ff8c00;
}
.product-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
@media (min-width: 768px) {
    .product-card-img {
        height: 180px;
        font-size: 48px;
    }
}
.product-card-info {
    padding: 12px;
}
.product-card-name {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 6px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.product-card-desc {
    font-size: 12px;
    color: #ccc;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-card-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.product-card-original-price {
    color: #999;
    text-decoration: line-through;
    font-size: 11px;
}
.product-card-discount-price {
    color: #ff6700;
    font-size: 16px;
    font-weight: bold;
}
.hot-tag {
    display: inline-block;
    background: #ff4d4d;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    margin-left: 5px;
}

/* 平台優勢 */
.advantages {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 15px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}
.advantage-card {
    background: rgba(255, 140, 0, 0.1);
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid #ff8c00;
}
.advantage-icon {
    font-size: 24px;
    color: #ff8c00;
    margin-bottom: 10px;
}
.advantage-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #fff;
}
.advantage-desc {
    font-size: 13px;
    color: #ccc;
    line-height: 1.4;
}

/* 尾部 */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #242424;
    padding: 15px 0;
    text-align: center;
    border-top: 2px solid #ff8c00;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    z-index: 998;
}
.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.footer-text {
    color: #ccc;
    font-size: 12px;
    line-height: 1.5;
}
.footer-text span {
    color: #ff8c00;
    font-weight: bold;
}
.footer-desc {
    color: #999;
    font-size: 10px;
}

/* 回到頂部 */
.back-to-top {
    position: fixed;
    bottom: 70px;
    right: 20px;
    width: 45px;
    height: 45px;
    background: #ff8c00;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(255, 140, 0, 0.5);
    transition: all 0.3s;
    opacity: 0;
    visibility: hidden;
    z-index: 999;
}
.back-to-top.show {
    opacity: 1;
    visibility: visible;
}
.back-to-top:hover {
    background: #ff6700;
    transform: translateY(-3px);
}

/* === 支付彈窗樣式 === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}
.modal-content {
    background: #2a2a2a;
    color: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    padding: 25px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    text-align: center;
}
.close-modal {
    position: absolute;
    top: 12px;
    right: 15px;
    background: none;
    border: none;
    color: #ff8c00;
    font-size: 24px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}
.close-modal:hover {
    background: rgba(255, 140, 0, 0.2);
}
.modal-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #ff8c00;
}
.payment-methods {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 15px 0;
}
.payment-method-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.payment-icon {
    font-size: 36px;
    color: #ff8c00;
    margin-bottom: 8px;
}
.payment-label {
    font-size: 13px;
    color: #ccc;
}
.payment-note {
    font-size: 12px;
    color: #999;
    margin-top: 20px;
    line-height: 1.6;
}
@media (max-width: 480px) {
    .payment-methods {
        grid-template-columns: 1fr;
    }
}