/* ==========================================================================
   BOOKING CART DRAWER
   Dedicated right-side drawer for cart review.
   Triggered by #navCartBtn — completely separate from the date picker pill.
   ========================================================================== */

/* Root — covers full viewport, pointer-events off when closed */
.cart-drawer {
    position: fixed;
    inset: 0;
    z-index: 1200;
    pointer-events: none;
}

.cart-drawer.open {
    pointer-events: all;
}

/* Backdrop */
.cart-drawer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.cart-drawer.open .cart-drawer__backdrop {
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .cart-drawer__backdrop {
        transition: none;
    }
}

/* Panel */
.cart-drawer__panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(400px, 100vw);
    background: var(--color-green, #00400e);
    color: white;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overscroll-behavior: contain;
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.3);
}

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

@media (prefers-reduced-motion: reduce) {
    .cart-drawer__panel {
        transition: none;
    }
}

/* Mobile: bottom sheet */
@media (max-width: 480px) {
    .cart-drawer__panel {
        top: auto;
        left: 0;
        right: 0;
        width: 100%;
        height: 92svh;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
    }

    .cart-drawer.open .cart-drawer__panel {
        transform: translateY(0);
    }
}

/* ── Header ─────────────────────────────────────────────────────────── */

.cart-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    position: relative;
}

/* Drag handle for mobile */
@media (max-width: 480px) {
    .cart-drawer__header::before {
        content: '';
        position: absolute;
        top: 0.625rem;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: rgba(255, 255, 255, 0.2);
        border-radius: 2px;
    }
}

.cart-drawer__title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.cart-drawer__title i {
    font-size: 1rem;
    opacity: 0.8;
}

.cart-drawer__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease;
    touch-action: manipulation;
}

.cart-drawer__close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.cart-drawer__close:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

/* ── Body ────────────────────────────────────────────────────────────── */

.cart-drawer__body {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.cart-drawer__body::-webkit-scrollbar {
    width: 5px;
}

.cart-drawer__body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.06);
}

.cart-drawer__body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 3px;
}

/* ── Empty State ─────────────────────────────────────────────────────── */

.cart-drawer__empty {
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 1.5rem;
    gap: 0.875rem;
}

.cart-drawer__empty i {
    font-size: 3rem;
    opacity: 0.3;
}

.cart-drawer__empty-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
}

.cart-drawer__empty-sub {
    margin: 0;
    font-size: 0.9375rem;
    opacity: 0.75;
    line-height: 1.5;
}

.cart-drawer__browse-btn {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.75rem 1.75rem;
    background: white;
    color: var(--color-green, #00400e);
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9375rem;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.15s ease;
    touch-action: manipulation;
}

.cart-drawer__browse-btn:hover {
    background: var(--color-yellow, #f9f6d0);
    transform: translateY(-2px);
}

/* ── Cart Items ──────────────────────────────────────────────────────── */

.cart-drawer__items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-drawer__item {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    grid-template-areas: 
        "img info remove"
        "img meta meta";
    gap: 0.5rem 1rem;
    align-items: start;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    transition: background 0.2s ease, transform 0.2s ease;
    position: relative;
}

.cart-drawer__item:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Fallback for items without image */
.cart-drawer__item:not(:has(.cart-drawer__item-img)) {
    grid-template-columns: 1fr auto;
    grid-template-areas: 
        "info remove"
        "meta meta";
}

.cart-drawer__item-img {
    grid-area: img;
    width: 64px;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.cart-drawer__item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cart-drawer__item-info {
    grid-area: info;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.cart-drawer__item-name {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-drawer__item-date {
    margin: 0;
    font-size: 0.8125rem;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.cart-drawer__item-meta {
    grid-area: meta;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.25rem;
}

.cart-drawer__item-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-yellow, #f9f6d0);
    font-variant-numeric: tabular-nums;
}

.cart-drawer__qty {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cart-drawer__qty-label {
    font-size: 0.75rem;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.cart-drawer__qty-select {
    background: transparent;
    color: white;
    border: none;
    padding: 0.125rem 0.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    touch-action: manipulation;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.cart-drawer__qty-select:focus-visible {
    text-decoration: underline;
}

/* Addon-only cart: label above addon list */
.cart-drawer__addons-only-label {
    margin: 0 0 0.75rem;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.7;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.cart-drawer__item--addons-only {
    display: block;
    grid-template-columns: unset;
}

/* Add-ons nested under trip item */
.cart-drawer__addons {
    grid-column: 1 / -1;
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0.75rem 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cart-drawer__addon {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    opacity: 0.85;
}

.cart-drawer__addon-name {
    flex: 1;
    min-width: 0;
}

.cart-drawer__addon-price {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.cart-drawer__addon-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 0.75rem;
    cursor: pointer;
    flex-shrink: 0;
    touch-action: manipulation;
    transition: background 0.15s ease;
}

.cart-drawer__addon-remove:hover {
    background: rgba(255, 80, 80, 0.5);
}

/* Remove trip item button */
.cart-drawer__item-remove {
    grid-area: remove;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
    cursor: pointer;
    flex-shrink: 0;
    touch-action: manipulation;
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
    align-self: start;
}

.cart-drawer__item-remove:hover {
    background: rgba(255, 80, 80, 0.25);
    color: white;
}

.cart-drawer__item-remove:active {
    transform: scale(0.9);
}

.cart-drawer__item-remove:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}


.cart-drawer__item-remove:hover {
    background: rgba(255, 80, 80, 0.25);
    color: white;
}

.cart-drawer__item-remove:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

/* ── Footer ──────────────────────────────────────────────────────────── */

.cart-drawer__footer {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem 1.5rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--color-green, #00400e);
    flex-shrink: 0;
}

.cart-drawer__total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.cart-drawer__total-label {
    font-size: 0.875rem;
    opacity: 0.75;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.cart-drawer__total-amount {
    font-size: 1.375rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.cart-drawer__checkout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.9375rem 1.5rem;
    background: white;
    color: var(--color-green, #00400e);
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    touch-action: manipulation;
    transition: background 0.15s ease, transform 0.15s ease;
}

.cart-drawer__checkout-btn:hover {
    background: var(--color-yellow, #f9f6d0);
    transform: translateY(-1px);
}

.cart-drawer__checkout-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

.cart-drawer__clear-btn {
    width: 100%;
    padding: 0.625rem;
    background: transparent;
    color: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    font-size: 0.875rem;
    cursor: pointer;
    touch-action: manipulation;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.cart-drawer__clear-btn:hover {
    color: rgba(255, 255, 255, 0.85);
    border-color: rgba(255, 255, 255, 0.35);
}

.cart-drawer__clear-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}
