/* style.css */
/* =========================================================
   UPDATED COLOR PALETTE + LAYOUT
   - Active category: #1E2A78 border + #F1F5F9 bg (Warm Navy + Soft Cloud)
   - Prices:          #F59E0B (Warm Amber)
   - Add to Cart btn: #3B82F6 (unchanged)
   - Page background: #F1F5F9 (Soft Cloud)
   - Product cards:   white bg, soft shadow, rounded-xl, no harsh border
   - Product img bg:  #F1F5F9 (Soft Cloud)
   ========================================================= */

body {
    -webkit-font-smoothing: antialiased;
    font-family: 'Inter', sans-serif;
    background-color: #F1F5F9; /* Soft Cloud page bg */
    margin: 0;
    padding: 0;
}

.kiosk-container {
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.kiosk-header {
    flex-shrink: 0;
    margin-bottom: 1.25rem;
}

.kiosk-content-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 1.25rem 0; /* no horizontal padding - container handles it */
    flex-grow: 1;
    align-items: start; /* prevent stretching */
}

@media (min-width: 768px) {
    .kiosk-content-wrapper {
        grid-template-columns: 260px 1fr;
    }

    #category-sidebar {
        position: sticky;
        top: 1.25rem;
        /* NO height set here - let content determine height */
    }
}

/* Desktop Wide Layout */
@media (min-width: 1280px) {
    .kiosk-content-wrapper {
        grid-template-columns: 280px 1fr;
    }
}

/* Category Sidebar Styling */
#category-list-vertical {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
}

@media (min-width: 768px) {
    #category-list-vertical {
        grid-template-columns: 1fr; /* List view on desktop sidebar */
    }
}

/* ========================================================= */
/* --- CATEGORY RESPONSIVE UI UPDATE --- */
/* ========================================================= */
/* Force Tailwind's hidden class to work against the CSS IDs on mobile */
#category-sidebar.hidden,
#horizontal-category-list-container.hidden {
    display: none !important;
}
/* --- Category Sidebar --- */
#category-sidebar {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

/* Vertical Category Grid */
#category-list-vertical {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1rem;
    overflow-y: auto;
    padding-right: 6px;
    flex: 1; /* take remaining space inside sidebar */
}

#category-list-vertical::-webkit-scrollbar { width: 6px; }
#category-list-vertical::-webkit-scrollbar-thumb { background-color: #D1D5DB; border-radius: 4px; }
#category-list-vertical::-webkit-scrollbar-track { background: transparent; }

/* Category Buttons (Vertical) */
.mcd-category-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 1rem;
    background: white;
    border-radius: 1rem;
    border: 2px solid transparent; /* no harsh border by default */
    transition: all 0.2s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    cursor: pointer;
}

.mcd-category-button:hover {
    background-color: #F8FAFC;
    border-color: #E2E8F0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30,42,120,0.08);
}

.mcd-category-button.active {
    border-color: #1E2A78; /* Warm Navy */
    background-color: #F1F5F9; /* Soft Cloud */
    box-shadow: 0 0 0 2px rgba(30, 42, 120, 0.12);
}

.category-icon {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 0.75rem;
    transition: transform 0.2s ease;
}

.mcd-category-button:hover .category-icon {
    transform: scale(1.05);
}

.category-name-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: #374151;
    text-align: center;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mcd-category-button.active .category-name-text {
    font-weight: 700;
    color: #1E2A78; /* Warm Navy, was #1F2937 */
}

/* --- Horizontal Categories (Mobile Top Bar) --- */
#horizontal-category-list-container {
    flex-shrink: 0;
    overflow-x: auto;
    white-space: nowrap;
    background-color: transparent;
    padding: 0.25rem 0.25rem 1rem 0.25rem;
    display: flex;
    gap: 0.75rem;
}

#horizontal-category-list-container::-webkit-scrollbar { height: 6px; }
#horizontal-category-list-container::-webkit-scrollbar-thumb { background-color: #D1D5DB; border-radius: 3px; }
#horizontal-category-list-container::-webkit-scrollbar-track { background: transparent; }

.horizontal-category-button {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 9999px; /* Modern Pill Shape */
    background-color: white;
    border: 2px solid #E5E7EB;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.horizontal-category-button .category-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 0;
    margin-right: 0.5rem;
}

