/* carrier-cart.css — shared "select vehicles -> floating cart -> send offer" widget,
   used by both the map board and the plain vehicle list. Paired with
   public/js/carrier-cart.js and Views/carrier/_cart_widget.php. */

/* Checkbox used to mark a vehicle as selected — inside a map popup ".veh-row"
   or a vehicle-list "<tr>". Bootstrap's default checkbox is too subtle here. */
.veh-cb {
    width: 20px; height: 20px; margin-top: 1px; flex-shrink: 0; border: 2px solid #94a3b8; cursor: pointer;
}
.veh-cb:checked { background-color: #2563eb; border-color: #2563eb; }

/* ── Floating cart button — same on every screen size ── */
.cart-fab {
    position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 15;
    width: 58px; height: 58px; border-radius: 50%; border: none; background: #2563eb; color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 1.45rem;
    box-shadow: 0 8px 22px rgba(37, 99, 235, .42); transition: transform .15s ease;
}
.cart-fab:hover { transform: scale(1.06); }
.cart-fab:active { transform: scale(.94); }

/* ── Floating WhatsApp button — чуть выше кнопки корзины, тот же стиль.
   right:20px (не 16px) — компенсирует разницу ширины (50px vs 58px),
   чтобы центр кружка совпадал по горизонтали с центром грузовика. ── */
.whatsapp-fab {
    position: fixed; right: 20px; bottom: calc(90px + env(safe-area-inset-bottom)); z-index: 15;
    width: 50px; height: 50px; border-radius: 50%; border: none; background: #25D366; color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
    box-shadow: 0 8px 22px rgba(37, 211, 102, .42); transition: transform .15s ease;
}
.whatsapp-fab:hover { transform: scale(1.06); color: #fff; }
.whatsapp-fab:active { transform: scale(.94); }
.cart-fab.bump { animation: fabBump .35s ease; }
@keyframes fabBump { 0% { transform: scale(1); } 45% { transform: scale(1.2); } 100% { transform: scale(1); } }
.cart-fab-badge {
    position: absolute; top: -3px; right: -3px; min-width: 22px; height: 22px; padding: 0 5px;
    border-radius: 11px; background: #ef4444; color: #fff; font-size: .72rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center; border: 2px solid #fff;
}

/* Little dot that "flies" from the ticked vehicle row to the cart button. */
.fly-dot {
    position: fixed; width: 15px; height: 15px; border-radius: 50%; background: #2563eb; z-index: 50;
    pointer-events: none; transition: transform 1s cubic-bezier(.3, .5, .3, 1), opacity .9s ease .1s;
}

.cart-toast {
    position: fixed; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 16;
    background: #0f172a; color: #fff; padding: 7px 14px; border-radius: 20px; font-size: .8rem;
    display: flex; align-items: center; gap: 6px; box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
    opacity: 0; transform: translateY(6px); pointer-events: none; transition: opacity .22s ease, transform .22s ease;
    max-width: min(78vw, 320px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cart-toast.show { opacity: 1; transform: translateY(0); }
.cart-toast .bi-check-circle-fill { color: #4ade80; }
.cart-toast .bi-dash-circle-fill { color: #fca5a5; }

/* ── Cart drawer — the actual offer form, opened from the floating button ── */
.drawer-backdrop {
    position: fixed; inset: 0; background: rgba(15, 23, 42, .35); z-index: 17;
    opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.drawer-backdrop.show { opacity: 1; pointer-events: auto; }
.cart-drawer {
    position: fixed; left: 50%; bottom: 0; width: 100%; max-width: 420px; max-height: 85vh;
    background: #fff; border-radius: 16px 16px 0 0; box-shadow: 0 -10px 30px rgba(0, 0, 0, .2);
    transform: translateX(-50%) translateY(100%); transition: transform .3s ease;
    z-index: 18; display: flex; flex-direction: column;
}
.cart-drawer.open { transform: translateX(-50%) translateY(0); }
.cart-drawer::before {
    content: ''; display: block; flex-shrink: 0; width: 40px; height: 5px;
    background: #e2e8f0; border-radius: 3px; margin: 9px auto 0;
}
.cart-drawer form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.drawer-head { padding: 6px 44px 10px 18px; border-bottom: 1px solid #eef2f7; position: relative; flex-shrink: 0; }
.drawer-head .btn-close { position: absolute; top: 8px; right: 12px; }
.drawer-body { padding: 8px 16px; overflow-y: auto; flex: 1; min-height: 0; }
.drawer-foot { padding: 12px 16px; border-top: 1px solid #eef2f7; background: #fafbfc; flex-shrink: 0; }

.cart-row {
    display: flex; align-items: center; gap: 8px; padding: 7px 2px; border-bottom: 1px solid #eef2f7;
    transition: opacity .2s ease, transform .2s ease;
}
.cart-row:last-child { border-bottom: none; }
.cart-row.cart-row-added { animation: cartRowAdded 1.1s ease; border-radius: 6px; }
@keyframes cartRowAdded { 0% { background: #bbf7d0; } 100% { background: transparent; } }
.cart-row.cart-row-removing { opacity: 0; transform: translateX(14px); }
.cart-remove-btn {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 30px; height: 30px; border-radius: 50%; border: none; background: #fef2f2; color: #dc2626;
    transition: background-color .15s ease, color .15s ease, transform .1s ease;
}
.cart-remove-btn:hover, .cart-remove-btn:focus-visible { background: #fee2e2; color: #b91c1c; transform: scale(1.08); }
.cart-remove-btn:active { transform: scale(.92); }
.cart-remove-btn i { font-size: .82rem; pointer-events: none; }

.cart-summary-bump { animation: summaryBump .35s ease; }
@keyframes summaryBump { 0% { transform: scale(1); } 45% { transform: scale(1.12); } 100% { transform: scale(1); } }
