.cart-wrapper {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
}

.cart-display {
    background-color: rgba(0, 0, 0, 0.8);
    padding: 12px 20px;
    border-radius: 25px;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.cart-display:hover {
    background-color: rgba(0, 0, 0, 0.9);
}

.cart-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    width: 100%;
}

.cart-dropdown.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: slideUp 0.3s ease-out;
}

#checkout-button {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 20px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

#checkout-button:hover {
    background-color: rgba(0, 0, 0, 0.9);
}

.cart-total {
    margin-left: 8px;
    font-weight: bold;
}

/* Quantity controls */
.quantity-control {
    display: inline-flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: 25px;
    padding: 4px;
    margin: 10px 0;
}

.quantity-btn {
    background: none;
    border: none;
    color: #485fc7;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity {
    padding: 0 16px;
    font-weight: bold;
    color: #363636;
    min-width: 40px;
    text-align: center;
}

/* Slide-in Cart Panel Styles */
.cart-side-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 350px;
    max-width: 100vw;
    height: 100vh; /* Fallback */
    height: calc(var(--vh, 1vh) * 100);
    background-color: white;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    transition: right 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

.cart-side-panel.active {
    right: 0;
}

.cart-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.cart-panel-overlay.active {
    opacity: 1;
    visibility: visible;
}

.minimum-order-message {
    background-color: #fff3cd;
    color: #856404;
    padding: 10px 20px;
    border-bottom: 1px solid #ffeeba;
    font-size: 0.9rem;
    text-align: center;
}

.minimum-order-message p {
    margin: 0;
}

.minimum-order-message i {
    margin-right: 5px;
}

.cart-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.cart-panel-title {
    font-size: 1.25rem;
    font-weight: bold;
    margin: 0;
}

.close-cart-panel {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: #777;
    padding: 5px;
}

.cart-panel-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    padding: 0;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.empty-cart-message {
    text-align: center;
    color: #777;
    padding: 30px 0;
}

.cart-panel-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    background-color: #f9f9f9;
    position: sticky;
    bottom: 0;
    z-index: 10;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.cart-subtotal, .cart-shipping, .cart-total-panel {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

/* Ensure Country label matches subtotal/shipping font styling */
.shipping-country-form .label {
    font-family: 'Poppins Regular', sans-serif !important;
    font-weight: bold !important;
    font-size: 0.95rem !important;
}

.cart-total-panel {
    font-weight: bold;
    font-size: 1.1rem;
    padding-top: 10px;
    border-top: 1px solid #eee;
    margin-top: 10px;
}

.checkout-button-panel {
    width: 100%;
    margin-top: 15px;
}

.cart-item {
    display: flex;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

.cart-item-image {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    margin-right: 15px;
    flex-shrink: 0;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-details {
    flex: 1;
}

.cart-item-title {
    font-weight: bold;
    margin-bottom: 5px;
}

.cart-item-price {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 5px;
}

.cart-item-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
}

.cart-item-quantity button {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.cart-item-quantity span {
    margin: 0 10px;
    min-width: 20px;
    text-align: center;
}

.cart-item-subtotal {
    font-weight: bold;
}

.cart-badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #485fc7;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transform: translate(50%, -50%);
}

/* Sticky cart icon for when scrolling */
.sticky-cart-icon {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999;
    background-color: #fff;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    cursor: pointer;
}

.cart-icon-wrapper {
    position: relative;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #363636;
    transition: color 0.3s ease;
}

.sticky-cart-icon:hover .cart-icon-wrapper {
    color: #485fc7;
}

.sticky-cart-icon:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.sticky-cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff3860;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    text-align: center;
    line-height: 20px;
}

/* Custom styles for mobile */
@media screen and (max-width: 768px) {
    .cart-side-panel {
        width: 85%;
        right: -85%;
    }

    .cart-item {
        flex-wrap: wrap;
    }
    
    .cart-item-controls {
        width: 100%;
        margin-top: 10px;
    }
    
    .cart-item-quantity button {
        width: 24px;
        height: 24px;
    }
    
    .cart-panel-header {
        padding: 15px;
    }
    
    .cart-items {
        padding: 15px;
    }
    
    .cart-panel-footer {
        padding: 15px;
    }
    
    .sticky-cart-icon {
        top: 15px;
        right: 15px;
    }
    
    .cart-icon-wrapper {
        padding: 10px;
        font-size: 1.1rem;
    }
}
