#cart-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(10px);
    z-index: 9999;
}

.cart-floating-button {
    position: fixed;
    left: 50%;
    bottom: 1rem;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
    min-width: min(92vw, 360px);
    padding: 0.95rem 1.15rem;
    border: none;
    border-radius: 999px;
    background: linear-gradient(180deg, #ff4848 0%, #f43f45 100%);
    color: #ffffff;
    box-shadow: 0 18px 35px rgba(244, 63, 69, 0.28);
    z-index: 9998;
    cursor: pointer;
}

.cart-floating-button.hidden {
    display: none !important;
}

.cart-floating-button__label {
    font-size: 1rem;
    font-weight: 700;
}

.cart-floating-button__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 0.55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    font-size: 0.95rem;
    font-weight: 800;
}

.cart-modal-panel {
    position: relative;
    width: min(100%, 680px);
    max-height: 90vh;
    overflow-y: auto;
    padding: 0.25rem 0;
}

.cart-modal-close {
    position: absolute;
    top: 1.4rem;
    right: 1.2rem;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    z-index: 3;
}

.cart-modal-header {
    margin-bottom: 0.95rem;
    padding: 1.5rem 2rem;
    border-radius: 1.25rem;
    background: linear-gradient(180deg, #ff4848 0%, #f43f45 100%);
    color: #ffffff;
    box-shadow: 0 18px 50px rgba(244, 63, 69, 0.18);
}

.cart-modal-header h2 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.cart-content {
    display: grid;
    gap: 1.2rem;
}

.cart-summary-card,
.cart-form-card,
.cart-empty-card {
    background: rgba(255, 255, 255, 0.96);
    border-radius: 1.6rem;
   
    border: 1px solid rgba(255, 255, 255, 0.7);
}

.cart-empty-card {
    padding: 2rem;
    text-align: center;
}

.cart-empty-title {
    margin: 0;
    color: #111827;
    font-size: 1.4rem;
    font-weight: 700;
}

.cart-empty-text {
    margin: 0.65rem 0 0;
    color: #6b7280;
    font-size: 0.98rem;
}

#cart-items {
    display: block;
    padding: 1rem 1.6rem 0;
}

.cart-item {
    padding: 1.45rem 0;
    border-bottom: 1px solid #e9edf5;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-body {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.cart-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.cart-item-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
    line-height: 1.3;
}

.cart-item-price {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 700;
    color: #111827;
}

.cart-item-meta {
    margin: 0.15rem 0 0;
    font-size: 0.95rem;
    color: #6b7280;
}

.cart-item-remove {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    background: transparent;
    color: #ef4444;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 2rem;
    line-height: 1;
}

.cart-item-remove:hover {
    color: #b91c1c;
}

.cart-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.2rem 1.6rem 1.5rem;
    border-top: 1px solid #e9edf5;
    color: #374151;
    font-size: 1rem;
}

.cart-summary-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.6rem;
}

.cart-summary-button {
    border: 1px solid #d6dbe7;
    background: #ffffff;
    color: #111827;
    border-radius: 999px;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cart-summary-button:hover {
    border-color: #f43f45;
    color: #f43f45;
}

.quantity-controls {
    width: 26%;
}
.cart-summary-total {
    font-size: 1.45rem;
    font-weight: 800;
    color: #111827;
}

.cart-form-card {
    padding: 1.35rem 1.5rem 1.6rem;
}

.cart-field-label {
    display: block;
    margin-bottom: 0.5rem;
    color: #111827;
    font-size: 0.98rem;
    font-weight: 700;
    margin-top:10px;
}

.cart-input {
    width: 90%;
    border-radius: 1rem;
    border: 1px solid #d6dbe7;
    padding: 0.95rem 1rem;
    font-size: 1rem;
    color: #111827;
    background: #ffffff;
    outline: none;
    margin-bottom: 10px;
}

.cart-input:focus {
    border-color: #f43f45;
    box-shadow: 0 0 0 4px rgba(244, 63, 69, 0.08);
}

.cart-confirm-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 60px;
    border: none;
    border-radius: 1rem;
    background: linear-gradient(180deg, #2f3440 0%, #1f2530 100%);
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 16px 32px rgba(31, 37, 48, 0.22);
}

.cart-confirm-button:hover {
    filter: brightness(1.04);
}

#cart-content.hidden,
#cart-checkout-form.hidden,
#cart-action-area.hidden {
    display: none !important;
}

@media (max-width: 640px) {
    #cart-modal {
        align-items: flex-start;
        padding: 1rem;
    }

    .cart-modal-panel {
        max-height: 95vh;
    }

    .cart-modal-close {
        top: 1rem;
        right: 0.8rem;
    }

    .cart-modal-header {
        padding: 1.25rem 1.35rem;
        border-radius: 1.1rem;
    }

    .cart-modal-header h2 {
        font-size: 1.55rem;
    }

    #cart-items {
        padding: 0.7rem 1.15rem 0;
    }

    .cart-summary-row,
    .cart-form-card {
        padding-left: 1.15rem;
        padding-right: 1.15rem;
    }

    .cart-summary-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .cart-summary-total {
        font-size: 1.3rem;
    }

    .cart-summary-actions {
        width: 100%;
        align-items: flex-start;
    }

    .cart-floating-button {
        min-width: calc(100vw - 2rem);
        bottom: 0.85rem;
    }
}
