.cart-btn {
    border-radius: 0.5rem;
    padding: 0.25rem 0.5rem;
    font-size: 1rem;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: background 0.3s ease, transform 0.2s ease;
    position: relative;
    transform: translateX(0px);
    white-space: nowrap;
}

.cart-btn.highlight {
    background: linear-gradient(135deg, #f1c40f, #e67e22);
}

.cart-btn-text {
    font-weight: 500;
    font-size: 1rem;
}

.cart-btn i {
    font-size: 1rem;
}

.cart-badge {
    position: absolute;
    top: -0.9rem;
    right: 0rem;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 1.25rem;
    height: 1.25rem;
    padding-top: 0.1rem;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #fff;
}

.cart-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 85%;
    height: 100%;
    background-color: #f8f9fa;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1060;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    padding: 0;
}

.cart-panel.active {
    transform: translateX(0);
}

.btn-added {
    background-color: #2ecc71 !important;
    color: white !important;
}

.btn-added .btn-icon {
    display: none;
}

.btn-added .btn-checkmark {
    display: inline;
}

.btn-checkmark {
    display: none;
}

@keyframes btnRemove {
    0% { transform: scale(1); }
    50% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

.cart-header {
    padding: 0.5rem;
    margin: 0.5rem;
    margin-bottom: -3rem;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
}

.cart-header h5 {
    font-size: 1.1rem;
}

.cart-header i {
    font-size: 1.1rem;
    margin-right: 0.25rem;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 1rem -0.75rem;
}

.empty-state img {
    max-width: 60%;
    margin-bottom: 0;
}

.empty-state {
    font-size: 0.9rem;
    text-align: center;
}

.close-cart {
    background: none;
    border: none;
    color: white;
    font-size: 1rem;
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.quantity-input {
    width: 1.6rem;
    height: 1.6rem;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 0.25rem;
    margin: 0.5rem -0.5rem 0.5rem 0.5rem;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.quantity-input:focus {
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
}

.remove-item {
    background-color: #e74c3c;
    border: none;
    color: white;
    font-size: 0.8rem;
    margin-right: -0.75rem;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.remove-item:active {
    animation: btnRemove 0.3s ease;
}

.remove-item:focus,
.quantity-input:focus,
.btn-checkout:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0.5rem 0;
    margin-left: -0.75rem;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
    line-height: 1rem;
}

.cart-item-details {
    flex-grow: 1;
    font-size: 0.9rem;
}

.cart-item-details .text-muted {
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.delivery-option {
    margin: 0.5rem -0.75rem 1rem;
    background: #d1ecf1;
    border: 1px solid #a3c9b0;
    border-radius: 0.5rem;
    padding: 0.5rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.delivery-option label {
    font-size: 0.9rem;
    color: #2c3e50;
    display: block;
    margin-bottom: 0.25rem;
}

.delivery-button {
    font-size: 0.9rem;
    padding: 0.25rem;
    padding-left: 0.5rem;
    border-radius: 0.5rem;
    border: 2px solid #ddd;
    background: #fff;
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.delivery-button:focus {
    border-color: #27ae60;
    box-shadow: 0 0 8px rgba(46, 204, 113, 0.3);
    outline: none;
}

.delivery-select-icon {
    font-size: 0.9rem;
    color: #2c3e50;
    line-height: 1.2;
    position: relative;
}

.delivery-select-icon::after {
    content: '';
    display: inline-block;
    width: 0.5rem;
}

/* Styles for delivery cards */
.delivery-card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(4rem, 1fr));
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.delivery-card {
    background-color: #fff;
    border: 2px solid #ddd;
    border-radius: 0.5rem;
    margin: 0 -0.75rem;
    padding: 0;
    width: calc(100% + 1.5rem);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    outline: none;
}

.delivery-card:focus {
    border-color: #3498db;
    box-shadow: 0 0 8px rgba(52, 152, 219, 0.5);
}

.delivery-card img {
    max-width: 100%;
    object-fit: contain;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

.delivery-card h6 {
    font-size: 0.85rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.delivery-card p {
    font-size: 0.8rem;
    color: #6c757d;
    margin: 0;
    padding: 0.25rem;
}

.delivery-select-icon::after {
    content: '';
    display: inline-block;
    width: 0.5rem;
}

.subtotal-info {
    font-size: 0.9rem;
    color: #555;
    display: flex;
    align-items: center;
    margin: 0.15rem -0.75rem;
    gap: 1.1rem;
    flex-wrap: nowrap;
}

.subtotal-info .icon-wrapper {
    flex: 0 0 auto;
    font-size: 0.9rem;
    color: #6c757d;
    width: 0.3rem;
    text-align: center;
}

.subtotal-info .label-wrapper {
    flex: 1;
    min-width: 0;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
}

.subtotal-info .value-wrapper {
    flex: 0 0 auto;
    text-align: right;
}

.subtotal-info strong {
    color: #2c3e50;
    font-size: 0.9rem;
}

.total-bayar {
    background-color: #e8f5e9;
    padding: 0.5rem 0.5rem;
    border-radius: 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: -0.5rem -0.75rem;
    margin-bottom: 0.25rem;
    gap: 0.5rem;
}

.btn-checkout {
    background-color: #2ecc71;
    border: none;
    padding: 0.5rem;
    margin-top: 0.5rem;
    margin-left: -0.75rem;
    width: calc(100% + 1.5rem);
    font-weight: 500;
    border-radius: 0.5rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-checkout:focus {
    background-color: #27ae60;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    outline: none;
}

.btn-checkout:active {
    transform: translateY(0);
}

.btn-checkout i {
    font-size: 1.2rem;
}

.btn-checkout.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-checkout.loading .btn-spinner {
    display: inline-block;
    margin-right: 0.1rem;
}

.btn-spinner {
    display: none;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.delivery-card.disabled {
    position: relative;
    cursor: not-allowed;
}

.warning-overlay {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(231, 76, 60, 0.9);
    color: white;
    width: 2.5rem; height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 10;
}