/* Cart Button Widget Styles */
.cart-button-widget {
    position: relative;
    display: inline-block;
}

/* Custom Cart Button Styles */
.custom-cart-button {
    width: 45px;
    height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: pointer;
    border: none;
    background: #DAA520;
    border-radius: 50%;
    padding: 0;
    transition: transform 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.custom-cart-button:hover {
    transform: scale(1.1);
}

.cart-button-frame {
    width: 45px;
    height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.cart-button-image {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.cart-button {
    display: flex;
    align-items: center;
    gap: 8px;
        padding: 18px 10px 18px 15px !important;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.cart-button:hover {
    background: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.cart-button:active {
    transform: translateY(0);
}

.cart-button-text {
    white-space: nowrap;
}

.cart-count-on-button {
    background: #ff6b6b;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    position: absolute;
    top: -5px;
    right: -5px;
    z-index: 10;
    min-width: 20px;
    min-height: 20px;
}

.cart-count {
    background: #ff6b6b;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 20px;
    min-height: 20px;
}

/* Cart Sidebar Styles */
.cart-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.cart-sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    max-height: 100vh;
    background: white;
    border-left: 2px solid #888888;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    overflow: hidden;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
}

.cart-sidebar.active {
    right: 0;
}

.cart-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 32px;
    background: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.cart-sidebar-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #020817;
}

.cart-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.cart-close-btn:hover {
    opacity: 1;
    background: var(--primary-white);
}

.cart-items-container {
    overflow-y: auto;
    padding: 16px;
}

.cart-empty-message {
    text-align: center;
    color: #666;
    font-size: 16px;
    padding: 40px 20px;
    background: white;
    border-radius: 8px;
    margin: 20px;
}

.cart-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    margin-bottom: 12px;
    transition: box-shadow 0.3s ease;
}



.cart-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.cart-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.cart-item-name {
    font-weight: 600;
    color: #333;
    margin: 0;
    font-size: 14px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cart-item-shop {
    font-size: 12px;
    color: #666;
    margin: 0;
    font-style: italic;
}

.cart-item-price {
    font-weight: bold;
    color: #0073aa;
    margin: 0;
    font-size: 16px;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    background-color: #fff !important;
    flex-shrink: 0;
}


.back-button:hover{
   color: var(--primary-color) !important;
   gap: 0px  !important;

    }
    .back-button{
        gap: 0px  !important;
    }

.quantity-input {
    width: 50px;
    height: 30px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    flex-shrink: 0;
}

.quantity-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.delete-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.delete-btn:hover {
    background: #c82333;
}

.delete-btn:active {
    transform: scale(0.95);
}

.cart-sidebar-footer {
    background: #fff!important;
    position: sticky;
    bottom: 0;
    z-index: 10;
    flex-shrink: 0;
    min-height: 80px;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.total-label {
    color: #666;
}

.total-amount {
    color: #0073aa;
}

.checkout-button {
    width: 100%;
    padding: 16px;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}


.checkout-button:active {
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Mobile Cart Button Improvements */
    .custom-cart-button {
        width: 50px;
        height: 50px;
        min-width: 50px;
        min-height: 50px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
    }
    
    .cart-button-frame {
        width: 50px;
        height: 50px;
    }
    
    .cart-button-image {
        width: 28px;
        height: 28px;
    }
    
    .cart-button {
        padding: 15px 20px;
        min-height: 44px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
    }
    
    .cart-count-on-button {
        width: 24px;
        height: 24px;
        min-width: 24px;
        min-height: 24px;
        font-size: 14px;
        top: -8px;
        right: -8px;
    }
    
    /* Mobile Sidebar Improvements */
    .cart-sidebar {
        width: 100%;
        right: -100%;
        max-width: 100vw;
        height: 100vh;
        max-height: 100vh;
        top: 0;
        display: flex;
        flex-direction: column;
    }
    
    .cart-sidebar.active {
        right: 0;
    }
    
    .cart-sidebar-overlay {
        z-index: 9998;
        backdrop-filter: blur(2px);
    }
    
    .cart-sidebar {
        z-index: 9999;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.2);
    }
    
    .cart-sidebar-header {
        padding: 20px;
        position: sticky;
        top: 0;
        z-index: 10;
        background: white;
    
        min-height: 60px;
        display: flex;
        align-items: center;
        flex-shrink: 0;
    }
    
    .cart-sidebar-title {
        font-size: 20px;
        flex: 1;
    }
    
    .cart-close-btn {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
    }
    
    .cart-items-container {
        padding: 12px;
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 20px;
        min-height: 0;
        max-height: calc(100vh - 140px);
    }
    
    .cart-item {
        padding: 12px;
        gap: 12px;
        margin-bottom: 10px;
        min-height: 80px;
    }
    
    .cart-item-image {
        width: 50px;
        height: 50px;
        flex-shrink: 0;
    }
    
    .cart-item-details {
        min-width: 0;
        flex: 1;
    }
    
    .cart-item-controls {
        flex-wrap: wrap;
        gap: 6px;
        margin-top: 8px;
    }
    
    .quantity-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
        min-width: 32px;
        min-height: 32px;
        touch-action: manipulation;
    }
    
    .quantity-input {
        width: 50px;
        height: 32px;
        font-size: 14px;
        min-width: 50px;
    }
    
    .delete-btn {
        padding: 8px 12px;
        font-size: 12px;
        min-height: 32px;
        touch-action: manipulation;
    }
    
    .cart-sidebar-footer {
        position: sticky;
        bottom: 0;
        z-index: 10;
        background: white;
        flex-shrink: 0;
        min-height: 100px;
    }
    
    .checkout-button {
        padding: 16px;
        font-size: 16px;
        min-height: 48px;
        touch-action: manipulation;
    }
    
    .cart-total {
        font-size: 18px;
        margin-bottom: 16px;
    }
}

@media (max-width: 480px) {
    /* Extra Small Mobile Cart Button */
    .custom-cart-button {
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
        touch-action: manipulation;
    }

	.cart-sidebar-header .back-button{
        margin: 0px !important;
	}
	.cart-sidebar-header{
		padding: 0px !important;
	}
    
    .cart-button-frame {
        width: 48px;
        height: 48px;
    }
    
    .cart-button-image {
        width: 24px;
        height: 24px;
    }
    
    .cart-button {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 44px;
        touch-action: manipulation;
    }
    
    .cart-count-on-button {
        width: 22px;
        height: 22px;
        min-width: 22px;
        min-height: 22px;
        font-size: 12px;
        top: -6px;
        right: -6px;
    }
    
    .cart-count {
        width: 20px;
        height: 20px;
        font-size: 12px;
    }
    
    /* Extra Small Mobile Sidebar */
    .cart-sidebar {
        width: 100%;
        right: -100%;
        max-width: 100vw;
        height: 100vh;
        max-height: 100vh;
        display: flex;
        flex-direction: column;
    }
    
    .cart-sidebar.active {
        right: 0;
    }
    
    .cart-sidebar-header {
        position: sticky;
        top: 0;
        z-index: 10;
        background: white;
 
        min-height: 56px;
        flex-shrink: 0;
    }
    
    .cart-sidebar-title {
        font-size: 18px;
        flex: 1;
    }
    
    .cart-close-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        touch-action: manipulation;
    }
    
    .cart-items-container {
        padding: 8px;
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 16px;
        min-height: 0;
        max-height: calc(100vh - 120px);
    }
    
    .cart-item {
        padding: 10px;
        gap: 10px;
        margin-bottom: 8px;
        min-height: 70px;
    }
    
    .cart-item-image {
        width: 45px;
        height: 45px;
        flex-shrink: 0;
    }
    
    .cart-item-details {
        min-width: 0;
        flex: 1;
    }
    
    .cart-item-name {
        font-size: 13px;
        line-height: 1.2;
    }
    
    .cart-item-price {
        font-size: 14px;
    }
    
    .cart-item-controls {
        flex-wrap: wrap;
        gap: 4px;
        margin-top: 6px;
    }
    
    .quantity-btn {
        width: 28px;
        height: 28px;
        font-size: 14px;
        min-width: 28px;
        min-height: 28px;
        touch-action: manipulation;
    }
    
    .quantity-input {
        width: 45px;
        height: 28px;
        font-size: 13px;
        min-width: 45px;
    }
    
    .delete-btn {
        padding: 6px 10px;
        font-size: 11px;
        min-height: 28px;
        touch-action: manipulation;
    }
    
    .cart-sidebar-footer {
        position: sticky;
        bottom: 0;
        z-index: 10;
        background: white;
        flex-shrink: 0;
        min-height: 90px;
    }
    
    .cart-total {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .checkout-button {
        padding: 14px;
        font-size: 14px;
        min-height: 44px;
        touch-action: manipulation;
    }
}

/* Animation for cart count */
@keyframes cartCountPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.cart-count.updated {
    animation: cartCountPulse 0.3s ease;
}

/* Loading state for cart items */
.cart-item.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Empty state styling */
.cart-empty-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.cart-empty-message::before {
    content: "🛒";
    font-size: 48px;
    opacity: 0.3;
}

/* Scrollbar styling for cart items container */
.cart-items-container::-webkit-scrollbar {
    width: 6px;
}

.cart-items-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.cart-items-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.cart-items-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Focus states for accessibility */


.quantity-input:focus {
    outline: 2px solid #0073aa;
    outline-offset: 1px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .cart-button {
        border: 2px solid currentColor;
    }
    
    .cart-sidebar {
        border-left: 3px solid #000;
    }
    
    .cart-item {
        border: 2px solid #000;
    }
    
    .quantity-btn,
    .delete-btn,
    .checkout-button {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .cart-button,
    .cart-sidebar,
    .cart-sidebar-overlay,
    .quantity-btn,
    .delete-btn,
    .checkout-button {
        transition: none;
    }
    
    .cart-count.updated {
        animation: none;
    }
}