/* ==========================================================================
   購物車與結帳區塊樣式
   ========================================================================== */

/* 購物車空狀態 */
.cart-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: #8b6e5e;
    margin-top: 50px;
}

.cart-actions {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #fffaf5;
    border-radius: 8px;
    color: #8b6e5e;
}

/* 購物車懸浮按鈕 (FAB) */
.cart-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 30px;
    background-color: #8b6e5e;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    border: none;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s;
}

.cart-fab:hover {
    transform: scale(1.08);
    background-color: #7a5e50;
}

@media (max-width: 600px) {
    .cart-fab {
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
    }
}

.cart-fab.active {
    background-color: #5a4b41;
}

.cart-fab svg {
    transform: translateX(-2px);
}

/* 購物車數字標籤 (Badge) */
.cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background-color: #ff5f5f;
    color: white;
    font-size: 11px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* cart-btn gap */
.cart-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    justify-content: center;
}

/* empty-state */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    margin-top: 50px;
    width: 100%;
}

.empty-state-icon {
    display: inline-block;
    color: #8b6e5e;
    margin-bottom: 10px;
}

.empty-state-title {
    margin-top: 15px;
    color: #8b6e5e;
}

/* checkout-panel */
.checkout-panel {
    margin-top: 30px;
    padding: 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.checkout-summary {
    font-size: 18px;
    font-weight: bold;
    color: #d32f2f;
    margin-bottom: 20px;
    border-bottom: 1px dashed #eee;
    padding-bottom: 15px;
}

.checkout-label {
    display: block;
    font-weight: bold;
    margin-bottom: 10px;
    color: #5a4b41;
}

.checkout-input {
    display: block;
    margin: 0 auto 15px auto;
    width: 80%;
    max-width: 300px;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
}

.checkout-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    background: #8b6e5e;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    border-radius: 25px;
    cursor: pointer;
    transition: background 0.3s;
    font-weight: bold;
}

.checkout-btn:not(:disabled):hover {
    background: #73594b;
}

.checkout-btn:disabled {
    cursor: not-allowed;
}

/* 購物車商品卡片樣式 */
.cart-item-details {
    padding: 15px;
}

.cart-item-title {
    font-weight: bold;
    margin-bottom: 10px;
}

.cart-item-variant-label {
    font-size: 13px;
    color: #666;
}

.cart-item-variant-select-wrapper {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.variant-select {
    flex: 1;
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #ccc;
    font-size: 14px;
    background: #fff;
}

.cart-item-qty-row {
    display: flex;
    align-items: center;
    margin-top: 15px;
    justify-content: space-between;
    border-top: 1px dashed #eee;
    padding-top: 10px;
}

.cart-item-qty-controls {
    display: flex;
    align-items: center;
}

.cart-qty-btn {
    width: 30px;
    height: 30px;
    border-radius: 5px;
    border: 1px solid #ccc;
    background: #f9f9f9;
    cursor: pointer;
    font-size: 16px;
}

.cart-qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #eaeaea;
}

.cart-qty-text {
    margin: 0 15px;
    font-weight: bold;
}

.cart-item-subtotal {
    margin-left: 15px;
    color: #d32f2f;
    font-weight: bold;
    font-size: 14px;
}

.cart-item-remove-btn {
    color: #d32f2f;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: bold;
}

.cart-add-variant-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: 15px;
    padding: 10px;
    border-radius: 25px;
    border: 1px solid #8b6e5e;
    color: #8b6e5e;
    background: #fff;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.cart-add-variant-btn:hover {
    background: #8b6e5e;
    color: #fff;
}

/* 結帳 Loading Spinner 動畫 */
.loading-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

.checkout-btn.is-loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.checkout-btn.is-loading .loading-spinner {
    display: inline-block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}