.horizontal-category-button .category-name-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: #374151;
}

.horizontal-category-button:hover {
    background-color: #F8FAFC; /* warmer hover, was #F9FAFB */
    border-color: #D1D5DB;
    transform: translateY(-1px);
}

.horizontal-category-button.active {
    background-color: #F1F5F9; /* Soft Cloud, was #FEFCE8 */
    border-color: #1E2A78; /* Warm Navy, was #FACC15 */
}

.horizontal-category-button.active .category-name-text {
    font-weight: 700;
    color: #1E2A78; /* Warm Navy, was #1F2937 */
}

/* --- RESPONSIVE MAGIC (Desktop Lock) --- */
@media (min-width: 768px) {
    /* Desktop Sidebar View */
    .mcd-category-button {
        flex-direction: row;
        justify-content: flex-start;
        padding: 0.75rem 1rem;
    }
    .mcd-category-button .category-icon {
        width: 36px;
        height: 36px;
        margin-bottom: 0;
        margin-right: 1rem;
    }
    .mcd-category-button .category-name-text {
        text-align: left;
        font-size: 1rem;
    }
    #category-list-vertical {
        grid-template-columns: 1fr; /* Single list column */
        gap: 0.75rem;
    }
    
    /* Stop JS from hiding sidebar on desktop */
    #category-sidebar.hidden {
        display: flex !important;
        opacity: 1 !important;
        transform: none !important;
        width: auto;
    }
    /* Stop JS from showing horizontal bar on desktop */
    #horizontal-category-list-container:not(.hidden) {
        display: none !important;
    }
}
/* ========================================================= */
/* --- Product Display Area --- */
#main-content-area {
    background-color: #ffffff;
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 1px 6px rgba(0,0,0,0.07);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 160px); /* fixed height - stays consistent across all categories */
    max-height: calc(100vh - 160px);
    overflow: hidden;
    box-sizing: border-box;
    min-width: 0;
}

#main-content-area.is-scrollable {
    /* JS will set max-height */
    
}

#main-content-area.hidden {
    display: none;
    
}

#main-content-area:not(.hidden) {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
    
}

#category-sidebar:has(+ #main-content-area.hidden) {
    width: 100%;
}


#product-list-title {
    flex-shrink: 0;
}

#product-list-container {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    min-height: 0; /* crucial for overflow-y scroll inside flex */
    text-align: left;
}
#product-list-container::-webkit-scrollbar {
    width: 6px;
}
#product-list-container::-webkit-scrollbar-thumb {
    background-color: #D1D5DB;
    border-radius: 3px;
}
#product-list-container::-webkit-scrollbar-track {
    background: transparent;
}

/* Force 5 products per row */
#product-list {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 0.85rem;
}

@media (max-width: 1024px) {
    #product-list {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

@media (max-width: 768px) {
    #product-list {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* --- Product Card Styling --- */
.product-card {
    border: 1.5px solid #F1F5F9; /* very subtle, almost invisible */
    border-radius: 0.75rem; /* rounded-xl to match preview */
    background-color: #ffffff;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: box-shadow 0.2s ease-in-out, transform 0.2s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06); /* soft lift */
}

.product-card:hover {
    box-shadow: 0 6px 20px rgba(30,42,120,0.10);
    transform: translateY(-2px);
    border-color: #E2E8F0;
}

.product-image {
    width: 100%;
    height: 100px;
    object-fit: contain;
    margin-bottom: 0.5rem;
    border-radius: 0.5rem;
    background-color: #F1F5F9; /* Soft Cloud */
}

.product-name {
    font-weight: 600; /* slightly bolder to match preview */
    color: #1E293B;
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.8rem;
    line-height: 1.3em;
    min-height: 2.6em;
}

.product-price {
    color: #F59E0B; /* Warm Amber */
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
}

/* --- Sidebar container override --- */
#category-sidebar {
    align-self: start; /* crucial - prevents sidebar from stretching to grid height */
}

#category-sidebar > div {
    background-color: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 1px 6px rgba(0,0,0,0.07);
    border: none;
    max-height: calc(100vh - 160px); /* limit height with scroll */
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* --- Search bar override --- */
#kiosk-product-search {
    background-color: #F8FAFC;
    border: 1.5px solid #E2E8F0;
    border-radius: 0.625rem;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    color: #1E293B;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    outline: none;
}

