/* 相關文章區塊樣式 */
.related-articles-section {
    margin-top: 3rem;
    margin-bottom: 3rem;
    padding: 2rem 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
}

.related-articles-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding: 0 1rem;
}

.related-articles-title {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1rem;
    position: relative;
}

.related-articles-divider {
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #2980b9);
    margin: 0 auto;
    border-radius: 2px;
}

/* 相關文章列表樣式 */
.related-articles-list {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

.related-article-item {
    display: flex;
    align-items: flex-start;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
}

    .related-article-item:last-child {
        border-bottom: none;
    }

    .related-article-item:hover {
        background-color: rgba(52, 152, 219, 0.02);
        border-radius: 8px;
        padding-left: 1rem;
        padding-right: 1rem;
    }

.article-marker {
    flex-shrink: 0;
    margin-right: 1rem;
    margin-top: 0.3rem;
}

.marker-dot {
    display: block;
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
}

.related-article-item:hover .marker-dot {
    width: 12px;
    height: 12px;
    margin-top: -2px;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.article-content {
    flex-grow: 1;
}

.article-title {
    margin-bottom: 0.8rem;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.4;
    color: #2c3e50;
}

.article-link {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

    .article-link:hover {
        color: #3498db;
        text-decoration: none;
    }

.article-description {
    color: #6c757d;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more {
    font-size: 0.9rem;
    font-weight: 500;
}

.read-more-link {
    color: #3498db;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 500;
}

    .read-more-link:hover {
        color: #2980b9;
        text-decoration: none;
        transform: translateX(3px);
    }

/* 響應式設計 */
@media (max-width: 768px) {
    .related-articles-section {
        margin: 2rem 0;
        padding: 1.5rem 0;
        border-radius: 8px;
    }

    .related-articles-list {
        padding: 0 0.5rem;
    }

    .related-article-item {
        padding: 0.5rem 0;
    }

    .related-articles-title {
        font-size: 1.6rem;
    }

    .article-title {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .related-articles-section {
        margin: 1.5rem 0;
        padding: 1rem 0;
    }

    .related-article-item {
        padding: 0.5rem 0;
    }

    .related-articles-title {
        font-size: 1.4rem;
    }

    .article-marker {
        margin-right: 0.8rem;
    }
}

/* =======================================
   Modal 跳出視窗樣式 (適用於 Bootstrap Modal)
   ======================================= */

/* 自定義 Bootstrap Modal 樣式 */
#PopupAdsModal .modal-dialog {
    max-width: 70vw;
    max-height: 80vh;
    margin: 5vh auto;
    padding: 25px; /* 新增：給按鈕留出空間 */
}

#PopupAdsModal .modal-content {
    position: relative;
    height: 80vh;
    border: none;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: visible; /* 改為 visible，讓按鈕可以超出邊界 */
}

#PopupAdsModal .modal-body {
    padding: 20px;
    overflow-y: auto;
    height: 100%;
    border-radius: 16px; /* 保持圓角 */
}

/* 關閉按鈕樣式 - 位於右上角外側 */
#PopupAdsModal .btn-close-custom {
    position: absolute;
    top: -20px;
    right: -20px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
    color: #666;
    z-index: 1050;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

    #PopupAdsModal .btn-close-custom:hover {
        background: rgba(255, 255, 255, 1);
        color: #333;
        transform: scale(1.1);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }

/* 美化滾動條 */
#PopupAdsModal .modal-body::-webkit-scrollbar {
    width: 8px;
}

#PopupAdsModal .modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#PopupAdsModal .modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

    #PopupAdsModal .modal-body::-webkit-scrollbar-thumb:hover {
        background: #a8a8a8;
    }

/* Modal 動畫效果 */
@keyframes modalBounce {
    0% {
        transform: scale(0.7);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

#PopupAdsModal.show .modal-dialog {
    animation: modalBounce 0.5s ease;
}

/* 響應式設計 - Modal */
@media (max-width: 768px) {
    #PopupAdsModal .modal-dialog {
        max-width: 90vw;
        max-height: 85vh;
        margin: 7.5vh auto;
        padding: 22px; /* 調整 padding */
    }

    #PopupAdsModal .modal-content {
        height: 85vh;
    }

    #PopupAdsModal .modal-body {
        padding: 15px;
    }

    #PopupAdsModal .btn-close-custom {
        top: -18px;
        right: -18px;
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    #PopupAdsModal .modal-dialog {
        max-width: 95vw;
        max-height: 90vh;
        margin: 5vh auto;
        padding: 20px; /* 調整 padding */
    }

    #PopupAdsModal .modal-content {
        height: 90vh;
        border-radius: 12px;
    }

    #PopupAdsModal .modal-body {
        padding: 12px;
    }

    #PopupAdsModal .btn-close-custom {
        top: -16px;
        right: -16px;
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
}


