/* ── 商品列表與卡片佈局 ── */

.app .ui-container .goodslist {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important; /* PC版固定一列 3 商品 */
    gap: 30px !important;
    padding: 20px 0 !important;
    width: 100% !important;
}

/* 商品卡片 (Product Card) */
.app .ui-container .goodsitem {
    width: 100% !important;
    background: #fff !important;
    border-radius: 20px !important;
    border: 1px solid rgba(0,0,0,0.05) !important;
    overflow: hidden !important;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
    cursor: pointer !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03) !important;
    box-sizing: border-box !important;
}

.goodsitem:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(141, 25, 232, 0.12);
    border-color: var(--primary-light);
}

/* 圖片容器 */
.goodsitem .imgbox {
    width: 100%;
    aspect-ratio: 1.1 / 1;
    overflow: hidden;
    background: #f8f9fa;
    position: relative;
}

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

.goodsitem:hover .imgbox img {
    transform: scale(1.08);
}

.pv-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(141, 25, 232, 0.9);
    color: #fff;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 700;
    backdrop-filter: blur(4px);
    z-index: 2;
}

/* 內容區 */
.goodsitem .info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.goods-sn {
    font-family: 'Archivo', sans-serif;
    font-size: 11px;
    color: #666;
    font-weight: 700;
    margin-bottom: 10px;
    display: inline-block;
    background: #f0f0f0;
    padding: 3px 10px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.goodsitem h3 {
    font-size: 18px;
    color: var(--heading);
    margin: 0 0 10px 0;
    font-weight: 700;
    line-height: 1.4;
    transition: color 0.3s;
}

.goodsitem:hover h3 { color: var(--primary); }

.goodsitem .sketch {
    font-size: 14px;
    color: #777;
    line-height: 1.6;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 價格區域 */
.price-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: auto;
    padding-bottom: 20px;
}

.price-box {
    color: var(--secondary);
    font-weight: 800;
}

.price-box .currency { font-size: 16px; margin-right: 2px; }
.price-box .val { font-size: 24px; font-family: 'Archivo', sans-serif; }

.pv-box {
    font-size: 13px;
    color: #888;
    font-weight: 600;
}

/* 按鈕群組 */
.goodsitem .btns {
    display: flex !important;
    gap: 12px !important;
    width: 100% !important;
}

.goodsitem .btns button {
    height: 48px !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.3s !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: none !important;
    outline: none !important;
}

.btn-cart {
    width: 50px !important;
    background: #f0f2f5 !important;
    color: var(--heading) !important;
    flex-shrink: 0 !important;
}

.btn-cart:hover {
    background: #e6e8eb !important;
}

.btn-cart i { 
    font-size: 20px !important; 
    color: var(--heading) !important;
}

.btn-buy {
    flex: 1 !important;
    background: var(--primary) !important;
    color: #ffffff !important;
    white-space: nowrap !important;
}

.btn-buy:hover {
    background: #7a14cc !important;
    box-shadow: 0 5px 15px rgba(141, 25, 232, 0.3) !important;
}

/* 響應式微調 */
@media (max-width: 1200px) {
    .goodslist { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .app .ui-container .goodslist { 
        grid-template-columns: 1fr !important; 
        gap: 25px !important;
        padding: 10px 0 !important;
    }
    .goodsitem { border-radius: 15px !important; }
    .goodsitem .btns { flex-direction: row !important; }
}

/* ── Cart Toast 彈窗 ── */
@keyframes cartToastSlideIn {
    from { opacity: 0; transform: translateX(120%); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes cartToastSlideOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(120%); }
}

.cart-toast-popup {
    position: fixed;
    bottom: 32px;
    right: 24px;
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(141, 25, 232, 0.18), 0 2px 8px rgba(0,0,0,0.08);
    padding: 16px 20px;
    min-width: 260px;
    max-width: 340px;
    border-left: 4px solid var(--primary, #8D19E8);
    animation: cartToastSlideIn 0.36s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.cart-toast-popup.hiding {
    animation: cartToastSlideOut 0.3s ease-in both;
}

.cart-toast-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary, #8D19E8), #b55af0);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(141, 25, 232, 0.35);
}

.cart-toast-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.cart-toast-msg {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-toast-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--secondary, #FF782D);
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(255, 120, 45, 0.10);
    border: 1px solid rgba(255, 120, 45, 0.25);
    transition: all 0.2s;
    align-self: flex-start;
    cursor: pointer;
}

.cart-toast-btn:hover {
    background: var(--secondary, #FF782D);
    color: #fff;
    border-color: var(--secondary, #FF782D);
    text-decoration: none;
}

.cart-toast-close {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #f0f0f0;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 13px;
    line-height: 1;
    padding: 0;
    transition: background 0.2s;
    align-self: flex-start;
}

.cart-toast-close:hover { background: #e0e0e0; }

@media (max-width: 480px) {
    .cart-toast-popup {
        bottom: 0;
        right: 0;
        left: 0;
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        border-left: none;
        border-top: 4px solid var(--primary, #8D19E8);
    }
    @keyframes cartToastSlideIn {
        from { opacity: 0; transform: translateY(100%); }
        to   { opacity: 1; transform: translateY(0); }
    }
    @keyframes cartToastSlideOut {
        from { opacity: 1; transform: translateY(0); }
        to   { opacity: 0; transform: translateY(100%); }
    }
}