#kiosk-product-search:focus {
    border-color: #1E2A78;
    box-shadow: 0 0 0 3px rgba(30,42,120,0.08);
    background-color: #ffffff;
}

/* --- Product list title --- */
#product-list-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1E293B;
    letter-spacing: 0.01em;
    flex-shrink: 0;
    margin-bottom: 0.75rem;
}

/* --- Out of stock card border --- */
.product-card.out-of-stock {
    opacity: 0.6;
    cursor: not-allowed;
    position: relative;
     border-color: #EF4444; /* Tailwind red-500 */
}
.product-card.out-of-stock:hover {
    /* Reset hover effects if any */
    transform: none;
    box-shadow: none; /* Assuming default card has no shadow */
}

.product-card.critical-stock {
     border-color: #F59E0B; /* Tailwind amber-500 */
}


/* --- Product Options Modal Styling --- */
#product-options-modal .bg-white {
    max-height: 90vh; /* Limit modal height */
    overflow-y: auto; /* Allow scrolling if content overflows */
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: #F59E0B #e5e7eb; /* Warm Amber scrollbar, was #FACC15 */
}
#product-options-modal .bg-white::-webkit-scrollbar { width: 6px; }
#product-options-modal .bg-white::-webkit-scrollbar-track { background: #e5e7eb; border-radius: 3px; }
#product-options-modal .bg-white::-webkit-scrollbar-thumb { background-color: #F59E0B; border-radius: 3px; } /* Warm Amber, was #FACC15 */


#options-modal-variations select {
    /* Basic styling for dropdowns */
    appearance: none; /* Remove default arrow */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem; /* Make space for arrow */
}

#options-modal-qty-controls button {
    transition: background-color 0.15s ease-in-out;
}

/* Style for quantity input */
#options-modal-qty {
    /* Hide spinner arrows */
    -moz-appearance: textfield;
}
#options-modal-qty::-webkit-outer-spin-button,
#options-modal-qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}



/* Text indicators */
.out-of-stock-text {
    color: #EF4444; /* rma-danger (Tailwind red-500) */
    font-weight: 600;
    font-size: 0.8rem;
    text-align: center;
    margin-top: 4px;
}

.stock-warning {
    font-size: 0.75em;
    color: #D97706; /* Tailwind amber-600 */
    font-weight: 600; /* Make it bolder */
    text-align: center;
    margin-top: 4px;
}

/* Button states */
.add-to-cart-btn:disabled {
    background-color: #9CA3AF; /* Tailwind gray-400 */
    cursor: not-allowed;
    border: 1px solid #9CA3AF;
    color: #F9FAFB;
}
.add-to-cart-btn:disabled:hover {
     background-color: #9CA3AF;
     border: 1px solid #9CA3AF;
}

/* Cart quantity button disabled state */
.quantity-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background-color: #e5e7eb; /* Keep light background */
}
.quantity-btn:disabled:hover {
    background-color: #e5e7eb; /* No hover effect */
}
.add-to-cart-btn {
    width: 100%;
    background-color: #3B82F6; /* unchanged */
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 500;
    font-size: 0.75rem;
    transition: background-color 0.2s ease-in-out;
    margin-top: auto;
    cursor: pointer;
    border: none;
    text-align: center;
}

.add-to-cart-btn:hover {
    background-color: #2563EB; /* Darker blue */
}

/* --- Loading/Error Indicators --- */
#loading-indicator, #error-message, #success-message {
    flex-shrink: 0;
}

/* --- Footer --- */
.kiosk-footer {
    flex-shrink: 0;
    text-align: center;
    color: #6b7280;
    margin-top: 1rem;
    padding-bottom: 0.5rem;
    font-size: 0.875rem;
}

/* --- Cart Icon --- */
#cart-icon-btn {
    position: fixed;
    z-index: 50;
}

/* --- Cart Modal --- */
#cart-modal {
    z-index: 100;
}