/* 商品輪播展示區樣式 */
.product-carousel-section {
    margin-top: 3rem;
    margin-bottom: 3rem;
    padding: 2rem 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
}

.product-carousel-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding: 0 1rem;
}

.product-carousel-header-title {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.product-carousel-divider {
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #2980b9);
    margin: 0 auto;
    border-radius: 2px;
}

.product-carousel-container {
    display:flex;
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px; /* 增加左右間距給按鈕 */
}

.product-carousel-slider {
    overflow: hidden;
    border-radius: 12px;
}

.product-carousel-track {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
    will-change: transform;
}

.product-carousel-item {
    /* 電腦版：確保只顯示4個商品 */
    flex: 0 0 auto; /* 【新增】改為 auto */
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
    margin-right: 1.5rem; /* 【新增】用 margin 控制間距 */
}

    .product-carousel-item:hover {
        transform: translateY(-8px);
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    }

.product-carousel-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.product-carousel-image-wrapper {
    width: 100%;
    height: 240px;
    overflow: hidden;
    position: relative;
    background: #f8f9fa;
}

.product-carousel-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-carousel-item:hover .product-carousel-image {
    transform: scale(1.05);
}

.product-carousel-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 120px;
}

    .product-carousel-content .product-carousel-title {
        font-size: 1.1rem;
        font-weight: 600;
        color: #2c3e50;
        margin: 0 0 0.8rem 0;
        line-height: 1.4;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        flex-shrink: 0;
    }

.product-carousel-description {
    font-size: 0.9rem;
    color: #6c757d;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

/* 導航按鈕樣式 */
.product-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

    .product-carousel-nav:hover {
        background: #ffffff;
        box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
        transform: translateY(-50%) scale(1.1);
    }

    .product-carousel-nav:disabled {
        opacity: 0.3 !important;
        cursor: not-allowed !important;
        transform: translateY(-50%) scale(0.9) !important;
    }

    .product-carousel-nav svg {
        color: #2c3e50;
        transition: color 0.3s ease;
    }

    .product-carousel-nav:hover svg {
        color: #3498db;
    }

.product-carousel-nav--prev {
    left: 10px;
}

.product-carousel-nav--next {
    right: 10px;
}

/* 響應式設計 - 平板 */
@media (max-width: 1024px) {
    .product-carousel-container {
        padding: 0 10px;
    }

    .product-carousel-image-wrapper {
        height: 200px;
    }
}

/* 響應式設計 - 手機版 */
@media (max-width: 768px) {
    .product-carousel-container {
        padding: 0 10px;
    }

    .product-carousel-image-wrapper {
        height: 162px; /* 【修改】從 180px 縮小到 162px (約10%) */
    }

    .product-carousel-content {
        padding: 0.9rem; /* 【修改】從 1rem 縮小到 0.9rem (約10%) */
        height: 90px; /* 【修改】從 100px 縮小到 90px (約10%) */
    }

    .product-carousel-nav {
        width: 40px;
        height: 40px;
    }

        .product-carousel-nav svg {
            width: 16px;
            height: 16px;
        }
}

@media (max-width: 480px) {
    .product-carousel-section {
        padding: 1.5rem 0;
    }

    .product-carousel-container {
        padding: 0 10px;
    }

    .product-carousel-image-wrapper {
        height: 144px; /* 【修改】從 160px 縮小到 144px (約10%) */
    }

    .product-carousel-content {
        padding: 0.72rem; /* 【修改】從 0.8rem 縮小到 0.72rem (約10%) */
        height: 81px; /* 【修改】從 90px 縮小到 81px (約10%) */
    }

        .product-carousel-content .product-carousel-title {
            font-size: 0.855rem; /* 【修改】從 0.95rem 縮小到 0.855rem (約10%) */
            margin-bottom: 0.45rem; /* 【修改】從 0.5rem 縮小到 0.45rem (約10%) */
        }

    .product-carousel-description {
        font-size: 0.72rem; /* 【修改】從 0.8rem 縮小到 0.72rem (約10%) */
        -webkit-line-clamp: 1;
    }
}
