/* ===== Variables CSS ===== */
:root {
    --primary-color: #00a650;
    --primary-dark: #008c44;
    --primary-light: #e8f5e9;
    --primary-gradient: linear-gradient(135deg, #00a650 0%, #00c853 100%);
    --secondary-color: #1a1a1a;
    --text-color: #2d3436;
    --text-light: #636e72;
    --text-muted: #b2bec3;
    --background: #f8f9fa;
    --white: #ffffff;
    --border-color: #e9ecef;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-colored: 0 4px 16px rgba(0, 166, 80, 0.2);
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
    --sidebar-width: 280px;
    --header-height: 70px;
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== User Bar ===== */
.user-bar {
    background: var(--primary-gradient);
    color: white;
    padding: 10px 0;
    font-size: 0.85rem;
    font-weight: 500;
}

.user-bar-content {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.user-info, .login-prompt {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-login, .btn-logout {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.25);
    color: white;
    padding: 6px 18px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: var(--transition);
}

.btn-login:hover, .btn-logout:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-1px);
}

/* ===== Header ===== */
.header {
    background: var(--white);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.95);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 32px;
    filter: drop-shadow(0 2px 4px rgba(0,166,80,0.2));
}

.logo h1 {
    font-size: 1.4rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
    letter-spacing: -0.5px;
}

.search-container {
    flex: 1;
    max-width: 480px;
    display: flex;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 14px 52px 14px 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
    background: var(--background);
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-colored);
    background: var(--white);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-gradient);
    color: var(--white);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: var(--shadow-colored);
}

.search-btn:hover {
    transform: translateY(-50%) scale(1.05);
}

.search-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: var(--background);
    border: none;
    cursor: pointer;
    padding: 10px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.menu-toggle:hover {
    background: var(--border-color);
}

.menu-toggle:active {
    transform: scale(0.95);
}

.menu-toggle span {
    width: 22px;
    height: 2.5px;
    background: var(--primary-color);
    border-radius: 4px;
    transition: var(--transition);
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    padding: 24px 0;
}

.layout {
    display: flex;
    gap: 28px;
}

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    height: fit-content;
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

.sidebar-header {
    padding: 20px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--background);
}

.sidebar-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--secondary-color);
    letter-spacing: -0.3px;
}

.close-sidebar {
    display: none;
    background: var(--background);
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
}

.categories-nav {
    padding: 8px;
}

.category-item {
    margin-bottom: 4px;
}

.category-btn {
    width: 100%;
    padding: 14px 16px;
    background: none;
    border: none;
    text-align: left;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 12px;
}

.category-btn:hover {
    background: var(--primary-light);
    color: var(--primary-color);
    transform: translateX(4px);
}

.category-btn.active {
    background: var(--primary-gradient);
    color: var(--white);
    box-shadow: var(--shadow-colored);
}

.category-btn .icon {
    font-size: 1.3rem;
    width: 28px;
    text-align: center;
}

.subcategories {
    margin-left: 44px;
    display: none;
    padding: 4px 0;
    border-left: 2px solid var(--border-color);
}

.subcategories.show {
    display: block;
}

.subcategory-btn {
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    text-align: left;
    font-size: 0.85rem;
    color: var(--text-light);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-weight: 500;
}

.subcategory-btn:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

.subcategory-btn.active {
    color: var(--primary-color);
    font-weight: 600;
    background: var(--primary-light);
}

/* ===== Products Section ===== */
.products-section {
    flex: 1;
    min-width: 0;
}

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.products-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--secondary-color);
}

.products-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

#productsCount {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.sort-select {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    cursor: pointer;
    background: var(--white);
    outline: none;
}

.sort-select:focus {
    border-color: var(--primary-color);
}

/* ===== Products Grid ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.welcome-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 24px;
    background: linear-gradient(135deg, var(--white) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.welcome-icon {
    font-size: 4.5rem;
    margin-bottom: 24px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

.welcome-message h3 {
    font-size: 1.6rem;
    margin-bottom: 12px;
    color: var(--secondary-color);
    font-weight: 700;
    letter-spacing: -0.5px;
}

.welcome-message p {
    color: var(--text-light);
    max-width: 420px;
    margin: 0 auto;
    font-size: 1rem;
    line-height: 1.6;
}

/* ===== Product Card ===== */
.product-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid var(--border-color);
    position: relative;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.product-card:active {
    transform: translateY(-2px);
}