/* --- Cart Item Styling Update --- */
.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* Align items top */
    padding: 0.75rem 0; /* Increased padding */
    border-bottom: 1px solid #f3f4f6; /* border-gray-100 */
}
.cart-item:last-child {
    border-bottom: none;
}
.cart-item-img {
    width: 40px; /* w-10 */
    height: 40px; /* h-10 */
    object-fit: contain;
    border-radius: 0.25rem; /* rounded */
    margin-right: 0.75rem; /* mr-3 */
    flex-shrink: 0;
}
.cart-item-details {
    flex-grow: 1;
    margin-right: 1rem;
}
.cart-item-name {
    font-weight: 600; /* semibold */
    color: #1F2937;
    line-height: 1.3;
}
.cart-item-variation { /* Style for flavor/size */
    font-size: 0.8rem;
    color: #6b7280; /* text-gray-500 */
    margin-top: 0.1rem;
}
.cart-item-price {
    font-size: 0.875rem; /* text-sm */
    color: #4b5563; /* text-gray-600 */
    margin-top: 0.25rem;
}
.cart-item-actions {
    display: flex;
    flex-direction: column; /* Stack buttons vertically */
    align-items: flex-end;
    gap: 0.5rem; /* Space between buttons */
    flex-shrink: 0;
}
.cart-item-subtotal {
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 0.5rem; /* Space above buttons */
}
.cart-item-action-buttons {
    display: flex;
    gap: 0.5rem; /* Space between edit/remove */
}
.cart-item-action-buttons button {
    padding: 0.25rem; /* p-1 */
    border-radius: 0.25rem; /* rounded */
    transition: background-color 0.15s ease-in-out;
}
.cart-item-action-buttons button:hover {
    background-color: #f3f4f6; /* bg-gray-100 */
}
.cart-item-action-buttons svg {
     width: 1rem; /* w-4 */
     height: 1rem; /* h-4 */
     pointer-events: none; /* Important */
}

#cart-items::-webkit-scrollbar { display: none; } /* Hide scrollbar in cart modal */
#cart-items { -ms-overflow-style: none; scrollbar-width: none; }

/* --- Notification --- */
#add-to-cart-notification {
    z-index: 150;
}

/* --- Receipt Modal Styling --- */
#receipt-modal {
    z-index: 110;
}

#receipt-content-area {
    font-family: 'Courier New', Courier, monospace;
    line-height: 1.4;
    /* Added background and padding in kiosk.php for html2canvas */
}

#receipt-content-area::-webkit-scrollbar {
    width: 5px;
}
#receipt-content-area::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 3px;
}
#receipt-content-area::-webkit-scrollbar-track {
    background: transparent;
}


.receipt-header {
    color: #1F2937;
    font-size: 0.9rem;
}

.receipt-details p {
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
}
.receipt-details strong {
    color: #374151;
}

/* *** Style for the larger order number *** */
.receipt-order-number-display {
    font-size: 1.5rem;  /* Larger font size */
    font-weight: 700; /* Bold */
    color: #1F2937; /* Dark color */
    display: inline-block; /* Allows margin/padding if needed */
    margin-left: 0.25rem;
}


#receipt-items-list {
    border-top: 1px dashed #ccc;
    border-bottom: 1px dashed #ccc;
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0;
}

.receipt-item {
    display: flex;
    justify-content: space-between;
    padding: 1px 0;
    font-size: 0.8rem;
    color: #374151;
}
.receipt-item-name {
    text-align: left;
    flex-grow: 1;
    margin-right: 10px;
    white-space: normal;
    word-break: break-word;
}
.receipt-item-qty {
    min-width: 30px;
    text-align: right;
    margin-right: 10px;
}
.receipt-item-subtotal {
    min-width: 60px;
    text-align: right;
    font-weight: 500;
}

.receipt-total-line {
    color: #1F2937;
    font-weight: bold;
}
/* --- END Receipt Modal Styling --- */

.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s, opacity 0.2s, transform 0.1s ease-out;
    text-align: center;
    line-height: 1.4;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    display: inline-block;
}

.btn:active {
    transform: scale(0.98); /* Click effect */
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none; /* Disable click effect */
}

.btn.primary {
    background-color: #2980b9; /* Blue */
    color: white;
    border: 1px solid #2980b9;
}
.btn.primary:not(:disabled):hover {
    background-color: #3498db;
    border-color: #3498db;
}

