/* Cart Styles */

/* Floating Action Button Wrapper */
.cart-fab {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: auto;
    height: auto;
    background: transparent;
    border: none;
    box-shadow: none;
    z-index: 900;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: none;
    /* Controlled by JS */
}

.cart-fab:hover {
    transform: scale(1.05);
}

/* Square Icon Container */
.cart-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background-color: white;
    border: 2px solid var(--color-primary);
    /* Use var */
    border-radius: 12px;
    color: #64748b;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Large Top-Left Badge */
.cart-badge {
    position: absolute;
    top: -16px;
    left: -16px;
    right: auto;
    background-color: var(--color-primary);
    /* Use var */
    color: white;
    font-size: 20px;
    font-weight: 700;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid white;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Cart Overlay & Modal */
.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    justify-content: flex-end;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cart-modal {
    background: white;
    width: 100%;
    max-width: 400px;
    height: 100%;
    padding: 24px;
    position: relative;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

@media (min-width: 769px) {
    .cart-overlay {
        justify-content: flex-end;
        /* Align to right */
        align-items: flex-start;
        /* Or stretch */
    }

    .cart-modal {
        height: 100vh;
        /* Full height */
        max-height: none;
        border-radius: 0;
        width: 450px;
        /* Wider drawer */
        transform: translateX(100%);
        /* Start off-screen right */
        opacity: 1;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    }

    .cart-overlay.active .cart-modal {
        transform: translateX(0);
        /* Slide in */
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .cart-overlay.active .cart-modal {
        transform: translateX(0);
    }
}

/* Modal Contents */
.cart-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-body);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.cart-close-btn:hover {
    background-color: rgba(9, 30, 66, 0.08);
    /* Ghost hover */
}

.cart-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
}

.cart-items-list {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 16px;
    min-height: 100px;
    padding-right: 8px;
    /* For scrollbar space */
}

/* Scrollbar styling */
.cart-items-list::-webkit-scrollbar {
    width: 6px;
}

.cart-items-list::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.cart-items-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.cart-empty-message {
    text-align: center;
    padding: 20px;
    color: #999;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--color-border);
    gap: 16px;
}

.cart-item-visual {
    width: 80px;
    height: 56px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background: #f1f5f9;
}

.cart-item-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-img-placeholder {
    width: 100%;
    height: 100%;
    background-color: #e2e8f0;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
    /* Text truncation fix */
}

.cart-item-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-main);
    margin-bottom: 4px;
    line-height: 1.4;

    /* Truncate text */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-sub {
    font-size: 13px;
    color: var(--color-text-body);
}

.cart-remove-btn {
    background: none;
    border: 1px solid #94a3b8;
    /* Gray border like image */
    border-radius: 4px;
    color: #94a3b8;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
}

.cart-remove-btn:hover {
    color: var(--color-danger-text);
    border-color: var(--color-danger-text);
    background: #FFF1F0;
}

.cart-form {
    margin-top: auto;
}

.cart-subtitle {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
}

.form-label-sm {
    font-size: 12px;
    color: var(--color-text-body);
    margin-bottom: 4px;
    display: block;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 14px;
    background-color: #F8F9FA;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    background-color: white;
    box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.1);
    /* Focus ring */
}

/* Pulse Animation for Cart */
@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.cart-fab.pulse {
    animation: pulse 0.3s ease-in-out;
}

.btn-book-large.in-cart {
    background-color: var(--color-success-text) !important;
    cursor: default;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}