.product-image {
    width: 100%;
    height: 180px;
    object-fit: contain;
    background: linear-gradient(180deg, #fafafa 0%, #f5f5f5 100%);
    padding: 16px;
    transition: var(--transition);
}

.product-card:hover .product-image {
    transform: scale(1.03);
}

.product-info {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.product-category {
    font-size: 0.7rem;
    color: var(--primary-color);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.product-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 6px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    letter-spacing: -0.2px;
}

.product-packaging {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.product-price-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.product-price {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

.product-old-price {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

.product-unit-price {
    font-size: 0.75rem;
    color: var(--text-muted);
    width: 100%;
    margin-top: 4px;
}

.product-badges {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.badge {
    font-size: 0.65rem;
    padding: 4px 10px;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-new {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1565c0;
}

.badge-discount {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #c62828;
}

.badge-pack {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    color: #e65100;
}

/* ===== Loading ===== */
.loading-categories,
.loading-products {
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.hidden {
    display: none !important;
}

/* ===== Modal ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    padding: 16px;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-xl);
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(-24px) scale(0.96);
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
}

.modal.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--white);
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    transition: var(--transition);
    z-index: 10;
    box-shadow: var(--shadow-sm);
}

.modal-close:hover {
    background: var(--background);
    color: var(--secondary-color);
    transform: scale(1.05);
}

.modal-body {
    padding: 28px;
}

.modal-image {
    width: 100%;
    max-height: 280px;
    object-fit: contain;
    background: linear-gradient(180deg, #fafafa 0%, #f0f0f0 100%);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
}

.modal-category {
    font-size: 0.8rem;
    color: var(--primary-color);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.modal-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.modal-details {
    margin-bottom: 20px;
}

.modal-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.modal-detail-row:last-child {
    border-bottom: none;
}

.modal-detail-label {
    color: var(--text-light);
    font-size: 0.9rem;
}

.modal-detail-value {
    font-weight: 500;
    color: var(--secondary-color);
}

.modal-price-section {
    background: var(--primary-light);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
}

.modal-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.modal-old-price {
    font-size: 1.2rem;
    color: var(--text-muted);
    text-decoration: line-through;
    margin-left: 10px;
}

.modal-unit-price {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 5px;
}

.modal-link {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 30px;
    background: var(--primary-color);
    color: var(--white);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 500;
    transition: var(--transition);
}

.modal-link:hover {
    background: var(--primary-dark);
}

/* ===== Overlay ===== */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Reinforce overlay visibility and interactivity when active */
.overlay.active {
    display: block !important;
    pointer-events: auto !important;
}

/* Ensure header hamburger is above floating controls and clickable */
.menu-toggle {
    position: relative;
    z-index: 310;
}

/* ===== Footer ===== */
.footer {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #2d3436 100%);
    color: var(--white);
    padding: 32px 0;
    text-align: center;
}

.footer p {
    font-size: 0.85rem;
    opacity: 0.7;
    margin: 4px 0;
}

/* ===== No Results ===== */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 24px;
    background: var(--white);
    border-radius: var(--radius-lg);
    border-radius: var(--radius-md);
}

.no-results-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.no-results h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--secondary-color);
}

.no-results p {
    color: var(--text-light);
}

/* ===== Responsive Design ===== */
@media (max-width: 1024px) {
    .sidebar {
        width: 260px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .user-bar {
        padding: 8px 0;
        font-size: 0.8rem;
    }
    
    .header-content {
        flex-wrap: wrap;
        padding: 10px 0;
    }
    
    .logo h1 {
        font-size: 1.15rem;
    }
    
    .logo-icon {
        font-size: 26px;
    }
    
    .search-container {
        order: 3;
        max-width: 100%;
        width: 100%;
        margin-top: 12px;
    }
    
    .search-input {
        padding: 12px 48px 12px 16px;
        font-size: 0.9rem;
    }
    
    .search-btn {
        width: 36px;
        height: 36px;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .layout {
        flex-direction: column;
    }
    
    .main-content {
        padding: 20px 0;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
        z-index: 200;
        transition: var(--transition);
        box-shadow: var(--shadow-lg);
    }
    
    .sidebar.active {
        left: 0 !important;
        transform: none !important;
        visibility: visible !important;
        display: block !important;
        z-index: 260 !important; /* above overlay (150) so panel is visible */
    }
    
    .close-sidebar {
        display: flex;
    }
    
    .products-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .products-header h2 {
        font-size: 1.25rem;
    }
    
    .products-info {
        width: 100%;
        justify-content: space-between;
    }
    
    .sort-select {
        font-size: 0.85rem;
        padding: 8px 12px;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .product-image {
        height: 140px;
        padding: 12px;
    }
    
    .product-info {
        padding: 12px;
    }
    
    .product-category {
        font-size: 0.65rem;
        margin-bottom: 4px;
    }
    
    .product-name {
        font-size: 0.85rem;
        margin-bottom: 4px;
    }
    
    .product-packaging {
        font-size: 0.75rem;
        margin-bottom: 8px;
    }
    
    .product-price {
        font-size: 1.05rem;
    }
    
    .welcome-message {
        padding: 40px 20px;
    }
    
    .welcome-icon {
        font-size: 3rem;
    }
    
    .welcome-message h3 {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
    
    .user-bar-content {
        font-size: 0.75rem;
    }
    
    .btn-login, .btn-logout {
        padding: 5px 12px;
        font-size: 0.75rem;
    }
    
    .logo h1 {
        font-size: 1.1rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .product-card {
        border-radius: var(--radius-md);
    }
    
    .product-image {
        height: 110px;
        padding: 10px;
    }
    
    .product-info {
        padding: 10px;
    }
    
    .product-category {
        font-size: 0.6rem;
    }
    
    .product-name {
        font-size: 0.8rem;
        -webkit-line-clamp: 2;
    }
    
    .product-packaging {
        font-size: 0.7rem;
        display: none;
    }
    
    .product-price {
        font-size: 0.95rem;
    }
    
    .product-unit-price {
        font-size: 0.65rem;
    }
    
    .product-badges {
        margin-top: 6px;
    }
    
    .badge {
        font-size: 0.55rem;
        padding: 3px 6px;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .modal-title {
        font-size: 1.1rem;
    }
    
    .modal-price {
        font-size: 1.4rem;
    }
}

/* ===== Scrollbar Styles ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== Ingredients Panel ===== */
.ingredients-panel {
    position: fixed;
    bottom: 120px;
    right: 20px;
    width: 350px;
    max-height: 400px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 90;
    display: flex;
    flex-direction: column;
    transform: translateX(400px);
    transition: var(--transition);
}

.ingredients-panel.active {
    transform: translateX(0);
}

.ingredients-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ingredients-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--secondary-color);
}

.ingredients-count {
    background: var(--primary-color);
    color: var(--white);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.ingredients-list {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    max-height: 250px;
}

/* Collapsed (compact) ingredients state */
.ingredients-panel.collapsed {
    width: auto;
    min-width: 64px;
    height: 64px;
    border-radius: 50%;
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: none;
}

.ingredients-panel.collapsed .ingredients-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.ingredients-panel.collapsed .ingredients-header h3 {
    display: none;
}

.ingredients-panel.collapsed .ingredients-list,
.ingredients-panel.collapsed .ingredients-actions {
    display: none;
}

.ingredients-collapsed-icons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
    height: 28px;
    padding: 0 4px;
}

.ingredients-collapsed-icons img {
    width: 28px;
    height: 28px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid var(--white);
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    margin-left: 0;
    flex-shrink: 0;
}

.thumbs-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.ingredients-extra {
    margin-left: 8px;
    background: var(--primary-color);
    color: white;
    min-width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.ingredients-panel .ingredients-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #c62828;
    color: white;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
}

.empty-ingredients {
    color: var(--text-muted);
    text-align: center;
    font-size: 0.9rem;
    padding: 20px;
}

.ingredient-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: var(--background);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.ingredient-item img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    margin-right: 10px;
}

.ingredient-info {
    flex: 1;
    display: flex;
    align-items: center;
}

.ingredient-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--secondary-color);
    line-height: 1.3;
}

.ingredient-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    transition: var(--transition);
}

.ingredient-remove:hover {
    color: #c62828;
}

.ingredients-actions {
    padding: 15px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
}

.btn-clear {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border-color);
    background: var(--white);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.btn-clear:hover {
    background: var(--background);
}

.btn-generate {
    flex: 2;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-generate:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Toggle Button */
.ingredients-toggle {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-90px);
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow-lg);
    z-index: 92;
    transition: var(--transition);
}

.ingredients-toggle:hover {
    transform: scale(1.1);
}

.ingredients-toggle.hidden {
    display: none;
}

.toggle-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #c62828;
    color: var(--white);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-count.hidden {
    display: none;
}

/* Product action buttons container */
.product-actions {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

.btn-add-to-list {
    flex: 1;
    padding: 10px 8px;
    background: #e3f2fd;
    color: #1976d2;
    border: 2px solid #1976d2;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.btn-add-to-list:hover {
    background: #1976d2;
    color: white;
}

/* Add to ingredients button */
.btn-add-ingredient {
    flex: 1;
    padding: 10px 8px;
    background: var(--primary-light);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.btn-add-ingredient:hover {
    background: var(--primary-color);
    color: var(--white);
}

.btn-add-ingredient.added {
    background: var(--primary-color);
    color: var(--white);
}

/* Modal Large */
.modal-large {
    max-width: 800px;
}

.menu-loading {
    text-align: center;
    padding: 60px 20px;
}

.menu-loading p {
    color: var(--text-light);
    margin-top: 15px;
}

.menu-content {
    padding: 10px;
}

.menu-header {
    text-align: center;
    margin-bottom: 30px;
}

.menu-header h2 {
    font-size: 1.8rem;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.menu-header p {
    color: var(--text-light);
}

.menu-ingredients-used {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 15px;
}

.menu-ingredient-tag {
    background: var(--primary-light);
    color: var(--primary-color);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.recipe-card {
    background: var(--background);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
}

.recipe-card:last-child {
    margin-bottom: 0;
}

.recipe-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.recipe-number {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.recipe-title {
    flex: 1;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--secondary-color);
}

.btn-save-recipe {
    width: 40px;
    height: 40px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-save-recipe:hover {
    background: #fff3cd;
    transform: scale(1.1);
}

.btn-save-recipe.saved {
    background: linear-gradient(135deg, #ffd700 0%, #ffb300 100%);
    color: white;
}

.recipe-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.recipe-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.recipe-section {
    margin-bottom: 15px;
}

.recipe-section:last-child {
    margin-bottom: 0;
}

.recipe-section h4 {
    font-size: 0.9rem;
    color: var(--primary-color);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.recipe-section ul {
    list-style: none;
    padding: 0;
}

.recipe-section li {
    padding: 5px 0;
    padding-left: 20px;
    position: relative;
    color: var(--text-color);
    font-size: 0.95rem;
}

.recipe-section li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

.recipe-steps {
    counter-reset: step;
}

.recipe-steps li {
    padding-left: 30px;
    margin-bottom: 10px;
}

.recipe-steps li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0;
    width: 22px;
    height: 22px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-error {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

.menu-error h3 {
    color: #c62828;
    margin-bottom: 10px;
}

/* Recipe Card with Image */
.recipe-card {
    background: var(--background);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 20px;
}

.recipe-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.recipe-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.recipe-card:hover .recipe-image img {
    transform: scale(1.05);
}

.recipe-content {
    padding: 20px;
}

.recipe-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.recipe-meta span {
    font-size: 0.9rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Menu Actions Container */
.menu-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

/* Save Menu Button */
.btn-save-menu {
    padding: 12px 25px;
    background: linear-gradient(135deg, #ffd700 0%, #ffb300 100%);
    color: #333;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.btn-save-menu:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

/* Switch Option Button */
.btn-switch-option {
    padding: 12px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-switch-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Favorites Toggle Button */
.favorites-toggle {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(0);
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #ffd700 0%, #ffb300 100%);
    border: none;
    border-radius: 50%;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    z-index: 93;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 1.5rem;
}

.favorites-toggle:hover {
    transform: scale(1.1);
}

.favorites-count {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Favorites Modal Styles */
.favorites-header {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.favorites-header h2 {
    font-size: 1.8rem;
    color: var(--secondary-color);
    margin-bottom: 5px;
}

.favorites-header p {
    color: var(--text-light);
}

.favorites-content {
    max-height: 60vh;
    overflow-y: auto;
}

.favorites-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.favorites-empty .empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.favorites-empty h3 {
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.favorite-menu-card {
    background: var(--background);
    border-radius: var(--radius-md);
    padding: 15px;
    margin-bottom: 15px;
    transition: var(--transition);
}

.favorite-menu-card:hover {
    box-shadow: var(--shadow-md);
}

.favorite-menu-header {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.favorite-menu-image {
    width: 100px;
    height: 80px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

.favorite-menu-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.favorite-menu-info {
    flex: 1;
}

.favorite-menu-info h3 {
    font-size: 1rem;
    color: var(--secondary-color);
    margin-bottom: 5px;
}

.favorite-menu-info p {
    font-size: 0.85rem;
    color: var(--text-light);
}

.favorite-ingredients {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.favorite-ingredients span {
    background: var(--primary-light);
    color: var(--primary-color);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
}

.favorite-menu-actions {
    display: flex;
    gap: 10px;
}

.btn-view-favorite,
.btn-remove-favorite {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.btn-view-favorite {
    background: var(--primary-color);
    color: var(--white);
}

.btn-view-favorite:hover {
    background: var(--primary-dark);
}

.btn-remove-favorite {
    background: #ffebee;
    color: #c62828;
}

.btn-remove-favorite:hover {
    background: #ffcdd2;
}

/* Notification Toast */
.notification {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--secondary-color);
    color: var(--white);
    padding: 15px 30px;
    border-radius: 30px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
}

.notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Ticket Upload Button */
.ticket-toggle {
    position: fixed;
    bottom: 20px;
    right: 80px; /* Al lado del botón de ingredientes */
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    border: none;
    border-radius: 50%;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 1.5rem;
}

.ticket-toggle:hover {
    transform: scale(1.1);
}

/* Modal Medium Size */
.modal-medium {
    max-width: 550px;
}

/* Ticket Modal Styles */
.ticket-header {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.ticket-header h2 {
    font-size: 1.6rem;
    color: var(--secondary-color);
    margin-bottom: 8px;
}

.ticket-header p {
    color: var(--text-light);
    font-size: 0.95rem;
}

.ticket-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 40px 20px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    margin-bottom: 20px;
}

.ticket-upload-area:hover,
.ticket-upload-area.dragover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.ticket-upload-area p {
    color: var(--text-light);
    margin-bottom: 15px;
}

.btn-select-file {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 10px 25px;
    border-radius: 25px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-select-file:hover {
    background: var(--primary-dark);
}

.ticket-file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--primary-light);
    padding: 12px 15px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.ticket-file-info .file-icon {
    font-size: 1.5rem;
}

.ticket-file-info .file-name {
    flex: 1;
    font-weight: 500;
    color: var(--secondary-color);
}

.btn-remove-file {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}

.btn-remove-file:hover {
    color: #c62828;
}

.ticket-options {
    margin-bottom: 20px;
}

.ticket-options h4 {
    text-align: center;
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-size: 1rem;
}

.option-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.option-buttons-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

@media (max-width: 600px) {
    .option-buttons-3 {
        grid-template-columns: 1fr;
    }
}

.btn-option {

/* Centered floating container to hold buttons as a group */
#floatingControls {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    display: flex;
    gap: 14px;
    align-items: center;
    z-index: 120;
    pointer-events: auto;
}

/* Place buttons inside the container (override fixed placements) */
.ingredients-toggle,
.favorites-toggle,
.user-favorites-toggle,
.ticket-toggle,
.shopping-list-toggle {
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    margin: 0 !important;
}

/* Slightly smaller on compact screens */
@media (max-width: 480px) {
    #floatingControls { gap: 10px; }
}
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 20px 15px;
    background: var(--background);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.btn-option:hover {
    border-color: var(--primary-color);
}

.btn-option.selected {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.btn-option span:first-child {
    font-size: 2rem;
}

.btn-option span:nth-child(2) {
    font-weight: 600;
    color: var(--secondary-color);
}

.btn-option small {
    color: var(--text-light);
    font-size: 0.8rem;
}

.btn-process-ticket {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-process-ticket:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 166, 80, 0.3);
}

.btn-process-ticket:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Weekly Menu Styles */
.weekly-menu {
    display: grid;
    gap: 15px;
}

.day-card {
    background: var(--background);
    border-radius: var(--radius-md);
    padding: 15px;
    border-left: 4px solid var(--primary-color);
}

.day-card h3 {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.day-meals {
    display: grid;
    gap: 10px;
}

.meal-item {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: var(--white);
    border-radius: var(--radius-sm);
}

.meal-type {
    font-weight: 600;
    color: var(--secondary-color);
    min-width: 80px;
    font-size: 0.85rem;
}

.meal-name {
    color: var(--text-color);
    flex: 1;
}

/* Responsive for ingredients panel */
@media (max-width: 480px) {
    .ingredients-panel {
        width: calc(100% - 40px);
        right: 20px;
        left: 20px;
        bottom: 90px;
    }
    
    .ingredients-toggle {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        right: 120px;
        bottom: 20px;
    }
    
    .favorites-toggle {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        right: 240px;
        bottom: 20px;
    }

/* User favorites toggle (third button) placed to the right of center */
.user-favorites-toggle {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(90px);
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #ff6b81 0%, #ff5252 100%);
    border: none;
    border-radius: 50%;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    z-index: 91;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 1.5rem;
}

.user-favorites-toggle:hover { transform: scale(1.05); }

/* ===== Responsive: Mobile & Small Screens ===== */
@media (max-width: 768px) {
    /* Layout adjustments */
    .layout {
        flex-direction: column;
        gap: 12px;
    }

    /* Hide the left sidebar on small screens (mobile navigation via menu toggle)
       and make products section take full width */
    .sidebar {
        display: none;
    }

    .products-section {
        padding-bottom: 160px; /* leave space for floating controls */
    }

    /* Ingredients panel becomes a bottom sheet by default */
    .ingredients-panel {
        width: calc(100% - 32px);
        left: 16px;
        right: 16px;
        bottom: 180px;
        transform: translateX(0);
        border-radius: 12px;
        max-height: 50vh;
    }

    /* Collapsed circular icon state on mobile (small badge) */
    .ingredients-panel.collapsed {
        width: 64px;
        height: 64px;
        bottom: 170px;
        left: auto;
        right: 16px;
        border-radius: 50%;
        padding: 8px;
    }

    .ingredients-panel.collapsed .ingredients-header {
        align-items: center;
    }

    /* Floating buttons: smaller and closer together, centered */
    .ingredients-toggle, .favorites-toggle, .user-favorites-toggle {
        width: 52px;
        height: 52px;
        font-size: 1.15rem;
    }

    .ingredients-toggle { transform: translateX(-64px); }
    .favorites-toggle { transform: translateX(0); }
    .user-favorites-toggle { transform: translateX(64px); }

    .ingredients-collapsed-icons img {
        width: 22px;
        height: 22px;
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    /* Extra adjustments for very small screens */
    .ingredients-panel {
        bottom: 160px;
        max-height: 55vh;
    }

    .products-grid article.product-card {
        width: 100%;
        margin-bottom: 12px;
    }

    .search-container { max-width: 100%; }
}
    
    .ticket-toggle {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        right: 60px;
        bottom: 20px;
    }
    
    .shopping-list-toggle {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        right: 180px;
        bottom: 20px;
    }
    
    .option-buttons {
        grid-template-columns: 1fr;
    }
    
    .recipe-image {
        height: 150px;
    }
    
    .recipe-meta {
        gap: 10px;
    }
    
    .recipe-meta span {
        font-size: 0.8rem;
    }
}

/* ===== Shopping List Styles ===== */
.shopping-list-toggle {
    position: fixed;
    bottom: 20px;
    right: 200px; /* Al lado de los otros botones */
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #2196F3 0%, #1565C0 100%);
    border: none;
    border-radius: 50%;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 1.5rem;
}

.shopping-list-toggle:hover {
    transform: scale(1.1);
}

.shopping-list-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #f44336;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.shopping-list-header {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.shopping-list-header h2 {
    font-size: 1.6rem;
    color: var(--secondary-color);
    margin-bottom: 8px;
}

.shopping-list-header p {
    color: var(--text-light);
    font-size: 0.95rem;
}

.shopping-list-search {
    position: relative;
    margin-bottom: 20px;
}

.shopping-search-input {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: var(--transition);
}

.shopping-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.shopping-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: var(--shadow-lg);
}

.shopping-search-results.active {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--border-color);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--primary-light);
}

.search-result-item img {
    width: 45px;
    height: 45px;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.search-result-info {
    flex: 1;
}

.search-result-info h4 {
    font-size: 0.9rem;
    margin-bottom: 2px;
    color: var(--secondary-color);
}

.search-result-info span {
    font-size: 0.8rem;
    color: var(--text-light);
}

.search-result-price {
    font-weight: 600;
    color: var(--primary-color);
}

.shopping-list-content {
    min-height: 200px;
    max-height: 350px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.empty-shopping-list {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

.empty-shopping-list span {
    font-size: 3rem;
    display: block;
    margin-bottom: 15px;
}

.empty-shopping-list p {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.shopping-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: var(--background);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
}

.shopping-item img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.shopping-item-info {
    flex: 1;
}

.shopping-item-info h4 {
    font-size: 0.95rem;
    margin-bottom: 4px;
    color: var(--secondary-color);
}

.shopping-item-info .item-details {
    font-size: 0.8rem;
    color: var(--text-light);
}

.shopping-item-info .item-weight-note {
    font-size: 0.75rem;
    color: #ff9800;
    font-style: italic;
}

.shopping-item-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
}

.shopping-item-quantity button {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.shopping-item-quantity button:hover {
    background: var(--primary-dark);
}

.shopping-item-quantity span {
    font-weight: 600;
    min-width: 25px;
    text-align: center;
}

.shopping-item-price {
    font-weight: 700;
    color: var(--primary-color);
    min-width: 70px;
    text-align: right;
}

.shopping-item-remove {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
    padding: 5px;
}

.shopping-item-remove:hover {
    color: #f44336;
}

.shopping-list-footer {
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
}

.shopping-list-total {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.shopping-list-total span:first-child {
    font-size: 1.1rem;
    color: var(--text-color);
}

.total-amount {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

.shopping-list-total small {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.shopping-list-actions {
    display: flex;
    gap: 15px;
}

.btn-clear-list, .btn-share-list {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-clear-list {
    background: var(--background);
    color: var(--text-color);
}

.btn-clear-list:hover {
    background: #ffebee;
    color: #f44336;
}

.btn-share-list {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-share-list:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Share Link Container */
.share-link-container {
    background: var(--background);
    border-radius: var(--radius-md);
    padding: 15px;
    margin-top: 15px;
    display: none;
}

.share-link-container.active {
    display: block;
}

.share-link-container p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 10px;
}

.share-link-input {
    display: flex;
    gap: 10px;
}

.share-link-input input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.share-link-input button {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.share-link-input button:hover {
    background: var(--primary-dark);
}

/* Add to shopping list button in product cards */
.btn-add-to-list {
    background: linear-gradient(135deg, #2196F3 0%, #1565C0 100%);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 8px;
    width: 100%;
}

.btn-add-to-list:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.btn-add-to-list.added {
    background: #4CAF50;
}

/* ===== Login Modal Styles ===== */
.modal-small {
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 25px;
}

.login-header h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: var(--secondary-color);
}

.login-header p {
    color: var(--text-light);
    font-size: 0.95rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.login-input {
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: var(--transition);
}

.login-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-login-submit {
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-login-submit:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.existing-users {
    margin-bottom: 10px;
}

.existing-users label {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 8px;
    display: block;
}

.users-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.user-btn {
    padding: 8px 16px;
    background: var(--background);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
}

.user-btn:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.login-divider {
    text-align: center;
    position: relative;
    margin: 10px 0;
}

.login-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
}

.login-divider span {
    background: var(--white);
    padding: 0 15px;
    position: relative;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ===== Google OAuth Button ===== */
.btn-google-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 20px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    color: #3c4043;
    cursor: pointer;
    transition: var(--transition);
}

.btn-google-login:hover {
    background: #f8f9fa;
    border-color: #d0d0d0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-google-login svg {
    flex-shrink: 0;
}

.btn-test-login {
    background: linear-gradient(135deg, #9E9E9E 0%, #757575 100%);
    font-size: 0.9rem;
    padding: 10px 16px;
}

.btn-test-login:hover {
    background: linear-gradient(135deg, #757575 0%, #616161 100%);
}

/* OAuth User Info */
.oauth-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.oauth-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.user-initials-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

/* ===== User Favorites Button ===== */
.user-favorites-toggle {
    position: fixed;
    bottom: 20px;
    right: 320px; /* Junto a los otros botones */
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #E91E63 0%, #C2185B 100%);
    border: none;
    border-radius: 50%;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 1.5rem;
}

.user-favorites-toggle:hover {
    transform: scale(1.1);
}

.user-favorites-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff9800;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

/* ===== Product Favorite Button ===== */
.btn-favorite-product {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    z-index: 5;
}

.btn-favorite-product:hover {
    transform: scale(1.1);
    background: white;
}

.btn-favorite-product.favorited {
    background: #ffebee;
    color: #E91E63;
}

.product-card {
    position: relative;
}

/* Favorites category highlight */
.favorites-category-item {
    background: linear-gradient(135deg, #fce4ec 0%, #f8bbd0 100%) !important;
    border-left: 4px solid #E91E63 !important;
}

.favorites-category-item .category-name {
    color: #C2185B !important;
    font-weight: 600;
}

/* Mobile responsive for user favorites */
@media (max-width: 768px) {
    .user-bar-content {
        justify-content: center;
    }
    
    .user-favorites-toggle {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        right: 300px;
        bottom: 20px;
    }
}

/* ===== Shopping Mode Styles ===== */
.btn-go-shopping {
    flex: 1;
    padding: 14px 20px;
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-go-shopping:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.shopping-mode-actions {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.btn-exit-shopping {
    flex: 1;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-exit-shopping:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Shopping mode item styles */
.shopping-item.shopping-mode {
    cursor: pointer;
    transition: var(--transition);
}

.shopping-item.shopping-mode:hover {
    background: #e8f5e9;
}

.shopping-item.checked {
    opacity: 0.5;
    text-decoration: line-through;
    background: #f5f5f5;
}

.shopping-item.checked .shopping-item-info h4 {
    text-decoration: line-through;
    color: var(--text-muted);
}

.shopping-item .check-indicator {
    font-size: 1.5rem;
    margin-right: 10px;
}

/* Share options */
.share-options {
    margin-top: 15px;
    padding: 15px;
    background: var(--background);
    border-radius: var(--radius-md);
}

.share-option-row {
    display: flex;
    gap: 15px;
    align-items: stretch;
}

.btn-share-link {
    padding: 12px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.btn-share-link:hover {
    background: var(--primary-dark);
}

.share-to-user {
    flex: 1;
    display: flex;
    gap: 10px;
}

.share-to-user input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
}

.share-to-user input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.share-to-user button {
    padding: 10px 20px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.share-to-user button:hover {
    background: #1976D2;
}

/* Shared lists section */
.shared-lists-section {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-radius: var(--radius-md);
    padding: 15px;
    margin-bottom: 20px;
    border-left: 4px solid #FF9800;
}

.shared-lists-section h4 {
    margin-bottom: 12px;
    color: #E65100;
}

.shared-list-card {
    background: white;
    border-radius: var(--radius-sm);
    padding: 12px 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
}

.shared-list-card:last-child {
    margin-bottom: 0;
}

.shared-list-info {
    flex: 1;
}

.shared-list-info h5 {
    font-size: 0.95rem;
    color: var(--secondary-color);
    margin-bottom: 4px;
}

.shared-list-info span {
    font-size: 0.8rem;
    color: var(--text-light);
}

.shared-list-actions {
    display: flex;
    gap: 8px;
}

.shared-list-actions button {
    padding: 8px 14px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition);
}

.btn-accept-list {
    background: var(--primary-color);
    color: white;
}

.btn-accept-list:hover {
    background: var(--primary-dark);
}

.btn-dismiss-list {
    background: var(--background);
    color: var(--text-color);
}

.btn-dismiss-list:hover {
    background: #ffebee;
    color: #f44336;
}

/* Shopping mode indicator */
.shopping-mode-indicator {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    color: white;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    text-align: center;
    margin-bottom: 15px;
    font-weight: 600;
}

.shopping-mode-indicator span {
    margin-right: 8px;
}

/* Shopping list actions - 3 buttons */
.shopping-list-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.shopping-list-actions button {
    flex: 1;
    min-width: 100px;
}

@media (max-width: 500px) {
    .shopping-list-actions {
        flex-direction: column;
    }
    
    .share-option-row {
        flex-direction: column;
    }
}

/* ===== Ticket Products Results ===== */
.ticket-products-header {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.ticket-products-header h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.ticket-products-header p {
    color: var(--text-light);
}

.ticket-products-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.ticket-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding: 5px;
}

.ticket-product-card {
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: var(--transition);
    position: relative;
}

.ticket-product-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.ticket-product-card img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 10px;
}

.ticket-product-card h4 {
    font-size: 0.85rem;
    margin-bottom: 5px;
    line-height: 1.3;
}

.ticket-product-card .product-match {
    font-size: 0.75rem;
    color: var(--primary-color);
    background: var(--primary-light);
    padding: 3px 8px;
    border-radius: 10px;
    margin-bottom: 8px;
}

.ticket-product-card .product-price {
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.ticket-product-card .btn-add-favorite {
    width: 100%;
    padding: 8px;
    background: linear-gradient(135deg, #E91E63 0%, #C2185B 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition);
}

.ticket-product-card .btn-add-favorite:hover {
    transform: translateY(-2px);
}

.ticket-product-card .btn-add-favorite.added {
    background: #4CAF50;
}

.ticket-products-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.ticket-products-actions button {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-add-all-favorites {
    background: linear-gradient(135deg, #E91E63 0%, #C2185B 100%);
    color: white;
}

.btn-add-all-favorites:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-add-to-shopping {
    background: linear-gradient(135deg, #2196F3 0%, #1565C0 100%);
    color: white;
}

.btn-add-to-shopping:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ===== Profile Modal Styles ===== */

.modal-xlarge {
    max-width: 1000px;
    width: 95%;
}

.profile-header {
    text-align: center;
    margin-bottom: 20px;
}

.profile-header h2 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.profile-header p {
    color: var(--text-muted);
}

.btn-profile {
    padding: 6px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    margin-right: 8px;
}

.btn-profile:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Profile Tabs */
.profile-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.profile-tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.profile-tab:hover {
    color: var(--primary);
    background: rgba(102, 126, 234, 0.1);
}

.profile-tab.active {
    color: var(--primary);
    background: rgba(102, 126, 234, 0.15);
    border-bottom: 3px solid var(--primary);
    margin-bottom: -12px;
}

.profile-tab-content {
    min-height: 400px;
}

.profile-tab-content.hidden {
    display: none;
}

/* Tickets List */
.tickets-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 500px;
    overflow-y: auto;
}

.empty-tickets {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-tickets span {
    font-size: 4rem;
    display: block;
    margin-bottom: 15px;
}

.empty-tickets p {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.ticket-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 15px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.ticket-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.ticket-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.ticket-date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.ticket-icon {
    font-size: 1.3rem;
}

.ticket-total {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
}

.ticket-card-body {
    margin-bottom: 10px;
}

.ticket-products-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.ticket-product-tag {
    background: rgba(102, 126, 234, 0.15);
    color: var(--primary);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
}

.ticket-more {
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 3px 8px;
}

.ticket-stats {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.ticket-card-actions {
    display: flex;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.btn-ticket-detail {
    flex: 1;
    padding: 8px 15px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-ticket-detail:hover {
    background: var(--primary-dark);
}

.btn-ticket-delete {
    padding: 8px 12px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.btn-ticket-delete:hover {
    background: #d32f2f;
}

/* Ticket Detail */
.ticket-detail {
    padding: 20px;
}

.ticket-detail h3 {
    margin-bottom: 15px;
}

.ticket-detail-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.ticket-detail-total .total-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.ticket-detail-products h4 {
    margin-bottom: 10px;
}

.ticket-products-table {
    width: 100%;
    border-collapse: collapse;
}

.ticket-products-table th,
.ticket-products-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.ticket-products-table th {
    background: var(--bg-secondary);
    font-weight: 600;
}

.category-tag {
    background: rgba(102, 126, 234, 0.15);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
}

/* Stats Dashboard */
.stats-filters {
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.stats-filters label {
    font-weight: 600;
    margin-right: 10px;
}

.date-range-picker {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
    flex-wrap: wrap;
}

.date-range-picker input[type="date"] {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
}

.btn-clear-dates {
    padding: 8px 15px;
    background: #9e9e9e;
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.btn-clear-dates:hover {
    background: #757575;
}

.quick-date-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.quick-date-filters button {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.quick-date-filters button:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Stats Summary Cards */
.stats-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Stats Charts */
.stats-charts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.chart-container {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--border-color);
}

.chart-container.full-width {
    grid-column: 1 / -1;
}

.chart-container h4 {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.no-data {
    text-align: center;
    color: var(--text-muted);
    padding: 30px;
}

/* Category Chart Bars - Accordion Style */
.category-accordion {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    overflow: hidden;
    transition: var(--transition);
}

.category-accordion:hover {
    border-color: var(--primary);
}

.category-accordion.expanded {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.category-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: var(--transition);
}

.category-bar-row:hover {
    background: rgba(102, 126, 234, 0.05);
}

.category-expand-icon {
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
    width: 12px;
}

.category-accordion.expanded .category-expand-icon {
    color: var(--primary);
}

.category-name {
    width: 120px;
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.category-bar-container {
    flex: 1;
    height: 20px;
    background: var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.category-bar {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius-sm);
    transition: width 0.5s ease;
}

.category-value {
    width: 70px;
    text-align: right;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
}

/* Category Products List (Accordion Content) */
.category-products-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.category-accordion.expanded .category-products-list {
    border-top-color: var(--primary);
}

.category-products-header {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    background: rgba(102, 126, 234, 0.1);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
}

.category-product-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.category-product-item:last-child {
    border-bottom: none;
}

.category-product-item .product-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-product-item .product-count {
    background: rgba(102, 126, 234, 0.15);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.category-product-item .product-spent {
    font-weight: 600;
    width: 65px;
    text-align: right;
}

.no-products {
    padding: 15px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Top Products List */
.top-product-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.top-product-row:last-child {
    border-bottom: none;
}

.product-rank {
    width: 25px;
    height: 25px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
}

.product-name {
    flex: 1;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-count {
    background: rgba(102, 126, 234, 0.15);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
}

.product-spent {
    font-weight: 600;
    width: 60px;
    text-align: right;
}

/* Monthly Chart */
.monthly-bars {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    height: 200px;
    padding: 10px 0;
}

.monthly-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.monthly-bar {
    width: 100%;
    max-width: 50px;
    background: linear-gradient(to top, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    margin-top: auto;
    transition: height 0.5s ease;
}

.monthly-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 8px;
    text-align: center;
}

.monthly-value {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary);
    margin-top: 2px;
}

/* Responsive for Profile */
@media (max-width: 768px) {
    .stats-summary {
        grid-template-columns: 1fr;
    }
    
    .stats-charts {
        grid-template-columns: 1fr;
    }
    
    .profile-tabs {
        flex-wrap: wrap;
    }
    
    .profile-tab {
        flex: 1;
        text-align: center;
    }
    
    .date-range-picker {
        flex-direction: column;
        align-items: stretch;
    }
    
    .category-name {
        width: 80px;
    }
    
    .monthly-bars {
        height: 150px;
    }
}

/* ===== Ticket Confirmation Styles ===== */
.ticket-confirm-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.ticket-confirm-header h2 {
    margin-bottom: 8px;
}

.ticket-confirm-header p {
    color: var(--text-muted);
    margin-bottom: 15px;
}

.ticket-info-bar {
    display: flex;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
    padding: 10px 15px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.ticket-info-bar span {
    font-size: 0.9rem;
}

.ticket-info-bar strong {
    color: var(--primary);
}

/* Confirm List */
.ticket-confirm-list {
    max-height: 450px;
    overflow-y: auto;
    padding-right: 5px;
}

.ticket-confirm-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    overflow: hidden;
    transition: var(--transition);
}

.ticket-confirm-item:hover {
    border-color: var(--primary);
}

.ticket-confirm-item.confirmed {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.05);
}

.ticket-confirm-item.skipped {
    opacity: 0.6;
    border-color: #9e9e9e;
}

.ticket-confirm-item.unmatched {
    border-color: #ff9800;
    background: rgba(255, 152, 0, 0.05);
}

.confirm-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: rgba(102, 126, 234, 0.08);
    border-bottom: 1px solid var(--border-color);
}

.ingredient-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.ingredient-name {
    flex: 1;
    font-weight: 600;
    font-size: 0.95rem;
}

.match-status {
    font-size: 0.8rem;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
}

.match-status.matched {
    background: rgba(76, 175, 80, 0.15);
    color: #4CAF50;
}

.match-status.unmatched {
    background: rgba(244, 67, 54, 0.15);
    color: #f44336;
}

.match-status.skipped {
    background: rgba(158, 158, 158, 0.15);
    color: #757575;
}

.confirm-item-body {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    gap: 15px;
}

.matched-product {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.matched-product img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: white;
    padding: 5px;
}

.matched-product .product-info {
    flex: 1;
}

.matched-product .product-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 3px;
}

.matched-product .product-category {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.matched-product .product-price {
    font-weight: 600;
    color: var(--primary);
    margin-top: 3px;
}

.no-match {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    padding: 15px;
}

.no-match.skipped {
    color: #757575;
}

.confirm-item-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-change-product, .btn-skip-product {
    padding: 8px 15px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-change-product {
    background: var(--primary);
    color: white;
}

.btn-change-product:hover {
    background: var(--primary-dark);
}

.btn-skip-product {
    background: #9e9e9e;
    color: white;
}

.btn-skip-product:hover {
    background: #757575;
}

.btn-search-small {
    padding: 5px 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    cursor: pointer;
}

/* Product Search in Ticket */
.product-search-container {
    padding: 15px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}

.product-search-container.hidden {
    display: none;
}

.product-search-input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.product-search-input:focus {
    border-color: var(--primary);
    outline: none;
}

.product-search-results {
    max-height: 200px;
    overflow-y: auto;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.search-result-item:hover {
    background: rgba(102, 126, 234, 0.1);
}

.search-result-item img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: white;
}

.search-result-item .result-info {
    flex: 1;
}

.search-result-item .result-name {
    font-size: 0.9rem;
    font-weight: 500;
}

.search-result-item .result-price {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 600;
}

.search-hint, .searching, .no-results, .search-error {
    text-align: center;
    padding: 15px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.unmatched-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px dashed #ff9800;
}

.unmatched-section h4 {
    color: #ff9800;
    margin-bottom: 15px;
}

/* Confirm Actions */
.ticket-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.btn-cancel-ticket, .btn-confirm-ticket {
    padding: 12px 25px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-cancel-ticket {
    background: #9e9e9e;
    color: white;
}

.btn-cancel-ticket:hover {
    background: #757575;
}

.btn-confirm-ticket {
    background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
    color: white;
}

.btn-confirm-ticket:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-view-profile {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-view-profile:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.product-category-tag {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

/* Responsive */
@media (max-width: 768px) {
    .confirm-item-body {
        flex-direction: column;
        align-items: stretch;
    }
    
    .confirm-item-actions {
        flex-direction: row;
        justify-content: flex-end;
    }
    
    .ticket-info-bar {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .ticket-confirm-actions {
        flex-direction: column;
    }
    
    .btn-cancel-ticket, .btn-confirm-ticket {
        width: 100%;
    }
}

/* ===== Floating Controls: Normalize & Centered Group ===== */
/* These rules help keep the floating action buttons centered, evenly spaced
   and prevent overlapping on different screen sizes. They intentionally
   override earlier per-button absolute placements. */

/* Base normalization for buttons (will be refined per-button below) */
.ingredients-toggle,
.favorites-toggle,
.user-favorites-toggle,
.ticket-toggle,
.shopping-list-toggle {
    position: fixed;
    bottom: 20px;
    left: 50%;
    margin: 0;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.16);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    z-index: 100;
    pointer-events: auto;
}

/* By default hide protected actions (ticket, shopping list, favorites) until JS enables them for logged users */
.ticket-toggle,
.shopping-list-toggle,
.favorites-toggle,
.user-favorites-toggle,
.ingredients-toggle {
    display: none !important;
}

/* Hide generate menu button by default; JS will enable/show it for logged users */
#generateMenu {
    display: none !important;
}

/* Position each control relative to center (fine-tune spacing here) */
.ingredients-toggle { transform: translateX(-110px); z-index: 103; }
.favorites-toggle { transform: translateX(0); z-index: 104; }
.user-favorites-toggle { transform: translateX(110px); z-index: 102; }
.ticket-toggle { transform: translateX(220px); z-index: 101; }
.shopping-list-toggle { transform: translateX(-220px); z-index: 101; }

/* Preserve translateX on hover while adding a subtle scale */
.ingredients-toggle:hover { transform: translateX(-110px) scale(1.06); }
.favorites-toggle:hover { transform: translateX(0) scale(1.06); }
.user-favorites-toggle:hover { transform: translateX(110px) scale(1.06); }
.ticket-toggle:hover { transform: translateX(220px) scale(1.06); }
.shopping-list-toggle:hover { transform: translateX(-220px) scale(1.06); }

/* Consistent font size / icon scale */
.ingredients-toggle, .favorites-toggle, .user-favorites-toggle, .ticket-toggle, .shopping-list-toggle {
    font-size: 1.45rem;
}

/* Badges inside the buttons */
.toggle-count, .favorites-count, .shopping-list-count, .user-favorites-count {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    background: var(--primary-color);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Responsive adjustments: reduce spacing and hide extras on very small screens */
@media (max-width: 768px) {
    .ingredients-toggle { transform: translateX(-84px); }
    .favorites-toggle { transform: translateX(0); }
    .user-favorites-toggle { transform: translateX(84px); }
    .ticket-toggle { transform: translateX(168px); }
    .shopping-list-toggle { transform: translateX(-168px); }
    .ingredients-toggle, .favorites-toggle, .user-favorites-toggle, .ticket-toggle, .shopping-list-toggle { width: 56px; height: 56px; font-size: 1.2rem; }
}

@media (max-width: 480px) {
    .ingredients-toggle { transform: translateX(-64px); }
    .favorites-toggle { transform: translateX(0); }
    .user-favorites-toggle { transform: translateX(64px); }
    .ticket-toggle { transform: translateX(128px); display: flex; z-index: 101; }
    .shopping-list-toggle { transform: translateX(-128px); display: flex; z-index: 101; }
    .ingredients-toggle, .favorites-toggle, .user-favorites-toggle, .ticket-toggle, .shopping-list-toggle { width: 52px; height: 52px; font-size: 1.1rem; }
}