.btn.secondary {
    background-color: #7f8c8d; /* Gray */
    color: white;
    border: 1px solid #7f8c8d;
}
.btn.secondary:not(:disabled):hover {
    background-color: #95a5a6; /* Lighter gray */
    border-color: #95a5a6;
}

/* Add other button types if needed (e.g., danger, warning, success) */
.btn.danger {
    background-color: #e74c3c;
    color: white;
    border: 1px solid #e74c3c;
}
.btn.danger:not(:disabled):hover {
    background-color: #c0392b;
    border-color: #c0392b;
}

#confirm-kiosk-clear-cart-modal {
    position: fixed; inset: 0; background-color: rgba(31, 41, 55, 0.75); display: flex; align-items: center; justify-content: center; z-index: 115; padding: 1rem;
}
#confirm-kiosk-clear-cart-modal.hidden { display: none; }
#confirm-kiosk-clear-cart-modal .bg-white { background-color: #ffffff; padding: 1.5rem; border-radius: 0.5rem; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); width: 100%; max-width: 24rem; text-align: center; }
#confirm-kiosk-clear-cart-modal h2 { font-size: 1.25rem; font-weight: 600; color: #1F2937; margin-bottom: 1rem; }
#confirm-kiosk-clear-cart-modal p { color: #374151; margin-bottom: 1.5rem; line-height: 1.5; }
#confirm-kiosk-clear-cart-modal .flex { display: flex; justify-content: center; gap: 1rem; }

/* Ensure buttons inherit base .btn styles or add specific styles */
#confirm-kiosk-clear-yes.btn.danger { /* Example using base btn */ }
#confirm-kiosk-clear-no.btn.secondary { /* Example using base btn */ }

/* ========================================================= */
/* --- CHATBOT UI REDESIGN --- */
/* ========================================================= */

/* FAB Button */
.chat-fab-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #D51314;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(213,19,20,0.45);
    transition: all 0.25s ease;
    position: relative;
}

.chat-fab-btn:hover {
    background: #B91010;
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(213,19,20,0.55);
}

.chat-fab-btn::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(213,19,20,0.4);
    animation: chat-pulse 2s ease-out infinite;
}

@keyframes chat-pulse {
    0%   { transform: scale(1);   opacity: 1; }
    100% { transform: scale(1.6); opacity: 0; }
}

/* Chat Window Popup */
.chat-window-popup {
    width: 340px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(30,42,120,0.18), 0 4px 16px rgba(0,0,0,0.10);
    display: flex;
    flex-direction: column;
    background: #ffffff;
    animation: chatSlideUp 0.3s cubic-bezier(.22,.68,0,1.2) both;
}

@keyframes chatSlideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* Fullscreen chat wrapper */
.fullscreen-chat-wrap {
    background: #FAFBFD;
}

/* Shared Header */
.chat-win-header {
    background: #1E2A78;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    border-radius: 20px 20px 0 0;
}

.chat-win-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-win-bot-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #D51314;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(213,19,20,0.35);
}

.chat-win-bot-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

.chat-win-bot-status {
    font-size: 0.68rem;
    color: #86efac;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 1px;
}

.chat-win-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4ade80;
    display: inline-block;
}

.chat-win-close {
    background: rgba(255,255,255,0.12);
    border: none;
    border-radius: 8px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-size: 1.1rem;
    line-height: 1;
    transition: background 0.2s;
}

.chat-win-close:hover { background: rgba(255,255,255,0.22); }

