/* Kirana Storefront Styles */
.kirana-store-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: sans-serif;
}

.kirana-store-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.kirana-store-main {
    display: flex;
    gap: 30px;
}

.kirana-products-grid {
    /* Kept for backward compatibility if needed, but we now use slider */
}

.kirana-product-slider {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding-bottom: 15px;
    scroll-snap-type: x mandatory;
}
.kirana-product-slider::-webkit-scrollbar {
    height: 6px;
}
.kirana-product-slider::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.kirana-product-card {
    border: 1px solid #eee;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    background: #fff;
    
    /* Sliding properties */
    flex: 0 0 calc(50% - 10px); /* 2 items per view on mobile */
    min-width: 140px;
    scroll-snap-align: start;
    
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .kirana-product-slider .kirana-product-card {
        flex: 0 0 200px; /* Fixed width on desktop */
    }
}

.kirana-product-card h3 {
    margin-top: 0;
    font-size: 18px;
}

.product-price {
    font-size: 20px;
    font-weight: bold;
    color: #27ae60;
}

.kirana-cart-sidebar {
    width: 300px;
    background: #fff;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    position: sticky;
    top: 20px;
    height: fit-content;
}

.kirana-cart-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.kirana-cart-sidebar ul li {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    border-bottom: 1px dashed #eee;
    padding-bottom: 5px;
}

.cart-total {
    font-size: 18px;
    margin-bottom: 20px;
    border-top: 2px solid #333;
    padding-top: 10px;
}

.kirana-btn {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
}

.kirana-btn-whatsapp {
    background: #25D366;
}

.kirana-btn-whatsapp:hover {
    background: #128C7E;
}

.kirana-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Mobile responsive */
.kirana-mobile-cart-banner {
    display: none;
}
.close-cart-mobile {
    display: none;
}

@media (max-width: 768px) {
    .kirana-store-main {
        flex-direction: column;
    }
    
    .kirana-mobile-cart-banner {
        background: #e8f5e9;
        padding: 15px;
        border-radius: 8px;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        margin-bottom: 20px;
        align-items: center;
        justify-content: space-between;
        border: 1px solid #27ae60;
        position: sticky;
        top: 10px;
        z-index: 100;
        /* display will be set via JS */
    }

    /* Full-screen cart on mobile */
    .kirana-cart-sidebar {
        position: fixed;
        top: 100%;
        left: 0;
        width: 100%;
        height: 100%;
        background: #fff;
        z-index: 2000;
        transition: top 0.3s ease;
        padding: 20px;
        box-sizing: border-box;
        overflow-y: auto;
    }
    .kirana-cart-sidebar.open {
        top: 0;
    }

    .close-cart-mobile {
        display: block;
        text-align: right;
        font-size: 18px;
        font-weight: bold;
        color: #e74c3c;
        margin-bottom: 15px;
        cursor: pointer;
    }

    .desktop-qr {
        display: none !important;
    }
}
@media (min-width: 769px) {
    .mobile-upi {
        display: none !important;
    }
}

/* Quantity Controls */
.qty-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 5px;
}
.qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: 1px solid #27ae60;
    background: #e8f5e9;
    color: #27ae60;
    cursor: pointer;
    font-weight: bold;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s;
}
.qty-btn:hover {
    background: #27ae60;
    color: #fff;
}
.qty-controls span {
    font-size: 16px;
    font-weight: bold;
    min-width: 25px;
    text-align: center;
}

/* Modal Styles */
.kirana-modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}
.kirana-modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    position: relative;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}
.kirana-close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    cursor: pointer;
    color: #666;
}
.kirana-close:hover {
    color: #000;
}

/* Print Receipt Styles */
@media print {
    body * {
        visibility: hidden;
    }
    #receipt-printable, #receipt-printable * {
        visibility: visible;
    }
    #receipt-printable {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        display: block !important;
        padding: 20px;
    }
    .kirana-modal { display: none !important; }
}
