/* ========== 本地购物车/清单 ========== */
.cart-floating-button {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 900;
    display: none;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border: none;
    border-radius: 999px;
    background: #2c3e50;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cart-floating-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.26);
}

.cart-floating-icon {
    font-size: 1.1rem;
    line-height: 1;
}

.cart-badge {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: #e74c3c;
    color: #fff;
    font-size: 0.78rem;
}

.cart-backdrop {
    position: fixed;
    inset: 0;
    z-index: 940;
    background: rgba(15, 23, 42, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 950;
    display: flex;
    flex-direction: column;
    width: min(420px, 92vw);
    height: 100vh;
    background: #fff;
    box-shadow: -12px 0 34px rgba(15, 23, 42, 0.2);
    transform: translateX(105%);
    transition: transform 0.25s ease;
}

body.cart-open .cart-backdrop {
    opacity: 1;
    pointer-events: auto;
}

body.cart-open .cart-drawer {
    transform: translateX(0);
}

.cart-drawer-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid #eef2f7;
    background: linear-gradient(135deg, #2c3e50, #1a1a2e);
    color: #fff;
}

.cart-drawer-header h2 {
    margin: 0 0 4px;
    font-size: 1.35rem;
}

.cart-drawer-header p {
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.88rem;
}

.cart-close-btn {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 1.45rem;
    line-height: 1;
    cursor: pointer;
}

.cart-items {
    flex: 1;
    overflow: auto;
    padding: 14px;
}

.cart-empty {
    padding: 42px 18px;
    text-align: center;
    color: #7f8c8d;
    background: #f8fafc;
    border: 1px dashed #d8e1ea;
    border-radius: 12px;
}

.cart-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px 12px;
    padding: 12px;
    border: 1px solid #edf2f7;
    border-radius: 12px;
    margin-bottom: 10px;
    background: #fff;
}

.cart-item-name {
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.35;
}

.cart-item-meta {
    margin-top: 4px;
    color: #7f8c8d;
    font-size: 0.86rem;
}

.cart-item-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.cart-item-actions button {
    width: 28px;
    height: 28px;
    border: 1px solid #d8e1ea;
    border-radius: 50%;
    background: #f8fafc;
    color: #2c3e50;
    font-weight: 800;
    cursor: pointer;
}

.cart-qty-input {
    width: 56px;
    height: 30px;
    border: 1px solid #d8e1ea;
    border-radius: 8px;
    color: #2c3e50;
    font-weight: 700;
    text-align: center;
}

.cart-qty-input:focus {
    outline: none;
    border-color: #2c3e50;
    box-shadow: 0 0 0 2px rgba(44, 62, 80, 0.14);
}

.cart-line-total {
    color: #2c3e50;
    font-weight: 800;
}

.cart-remove-btn {
    justify-self: end;
    border: none;
    background: transparent;
    color: #e74c3c;
    cursor: pointer;
    font-weight: 600;
}

.cart-summary-panel {
    padding: 16px 18px 18px;
    border-top: 1px solid #eef2f7;
    background: #f8fafc;
}

.cart-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    color: #5a6c7d;
}

.cart-summary-row strong {
    color: #2c3e50;
}

.cart-summary-total {
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px dashed #d8e1ea;
    font-size: 1.1rem;
    color: #2c3e50;
}

.cart-summary-total strong {
    color: #e74c3c;
    font-size: 1.25rem;
}

.cart-clear-btn {
    width: 100%;
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid #f2c7c4;
    border-radius: 999px;
    background: #fff5f4;
    color: #a7382f;
    font-weight: 700;
    cursor: pointer;
}

.cart-clear-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cart-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid #2c3e50;
    border-radius: 999px;
    background: #2c3e50;
    color: #fff;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cart-add-btn:hover:not(:disabled) {
    background: #1a1a2e;
    border-color: #1a1a2e;
    transform: translateY(-1px);
}

.cart-add-btn:disabled {
    background: #f1f5f9;
    border-color: #d8e1ea;
    color: #9aa7b5;
    cursor: not-allowed;
}

.cart-add-btn.is-in-cart {
    background: #fff7ed;
    border-color: #f59e0b;
    color: #b45309;
}

.price-cart-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 1rem;
}

.price-cart-row .cigarette-price {
    flex: 1;
    min-width: 0;
}

.price-cart-row .cart-add-btn {
    flex: 0 0 auto;
}

.cart-card-action {
    margin-top: 12px;
}

.simple-cart-btn {
    padding: 6px 10px;
    font-size: 0.82rem;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .cart-floating-button {
        right: 12px;
        bottom: 12px;
        padding: 10px 13px;
        font-size: 0.9rem;
    }

    .cart-drawer {
        width: 100vw;
    }

    .cart-item {
        grid-template-columns: 1fr;
    }

    .cart-item-actions,
    .cart-remove-btn {
        justify-self: start;
    }
}