.chat-back-btn {
    background: rgba(255,255,255,0.12);
    border: none;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-back-btn:hover { background: rgba(255,255,255,0.22); }

/* Suggestions bar */
.chat-win-suggestions {
    background: #F1F5F9;
    padding: 8px 12px;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    border-bottom: 1px solid #E2E8F0;
    flex-shrink: 0;
}

.chat-win-suggestions::-webkit-scrollbar { display: none; }

.chat-win-chip {
    white-space: nowrap;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 20px;
    padding: 4px 11px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #1E2A78;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chat-win-chip:hover {
    background: #1E2A78;
    color: white;
    border-color: #1E2A78;
}

/* Messages area */
.chat-win-messages {
    flex: 1;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    background: #FAFBFD;
    min-height: 240px;
    max-height: 280px;
}

.fullscreen-messages {
    min-height: unset;
    max-height: unset;
    flex-grow: 1;
}

.chat-win-messages::-webkit-scrollbar { width: 4px; }
.chat-win-messages::-webkit-scrollbar-thumb { background: #E2E8F0; border-radius: 4px; }

/* Message rows */
.chat-msg-row {
    display: flex;
    align-items: flex-end;
    gap: 7px;
}

.chat-msg-row.user-row { flex-direction: row-reverse; }

.chat-msg-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #D51314;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-msg-avatar svg { width: 13px; height: 13px; fill: white; }

.chat-msg-avatar-user {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #2E3FA3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 800;
    color: white;
    flex-shrink: 0;
}

.chat-msg-col {
    display: flex;
    flex-direction: column;
    max-width: 78%;
}

.user-row .chat-msg-col { align-items: flex-end; }

/* Bubbles */
.chat-bubble {
    padding: 9px 13px;
    border-radius: 16px;
    font-size: 0.8rem;
    line-height: 1.5;
    word-break: break-word;
}

.chat-bubble.bot-bubble {
    background: #F1F5F9;
    color: #1E293B;
    border-bottom-left-radius: 4px;
}

.chat-bubble.user-bubble {
    background: #1E2A78;
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-bubble-time {
    font-size: 0.6rem;
    color: #94A3B8;
    margin-top: 3px;
    padding: 0 3px;
}

.user-row .chat-bubble-time { text-align: right; }

/* Typing dots */
.chat-typing-dots {
    display: flex;
    gap: 4px;
    padding: 9px 13px;
    background: #F1F5F9;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    width: fit-content;
}

.chat-typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #94A3B8;
    animation: chatBounce 1.2s infinite;
}

.chat-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes chatBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30%           { transform: translateY(-5px); }
}

/* Input area */
.chat-win-input-area {
    padding: 10px 12px;
    background: white;
    border-top: 1px solid #E2E8F0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    border-radius: 0 0 20px 20px;
}

.chat-win-input {
    flex: 1;
    background: #F1F5F9;
    border: 1.5px solid transparent;
    border-radius: 24px;
    padding: 8px 15px;
    font-size: 0.8rem;
    color: #1E293B;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    font-family: inherit;
}

.chat-win-input:focus {
    border-color: #1E2A78;
    background: white;
}

.chat-win-input::placeholder { color: #94A3B8; }

.chat-win-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #1E2A78;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chat-win-send-btn:hover {
    background: #162060;
    transform: scale(1.05);
}

/* Footer note */
.chat-win-footer {
    text-align: center;
    font-size: 0.62rem;
    color: #94A3B8;
    padding: 5px 12px 8px;
    background: white;
    border-radius: 0 0 20px 20px;
    flex-shrink: 0;
}

.chat-win-footer span {
    color: #F59E0B;
    font-weight: 700;
}

/* Legacy bubble styles — keep for JS compatibility */
.chat-suggestion-btn {
    background-color: white;
    color: #1E2A78;
    padding: 4px 11px;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    border: 1.5px solid #E2E8F0;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-suggestion-btn:hover {
    background: #1E2A78;
    color: white;
}

.user-message .bubble {
    background-color: #1E2A78;
    color: white;
    border-radius: 16px;
    border-bottom-right-radius: 4px;
    padding: 9px 13px;
    font-size: 0.8rem;
}

.bot-message .bubble {
    background-color: #F1F5F9;
    color: #1E293B;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    padding: 9px 13px;
    font-size: 0.8rem;
}

#fullscreen-chat.visible {
    opacity: 1;
    transform: translateY(0);
}
/* Add to the end of kiosk/style.css */

/* Profile Section */
#user-profile-section {
    min-width: 150px; /* Ensure it has some space */
}

/* Login/Register Modals */
.form-group {
    margin-bottom: 1rem;
}

.error-message {
    color: #EF4444; /* rma-danger */
    background-color: #FEE2E2; /* red-100 */
    padding: 0.75rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    border: 1px solid #FCA5A5; /* red-300 */
}

