/* =========================================================================
   LAVUMALL - assets/css/index/index-product.css
   首頁商品區塊 / 商品卡 / 活動標籤 / 查看完整分類
   ========================================================================= */

/* 商品區塊標題與 4x2 方塊 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0 20px 0;
}
.section-title {
    font-size: 26px; font-weight: 700; color: #1d1d1f;
    border-left: 5px solid #0071e3; padding-left: 12px;
}

/* 查看完整分類按鈕 - 支援頂端列 Icon 等級之按壓與懸停回饋 */
.view-all-link {
    font-size: 14px; color: #0071e3; text-decoration: none; font-weight: 500; display: inline-flex; align-items: center; gap: 4px;
}
.view-all-link span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    position: relative;
    z-index: 2;
    transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1), color 0.4s ease;
}
@media (hover: hover) {
    .view-all-link:hover span {
        color: #0071e3 !important;
        transform: scale(0.88) translateY(2px);
    }
}
.view-all-link:active span, .view-all-link.watermark-active span {
    color: #0071e3 !important;
    transform: scale(0.88) translateY(2px) !important;
}

.products-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 25px; margin-bottom: 20px; }

.product-card {
    background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(5px); border-radius: 16px; padding: 18px;
    border: 1px solid rgba(234, 234, 234, 0.8); position: relative; cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.3s ease, border-color 0.3s ease; overflow: hidden;
}
.product-card:hover { border-color: #0071e3; box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08); transform: translateY(-5px); }

.wishlist-btn {
    position: absolute; top: 25px; right: 25px; background: rgba(255, 255, 255, 0.75); backdrop-filter: blur(4px);
    border: none; color: #86868b; font-size: 16px; cursor: pointer; transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; z-index: 12; box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.wishlist-btn:hover { transform: scale(1.12); color: #ff2d55; background: #ffffff; }
.wishlist-btn.active { color: #ff2d55; background: #ffffff; animation: heartBeat 0.3s ease-in-out; }
@keyframes heartBeat { 0% { transform: scale(1); } 50% { transform: scale(1.3); } 100% { transform: scale(1.12); } }

/* 1.5 秒蓄力條 */
.charge-bar { position: absolute; top: 0; left: 0; width: 100%; height: 5px; background-color: rgba(234, 234, 234, 0.5); z-index: 5; opacity: 0; transition: opacity 0.2s ease; }
.charge-fill { height: 100%; width: 0%; background-color: #0071e3; transition: width 1.5s linear; }
.product-card.preparing-pop { animation: subtle-bounce 0.5s ease infinite; }
.product-card.preparing-pop .charge-bar { opacity: 1; }
.product-card.preparing-pop .charge-fill { width: 100%; }
@keyframes subtle-bounce { 0%, 100% { transform: translateY(-5px); } 50% { transform: translateY(-12px); } }

.product-image-wrapper { width: 100%; aspect-ratio: 1/1; background: #f5f5f7; border-radius: 10px; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; margin-bottom: 15px; }
.product-image-wrapper i { font-size: 52px; color: #d2d2d7; }

.product-info { position: relative; }
.product-name { font-size: 16px; font-weight: 500; color: #1d1d1f; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; white-space: normal; line-height: 1.4; height: 2.8em; }

.product-bottom-row { display: flex; align-items: flex-end; justify-content: space-between; }
.price-group { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
@media (min-width: 993px) { .price-group { flex-direction: row; align-items: baseline; gap: 8px; } }

.discount-price { font-size: 18px; font-weight: 700; color: #ff3b30; line-height: 1; }
.original-price { font-size: 13px; color: #86868b; text-decoration: line-through; line-height: 1; }
.action-group { display: flex; align-items: center; gap: 8px; z-index: 10; }

.share-btn { background: none; border: none; color: #86868b; font-size: 16px; cursor: pointer; transition: color 0.3s, transform 0.2s; padding: 5px; margin-bottom: -2px; }
.share-btn:hover { color: #0071e3; transform: scale(1.15); }

.quick-cart-btn { background: none; border: none; color: #86868b; font-size: 20px; cursor: pointer; transition: color 0.3s, transform 0.2s; padding: 5px; margin-bottom: -2px; z-index: 10; }
.quick-cart-btn:hover { color: #0071e3; transform: scale(1.15); }

.product-stats-row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #86868b; margin-top: 10px; padding-top: 8px; border-top: 1px dashed rgba(234, 234, 234, 0.6); }
.stat-rec i { color: #ff9500; margin-right: 2px; }

/* ================= 行銷活動標籤 / 商品卡固定版型（由 index.php 移出） ================= */
/* 行銷活動標籤：商品名稱與價格之間 */
.marketing-badge-strip{
    position:relative;
    display:flex;
    align-items:center;
    gap:5px;
    min-height:22px;
    margin:6px 0 5px;
    max-width:100%;
    overflow:hidden;
    white-space:nowrap;
}
.marketing-badge-link{
    flex:0 0 auto;
    display:inline-flex;
    align-items:center;
    max-width:118px;
    padding:3px 7px;
    border-radius:6px;
    background:#eaf4ff;
    color:#0071e3;
    font-size:13px;
    font-weight:800;
    line-height:1.2;
    text-decoration:none;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}
.marketing-badge-link:hover{background:#dcecff}
.marketing-badge-strip.is-overflowing{
    padding-right:18px;
    -webkit-mask-image:linear-gradient(to right,#000 0%,#000 82%,transparent 96%);
    mask-image:linear-gradient(to right,#000 0%,#000 82%,transparent 96%);
}
.marketing-badge-more{
    position:absolute;
    right:0;
    top:0;
    bottom:0;
    display:flex;
    align-items:center;
    padding-left:5px;
    background:linear-gradient(to right,transparent,#fff 45%);
    color:#86868b;
    font-weight:900;
}

.marketing-badge-static{
    cursor:default;
    pointer-events:none;
}

/* 商品卡固定版型：名稱永遠一行，活動標籤永遠佔同一列 */
.product-info .product-name{
    display:block !important;
    height:1.4em !important;
    min-height:1.4em !important;
    max-height:1.4em !important;
    line-height:1.4 !important;
    margin-bottom:6px !important;
    overflow:hidden !important;
    white-space:nowrap !important;
    text-overflow:clip !important;
    -webkit-line-clamp:unset !important;
    -webkit-box-orient:unset !important;
    -webkit-mask-image:linear-gradient(to right,#000 0%,#000 88%,transparent 100%);
    mask-image:linear-gradient(to right,#000 0%,#000 88%,transparent 100%);
}
.product-info .marketing-badge-strip{
    height:24px !important;
    min-height:24px !important;
    max-height:24px !important;
    margin:4px 0 7px !important;
    box-sizing:border-box;
}
.product-info .marketing-badge-strip.is-empty{
    visibility:hidden;
}
.product-info .marketing-badge-link{
    font-size:13px !important;
    line-height:1.25 !important;
}

@media (max-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .product-card { padding: 12px; }

    .wishlist-btn {
        top: 18px;
        right: 18px;
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
}