:root {
    --primary-red: #da251d;
    --primary-yellow-img: url('/assets/img/background.avif');
    --secondary-yellow: #f8c947; 
    --text-dark: #333;
    --bg-gray: #f5f6f8;
    --green-text: #008a00;
}
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Poppins', sans-serif; }
body { background-color: var(--bg-gray); color: var(--text-dark); overflow-x: hidden; }
.hide-on-desktop { display: none !important; }

#toast-container { position: fixed; bottom: 25px; left: 25px; z-index: 9999999; display: flex; flex-direction: column; gap: 10px; }
.ui-toast { background: #222; color: #fff; padding: 12px 22px; border-radius: 12px; font-size: 13px; font-weight: 500; box-shadow: 0 8px 25px rgba(0,0,0,0.25); display: flex; align-items: center; gap: 10px; }
.ui-toast.success { background: #16a34a; }
.ui-toast.error { background: #dc2626; }

.app-wrapper { display: flex; }
.sidebar-cart {
    width: 430px; 
    background-image: var(--primary-yellow-img); 
    background-size: cover;        
    background-position: center;   
    background-repeat: no-repeat;  
    position: fixed; 
    top: 0; 
    left: 0; 
    height: 100vh;
    display: flex; 
    flex-direction: column; 
    padding: 15px 25px; 
    z-index: 100; 
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}
.sidebar-logo { text-align: center; margin-top: -15px; margin-bottom: 15px; flex-shrink: 0; }
.sidebar-logo img { width: 120px; }

.receipt-container { flex: 1; min-height: 0; display: flex; flex-direction: column; margin-bottom: 5px; }
.receipt-box { background: #ffffff; display: flex; flex-direction: column; position: relative; padding: 20px 20px 0 20px; border-radius: 12px 12px 0px 0px; }
.receipt-box::after {
    content: ""; position: absolute; bottom: -16px; left: 0; width: 100%; height: 20px;
    background: linear-gradient(135deg, #fff 50%, transparent 50%), linear-gradient(225deg, #fff 50%, transparent 50%);
    background-size: 20px 20px; background-repeat: repeat-x; z-index: 10;
}
#cart-items-container { flex: 1; overflow-y: auto; overflow-x: hidden; max-height: 42vh; padding-right: 5px; }
#cart-items-container::-webkit-scrollbar { display: none; }

.cart-item { border-bottom: 1px dotted #ccc; padding: 12px 0; display: flex; flex-direction: column; gap: 8px; }
.cart-item-name { font-size: 13px; font-weight: 600; color: #444; text-transform: uppercase; }
.cart-actions { display: flex; justify-content: flex-end; align-items: center; gap: 15px; }
.qty-btn { background: none; border: none; font-size: 16px; color: #888; cursor: pointer; }
.qty-num { font-size: 14px; font-weight: 500; color: #666; }
.item-price { font-size: 14px; font-weight: 600; color: #333; margin-left: 10px;}
.del-btn { background: none; border: none; color: #aaa; font-size: 14px; cursor: pointer; font-weight: bold; margin-left: 5px;}

.receipt-footer { flex-shrink: 0; padding-bottom: 25px; background: #fff; }
.subtotal-row { display: flex; justify-content: space-between; padding: 15px 0; border-top: 1px solid #eee; border-bottom: 1px dotted #ccc; font-size: 18px; font-weight: 700; }
.subtotal-text { color: var(--green-text); }
.subtotal-val { color: var(--primary-red); }

.checkout-row { display: flex; justify-content: space-between; align-items: center; padding: 20px 0 10px; }
.limit-text { font-size: 12px; color: #777; line-height: 1.4; font-weight: 400;}
.checkout-btn { padding: 8px 18px; border: none; border-radius: 8px; font-weight: 700; font-size: 14px; cursor: pointer; transition: 0.3s; }
.checkout-btn.disabled { background: #dcdcdc; color: #fff; cursor: not-allowed; }
.checkout-btn.active { background: var(--primary-red); color: #fff; box-shadow: 0 4px 12px rgba(218, 37, 29, 0.3); }
.payment-guidelines { font-size: 8px; color: #888; margin-top: 10px; line-height: 1.5; text-align: justify; }

.main-content { margin-left: 430px; flex: 1; padding: 0 25px 25px 25px; min-height: 100vh; }
.top-controls { display: flex; justify-content: space-between; align-items: center; background: var(--bg-gray); padding: 20px 0 15px 0; position: sticky; top: 0; z-index: 50; border-bottom: 1px solid #e2e2e2; margin-bottom: 20px; }
.dropdowns, .action-buttons { display: flex; align-items: center; gap: 12px; }
.control-select { padding: 8px 15px; border: 1px solid #ddd; border-radius: 20px; font-size: 12px; outline: none; background: #fff; cursor: pointer; }

.search-container { display: none; margin-right: 5px; }
.search-container.active { display: block; }
.search-container input { padding: 8px 15px; border-radius: 20px; border: 1px solid #ddd; outline: none; font-size: 12px; width: 180px;}

.icon-btn-round { background: var(--primary-red); color: #fff; border: none; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; display: flex; justify-content: center; align-items: center; font-size: 15px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); transition: 0.2s; }
.icon-btn-round:hover { transform: scale(1.05); }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.product-card { background: #fff; border-radius: 16px; padding: 16px; position: relative; display: flex; flex-direction: column; box-shadow: 0 5px 15px rgba(0,0,0,0.04); cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; }
.product-card:hover { transform: translateY(-4px); box-shadow: 0 10px 25px rgba(0,0,0,0.08); }

.item-counter-bubble { position: absolute; top: -8px; left: -8px; background: var(--primary-red); color: #fff; width: 26px; height: 26px; border-radius: 50%; display: none; align-items: center; justify-content: center; font-size: 11px; font-weight: bold; z-index: 2; box-shadow: 0 3px 8px rgba(0,0,0,0.2); }
.product-image { width: 100%; height: 160px; object-fit: contain; margin-bottom: 12px; pointer-events: none;}
.product-title { font-size: 13px; font-weight: 600; color: var(--text-dark); margin-bottom: 5px; line-height: 1.3; text-transform: uppercase; pointer-events: none;}
.product-subtitle { font-size: 10px; color: #888; margin-bottom: 15px; flex-grow: 1; pointer-events: none;}
.product-price-box { margin-top: auto; pointer-events: none;}
.price-new { color: var(--primary-red); font-weight: 700; font-size: 20px; display: block; }
.price-old { color: #aaa; font-size: 10px; text-decoration: line-through; }

.triangle-cart-btn {
    position: absolute; bottom: 0; right: 0; width: 75px; height: 75px; background-color: var(--secondary-yellow);
    clip-path: polygon(100% 0, 100% 100%, 0 100%); display: flex; align-items: flex-end; justify-content: flex-end;
    padding: 10px; border-bottom-right-radius: 16px; transition: 0.2s; pointer-events: none;
}
.triangle-cart-btn i { color: #fff; font-size: 18px; margin-bottom: 4px; margin-right: 4px; }
.product-card.active-item .triangle-cart-btn { background-color: var(--primary-red); }
.product-card.active-item .item-counter-bubble { display: flex; }

.whatsapp-float {
    position: fixed; bottom: 25px; right: 25px; background: #25d366; color: #fff; width: 65px; height: 65px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center; z-index: 1000; text-decoration: none; font-size: 36px; box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4); transition: transform 0.2s;
}
.whatsapp-float:hover { transform: scale(1.1); }

.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.75);
    display: none; justify-content: center; align-items: center; z-index: 5000; backdrop-filter: blur(8px);
}
.big-checkout-modal {
    position: relative; background: #ffffff; width: 95%; max-width: 900px; height: 600px; border-radius: 32px;
    padding: 50px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4); border: 1px solid #e2e8f0;
    display: flex; flex-direction: column; justify-content: space-between; overflow: hidden;
    animation: zoomInPopup 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    z-index: 10;
}
@keyframes zoomInPopup { 0% { transform: scale(0.8); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

.split-modal-container { display: flex; gap: 20px; align-items: stretch; height: 100%; }
.split-left-pane { flex: 0 0 65%; border-right: 1px solid #edf2f7; padding-right: 30px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.split-right-pane { flex: 0 0 30%; display: flex; flex-direction: column; justify-content: space-between; align-items: center; text-align: center; }

.close-modal { position: absolute; top: 20px; right: 25px; background: none; border: none; font-size: 28px; color: #888; cursor: pointer; z-index: 20; transition: color 0.2s; }
.close-modal:hover { color: #111; }

.input-group { display: flex; flex-direction: column; gap: 5px; }
.input-group label { font-size: 13px; font-weight: 600; color: #2d3748; }
.input-group input, .input-group textarea { padding: 11px 14px; border: 1px solid #DCA350; border-radius: 10px; font-size: 13px; outline: none; width: 100%; background: #fffaf1; }

.card-header { text-align: center; position: relative; margin-bottom: 4px; }
.qr-container { display: flex; justify-content: center; align-items: center; margin-bottom: 8px; }
.qr-frame { padding: 8px; margin-left: 18px; background: #ffffff; border-radius: 12px; border: 1px solid #e2e8f0; }
#qrcode img { display: block; width: 200px !important; height: 200px !important; }
.upi-id-section { font-size: 10px; font-weight: 600; color: #4a5568; margin-bottom: 8px; }

.payment-action-box { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.payment-action-box input { width: 100%; padding: 9px 12px; border: 1px solid #DCA350; border-radius: 10px; font-size: 12px; text-align: center; outline: none; background: #fffaf1; }
.pay-later-label { font-size: 11px; display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; font-weight: 600; color: #4a5568; }
.confirm-pay-btn { width: 100%; background: var(--primary-red); color: #fff; border: none; padding: 12px; border-radius: 10px; font-size: 13px; font-weight: 700; cursor: pointer; transition: 0.2s; }
.confirm-pay-btn:hover { background: #b51e17; }

.big-checkout-modal.success-transformed {
    background: #16a34a !important;
    border-color: #15803d !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background 0.4s ease, border-color 0.4s ease;
}

.popup-confetti-canvas {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    pointer-events: none; z-index: 9999999 !important;
}

.success-inner-content {
    display: none;
    position: relative; 
    z-index: 5; 
    width: 100%; 
    height: 100%;
    flex-direction: column; 
    justify-content: center; 
    align-items: center;
    text-align: center; 
    color: #fff; 
    gap: 12px; 
    padding: 20px;
    box-sizing: border-box;
}

.success-check-badge {
    width: 70px; height: 70px; background: #ffffff; color: #16a34a; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 32px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    animation: bounceIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes bounceIn { 0% { transform: scale(0); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }

.success-info-card {
    background: rgba(255, 255, 255, 0.96); color: #1a202c; border-radius: 14px; padding: 12px 20px;
    width: 100%; max-width: 440px; text-align: left; font-size: 12px; display: flex; flex-direction: column; gap: 5px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
.success-info-row { display: flex; justify-content: space-between; }

.done-close-btn {
    background: #ffffff; color: #16a34a; border: none; padding: 10px 28px; border-radius: 12px;
    font-size: 14px; font-weight: 700; cursor: pointer; box-shadow: 0 5px 15px rgba(0,0,0,0.15); transition: 0.2s;
}
.done-close-btn:hover { background: #f0fdf4; transform: translateY(-1px); }

@media (max-width: 768px) {
    .hide-on-desktop { display: flex !important; }
    .hide-on-mobile { display: none !important; }
    
    /* Fixed background and container bug for mobile cart view */
    body { 
        position: relative;
        background-color: #e8e8e8 !important; /* Fallback color */
        overflow-x: hidden;
        display: flex;
        flex-direction: column;
        height: 100%;
        height: 100dvh;
        margin: 0;
        width: 100%;
    }

    /* Creates a blurred background image layer without blurring page content */
    body::before {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-image: var(--primary-yellow-img) !important;
        background-size: cover !important;
        background-position: center !important;
        background-repeat: no-repeat !important;
        filter: blur(5px); /* Adjust the pixel value (e.g., 5px, 8px, 12px) for more or less blur */
        transform: scale(1.1); /* Prevents white blurry edges from showing during the blur */
        z-index: -1; /* Pushes the background layer behind all your HTML content */
    }

    /* When cart is active, background becomes transparent so image shows */
    body:has(#sidebar-cart-view.active) {
        background-color: transparent !important;
    }

    .app-wrapper {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        position: relative;
        width: 100%;
        height: calc(100dvh - 110px);
        background: transparent !important;
    }

    .main-content {
        margin-left: 0;
        flex: 1;
        height: 100%;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 0 10px 10px 10px;
    }
    
    .main-content::-webkit-scrollbar {
        display: none;
    }

    .sidebar-cart {
        width: 100%;
        height: 100%;
        display: none;
        position: fixed;
        background-image: var(--primary-yellow-img) !important;
        background-size: cover !important;
        background-position: center !important;
        padding: 15px;
        box-shadow: none !important;
    }

    .sidebar-cart.active {
        display: flex !important;
        flex-direction: column;
        justify-content: space-between;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 80px;
    }

    .mobile-header {
        background-color: transparent;
        height: 65px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0;
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    .mobile-header-btn-left {
        background-color: var(--primary-red);
        color: #fff;
        border: none;
        margin-top: 20px;
        height: 60px;
        width: 80px;
        border-top-right-radius: 35px;
        border-bottom-right-radius: 35px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 35px;
        cursor: pointer;
        box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    }

    .mobile-header-btn-right {
        background-color: var(--primary-red);
        color: #fff;
        border: none;
        margin-top: 20px;
        height: 60px;
        width: 80px;
        border-top-left-radius: 35px;
        border-bottom-left-radius: 35px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 35px;
        cursor: pointer;
        position: relative;
        box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    }

    .mobile-logo-container img {
        height: 75px;
        margin-top: 15px;
        object-fit: contain;
    }

    #product-grid {
        width: 100%;
        padding-bottom: 160px;
        padding-top: 12px;
    }

    .mobile-header-cart-badge {
        position: absolute;
        top: 5px;
        left: 55px;
        background: #fff;
        color: var(--primary-red);
        font-size: 11px;
        font-weight: bold;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    }

    .icon-btn-text { background: none; border: none; color: #fff; font-size: 22px; cursor: pointer; position: relative; }
    .cart-badge { position: absolute; top: -5px; right: -10px; background: #fff; color: var(--primary-red); font-size: 11px; font-weight: bold; padding: 2px 6px; border-radius: 50%; }
    .mobile-sub-controls { display: flex; justify-content: space-between; align-items: center; margin: 25px 15px 25px 15px;}
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .product-image { height: 110px; }
    .big-checkout-modal { height: auto; max-height: 90vh; overflow-y: auto; padding: 20px; }
    .split-modal-container { flex-direction: column; }
    .split-left-pane { border-right: none; border-bottom: 1px solid #edf2f7; padding-bottom: 15px; }
}

@media (max-width: 768px) {
    .receipt-container{
        margin-top: 100px;
    }

    .footer{
        display: none;
    }

    .big-checkout-modal::-webkit-scrollbar,
    .split-left-pane::-webkit-scrollbar {
        display: none;
    }

    /* Hide scrollbar for Firefox, IE, and Edge */
    .big-checkout-modal,
    .split-left-pane {
        -ms-overflow-style: none;  /* IE and Edge */
        scrollbar-width: none;     /* Firefox */
    }
}

@media (max-width: 768px) {

    .body{
        background: var(--primary-yellow-img);
    }
    /* 1. Reset padding and ensure the modal fits the screen width cleanly without scroll space gaps */
    .big-checkout-modal {
        width: 92% !important;
        margin: 0 auto;
        padding: 20px 15px !important;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .whatsapp-float {
    position: fixed; bottom: 25px; right: 25px; background: #25d366; color: #fff; width: 50px; height: 50px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center; z-index: 1000; text-decoration: none; font-size: 25px; box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4); transition: transform 0.2s;
}

    /* 2. Center-align form elements and text inside the left pane */
    .split-left-pane {
        padding-right: 0 !important;
        border-right: none !important;
        align-items: center;
        text-align: left;
    }

    /* 3. Make input groups and action boxes full width and centered */
    .split-left-pane .input-group,
    .split-left-pane .payment-action-box {
        width: 100%;
    }

    .split-left-pane .input-group input,
    .split-left-pane .input-group textarea {
        text-align: center;
    }

    /* 4. Center-align items in the right pane (QR and UPI sections) */
    .split-right-pane {
        width: 100%;
        align-items: center;
        text-align: center;
    }

    .split-right-pane img {
        margin-left: 5 !important; /* Removes off-center margin from desktop styling */
    }

    .qr-frame {
        margin-left: 0 !important;
    }
}