.success-message {
    color: #10B981; /* rma-success */
    background-color: #D1FAE5; /* green-100 */
    padding: 0.75rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    border: 1px solid #6EE7B7; /* green-300 */
}
/* Quantity Adjuster Styles for Cart Modal */
.cart-qty-btn {
    background-color: #f3f4f6; /* gray-100 */
    border: 1px solid #d1d5db; /* gray-300 */
    border-radius: 9999px; /* rounded-full */
    width: 1.75rem; /* w-7 */
    height: 1.75rem; /* h-7 */
    font-weight: 600;
    color: #374151; /* gray-700 */
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.cart-qty-btn:hover:not(:disabled) {
    background-color: #e5e7eb; /* gray-200 */
}
.cart-qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cart-qty-input {
    width: 3rem; /* w-12 */
    text-align: center;
    border: 1px solid #d1d5db; /* gray-300 */
    border-radius: 0.375rem; /* rounded-md */
    padding: 0.25rem;
    background-color: #fff;
    font-weight: 500;
}
/* Hide number input spinners */
.cart-qty-input::-webkit-outer-spin-button,
.cart-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.cart-qty-input[type=number] {
  -moz-appearance: textfield;
}

/* =========================================================
   MOBILE RESPONSIVE FIXES (max-width: 639px)
   ========================================================= */
@media (max-width: 639px) {

    /* Tighten outer container padding */
    #kiosk-main-container {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
        padding-top: 0.75rem !important;
    }

    /* Header: single row — logo+title left, profile/login right */
    .kiosk-header {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        flex-wrap: nowrap !important;
        gap: 0.5rem !important;
        padding: 1.1rem 1rem !important;
    }

    /* Logo + title group: take remaining space, shrink text to fit */
    .kiosk-header > div:first-child {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 0.4rem !important;
        min-width: 0 !important;
        flex: 1 1 0 !important;
    }

    .kiosk-header h1 {
        font-size: 1.05rem !important;
        line-height: 1.25 !important;
        white-space: normal !important;
        overflow: hidden !important;
    }

    .kiosk-header img {
        height: 2.5rem !important;
        flex-shrink: 0 !important;
    }

    /* Right side: don't grow, just wrap the icon/button */
    .header-right {
        flex-shrink: 0 !important;
        display: flex !important;
        align-items: center !important;
    }

    /* Login/Register button: compact on mobile */
    .header-right button#showAuthModalBtn {
        font-size: 0.78rem !important;
        padding: 0.4rem 0.75rem !important;
        gap: 0.25rem !important;
        white-space: nowrap !important;
    }

    /* Profile link: just the avatar circle, no text */
    .header-right a {
        padding: 0.25rem !important;
    }

    /* Fix main content area height on mobile */
    #main-content-area {
        height: calc(100svh - 120px) !important;
        max-height: calc(100svh - 120px) !important;
    }

    /* Smaller category card padding & icons */
    .mcd-category-button {
        padding: 0.75rem 0.5rem !important;
    }

    .mcd-category-button .category-icon {
        width: 44px !important;
        height: 44px !important;
        margin-bottom: 0.4rem !important;
    }

    .category-name-text {
        font-size: 0.78rem !important;
    }

    /* Product list: 2 columns */
    #product-list {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* FAB buttons — pull inward slightly */
    #cart-icon-btn {
        right: 0.75rem !important;
        bottom: 1.25rem !important;
        width: 3.25rem !important;
        height: 3.25rem !important;
    }

    #chat-icon-btn {
        right: 0.75rem !important;
        bottom: 5.5rem !important;
    }
}

/* Match cart FAB size to chat FAB */
#cart-icon-btn {
    width: 60px !important;
    height: 60px !important;
}

/* =========================================================
   ADD TO CART NOTIFICATION — restyled to match brand theme
   ========================================================= */
#add-to-cart-notification {
    /* Position: bottom center, above the cart FAB */
    position: fixed !important;
    bottom: 6rem !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    top: auto !important;
    right: auto !important;

    /* Brand colors: navy bg, white text */
    background-color: #F59E0B !important;
    color: #1F2937 !important;

    /* Pill shape */
    padding: 0.6rem 1.25rem !important;
    border-radius: 9999px !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    white-space: nowrap !important;

    /* Shadow for visibility */
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4) !important;

    z-index: 150;
}