/* ===== Shop20 2.0 版本專用樣式 ===== */

/* 導航欄樣式 */
.navbar.fixed-top {
    z-index: 1030; /* Bootstrap 預設值，確保在其他元素之上 */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 主要內容區域 */
.main-content {
    padding-top: 0; /* 移除上邊距，讓Banner直接貼著導航欄 */
    margin-top: 80px; /* 調整上間距 */
}

/* 橫幅區塊樣式 */
.hero-banner {
    margin-bottom: 40px; /* 設定下間距，與上間距相等 */
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    z-index: 1; /* 確保Banner在導航欄下方 */
    margin-top: 40px; /* 與導航欄保持距離，與下間距相等 */
}

.modern-carousel {
    position: relative;
    height: 400px;
    overflow: hidden;
    border-radius: 20px;
}

.carousel-track {
    height: 100%;
}

.carousel-slide {
    position: relative;
    height: 100%;
    display: none;
}

.carousel-slide.active,
.carousel-slide:first-child {
    display: block;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.carousel-slide:hover img {
    transform: scale(1.05);
}

.carousel-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    padding: 20px;
    opacity: 0; /* 預設隱藏 */
    transition: opacity 0.3s ease;
}

.carousel-slide:hover .carousel-overlay {
    opacity: 1; /* 滑鼠懸停時顯示 */
}

.carousel-content {
    text-align: left;
    color: white;
}

.carousel-content p {
    font-size: 1rem;
    font-weight: 400;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    line-height: 1.4;
}

.carousel-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 3;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.carousel-dot.active {
    background: white;
    transform: scale(1.3);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.5);
}

/* 輪播控制按鈕 */
.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
}

.carousel-control:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.carousel-control-prev {
    left: 20px;
}

.carousel-control-next {
    right: 20px;
}

/* 滑鼠懸停時顯示控制按鈕 */
.modern-carousel:hover .carousel-control {
    opacity: 1;
    visibility: visible;
}

