@import url("./mobile-style.css");

:root {
    /* PRIMARY BRAND COLORS */
    --color-primary: #0066cc;              /* Main brand blue - used for buttons, hover states, borders, FAB */
    --color-primary-dark: #0052a3;         /* Dark blue gradient - used in header gradient, button hover */
    --color-primary-light: #f0f5ff;        /* Light blue background - used for Recommendation Panel section */
    --color-primary-shadow: rgba(0, 102, 204, 0.15); /* Shadow for product cards on hover */
    --color-primary-shadow-dark: rgba(0, 102, 204, 0.3); /* Darker shadow for FAB hover */
    --color-dialog-header: #007bff;        /* Dialog header blue - used for blue-header-dialog theme */
    --color-primary-glow: rgba(0, 102, 204, 0.4); /* Glow effect for input focus */
    
    /* ACCENT COLORS */
    --color-accent-gold: #ffd700;          /* Gold/Yellow accent - used for logo icon in header */
    --color-accent-red: #ff4444;           /* Red accent - used for cart badge counter and action buttons */
    --color-accent-red-dark: #cc0000;      /* Dark red - for action button hover (settings, clear chat, remove) */
    
    /* SECTION BACKGROUND COLORS (Gradients) */
    --color-section-chat: #f8f9fa;         /* Light gray - Chat Section background top gradient */
    --color-section-chat-end: #ffffff;     /* White - Chat Section background end gradient */
    --color-section-rec: #f0f5ff;          /* Light blue - Recommendation Panel background top gradient */
    --color-section-rec-end: #ffffff;      /* White - Recommendation Panel background end gradient */
    --color-section-cart: #fff8f0;         /* Light orange - Cart Sidebar background top gradient */
    --color-section-cart-end: #ffffff;     /* White - Cart Sidebar background end gradient */
    
    /* TEXT COLORS */
    --color-text-white: white;             /* White text - used in header title and subtitle */
    --color-text-dark: rgba(0, 0, 0, 0.704); /* Dark text - used for cart item names */
    --color-text-header-subtitle: rgba(255, 255, 255, 0.8); /* Semi-transparent white - used for header subtitle */
    --color-text-gray: #666666;            /* Gray text - secondary text, disabled state */
    --color-text-light-gray: #999999;      /* Light gray text - tertiary text */
    
    /* BUTTON & INTERACTIVE COLORS */
    --color-button-secondary-bg: rgba(0, 102, 204, 0.08); /* Light blue background - Secondary/Tertiary buttons */
    --color-button-secondary-border: rgba(0, 102, 204, 0.2); /* Light blue border - Secondary/Tertiary buttons */
    --color-button-secondary-hover: rgba(0, 102, 204, 0.15); /* Medium blue - Secondary/Tertiary button hover */
    --color-button-secondary-hover-border: rgba(0, 102, 204, 0.4); /* Darker blue border - Secondary/Tertiary button hover */
    --color-button-secondary-text: #0066cc; /* Blue text - Secondary/Tertiary button text */
    
    /* SHADOW & OVERLAY COLORS */
    --color-shadow-light: rgba(0, 0, 0, 0.1); /* Light shadow - drawer shadows, minor elevations */
    --color-shadow-medium: rgba(0, 0, 0, 0.15); /* Medium shadow - product card shadows */
    --color-shadow-dark: rgba(0, 0, 0, 0.3); /* Dark shadow - flying product clone effect */
    --color-overlay-light: rgba(255, 255, 255, 0.1); /* Light overlay - header glossy effect */
    --color-overlay-dark: rgba(152, 146, 146, 0.9); /* Dark overlay - UI overlay states */
    
    /* NEUTRAL COLORS */
    --color-neutral-light-gray: rgba(164, 155, 155, 0.397); /* Light gray - remove button background */
    --color-neutral-gray: rgb(171, 175, 178); /* Gray - disabled/inactive states */
    --color-neutral-transparent: rgba(0, 0, 0, 0); /* Transparent - overlay backgrounds */
    --color-neutral-semi-white: rgba(255, 255, 255, 0.7); /* Semi-white - light overlays */
}



/* Pulse animation for speech recognition */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(255, 0, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 0, 0, 0); }
}

.recording {
    animation: pulse 1.5s infinite;
    border-radius: 50%;
}

/* Scaling pop animation for add-to-cart */
@keyframes add-to-cart-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.cart-added-animation {
    animation: add-to-cart-pop 0.4s ease-out;
}

/* Floating product clone effect */
.flying-product-clone {
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    transition: all 0.8s cubic-bezier(0.42, 0, 0.58, 1);
    border-radius: 50%;
    box-shadow: 0 4px 15px var(--color-shadow-dark);
}

