/* ============================================================================
   CART.CSS
   Styles khusus untuk fitur cart: qty stepper, add-cart button, checkout button,
   floating cart icon.

   Cara load: tambahkan <link> tag di layouts/app.blade.php setelah customer.css
   ============================================================================ */

/* ── ADD TO CART BUTTON (di product card) ────────────────────────────────── */
.btn-add-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    transition: background .15s;
    text-decoration: none;
}

.btn-add-cart:hover { background: var(--primary-dark); }
.btn-add-cart svg { width: 13px; height: 13px; }

/* ── QTY STEPPER ─────────────────────────────────────────────────────────── */
.qty-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--gray-300);
    border-radius: 999px;
    overflow: hidden;
    background: #fff;
}

.qty-btn {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: var(--gray-700);
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background .15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover { background: var(--gray-100); }
.qty-btn:active { background: var(--gray-200); }

.qty-input {
    width: 50px;
    height: 36px;
    text-align: center;
    border: none;
    border-left: 1px solid var(--gray-200);
    border-right: 1px solid var(--gray-200);
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-800);
    background: transparent;
    font-family: inherit;
}

.qty-input:focus { outline: none; background: var(--gray-50); }

/* Hide number input arrows */
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.qty-input[type=number] { -moz-appearance: textfield; }

/* Small version untuk cart item */
.qty-stepper-sm .qty-btn {
    width: 28px;
    height: 28px;
    font-size: 14px;
}

.qty-display {
    min-width: 36px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-800);
    border-left: 1px solid var(--gray-200);
    border-right: 1px solid var(--gray-200);
    background: var(--gray-50);
}

/* ── CHECKOUT BUTTON (di cart summary) ───────────────────────────────────── */
.btn-checkout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: var(--color-wa);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    transition: background .15s, transform .1s;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(37, 211, 102, .25);
}

.btn-checkout:hover { background: var(--color-wa-hover); }
.btn-checkout:active { transform: scale(.98); }
.btn-checkout svg { width: 18px; height: 18px; }

/* ── FLOATING CART BUTTON ────────────────────────────────────────────────── */
.fab-cart {
    position: fixed;
    bottom: 88px;             /* di atas WA button */
    right: 24px;
    z-index: 50;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 10px 25px rgba(0,0,0,.2);
    transition: background .15s, box-shadow .15s, transform .15s;
}

.fab-cart:hover {
    background: var(--primary-dark);
    box-shadow: 0 15px 30px rgba(0,0,0,.25);
    transform: translateY(-2px);
}

.fab-cart svg { width: 24px; height: 24px; }

/* Badge count */
.fab-cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    line-height: 1;
}

/* ── PRODUCT CARD LINK STYLES ────────────────────────────────────────────── */
.product-card-image-link {
    display: block;
    text-decoration: none;
}

.product-name-link {
    text-decoration: none;
    color: inherit;
}

/* ── RESPONSIVE ──────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .fab-cart {
        bottom: 80px;
        width: 48px;
        height: 48px;
    }
    .fab-cart svg { width: 20px; height: 20px; }
}