.hero-slide-placeholder {
    height: 400px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

/* 區塊標題樣式 */
.section-header {
    margin-bottom: 3rem;
    text-align: center;
}

/* 精選主題區塊樣式 */
.categories {
    padding-top: 0 !important; /* 移除上邊界，由 hero-banner 的 margin-bottom 控制 */
    padding-bottom: 2.5rem !important; /* 保持下邊界 */
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(45deg, #007bff, #17a2b8);
    border-radius: 2px;
}

.section-subtitle {
    font-size: 1.1rem;
    color: #6c757d;
    margin: 0;
}

/* 標籤容器樣式 */
.tags-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.tag-item {
    background: white;
    color: #007bff;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    border: 2px solid #007bff;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tag-item:hover {
    background: #007bff;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 123, 255, 0.3);
}

/* 限時搶購樣式 */
/* 限時搶購樣式已移至 css/components/flash-sale.css */

/* 限時搶購標題樣式已移至 css/components/flash-sale.css */

/* 倒數計時和價格樣式已移至 css/components/flash-sale.css */

/* 限時搶購手機版樣式已移至 css/components/flash-sale.css */

/* 限時搶購標題和網格樣式已移至 css/components/flash-sale.css */

/* 商品卡片樣式 */
.product-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    height: 100%;
    margin-bottom: 0 !important; /* 強制移除卡片底部邊距 */
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.product-card-modern {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 0 !important; /* 強制移除卡片底部邊距 */
}

.product-card-modern:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.product-image-container {
    position: relative;
    overflow: hidden;
    border-radius: 0.5rem 0.5rem 0 0;
}

.product-image,
.card_product {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image,
.product-card-modern:hover .card_product {
    transform: scale(1.05);
}

.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover .product-overlay,
.product-card-modern:hover .product-overlay {
    opacity: 1;
}

.overlay-content {
    text-align: center;
}

.product-info {
    padding: 1.5rem;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.product-title a {
    color: #212529;
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-title a:hover {
    color: #007bff;
}

/* 商品副標題樣式 */
.product-subtitle {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-subtitle {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 價格區塊改進 */
.price-section {
    margin-top: auto;
}

.original-price-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.original-price {
    text-decoration: line-through;
    color: #6c757d;
    font-size: 0.85rem;
}

.discount-badge {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 0.25rem;
    font-weight: 500;
}

.current-price, .product-price {
    color: #e74c3c;
    font-weight: 700;
    font-size: 1.1rem;
}

/* 限時搶購特殊樣式已移至 css/components/flash-sale.css */

/* 熱門商品副標題特殊樣式 */
.hot-products-section .card-subtitle {
    color: #4a5568;
}

/* 熱門商品樣式 */
.hot-products-section {
    padding: 1rem 0 0.5rem 0; /* 進一步減少上下padding */
    background: transparent; /* 預設透明背景 */
    position: relative;
    overflow: hidden;
}

/* 當有內容時顯示背景 */
.hot-products-section.has-content {
    background: transparent; /* 暫時移除背景，保持簡潔 */
}

/* 熱門商品背景容器 - 使用協調的藍色系 */
.hot-products-bg {
    background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
    border: 2px solid #3730a3;
    border-radius: 15px;
    margin: 0 auto;
    max-width: 1200px; /* 限制寬度與Banner相同 */
    padding: 1.5rem 1rem; /* 大幅縮小padding */
}

/* 熱門商品標題間距調整 */
.hot-products-header {
    margin-bottom: 0.75rem; /* 進一步縮小標題下邊界 */
}

.hot-title-wrapper {
    text-align: center;
}

.hot-title {
    margin: 0 0 0.25rem 0; /* 進一步縮小標題上下邊界 */
    color: #ffffff; /* 白色標題 */
    font-size: 1.75rem; /* 稍微縮小字體 */
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hot-subtitle {
    margin: 0; /* 移除副標題邊界 */
    color: #e0e7ff;
    font-size: 0.95rem; /* 縮小副標題字體 */
}

/* 手機版間距調整 */
@media (max-width: 768px) {
    .main-content {
        padding-top: 0;
        margin-top: 70px; /* 手機版調整上間距 */
    }
    
    .hero-banner {
        margin-top: 30px; /* 手機版上間距 */
        margin-bottom: 30px; /* 手機版下間距，與上間距相等 */
    }
    
    .categories {
        padding-top: 0 !important; /* 手機版移除上邊界 */
        padding-bottom: 2rem !important; /* 手機版保持下邊界 */
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .hot-title {
        font-size: 2rem;
    }
    
    .modern-carousel {
        height: 250px;
    }
    
    .hero-slide-placeholder {
        height: 250px;
    }
    
    /* 手機版控制按鈕調整 */
    .carousel-control {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        opacity: 1;
        visibility: visible;
    }
    
    .carousel-control-prev {
        left: 10px;
    }
    
    .carousel-control-next {
        right: 10px;
    }
    
    /* 手機版覆蓋層調整 */
    .carousel-overlay {
        padding: 15px;
    }
    
    .carousel-content p {
        font-size: 0.9rem;
    }
    
    .feature-card {
        margin-bottom: 2rem;
    }
}

/* 按鈕樣式 */
.btn-view-product {
    background: linear-gradient(45deg, #007bff, #0056b3);
    border: none;
    color: white;
    padding: 0.75rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-view-product:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 123, 255, 0.3);
    background: linear-gradient(45deg, #0056b3, #004085);
    color: white;
}

/* 功能特色樣式 */
.features-section {
    padding: 4rem 0;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    font-size: 3rem;
    color: #007bff;
    margin-bottom: 1rem;
}

.feature-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #212529;
}

.feature-text {
    color: #6c757d;
    line-height: 1.6;
}

/* 返回頂部按鈕 */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #007bff;
    color: white;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #0056b3;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.4);
}

/* 區塊間距優化 */
.browsing-history {
    padding: 1rem 0 0.5rem 0; /* 進一步減少上下padding */
}

.browsing-history .col-lg-3,
.browsing-history .col-md-4,
.browsing-history .col-sm-6 {
    margin-bottom: 0.5rem; /* 從1rem進一步減少到0.5rem */
    padding-bottom: 0.25rem; /* 從0.5rem減少到0.25rem */
}

/* 商品卡片內部邊距強制移除 */
.product-card,
.card.product-card-modern {
    margin-bottom: 0 !important; /* 強制移除卡片底部邊距 */
}

/* 行容器邊距移除 */
.hot-products-section .row,
.browsing-history .row {
    margin-bottom: 0 !important; /* 強制移除row的底部邊距 */
}

/* 商品類型標籤樣式 */
a.tag {
    position: relative;
    display: inline-block;
}

/* 基礎標籤樣式 */
a.tag::before {
    position: absolute;
    right: 5%;
    top: 5%;
    display: block;
    color: white;
    padding: 0.25rem 0.75rem;
    font-weight: bold;
    border-radius: 10px;
    font-size: 0.75rem;
    z-index: 15; /* 提高層級 */
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* 電子票券 */
a.tag-Eticket::before {
    content: "票券";
    background: #084298;
}

/* 實體票券 */
a.tag-Pticket::before {
    content: "實體票券";
    background: #0d6efd;
}

/* 冷凍商品 */
a.tag-CoolFood::before {
    content: "冷凍商品";
    background: #F75000;
}

/* 熟食商品 */
a.tag-HotFood::before {
    content: "熟食商品";
    background: #FF7300;
}

/* 常溫商品 */
a.tag-Goods::before {
    content: "實體商品";
    background: #00796e;
}

/* 線上報名 */
a.tag-Booking::before {
    content: "線上報名";
    background: #ec407a;
}

/* 組合票券 */
a.tag-Group::before {
    content: "組合票券";
    background: #50105A;
}

/* 限量商品 */
a.tag-limited::before {
    content: "限量" attr(data-before) "組";
    background: #C83737;
    top: 10%
}

/* 導購商品 */
a.tag-External::before {
    content: "導購";
    background: #50545a;
}

/* 確保限時搶購標籤有正確的層級 */
.flash-sale-badge-large,
.position-absolute.badge.bg-danger {
    z-index: 12 !important; /* 低於商品類別標籤 */
}

/* 響應式調整 */
@media (max-width: 768px) {
    a.tag::before {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
        right: 3%;
        top: 3%;
    }
}

/* === 限時搶購標籤樣式已移至專用檔案 === */
/* 請參考 flash-sale-badges.css */