/* Cart drawer slide-in animation */
@keyframes slide-in-right {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slide-out-right {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Product card fade-in animation */
@keyframes product-card-fade-in {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chat message pulse animation */
@keyframes message-pulse {
    0% {
        opacity: 0;
        transform: scale(0.98);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* FAB pop animation */
@keyframes fab-pop {
    0% { transform: scale(0.7); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Global smooth transitions for all interactive elements */
* {
    --lumo-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

vaadin-button,
vaadin-text-field,
vaadin-text-area,
vaadin-combo-box,
vaadin-date-picker {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* ==========================================================================
   RESPONSIVE MAIN LAYOUT & HEADER
   ========================================================================== */

.ai-chat-view {
    height: 100%;
    transition: opacity 0.4s ease, background-color 0.3s ease;
}

.main-layout-header {
    background: #277fbeb5;
    box-shadow: 0 4px 12px var(--color-primary-shadow);
    padding: var(--lumo-space-m);
    position: relative;
}

.main-layout-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, var(--color-overlay-light) 0%, transparent 50%);
    pointer-events: none;
}

/* Settings button - make it visible with dark color */
.settings-btn {
    color: #0066cc !important;
    background-color: transparent !important;
}

.settings-btn svg {
    color: #0066cc !important;
}

.settings-btn:hover {
    color: #0052a3 !important;
    background-color: rgba(0, 102, 204, 0.1) !important;
}

/* Clear chat button - make it visible */
.main-layout-header button:has(svg) {
    color: #0066cc !important;
}

.main-layout-header button:has(svg):hover {
    color: #0052a3 !important;
    background-color: rgba(0, 102, 204, 0.1) !important;
}

.main-layout-title {
    font-size: var(--lumo-font-size-xl);
    margin: 0;
    color: #0066cc;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.main-layout-title-wrapper {
    display: flex;
    align-items: baseline;
    gap: var(--lumo-space-s);
    margin-left: -12px;
    margin-bottom: -10px;
    position: relative;
    z-index: 1;
}

.main-layout-logo {
    color: var(--color-accent-gold);
    font-size: var(--lumo-font-size-xl);
}

.main-layout-subtitle {
    font-size: var(--lumo-font-size-s);
    color: #0066cc;
    margin-left: var(--lumo-space-s);
}

/* ========== DEFAULT MOBILE FAB STATE ========== */
/* FAB is visible by default (shown on mobile/tablet) */
.mobile-cart-fab {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ========== RESPONSIVE MAIN LAYOUT ========== */

/* DESKTOP VIEW (≥ 1024px) - 3 Panel Layout */
@media (min-width: 1024px) {
    .main-chat-layout {
        display: flex !important;
        flex-direction: row !important;
        width: 100% !important;
        height: 100% !important;
    }
    
    .chatsection-main {
        flex: 1 1 auto;
        min-width: 0;
        display: flex;
        flex-direction: column;
    }
    
    .recommendation-panel {
        width: 220px !important;
        min-width: 220px !important;
        flex: 0 0 220px !important;
        border-left: 1px solid var(--lumo-contrast-5pct);
        display: flex !important;
    }
    
    .cart-sidebar {
        width: 340px !important;
        min-width: 340px !important;
        flex: 0 0 340px !important;
        border-left: 1px solid var(--lumo-contrast-20pct);
        display: flex !important;
        position: relative !important;
    }
    
    /* Hide mobile FAB on desktop */
    .mobile-cart-fab {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
}

/* TABLET VIEW (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .main-chat-layout {
        display: flex !important;
        flex-direction: row !important;
        width: 100% !important;
        height: 100% !important;
    }
    
    .chatsection-main {
        flex: 1 1 auto;
        min-width: 0;
        display: flex;
        flex-direction: column;
    }
    
    /* Hide recommendation panel on tablet */
    .recommendation-panel {
        display: none !important;
    }
    
    /* Collapse cart to drawer on tablet */
    .cart-sidebar {
        display: none !important;
        position: fixed !important;
        right: 0 !important;
        top: 56px !important;
        height: calc(100vh - 56px) !important;
        width: 360px !important;
        max-width: 85vw !important;
        z-index: 1200 !important;
        background: var(--lumo-base-color);
        border-left: 1px solid var(--lumo-contrast-20pct);
        box-shadow: -4px 0 16px var(--color-shadow-light);
        flex-direction: column !important;
        border-left: none;
        animation: slide-in-right 0.3s ease-out;
    }
    
    .cart-sidebar.mobile-open {
        display: flex !important;
    }
    
    /* Show mobile FAB on tablet */
    .mobile-cart-fab {
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        position: fixed !important;
        right: 16px !important;
        bottom: 80px !important;
        width: 56px !important;
        height: 56px !important;
        min-width: 56px !important;
        z-index: 1150 !important;
        border-radius: 50% !important;
        background: var(--color-primary) !important;
        color: white !important;
        box-shadow: 0 4px 12px var(--color-primary-shadow-dark) !important;
        align-items: center !important;
        justify-content: center !important;
        animation: fab-pop 0.3s ease-out;
    }
    
    .mobile-cart-fab:hover {
        box-shadow: 0 6px 16px var(--color-primary-shadow-dark) !important;
    }
    
    .mobile-cart-badge {
        position: absolute;
        top: -8px;
        right: -8px;
        min-width: 24px;
        height: 24px;
        border-radius: 50%;
        background: var(--color-accent-red) !important;
        color: white !important;
        font-size: 11px;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 2px solid white;
    }
}

/* MOBILE VIEW (< 768px) - Single Column Stacked */
@media (max-width: 767px) {
    .main-chat-layout {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        height: 100% !important;
    }
    
    .chatsection-main {
        flex: 1 1 auto;
        min-width: 0;
        display: flex;
        flex-direction: column;
    }
    
    /* Hide recommendation panel on mobile */
    .recommendation-panel {
        display: none !important;
    }
    
    /* Cart as drawer on mobile */
    .cart-sidebar {
        display: none !important;
        position: fixed !important;
        right: 0 !important;
        top: 0 !important;
        height: 100vh !important;
        width: 100% !important;
        max-width: 90vw !important;
        z-index: 1200 !important;
        background: var(--lumo-base-color);
        flex-direction: column !important;
        animation: slide-in-right 0.3s ease-out;
        overflow-y: auto;
    }
    
    .cart-sidebar.mobile-open {
        display: flex !important;
    }
    
    /* Show floating cart FAB on mobile */
    .mobile-cart-fab {
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        position: fixed !important;
        right: 16px !important;
        bottom: 20px !important;
        width: 56px !important;
        height: 56px !important;
        min-width: 56px !important;
        z-index: 1100 !important;
        border-radius: 50% !important;
        background: var(--color-primary) !important;
        color: white !important;
        box-shadow: 0 4px 12px var(--color-primary-shadow-dark) !important;
        align-items: center !important;
        justify-content: center !important;
        border: none !important;
        padding: 0 !important;
        animation: fab-pop 0.3s ease-out;
        cursor: pointer;
    }
    
    .mobile-cart-fab:hover {
        box-shadow: 0 6px 16px var(--color-primary-shadow-dark) !important;
    }
    
    .mobile-cart-fab:active {
        transform: scale(0.95);
    }
    
    /* Cart badge on mobile FAB */
    .mobile-cart-badge {
        position: absolute;
        top: -8px;
        right: -8px;
        min-width: 24px;
        height: 24px;
        border-radius: 50%;
        background: var(--color-accent-red) !important;
        color: white !important;
        font-size: 11px;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 2px solid white;
    }
}

/* ========== CART SIDEBAR STYLES ========== */

.cart-sidebar {
    background: var(--lumo-base-color);
    border-left: 1px solid var(--lumo-contrast-20pct);
    padding: var(--lumo-space-m);
    overflow-y: auto;
    margin-top: -17px !important;
}

.cart-sidebar h3 {
    margin: 0 0 var(--lumo-space-m) 0;
    padding-bottom: var(--lumo-space-s);
    border-bottom: 1px solid var(--lumo-contrast-10pct);
    font-size: var(--lumo-font-size-l);
    color: var(--lumo-primary-text-color);
}

.cart-item-card {
    width: 100%;
    background: var(--lumo-contrast-5pct);
    border-radius: var(--lumo-border-radius-m);
    padding: var(--lumo-space-s);
    margin-bottom: var(--lumo-space-s);
    display: flex;
    gap: var(--lumo-space-s);
}

.cart-item-image {
    width: 70px;
    height: 100px;
    object-fit: contain;
    border-radius: var(--lumo-border-radius-s);
    background: white;
    flex-shrink: 0;
}

.cart-item-name {
    font-weight: 600;
    font-size: var(--lumo-font-size-m);
    color: var(--lumo-primary-text-color);
    word-break: break-word;
}

.cart-item-price {
    color: var(--lumo-primary-text-color);
    font-weight: 700;
    font-size: var(--lumo-font-size-m);
}

.cart-item-qty {
    font-size: var(--lumo-font-size-s);
    color: var(--lumo-secondary-text-color);
}

.cart-empty-msg {
    color: var(--lumo-secondary-text-color);
    font-style: italic;
    text-align: center;
    padding: var(--lumo-space-m);
}

/* Place Order button styling */
.place-order-btn {
    margin-top: 6px !important;
    margin-bottom: -29px !important;
}

.cart-title-bar vaadin-button {
    margin-top: 0 !important;
}

.remove-icon {
    display: none !important;
}

/* ==========================================================================
   CHAT INTERFACE & MESSAGES
   ========================================================================== */

.chat-message-container {
    padding: var(--lumo-space-m);
    gap: var(--lumo-space-m);
}

.loading-bar {
    padding: var(--lumo-space-s);
}

.loading-text {
    color: var(--lumo-secondary-text-color);
    font-size: var(--lumo-font-size-m);
}

.chat-content {
    overflow-y: auto;
    min-height: 0;
    padding-bottom: var(--lumo-space-l);
}

.chat-bubble {
    padding: var(--lumo-space-m);
    border-radius: var(--lumo-border-radius-m);
    animation: message-pulse 0.5s ease-out;
    transition: all 0.3s ease;
}

.chat-bubble-avatar {
    width: var(--lumo-size-s);
    height: var(--lumo-size-s);
}

.chat-bubble-subtitle {
    margin: 0;
    font-size: var(--lumo-font-size-s);
    color: var(--lumo-secondary-text-color);
}

.chat-bubble-progress {
    margin: 0;
}

.chat-bubble .timestamp {
    margin: 0;
    font-size: var(--lumo-font-size-s);
    color: var(--lumo-secondary-text-color);
}

/* Color-coded sections for visual hierarchy */
.chatsection-main {
    background: linear-gradient(to bottom, var(--color-section-chat) 0%, var(--color-section-chat-end) 100%);
    transition: background-color 0.3s ease;
}

.recommendation-panel {
    background: linear-gradient(to bottom, var(--color-section-rec) 0%, var(--color-section-rec-end) 100%);
    transition: background-color 0.3s ease;
}

.cart-sidebar {
    background: linear-gradient(to bottom, var(--color-section-cart) 0%, var(--color-section-cart-end) 100%);
    transition: background-color 0.3s ease;
}
vaadin-notification-container[slot="top-stretch"] {
    padding-top: 56px;
    padding-left: var(--lumo-space-s);
    padding-right: var(--lumo-space-s);
}

vaadin-notification-card {
    max-width: min(90vw, 400px);
    min-height: 40px;
    padding: 12px 16px;
    font-size: 13px;
    line-height: 1.4;
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--color-shadow-medium);
}

/* ==========================================================================
   WELCOME CARD
   ========================================================================== */
.welcome-card {
    padding: var(--lumo-space-l);
    margin: var(--lumo-space-m);
    border-left: 4px solid var(--lumo-primary-color);
}

.welcome-card h2 {
    margin-top: 0;
    margin-bottom: var(--lumo-space-m);
    color: var(--lumo-primary-text-color);
    font-size: var(--lumo-font-size-l);
}

.welcome-card .intro {
    margin-bottom: var(--lumo-space-s);
    color: var(--lumo-body-text-color);
    line-height: 1.5;
}

.welcome-card .feature-list {
    margin-left: var(--lumo-space-l);
    padding-left: 0;
    list-style: none;
}

.welcome-card .feature-item {
    margin: var(--lumo-space-s) 0;
    color: var(--lumo-secondary-text-color);
    padding-left: var(--lumo-space-m);
    position: relative;
}

.welcome-card .feature-item::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--lumo-success-color);
    font-weight: 700;
}

.welcome-card .cta {
    margin-top: var(--lumo-space-m);
    margin-bottom: 0;
    font-style: italic;
    color: var(--lumo-tertiary-text-color);
    font-size: var(--lumo-font-size-s);
}

/* ==========================================================================
   RESPONSIVE PRODUCT GRID  
   ========================================================================== */

/* Base product grid - responsive columns based on breakpoints */
.product-grid {
    display: grid;
    gap: var(--lumo-space-m);
    padding: var(--lumo-space-m);
    width: 100%;
    box-sizing: border-box;
    /* Desktop: 4 columns, Tablet: 3 columns, Mobile: 1-2 columns */
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* Desktop: 4 columns (≥ 1024px) */
@media (min-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Tablet: 3 columns (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mobile: 2 columns (all screens < 768px) - COMPACT */
@media (max-width: 767px) {
    .product-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 8px;
        width: 100%;
        box-sizing: border-box;
    }
}

/* Styles the individual product card container */
.product-card {
    border: 1px solid var(--lumo-contrast-10pct);
    border-radius: var(--lumo-border-radius-m);
    padding: 2px;
    background: var(--lumo-base-color);
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    height: auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 0 !important;
    animation: product-card-fade-in 0.4s ease-out;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.product-card:hover {
        border-color: var(--color-primary);
        box-shadow: 0 8px 24px var(--color-primary-shadow);
        transform: translateY(-2px);
}

/* Mobile: Compact card padding */
@media (max-width: 767px) {
    .product-card {
        padding: 1px;
        border-radius: 4px;
        animation: product-card-fade-in 0.3s ease-out;
    }
    
    .product-card:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px var(--color-primary-shadow);
    }
}

/* Styles the product image within the card */
.product-card img {
    width: 100%;
    height: 150px;
    object-fit: contain;
}

/* Mobile: Reduce image height for compact view */
@media (max-width: 767px) {
    .product-card img {
        height: 100px;
    }
}

/* Styles the container for product information within the card */
.product-card .product-info {
    padding: 2px 2px 0 2px;
    width: 100%;
    display: flex; 
    flex-direction: column; 
    justify-content: flex-start;
    gap: 0 !important;
}

/* Mobile: Compact product info */
@media (max-width: 767px) {
    .product-card .product-info {
        padding: 1px 1px 0 1px;
    }
}

/* Styles the product name text */
.product-card .product-name {
    font-weight: bold;
    font-size: var(--lumo-font-size-s);
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    min-height: 2.8em;
    margin: 0;
    padding: 0;
}

/* Mobile: Smaller product name */
@media (max-width: 767px) {
    .product-card .product-name {
        font-size: 11px;
        line-height: 1.2;
        min-height: auto;
        -webkit-line-clamp: 2;
    }
}

/* ✅ NEW: Product description in small font (2 lines max) */
.product-card .product-description {
    font-size: 0.9rem;  /* Increased from 0.75rem */
    color: var(--lumo-secondary-text-color);  /* Gray color */
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;  /* Limit to 2 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    padding: 0 2px;
    text-align: left;  /* Left align description */
    font-style: italic;  /* Italic for emphasis */
}

/* Desktop-only: Show description */
@media (min-width: 768px) {
    .product-card .product-description {
        display: -webkit-box;
    }
}

/* Mobile: Hide description */
@media (max-width: 767px) {
    .product-card .product-description {
        display: none;
    }
}

/* Shape / Size subtitle for Excel-sourced product cards */
.product-card .product-shape-size {
    font-size: var(--lumo-font-size-s);
    color: var(--lumo-secondary-text-color);
    text-align: center;
    margin: 2px 0 0 0;
    padding: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Styles the product price text within the card */
.product-card .product-price {
    color: var(--lumo-primary-text-color);
    margin: 0;
    padding: 0 2px;
    font-size: var(--lumo-font-size-s);
    display: flex;
    align-items: center;
    justify-content: space-between;  /* ✅ Left-right alignment */
    gap: 4px;
    flex-wrap: nowrap;
    white-space: nowrap;
    width: 100%;  /* ✅ Full width */
    box-sizing: border-box;
}

/* Mobile: Smaller price text */
@media (max-width: 767px) {
    .product-card .product-price {
        font-size: 10px;
        gap: 2px;
    }
}

.product-card .product-price .price-label {
    font-weight: 600;
    color: var(--lumo-secondary-text-color);
}

.product-card .product-price .original-price {
    text-decoration: line-through;
    color: var(--lumo-secondary-text-color);
    font-weight: 600;
    font-size: var(--lumo-font-size-xs);
}

.product-card .product-price .current-price {
    color: var(--lumo-primary-text-color);
    font-weight: 700;
}


/* Product footer with quantity and button */
.product-card .product-footer {
    padding: 2px;
    gap: 2px !important;
    display: flex;
    flex-direction: column;
    justify-content: flex-end !important;
    align-items: stretch;
    width: 100%;
    box-sizing: border-box;
}

/* ✅ NEW: Top line - Price LEFT, Qty RIGHT */
.product-card .price-qty-line {
    gap: 4px !important;
    padding: 0 2px;
    margin: 0;
    width: 100%;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center;
    box-sizing: border-box;
    margin-bottom: 4px;  /* Space between top and bottom lines */
}

/* ✅ NEW: Bottom line - Add to Cart centered */
.product-card .cart-button-line {
    gap: 0 !important;
    padding: 0 2px;
    margin: 0;
    width: 100%;
    display: flex !important;
    justify-content: center !important;
    align-items: center;
    box-sizing: border-box;
}

/* ✅ NEW: Left side qty controls */
.product-card .qty-controls-left {
    display: flex;
    gap: 0 !important;
    align-items: center;
    padding: 0;
    margin: 0;
}

/* ✅ NEW: Price display in footer line */
.product-card .product-price-display {
    font-size: var(--lumo-font-size-xs);
    font-weight: 700;
    color: var(--lumo-primary-text-color);
    white-space: nowrap;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
}

/* Add to cart button in product card */
.product-card .add-to-cart-btn {
    width: auto;
    margin: 0 !important;
    padding: 4px 8px;
    font-size: var(--lumo-font-size-m);
    flex-shrink: 0;
}

/* Mobile: Smaller button */
@media (max-width: 767px) {
    .product-card .add-to-cart-btn {
        padding: 3px 6px;
        font-size: 11px;
    }
}

/* ✅ NEW: DESKTOP-ONLY STYLES (min-width: 768px) */
@media (min-width: 768px) {
    /* Show description only on desktop */
    .product-card .product-description {
        display: -webkit-box !important;
        font-size: 0.9rem;
        color: var(--lumo-secondary-text-color);
        margin: 2px 0 0 0;
        padding: 0 2px;
    }
    
    /* Adjust info layout for desktop */
    .product-card .product-info {
        padding: 2px 2px 0 2px;
        gap: 0px;
    }
    
    /* Improve price layout on desktop */
    .product-card .product-price {
        padding: 2px;
        justify-content: space-between;
        width: 100%;
    }
    
    /* Top line - price LEFT, qty RIGHT */
    .product-card .price-qty-line {
        gap: 6px !important;
        padding: 0 12px;
        justify-content: space-between !important;
        width: 100% !important;
        align-items: center;
        margin-bottom: 6px;
        box-sizing: border-box;
    }
    
    .product-card .product-price-display {
        font-size: var(--lumo-font-size-s);
        font-weight: 700;
        flex-shrink: 0;
    }
    
    .product-card .qty-controls-left {
        display: flex;
        gap: 0;
        align-items: center;
        flex-shrink: 0;
    }
    
    /* Bottom line - Add to Cart centered */
    .product-card .cart-button-line {
        justify-content: center !important;
    }
    
    .product-card .add-to-cart-btn {
        width: auto;
        padding: 6px 12px;
        flex-shrink: 0;
    }
    
    /* Reduce image container padding on desktop */
    .product-image-container {
        padding: 4px !important;
    }
}

/* ✅ NEW: MOBILE STYLES (max-width: 767px) */
@media (max-width: 767px) {
    /* Hide description on mobile */
    .product-card .product-description {
        display: none !important;
    }
    
    /* Center align for mobile */
    .product-card .price-qty-line {
        gap: 0 !important;
        padding: 0;
        justify-content: center;
        width: fit-content;
        align-self: center;
        margin-bottom: 2px;
    }
    
    .product-card .cart-button-line {
        justify-content: center;
    }
    
    .product-card .add-to-cart-btn {
        width: 80%;
        margin: 0 auto !important;
        padding: 4px 8px;
    }
}

/* Global style for product price display */
.product-price {
    font-weight: bold;
    font-style: bold;
    color: var(--lumo-primary-text-color);
    margin: 0;
    padding: 0;
}

/* Styles the product quantity value text */
.product-qty-value {
    font-weight: bold;
}

/* ==========================================================================
   CATEGORY GRID - Responsive layout with 5 columns desktop, 3 tablet, 2 mobile
   ========================================================================== */
.category-grid {
    display: grid;
    gap: var(--lumo-space-m);
    padding: var(--lumo-space-m);
    width: 100%;
    box-sizing: border-box;
    /* Default: Responsive auto-fill */
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

/* Desktop: 5 columns (≥ 1280px) */
@media (min-width: 1280px) {
    .category-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Large Desktop: 5 columns (1024px - 1279px) */
@media (min-width: 1024px) and (max-width: 1279px) {
    .category-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Tablet: 3 columns (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mobile: 2 columns (< 768px) */
@media (max-width: 767px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 12px;
    }
}

/* Styles the individual category card - FIXED HEIGHT & WIDTH */
.category-card {
    border: 1px solid var(--lumo-contrast-10pct);
    border-radius: var(--lumo-border-radius-m);
    padding: 10px;
    background: var(--lumo-base-color);
    width: 100%;
    height: 280px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
}

.category-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 8px 24px var(--color-primary-shadow);
    transform: translateY(-4px);
}

/* Category card image - FIXED SIZE */
.category-card-image {
    width: 110px;
    height: 110px;
    object-fit: contain;
    border-radius: var(--lumo-border-radius-s);
    background: var(--lumo-contrast-5pct);
    padding: 6px;
    flex-shrink: 0;
}

/* Category card info section */
.category-card-info {
    width: 100%;
    text-align: center;
    flex-grow: 0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    justify-content: center;
    min-height: 60px;
}

/* Category card name */
.category-card-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--lumo-primary-text-color);
    word-wrap: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Category card metadata (child count, description) */
.category-card-meta {
    font-size: 12px;
    color: var(--lumo-secondary-text-color);
    word-wrap: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

/* Category card footer with button */
.category-card-footer {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: var(--lumo-space-s);
    margin-top: auto;
    padding-top: 8px;
}

.list-products-btn {
    width: 95%;
    padding: 6px 10px !important;
    font-size: 11px !important;
    height: 32px;
    flex-shrink: 0;
}

/* Mobile: Compact category cards */
@media (max-width: 767px) {
    .category-card {
        height: 240px;
        padding: 8px;
        gap: 5px;
    }
    
    .category-card-image {
        width: 90px;
        height: 90px;
    }
    
    .category-card-info {
        min-height: 50px;
    }
    
    .list-products-btn {
        width: 90%;
        padding: 5px 8px !important;
        font-size: 10px !important;
        height: 30px;
    }
    
    .category-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px var(--color-primary-shadow);
    }
}

/* ==========================================================================
   STORE GRID - Responsive layout with 4 columns desktop, 2-3 tablet, 1-2 mobile
   ========================================================================== */
.store-grid {
    display: grid;
    gap: var(--lumo-space-m);
    padding: var(--lumo-space-m);
    width: 100%;
    box-sizing: border-box;
    /* Default: Responsive auto-fill */
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

/* Desktop: 4 columns (≥ 1024px) */
@media (min-width: 1024px) {
    .store-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Tablet: 3 columns (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .store-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mobile: 2 columns (< 768px) */
@media (max-width: 767px) {
    .store-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 12px;
    }
}

/* Styles the individual store card - FIXED HEIGHT */
.store-card {
    border: 1px solid var(--lumo-contrast-10pct);
    border-radius: var(--lumo-border-radius-m);
    padding: 16px;
    background: var(--lumo-base-color);
    width: 100%;
    min-height: 240px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.store-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 8px 24px var(--color-primary-shadow);
    transform: translateY(-4px);
}

/* Store card image */
.store-card-image {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: var(--lumo-border-radius-s);
    background: var(--lumo-contrast-5pct);
}

/* Store card info section */
.store-card-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Store card name */
.store-card-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--lumo-primary-text-color);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Store card meta information */
.store-card-meta,
.store-card-type,
.store-card-location,
.store-card-time {
    font-size: 12px;
    color: var(--lumo-secondary-text-color);
    margin: 0;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Store card footer with button */
.store-card-footer {
    display: flex;
    gap: var(--lumo-space-s);
}

.shop-now-btn {
    width: 100%;
    padding: 10px 16px !important;
    font-size: 13px !important;
}

/* Mobile: Compact store cards */
@media (max-width: 767px) {
    .store-card {
        min-height: 200px;
        padding: 12px;
        gap: 10px;
    }
    
    .store-card-image {
        height: 100px;
    }
    
    .store-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px var(--color-primary-shadow);
    }
}

/* ==========================================================================
   Shopping Cart
   ========================================================================== */

/* Styles the sidebar container for the shopping cart */
.cart-sidebar {
    width: 25% !important;
    height: 100%;
    border-left: 1px solid var(--lumo-contrast-10pct);
    background: var(--lumo-base-color);
}

/* Styles the header inside the cart sidebar */
.cart-sidebar h3 {
    margin: 0;
    padding-bottom: var(--lumo-space-s);
    border-bottom: 1px solid var(--lumo-contrast-10pct);
}

/* Styles the card for an individual cart item */
.cart-item-card {
    width: 100%;
    background: var(--lumo-contrast-5pct);
    border-radius: var(--lumo-border-radius-s);
}

/* Styles the image of a cart item */
.cart-item-image {
    width: 70px;
    height: 110px;
    object-fit: contain;
    border-radius: var(--lumo-border-radius-s);
    background: white;
    flex-shrink: 0;
}

/* Styles the name of a cart item */
.cart-item-name { 
    font-weight: bold; 
    font-size: var(--lumo-font-size-m); 
    white-space: normal; 
    word-break: break-word; 
    overflow-wrap: anywhere; 
    display: block; 
    max-width: 100%;
    color: var(--color-text-dark) !important;
}

/* Styles the price of a cart item */
.cart-item-price {
    color: var(--lumo-primary-text-color);
    font-weight: bold;
    font-size: large;
}

/* Styles the quantity text of a cart item */
.cart-item-qty {
    font-size: var(--lumo-font-size-xs);
}

/* Styles the message displayed when the cart is empty */
.cart-empty-msg {
    color: var(--lumo-secondary-text-color);
    font-style: italic;
}

/* Styles the subtotal display in the cart */
.cart-subtotal {
    font-weight: bold;
    margin-top: 1px solid var(--lumo-contrast-10pct);
    border-top: 1px solid var(--lumo-contrast-10pct);
    padding-top: 1px solid var(--lumo-space-xs);
    padding-bottom: 1px solid var(--lumo-space-xs);
    margin-bottom: 1px solid var(--lumo-space-xs);
    border-bottom: 1px solid var(--lumo-contrast-10pct);
    width: 100%;
    text-align: right;
}

/* Styles the remove icon for cart items - DESKTOP ONLY */
.remove-icon{
    margin-top: -13px;
    margin-left: 2px;
    display: none !important;
}

/* ==========================================================================
   Form & Input Elements
   ========================================================================== */

/* Styles small text fields */
.small-textfield { 
    font-size: var(--lumo-font-size-xs);  
    padding: 2px 4px; 
    min-height: 10px;
} 

/* Styles small text areas */
.small-textarea { 
    min-height: 27px;
    resize: vertical;
}

/* Styles a row containing input elements */
.input-row {
    margin-bottom: 8px;  
    margin-top: 0;
    /* margin-left: -2px; */
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0 !important;
    width: 100% !important;
    padding: 0 !important;
    transition: all 0.3s ease;
}

/* Desktop: Ensure button and input are side-by-side */
@media (min-width: 1024px) {
    .input-row {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 0 !important;
        padding: 0 !important;
        transition: all 0.3s ease;
    }
    
    .input-row > vaadin-button {
        flex-shrink: 0;
        align-self: center !important;
        margin: 0 !important;
        margin-top: 6px !important;
        padding: 6px 12px !important;
        height: auto !important;
    }
    
    .message-input-wrapper {
        flex-grow: 1;
        flex-shrink: 1;
        min-width: 0;
        display: flex !important;
        align-items: center !important;
    }
}

/* Message input wrapper - always flex for consistency */
.message-input-wrapper {
    display: flex !important;
    flex-grow: 1;
    width: 100%;
    min-width: 0;
    margin: 0 !important;
    padding: 0 !important;
    transition: all 0.3s ease;
    margin-left: 6px !important;
}

.message-input {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    transition: all 0.3s ease;
}
.mic-button {
    height: 36px;
    font-size: 23px;
    padding: 0 !important;
    margin: 0 !important;
    min-width: auto !important;
    transition: all 0.2s ease;
}

/* Styles a row displaying price information */
.price-row {
    align-items: center;
    gap: var(--lumo-space-xs);
}

/* Styles the quantity value display in the cart */
.product-qty-value-cart {
    text-align: center;
    font-weight: 600;
    font-size: 17px;
    margin-bottom: -2px;
}

/* Styles the quantity control buttons */
.qty-controls vaadin-button {
    min-width: 26px;
    width: 26px;
    height: 26px;
    padding: 0;
    font-size: 13px;
    line-height: 1;
    transition: all 0.2s ease;
    background-color: var(--color-button-secondary-bg);
    border: 1px solid var(--color-button-secondary-border);
}

.qty-controls vaadin-button:hover {
    background-color: var(--color-button-secondary-hover);
    border-color: var(--color-button-secondary-hover-border);
}

/* Improve secondary and tertiary button contrast */
vaadin-button[theme~="tertiary"] {
    color: var(--color-button-secondary-text);
    font-weight: 500;
    transition: all 0.2s ease;
}

vaadin-button[theme~="tertiary"]:hover {
    background-color: var(--color-button-secondary-bg);
}

vaadin-button[theme~="secondary"] {
    transition: all 0.2s ease;
}
/* ==========================================================================
   Recommendation Panel
   ========================================================================== */

/* Styles the vertical layout within the compact product grid */
.compact-product-grid vaadin-vertical-layout {
    gap: 1px !important;
    /* margin-top: -2px; */
}

/* Overrides styles for product cards within the compact grid */
.compact-product-grid .product-card {
    padding: 1px !important;
    font-size: 12px;
    min-height: unset !important;
    height: auto !important;
    margin-left: -1px ;
}

/* Overrides styles for product info within the compact grid */
.compact-product-grid .product-info {
    margin: 0 !important;
    padding: 0 4px !important;
    min-height: 0 !important;
    height: auto !important;
}

/* Overrides styles for product names within the compact grid */
.compact-product-grid .product-name {
    font-size: 11px;
    line-height: 1.2;
    height: auto !important;
    min-height: 0 !important;
    -webkit-line-clamp: 2;
    margin: 0 !important;
    padding: 0 !important;
}

/* Overrides styles for product footer within the compact grid */
.compact-product-grid .product-footer {
    margin: 0 !important;
    padding: 0 !important;
    gap: 0 !important;
}

/* Sets the height for images in the recommendation panel */
.recommendation-panel .gallery-wrapper, 
.recommendation-panel .product-image-container { 
    height: 80px; /* smaller than grid cards */
 }

/* Configures the grid layout for the recommendation panel */
.recommendation-panel .product-grid {
    grid-template-columns: 1fr !important;
    padding: var(--lumo-space-xs);
}

/* Styles the add-to-cart button in the recommendation panel */
.recommendation-panel .add-to-cart-btn { 
    font-size: 12px; 
    height: 22px; 
    padding: 2px 8px; 
    background: var(--lumo-primary-color); 
    color: white;
    width: 70%;
}

/* Ensures images in the recommendation panel fit correctly */
.recommendation-panel img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

/* Centers images in the recommendation panel */
.recommendation-panel .product-image-container,
.recommendation-panel .gallery-wrapper {
    display: flex;
    align-items: center;     /* vertical center */
    justify-content: center; /* horizontal center */
    height: 80px;
    overflow: hidden;
}

/* Styles the quantity layout in the recommendation panel */
.recommendation-panel .qty-layout { 
    display: flex; 
    align-items: center; 
    gap: 0 !important;
    margin-top: -6px;
}

/* Styles the main recommendation panel container - DESKTOP ONLY */
.recommendation-panel {
    width: 250px;
    min-width: 250px;
    margin-left: -20px;
    margin-right: -4px;
    position: relative;
    display: none !important;
}

/* Styles the title of the recommendation panel */
.recommendation-title{
    font-size: 16px;
    font-style: bold;
}

/* Makes the header of the recommendation panel sticky */
.recommendation-panel vaadin-horizontal-layout {
    position: sticky;
    top: 0;
    background: var(--lumo-base-color);
    z-index: 1 !important;
}

/* Styles the remove recommendation button */
.remRec-Btn{
    margin-right: 5px;
    margin-top: 3px;
    background-color: var(--color-neutral-light-gray);
    width: 1px;
    height: 16px;
    
}

/* ==========================================================================
   Product Image Gallery
   ========================================================================== */

/* Styles the wrapper for the image gallery */
.gallery-wrapper {
    position: relative;
    width: 100%;
    height: 150px;
    margin-bottom: 2px;  
}

/* Styles the container for scrolling product images */
.product-image-container {
    display: flex;
    overflow-x: auto;
    width: 100%;
    height: 100%;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    border-radius: var(--lumo-border-radius-m);
    padding: 0;  /* ✅ No padding for full image width */
    box-sizing: border-box;
}

/* Hide scrollbar for Chrome/Safari */
.product-image-container::-webkit-scrollbar {
    display: none;
}

/* Ensure images take full width and support snapping */
.product-image-container img {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    object-fit: contain;
    scroll-snap-align: center;
    background: transparent !important;
    background-color: var(--color-neutral-transparent) !important;
}

/* Styles the navigation arrows for the gallery */
.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: var(--color-neutral-semi-white) !important;
    border-radius: 50%;
    color: var(--lumo-primary-text-color) !important;
    min-width: 32px;
    height: 32px;
    padding: 0;
}

/* Positions the left gallery arrow */
.gallery-arrow.left {
    left: 2px;
    background-color: var(--color-neutral-gray) !important;
}

/* Positions the right gallery arrow */
.gallery-arrow.right {
    right: 2px;
    background-color: var(--color-neutral-gray) !important;
}

/* Styles product thumbnails */
.product-thumb {
    cursor: pointer;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 4px 8px var(--color-shadow-light);
}

/* ==========================================================================
   Dialogs & Overlays
   ========================================================================== */

/* Styles the overlay background for dialogs */
vaadin-dialog-overlay::part(overlay) {
    background: var(--color-overlay-dark);
}

vaadin-dialog-overlay.profile-details-dialog {
    z-index: 3000 !important;
}

/* Styles images displayed within dialogs */
.dialog-image {
    max-width: 90vw;
    max-height: 90vh;
    cursor: zoom-in;
    transition: transform 0.3s ease;
    height: 500px;
}

/* Styles the zoomed state of dialog images */
.dialog-image.zoomed {
    transform: scale(2);
    cursor: zoom-out;
}

/* Styles the details button */
.details-button{
    background-color: burlywood;
}

/* Styles the fixed right panel overlay - DESKTOP ONLY */
.fixed-right-panel {
    border-left: 1px solid var(--lumo-contrast-20pct);
    background: var(--lumo-base-color);
    position: fixed;
    top: 56px;
    right: 0;
    z-index: 1000 !important;
    width: 343px !important;
    max-width: 343px !important;
    height: calc(100vh - 56px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Ensures the select overlay appears above other elements */
vaadin-select-overlay {
    z-index: 2000 !important;
}

/* Settings panel visibility states */
.fixed-right-panel[style*="display: none"] {
    display: none !important;
}

.fixed-right-panel.settings-panel-open {
    display: flex !important;
}

/* Styles the list box within the select overlay */
vaadin-select-overlay vaadin-select-list-box {
    max-height: 180px;
    overflow-y: auto;
    width: 300px; 
}
.mic-button.recording {
    color: red;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* Sets the header background to blue and title text to white */
vaadin-dialog-overlay[theme~="blue-header-dialog"]::part(header) {
    background-color: var(--color-dialog-header);
    color: white;
}

/* Sets the main content area background to white */
vaadin-dialog-overlay[theme~="blue-header-dialog"]::part(content) {
    background-color: white;
}

/* Optional: Sets the footer background to white */
vaadin-dialog-overlay[theme~="blue-header-dialog"]::part(footer) {
    background-color: white;
}
.logout-btn{
    font-size: var(--lumo-font-size-s);
    margin-top: auto;
    margin-left: auto;
}
.payment-success-gif {
    width: 200px;
    height: 200px;
    margin: 0 auto;
}