 *      {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
            background: linear-gradient(135deg, #2a6dc8 0%, #18478B 100%);
            min-height: 100vh;
            padding: 100px 20px 20px;
            transition: background 0.4s ease;
        }

        /* ── Maxima theme (default) ── */
        body.theme-maxima {
            background: linear-gradient(135deg, #2a6dc8 0%, #18478B 100%);
        }

        body.theme-maxima .floating-header {
            background: rgba(10, 30, 65, 0.92);
        }

        body.theme-maxima .store-btn.active {
            border-color: #18478B;
            background: #e8eef8;
        }

        body.theme-maxima .btn:not(.btn-secondary):not(.btn-danger) {
            background: #18478B;
        }

        body.theme-maxima .btn:hover:not(.btn-secondary):not(.btn-danger) {
            box-shadow: 0 4px 12px rgba(24, 71, 139, 0.45);
        }

        body.theme-maxima .tab-btn.active {
            color: #18478B;
        }

        body.theme-maxima .search-box {
            border-top: 3px solid #18478B;
        }

        /* ── IKI theme ── */
        body.theme-iki {
            background: linear-gradient(135deg, #FBDE37 0%, #005C32 100%);
        }

        body.theme-iki .floating-header {
            background: rgba(0, 60, 30, 0.92);
        }

        body.theme-iki .store-btn.active {
            border-color: #005C32;
            background: #e8f5e9;
        }

        body.theme-iki .btn:not(.btn-secondary):not(.btn-danger) {
            background: #005C32;
        }

        body.theme-iki .btn:hover:not(.btn-secondary):not(.btn-danger) {
            box-shadow: 0 4px 12px rgba(0, 92, 50, 0.45);
        }

        body.theme-iki .tab-btn.active {
            color: #005C32;
        }

        body.theme-iki .search-box {
            border-top: 3px solid #FBDE37;
        }

        body.theme-iki .admin-sidebar {
            border-color: rgba(0, 92, 50, 0.3);
        }

        /* ── Lidl theme ── */
        body.theme-lidl {
            background: linear-gradient(135deg, #1a6fd4 0%, #0050AA 100%);
        }

        body.theme-lidl .floating-header {
            background: rgba(0, 30, 80, 0.92);
        }

        body.theme-lidl .store-btn.active {
            border-color: #0050AA;
            background: #e6eef8;
        }

        body.theme-lidl .btn:not(.btn-secondary):not(.btn-danger) {
            background: #0050AA;
        }

        body.theme-lidl .btn:hover:not(.btn-secondary):not(.btn-danger) {
            box-shadow: 0 4px 12px rgba(0, 80, 170, 0.45);
        }

        body.theme-lidl .tab-btn.active {
            color: #0050AA;
        }

        body.theme-lidl .search-box {
            border-top: 3px solid #0050AA;
        }

        /* ── Rimi theme ── */
        body.theme-rimi {
            background: linear-gradient(135deg, #c4409a 0%, #A12871 100%);
        }

        body.theme-rimi .floating-header {
            background: rgba(80, 10, 50, 0.92);
        }

        body.theme-rimi .store-btn.active {
            border-color: #A12871;
            background: #f8e6f2;
        }

        body.theme-rimi .btn:not(.btn-secondary):not(.btn-danger) {
            background: #A12871;
        }

        body.theme-rimi .btn:hover:not(.btn-secondary):not(.btn-danger) {
            box-shadow: 0 4px 12px rgba(161, 40, 113, 0.45);
        }

        body.theme-rimi .tab-btn.active {
            color: #A12871;
        }

        body.theme-rimi .search-box {
            border-top: 3px solid #A12871;
        }

        /* ── Header store picker dropdown ── */
        .header-store-picker {
            position: relative;
        }

        .header-store-trigger {
            display: flex;
            align-items: center;
            gap: 6px;
            background: white;
            border: none;
            border-radius: 9px;
            padding: 5px 12px;
            cursor: pointer;
            height: 36px;
            transition: background 0.15s, box-shadow 0.15s;
            box-shadow: 0 1px 6px rgba(0, 0, 0, 0.18);
        }

        .header-store-trigger:hover {
            background: #f5f5f5;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
        }

        .store-trigger-logo {
            display: flex;
            align-items: center;
        }

        .store-trigger-logo img,
        .store-trigger-logo svg {
            height: 20px;
            width: auto;
            display: block;
        }

        .store-trigger-chevron {
            width: 14px;
            height: 14px;
            color: #666;
            flex-shrink: 0;
            transition: transform 0.2s;
        }

        .header-store-picker.open .store-trigger-chevron {
            transform: rotate(180deg);
        }

        .header-store-dropdown {
            display: none;
            position: absolute;
            top: calc(100% + 10px);
            left: 50%;
            transform: translateX(-50%);
            background: rgba(255, 255, 255, 0.97);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border: 1px solid rgba(0, 0, 0, 0.06);
            border-radius: 12px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
            padding: 6px 10px;
            z-index: 600;
            white-space: nowrap;
            gap: 4px;
            align-items: center;
        }

        .header-store-dropdown.open {
            display: flex;
        }

        .store-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            height: 36px;
            padding: 0 14px;
            border: 2px solid transparent;
            border-radius: 8px;
            background: transparent;
            cursor: pointer;
            transition: opacity 0.15s, border-color 0.15s, background 0.15s;
            flex-shrink: 0;
            opacity: 0.35;
        }

        .store-btn img,
        .store-btn svg {
            height: 24px;
            width: auto;
            display: block;
        }

        .store-btn:hover {
            opacity: 0.65;
            background: rgba(0, 0, 0, 0.04);
        }

        .store-btn.active {
            opacity: 1;
            border-color: #667eea;
            background: #f0f0ff;
        }

        /* ── Store unavailable overlay ── */
        .store-unavailable-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            z-index: 200;
            background: rgba(255, 255, 255, 0.55);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            align-items: center;
            justify-content: center;
        }

        .store-unavailable-overlay.visible {
            display: flex;
        }

        .store-unavailable-msg {
            text-align: center;
            padding: 40px 48px;
            background: rgba(255, 255, 255, 0.92);
            border-radius: 20px;
            box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
        }

        .store-unavailable-icon {
            font-size: 3rem;
            display: block;
            margin-bottom: 16px;
        }

        .store-unavailable-msg p {
            font-size: 1.2rem;
            font-weight: 600;
            color: #333;
            margin-bottom: 6px;
        }

        .store-unavailable-sub {
            font-size: 0.95rem !important;
            font-weight: 400 !important;
            color: #888 !important;
            margin-bottom: 0 !important;
        }

        /* ── Floating pill header ── */
        .floating-header {
            position: fixed;
            top: 14px;
            left: 50%;
            transform: translateX(-50%);
            width: calc(100% - 40px);
            max-width: 1200px;
            background: rgba(16, 16, 18, 0.88);
            backdrop-filter: blur(18px);
            -webkit-backdrop-filter: blur(18px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 14px;
            z-index: 500;
            box-shadow: 0 4px 28px rgba(0, 0, 0, 0.4);
        }

        .header-inner {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 22px;
            height: 58px;
        }

        .header-logo {
            display: flex;
            align-items: center;
            gap: 8px;
            background: white;
            border: none;
            border-radius: 9px;
            padding: 5px 12px;
            height: 36px;
            box-shadow: 0 1px 6px rgba(0, 0, 0, 0.18);
            user-select: none;
        }

        .header-logo-img {
            height: 26px;
            width: auto;
            display: block;
        }

        .header-logo-text {
            font-family: 'Fredoka One', cursive;
            font-size: 1.35rem;
            color: #3d6528;
            letter-spacing: 0.5px;
            line-height: 1;
        }

        .header-nav {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .btn-header-ghost {
            padding: 8px 18px;
            font-size: 14px;
            background: transparent;
            color: rgba(255, 255, 255, 0.8);
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-weight: 500;
            transition: background 0.18s, color 0.18s;
            white-space: nowrap;
        }

        .btn-header-ghost:hover {
            background: rgba(255, 255, 255, 0.1);
            color: #fff;
        }

        .btn-header-solid {
            padding: 8px 18px;
            font-size: 14px;
            background: #fff;
            color: #1a1a1a;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-weight: 600;
            transition: background 0.15s, transform 0.15s;
            white-space: nowrap;
        }

        .btn-header-solid:hover {
            background: #e8e8e8;
            transform: translateY(-1px);
        }

        /* Logged-in state in header */
        .header-person-icon {
            width: 18px;
            height: 18px;
            color: rgba(255, 255, 255, 0.75);
            flex-shrink: 0;
        }

        .header-username {
            color: rgba(255, 255, 255, 0.9);
            font-size: 14px;
            font-weight: 500;
            max-width: 140px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

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

        /* ── Cart button in header ── */
        .header-cart-btn {
            position: relative;
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 9px;
            height: 34px;
            padding: 0 10px 0 8px;
            display: flex;
            align-items: center;
            gap: 7px;
            cursor: pointer;
            color: white;
            transition: background 0.18s;
            flex-shrink: 0;
        }

        .header-cart-btn:hover {
            background: rgba(255, 255, 255, 0.18);
        }

        @keyframes cartBump {
            0%   { transform: scale(1); }
            30%  { transform: scale(1.28); }
            60%  { transform: scale(0.88); }
            80%  { transform: scale(1.08); }
            100% { transform: scale(1); }
        }

        .header-cart-btn.cart-bump {
            animation: cartBump 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97);
        }

        .header-cart-btn svg {
            width: 16px;
            height: 16px;
            flex-shrink: 0;
        }

        .cart-badge {
            position: absolute;
            top: -6px;
            left: 18px;
            background: #667eea;
            color: white;
            font-size: 10px;
            font-weight: 700;
            min-width: 17px;
            height: 17px;
            border-radius: 9px;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0 3px;
            border: 1.5px solid rgba(16, 16, 18, 1);
        }

        .cart-total-display {
            font-size: 13px;
            font-weight: 600;
            color: rgba(255, 255, 255, 0.9);
            letter-spacing: 0.2px;
        }

        @keyframes priceBump {
            0%   { color: rgba(255, 255, 255, 0.9); }
            40%  { color: #a78bfa; transform: scale(1.12); }
            100% { color: rgba(255, 255, 255, 0.9); transform: scale(1); }
        }

        .cart-total-display.price-bump {
            animation: priceBump 0.45s ease;
        }

        /* ── User dropdown ── */
        .header-user-wrap {
            position: relative;
        }

        .header-user-trigger {
            display: flex;
            align-items: center;
            gap: 8px;
            background: transparent;
            border: none;
            cursor: pointer;
            padding: 4px 8px;
            border-radius: 9px;
            transition: background 0.18s;
        }

        .header-user-trigger:hover {
            background: rgba(255, 255, 255, 0.08);
        }

        .dropdown-chevron {
            width: 13px;
            height: 13px;
            color: rgba(255, 255, 255, 0.5);
            transition: transform 0.2s;
            flex-shrink: 0;
        }

        .header-user-wrap.open .dropdown-chevron {
            transform: rotate(180deg);
        }

        .user-dropdown {
            display: none;
            position: absolute;
            top: calc(100% + 8px);
            right: 0;
            background: rgba(20, 20, 24, 0.97);
            backdrop-filter: blur(18px);
            -webkit-backdrop-filter: blur(18px);
            border: 1px solid rgba(255, 255, 255, 0.12);
            border-radius: 10px;
            box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
            min-width: 160px;
            overflow: hidden;
            z-index: 600;
        }

        .header-user-wrap.open .user-dropdown {
            display: block;
            animation: dropIn 0.15s ease;
        }

        @keyframes dropIn {
            from { opacity: 0; transform: translateY(-6px); }
            to   { opacity: 1; transform: translateY(0); }
        }

        .dropdown-item {
            display: flex;
            align-items: center;
            gap: 9px;
            width: 100%;
            padding: 11px 14px;
            background: transparent;
            border: none;
            color: rgba(255, 255, 255, 0.8);
            font-size: 14px;
            cursor: pointer;
            text-align: left;
            transition: background 0.15s;
            font-family: inherit;
        }

        .dropdown-item:hover {
            background: rgba(255, 255, 255, 0.08);
            color: white;
        }

        /* ── Admin floating sidebar ── */
        .admin-sidebar {
            position: fixed;
            top: 96px;
            left: 14px;
            background: rgba(16, 16, 18, 0.88);
            backdrop-filter: blur(18px);
            -webkit-backdrop-filter: blur(18px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 14px;
            z-index: 490;
            box-shadow: 0 4px 28px rgba(0, 0, 0, 0.4);
            display: none;
            width: 152px;
        }

        .admin-sidebar.visible {
            display: block;
        }

        .admin-sidebar-content {
            padding: 12px 8px;
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        .admin-sidebar-label {
            font-size: 9px;
            text-transform: uppercase;
            letter-spacing: 0.8px;
            color: rgba(255, 255, 255, 0.3);
            padding: 2px 8px 8px;
            font-weight: 600;
        }

        .admin-sidebar-btn {
            display: flex;
            align-items: center;
            gap: 8px;
            width: 100%;
            padding: 9px 10px;
            background: transparent;
            border: none;
            color: rgba(255, 255, 255, 0.75);
            font-size: 13px;
            cursor: pointer;
            border-radius: 8px;
            text-align: left;
            transition: background 0.18s, color 0.18s;
            font-weight: 500;
            font-family: inherit;
        }

        .admin-sidebar-btn:hover {
            background: rgba(255, 255, 255, 0.1);
            color: white;
        }

        /* ── Profile modal ── */
        .profile-info {
            display: flex;
            flex-direction: column;
            gap: 0;
            margin-bottom: 20px;
            border: 1px solid #e8e8f0;
            border-radius: 10px;
            overflow: hidden;
        }

        .profile-row {
            display: flex;
            align-items: center;
            padding: 11px 16px;
            border-bottom: 1px solid #f0f0f8;
        }

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

        .profile-label {
            font-size: 0.82em;
            font-weight: 600;
            color: #888;
            text-transform: uppercase;
            letter-spacing: 0.4px;
            width: 140px;
            flex-shrink: 0;
        }

        .profile-value {
            font-size: 0.95em;
            color: #222;
            font-weight: 500;
        }

        .profile-section-title {
            font-size: 0.8em;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: #999;
            margin-bottom: 10px;
        }

        .profile-pw-fields {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        /* ── Admin users table ── */
        .users-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.9em;
        }

        .users-table th {
            text-align: left;
            padding: 8px 12px;
            font-size: 0.75em;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: #888;
            border-bottom: 2px solid #eee;
            font-weight: 700;
        }

        .users-table td {
            padding: 10px 12px;
            border-bottom: 1px solid #f0f0f0;
            color: #333;
        }

        .users-table tr:last-child td {
            border-bottom: none;
        }

        .users-table tr:hover td {
            background: #fafafe;
        }

        .user-role-badge {
            display: inline-block;
            padding: 2px 8px;
            border-radius: 20px;
            font-size: 0.78em;
            font-weight: 600;
        }

        .role-admin {
            background: #fef3cd;
            color: #856404;
        }

        .role-courier {
            background: #d1ecf1;
            color: #0c5460;
        }

        .role-user {
            background: #e8f0fe;
            color: #3c4db1;
        }

        .role-select {
            border: 1px solid #e0e0ee;
            border-radius: 6px;
            padding: 3px 8px;
            font-size: 0.82em;
            font-weight: 600;
            background: #f7f7fc;
            color: #333;
            cursor: pointer;
            font-family: inherit;
        }

        .role-select:focus {
            outline: none;
            border-color: #667eea;
        }

        .container {
            max-width: 1160px;
            margin: 0 auto;
        }

        header {
            text-align: center;
            color: white;
            margin-bottom: 30px;
        }

        header h1 {
            font-size: 2.5rem;
            margin-bottom: 10px;
        }

        header p {
            opacity: 0.9;
        }

        /* Tabs */
        .tabs {
            display: flex;
            gap: 8px;
            margin-bottom: 16px;
        }

        .tab-btn {
            flex: 1;
            padding: 14px 20px;
            font-size: 16px;
            background: rgba(255,255,255,0.2);
            color: white;
            border: none;
            border-radius: 10px 10px 0 0;
            cursor: pointer;
            font-weight: 600;
            transition: background 0.2s;
        }

        .tab-btn.active {
            background: white;
            color: #667eea;
        }

        .tab-btn:hover:not(.active) {
            background: rgba(255,255,255,0.3);
        }

        .tab-content {
            display: none;
        }

        .tab-content.active {
            display: block;
        }

        .search-box {
            background: white;
            border-radius: 0 0 16px 16px;
            padding: 24px;
            box-shadow: 0 10px 40px rgba(0,0,0,0.2);
            margin-bottom: 24px;
        }

        .search-input-group {
            display: flex;
            gap: 12px;
            margin-bottom: 16px;
        }

        input[type="text"], textarea {
            flex: 1;
            padding: 14px 20px;
            font-size: 16px;
            border: 2px solid #e0e0e0;
            border-radius: 10px;
            outline: none;
            transition: border-color 0.2s;
            font-family: inherit;
        }

        input[type="text"]:focus, textarea:focus {
            border-color: #667eea;
        }

        textarea {
            min-height: 80px;
            resize: vertical;
        }

        .btn {
            padding: 14px 28px;
            font-size: 16px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
            border-radius: 10px;
            cursor: pointer;
            font-weight: 600;
            transition: transform 0.2s, box-shadow 0.2s;
        }

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

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

        .btn-secondary {
            background: #e0e0e0;
            color: #333;
        }

        .btn-secondary:hover {
            background: #d0d0d0;
        }

        .btn-small {
            padding: 8px 16px;
            font-size: 14px;
        }

        .filters {
            display: flex;
            flex-wrap: wrap;
            gap: 12px;
            align-items: center;
        }

        .filter-group {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .filter-group label {
            font-size: 14px;
            color: #666;
        }

        select {
            padding: 8px 12px;
            border: 1px solid #e0e0e0;
            border-radius: 6px;
            font-size: 14px;
            outline: none;
        }

        .checkbox-label {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 14px;
            color: #666;
            cursor: pointer;
            padding: 6px 12px;
            border-radius: 20px;
            background: #f5f5f5;
            transition: background 0.2s;
        }

        .checkbox-label:hover {
            background: #e8e8e8;
        }

        .checkbox-label input {
            accent-color: #667eea;
        }

        .results-header {
            background: white;
            border-radius: 12px;
            padding: 16px 20px;
            margin-bottom: 16px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            box-shadow: 0 4px 20px rgba(0,0,0,0.1);
        }

        .results-count {
            font-weight: 600;
            color: #333;
        }

        .price-range {
            color: #666;
            font-size: 14px;
        }

        .products-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 16px;
        }

        .product-card {
            background: white;
            border-radius: 12px;
            padding: 16px;
            display: flex;
            flex-direction: column;
            gap: 10px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.1);
            transition: transform 0.2s;
        }

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

        .product-card.clickable {
            cursor: pointer;
        }

        .product-card.selected {
            border: 2px solid #667eea;
        }

        .product-image {
            width: 100%;
            height: 140px;
            object-fit: contain;
            border-radius: 8px;
            background: white;
        }

        .product-info {
            flex: 1;
            display: flex;
            flex-direction: column;
        }

        .product-title {
            font-weight: 600;
            color: #333;
            margin-bottom: 4px;
        }

        .product-brand {
            font-size: 13px;
            color: #888;
            margin-bottom: 8px;
        }

        .product-price {
            display: flex;
            align-items: baseline;
            gap: 8px;
            margin-bottom: 6px;
        }

        .price-current {
            font-size: 1.25rem;
            font-weight: 700;
            color: #667eea;
        }

        .price-old {
            font-size: 0.9rem;
            color: #999;
            text-decoration: line-through;
        }

        .price-discount {
            font-size: 0.8rem;
            background: #ff4757;
            color: white;
            padding: 2px 8px;
            border-radius: 4px;
            font-weight: 600;
        }

        .price-per-unit {
            font-size: 13px;
            color: #888;
        }

        .product-tags {
            display: flex;
            gap: 6px;
            margin-top: 8px;
            flex-wrap: wrap;
        }

        .tag {
            font-size: 11px;
            padding: 3px 8px;
            border-radius: 12px;
            font-weight: 500;
        }

        .tag-eco { background: #d4edda; color: #155724; }
        .tag-veg { background: #d1ecf1; color: #0c5460; }
        .tag-gf { background: #fff3cd; color: #856404; }
        .tag-lf { background: #f8d7da; color: #721c24; }

        .loading {
            text-align: center;
            padding: 40px;
            color: white;
        }

        .loading::after {
            content: '';
            display: inline-block;
            width: 24px;
            height: 24px;
            border: 3px solid white;
            border-top-color: transparent;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin-left: 10px;
            vertical-align: middle;
        }

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

        .no-results {
            text-align: center;
            padding: 60px 20px;
            background: white;
            border-radius: 12px;
            color: #666;
        }

        .no-results h3 {
            margin-bottom: 8px;
            color: #333;
        }

        /* Recipe specific styles */
        .recipe-card {
            background: white;
            border-radius: 16px;
            padding: 24px;
            box-shadow: 0 10px 40px rgba(0,0,0,0.2);
            margin-bottom: 24px;
        }

        .recipe-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 20px;
            padding-bottom: 16px;
            border-bottom: 1px solid #e0e0e0;
        }

        .recipe-title {
            font-size: 1.5rem;
            font-weight: 700;
            color: #333;
            margin-bottom: 4px;
        }

        .recipe-meta {
            font-size: 14px;
            color: #666;
        }

        .recipe-source {
            display: inline-block;
            margin-top: 8px;
            padding: 4px 10px;
            border-radius: 999px;
            font-size: 12px;
            font-weight: 700;
        }

        .recipe-badges {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-top: 8px;
            flex-wrap: wrap;
        }

        .recipe-badges .recipe-source {
            margin-top: 0;
        }

        .recipe-meal-type {
            display: inline-block;
            padding: 4px 10px;
            border-radius: 999px;
            font-size: 12px;
            font-weight: 700;
            background: #fff4de;
            color: #8a5a00;
        }

        .recipe-source-user {
            background: #d4edda;
            color: #155724;
        }

        .recipe-source-ai {
            background: #e7f0ff;
            color: #1f4ea8;
        }

        .recipe-save-wrap {
            display: flex;
            justify-content: flex-end;
            margin-bottom: 14px;
        }

        .saved-recipes-box {
            margin-top: 16px;
            background: white;
            border-radius: 12px;
            padding: 16px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.1);
        }

        .saved-recipes-box h3 {
            margin-bottom: 12px;
            color: #333;
            font-size: 1.05rem;
        }

        .saved-recipes-list {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .saved-recipe-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 12px;
            flex-wrap: wrap;
            padding: 12px;
            border: 1px solid #e8e8e8;
            border-radius: 10px;
            background: #fafbff;
        }

        .saved-recipe-expanded {
            width: 100%;
            margin-top: 10px;
        }

        .saved-recipe-expanded .recipe-card {
            margin-bottom: 0;
        }

        .saved-recipe-title {
            font-weight: 700;
            color: #333;
        }

        .saved-recipe-meta {
            font-size: 13px;
            color: #666;
            margin-top: 4px;
        }

        .saved-recipe-actions {
            display: flex;
            gap: 8px;
        }

        .btn.btn-danger {
            background: #d9534f;
        }

        .btn.btn-danger:hover {
            box-shadow: 0 4px 12px rgba(217, 83, 79, 0.35);
        }

        .recipe-total {
            text-align: right;
        }

        .total-label {
            font-size: 14px;
            color: #666;
        }

        .total-price {
            font-size: 2rem;
            font-weight: 700;
            color: #667eea;
        }

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

        .custom-recipe-tools {
            margin-top: 10px;
        }

        .custom-recipe-form {
            margin-top: 14px;
            border: 1px solid #e8e8e8;
            border-radius: 12px;
            padding: 14px;
            background: #fafbff;
        }

        .custom-recipe-form.hidden {
            display: none;
        }

        .custom-recipe-form h3 {
            margin-bottom: 10px;
            color: #333;
        }

        .form-help {
            font-size: 13px;
            color: #666;
            margin-bottom: 14px;
            line-height: 1.4;
        }

        .custom-recipe-form label {
            display: block;
            margin: 8px 0 6px;
            color: #555;
            font-size: 14px;
        }

        .custom-recipe-grid {
            display: grid;
            grid-template-columns: 2fr 1fr 1fr;
            gap: 10px;
            margin-bottom: 8px;
        }

        .custom-recipe-grid div {
            display: flex;
            flex-direction: column;
        }

        .custom-recipe-grid label {
            display: block;
            margin-bottom: 6px;
            color: #555;
            font-size: 14px;
            font-weight: 500;
        }

        .custom-recipe-form input[type="text"],
        .custom-recipe-form input[type="number"],
        .custom-recipe-form select {
            width: 100%;
            padding: 12px 14px;
            font-size: 15px;
            border: 2px solid #e0e0e0;
            border-radius: 10px;
            outline: none;
            transition: border-color 0.2s;
        }

        .custom-recipe-form input[type="text"]:focus,
        .custom-recipe-form input[type="number"]:focus,
        .custom-recipe-form select:focus {
            border-color: #667eea;
        }

        .custom-recipe-form textarea {
            width: 100%;
            min-height: 90px;
            margin-bottom: 8px;
        }

        .recipe-section h3 {
            font-size: 1.1rem;
            color: #333;
            margin-bottom: 12px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .ingredient-list {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .ingredient-item {
            display: flex;
            gap: 12px;
            padding: 12px;
            background: #f8f9fa;
            border-radius: 10px;
            align-items: center;
            cursor: default;
            transition: background 0.2s, transform 0.2s;
        }

        .ingredient-item.editable {
            cursor: pointer;
        }

        .ingredient-item.editable:hover {
            background: #e9ecef;
            transform: translateX(4px);
        }

        .ingredient-manage-btn {
            margin-left: 8px;
            font-size: 12px;
            padding: 6px 10px;
        }

        .ingredient-image {
            width: 60px;
            height: 60px;
            object-fit: contain;
            border-radius: 8px;
            background: white;
        }

        .ingredient-details {
            flex: 1;
        }

        .ingredient-name {
            font-weight: 600;
            color: #333;
            margin-bottom: 2px;
        }

        .ingredient-amount {
            font-size: 13px;
            color: #666;
        }

        .ingredient-product {
            font-size: 13px;
            color: #888;
        }

        .ingredient-price {
            font-weight: 700;
            color: #667eea;
            font-size: 1.1rem;
        }

        .ingredient-change {
            font-size: 12px;
            color: #667eea;
            margin-top: 4px;
        }

        .ingredient-remove-btn {
            margin-top: 8px;
            width: 100%;
        }

        .ingredient-add-controls {
            display: flex;
            gap: 10px;
            margin-top: 12px;
            align-items: center;
        }

        .ingredient-add-input {
            flex: 1;
            padding: 10px 12px;
            font-size: 14px;
            border: 2px solid #e0e0e0;
            border-radius: 8px;
            outline: none;
        }

        .ingredient-add-input:focus {
            border-color: #667eea;
        }

        .instructions-list {
            list-style: none;
        }

        .instructions-list li {
            padding: 12px 16px;
            margin-bottom: 8px;
            background: #f8f9fa;
            border-radius: 8px;
            color: #333;
            position: relative;
            padding-left: 48px;
        }

        .instructions-list li::before {
            content: attr(data-step);
            position: absolute;
            left: 12px;
            top: 50%;
            transform: translateY(-50%);
            width: 24px;
            height: 24px;
            background: #667eea;
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            font-weight: 700;
        }

        /* Modal styles */
        .modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0,0,0,0.5);
            z-index: 1000;
            align-items: center;
            justify-content: center;
        }

        .modal-overlay.active {
            display: flex;
        }

        .modal {
            background: white;
            border-radius: 16px;
            padding: 24px;
            max-width: 600px;
            width: 90%;
            max-height: 80vh;
            overflow-y: auto;
            position: relative;
        }

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            padding-bottom: 16px;
            border-bottom: 1px solid #e0e0e0;
        }

        .modal-title {
            font-size: 1.25rem;
            font-weight: 700;
            color: #333;
        }

        .modal-close {
            background: none;
            border: none;
            font-size: 24px;
            cursor: pointer;
            color: #666;
            padding: 4px 8px;
            border-radius: 4px;
        }

        .modal-close:hover {
            background: #f0f0f0;
        }

        .alternatives-list {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .alternative-item {
            display: flex;
            gap: 12px;
            padding: 12px;
            background: #f8f9fa;
            border-radius: 10px;
            align-items: center;
            cursor: pointer;
            transition: background 0.2s;
            border: 2px solid transparent;
        }

        .alternative-item:hover {
            background: #e9ecef;
        }

        .alternative-item.current {
            border-color: #667eea;
            background: #f0f3ff;
        }

        .alternative-image {
            width: 60px;
            height: 60px;
            object-fit: contain;
            border-radius: 8px;
            background: white;
        }

        .alternative-details {
            flex: 1;
        }

        .alternative-title {
            font-weight: 600;
            color: #333;
            font-size: 14px;
            margin-bottom: 4px;
        }

        .alternative-brand {
            font-size: 12px;
            color: #888;
        }

        .alternative-price {
            font-weight: 700;
            color: #667eea;
            font-size: 1.1rem;
        }

        .alternative-per-unit {
            font-size: 12px;
            color: #888;
        }

        .modal-loading {
            text-align: center;
            padding: 40px;
            color: #666;
        }

        /* bendras login/register laukas */
            .auth-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.4);
            z-index: 9999;
            justify-content: center;
            align-items: center;
            }

            .auth-overlay .search-box {
            border-radius: 16px;
            max-width: 500px;
            width: 92%;
            padding: 32px;
            animation: popupIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) both;
            }

            @keyframes popupIn {
            from { opacity: 0; transform: scale(0.82); }
            to   { opacity: 1; transform: scale(1); }
            }

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

            .popup-header h2 {
            margin-bottom: 0 !important;
            text-align: left;
            }

            /* Cookie fields */
            .cookie-fields {
                display: flex;
                flex-direction: column;
                gap: 10px;
            }

            .cookie-field {
                display: flex;
                flex-direction: column;
                gap: 4px;
            }

            .cookie-label {
                font-size: 12px;
                font-weight: 700;
                color: #555;
                text-transform: uppercase;
                letter-spacing: 0.5px;
            }

            /* close(x) button */
            .close-btn {
            background: none;
            border: none;
            font-size: 50px;
            line-height: 1;
            cursor: pointer;
            color: #aaa;
            padding: 0 2px;
            flex-shrink: 0;
            transition: color 0.15s;
            }

            .close-btn:hover {
            color: #333;
            animation: spin180 0.2s ease-out forwards;
            }

            @keyframes spin180 {
            from { transform: rotate(0deg); }
            to   { transform: rotate(180deg); }
            }

            .search-box h2 {
                text-align: center;
                color: #333;
                margin-bottom: 20px;
            }

            .input-group {
                margin-bottom: 10px;

            }
            .search-input {
                width: 100%;
                padding: 14px 20px;
                margin-bottom: 15px;

                border: 2px solid #e0e0e0;
                background-color: white;
                border-radius: 10px;
                outline: none;
                color: #333;
                transition: all 0.2s ease;

                font-size: 16px;

            }

            .search-input:focus {
               border-color: #764ba2;                      /* Rėmelis tampa violetinis (tavo tema) */
                background-color: #fff;                     /* Pasidaro visiškai baltas */
                box-shadow: 0 0 8px rgba(118, 75, 162, 0.3); /* Švelnus violetinis švytėjimas */
                transform: translateY(-2px);                /* Lengvas pakilimo efektas */
            }

            .search-input ::placeholder {
                color: #aaa;
                font-style: italic;
                font-size: 14px;
            }
        @media (max-width: 900px) {
            .products-grid {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        @media (max-width: 600px) {
            body {
                padding: 140px 12px 16px;
            }

            .floating-header {
                top: 8px;
                width: calc(100% - 16px);
                border-radius: 12px;
            }

            .header-inner {
                height: auto;
                min-height: 58px;
                padding: 8px 10px;
                gap: 8px;
                flex-wrap: wrap;
            }

            .header-logo {
                padding: 4px 10px;
                height: 34px;
            }

            .header-logo-img {
                height: 24px;
            }

            .header-logo-text {
                font-size: 1.18rem;
            }

            .header-store-trigger {
                height: 34px;
                padding: 4px 10px;
            }

            .header-right {
                width: 100%;
                justify-content: space-between;
                gap: 8px;
            }

            .header-nav {
                gap: 6px;
            }

            .btn-header-ghost,
            .btn-header-solid {
                padding: 7px 12px;
                font-size: 13px;
            }

            .header-cart-btn {
                height: 32px;
                padding: 0 8px 0 7px;
            }

            .cart-total-display {
                display: none;
            }

            .tabs {
                overflow-x: auto;
                gap: 6px;
                padding-bottom: 2px;
                -webkit-overflow-scrolling: touch;
            }

            .tab-btn {
                flex: 0 0 auto;
                min-width: 165px;
                padding: 12px 14px;
                font-size: 14px;
            }

            .products-grid {
                grid-template-columns: repeat(2, 1fr);
            }

            .search-input-group {
                flex-direction: column;
            }

            .custom-recipe-grid {
                grid-template-columns: 1fr;
            }

            .filters {
                flex-direction: column;
                align-items: stretch;
            }

            .ingredient-item {
                flex-direction: column;
                align-items: center;
                text-align: center;
            }

            .ingredient-add-controls {
                flex-direction: column;
                align-items: stretch;
            }

            .product-tags {
                justify-content: center;
            }

            .recipe-header {
                flex-direction: column;
                gap: 16px;
            }

            .recipe-total {
                text-align: left;
            }

            
        }

        .cart-modal {
            background: white;
            padding: 20px;
            border-radius: 15px;
            width: 800px;
            max-height: 80vh;
            overflow-y: auto;
        }

        .total-row {
            display: flex;
            justify-content: space-between;
            font-size: 1.4rem;
            margin-top: 20px;
        }

                /* Konteineris, kuriame yra ir prekės kortelė, ir valdymo mygtukai */
        .cart-product-wrapper {
            background: white;
            border: 1px solid #eee;
            border-radius: 12px;
            margin-bottom: 20px;
            padding: 15px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.05);
        }

        .cart-product-wrapper .product-card {
            flex-direction: row;
            gap: 16px;
        }

        .cart-product-wrapper .product-image {
            width: 80px;
            height: 80px;
            flex-shrink: 0;
        }

        .cart-product-wrapper .quantity-control {
            display: none !important;
        }

        /* Paslepiame originalų "Į krepšelį" mygtuką, jei jis yra renderProductCard viduje, 
        nes krepšelyje mums jo nebereikia */
        .cart-product-wrapper .add-to-cart-btn {
            display: none;
        }

        .cart-item-controls {
            margin-top: 15px;
            padding-top: 15px;
            border-top: 1px dashed #ddd;
        }

        .qty-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 12px;
        }

        .qty-field {
            width: 60px;
            padding: 8px;
            border: 1px solid #ccc;
            border-radius: 6px;
            font-weight: bold;
        }

        .item-total-price {
            font-weight: bold;
            color: #28a745;
            font-size: 1.1em;
        }

        .btn-remove {
            width: 100%;
            background: #ff4d4d;
            color: white;
            border: none;
            padding: 10px;
            border-radius: 8px;
            cursor: pointer;
            font-weight: 600;
        }

        /* Price history */
        .price-lowest-30d {
            font-size: 12px;
            color: #28a745;
            font-weight: 600;
            margin-top: 2px;
            cursor: pointer;
            display: inline-block;
        }

        .price-lowest-30d:hover {
            text-decoration: underline;
        }

        .price-lowest-30d .low-label {
            color: #888;
            font-weight: 400;
        }

        /* Product card action area */
        .product-action {
            margin-top: auto;
            padding-top: 10px;
        }

        .add-to-cart-btn {
            width: 100%;
            background: #28a745;
            color: white;
            border: none;
            border-radius: 8px;
            padding: 9px 12px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: background 0.2s;
        }

        .add-to-cart-btn:hover {
            background: #1e9438;
        }

        /* In-card quantity counter */
        .qty-counter {
            display: flex;
            align-items: center;
            border-radius: 8px;
            overflow: hidden;
            border: 1.5px solid #ddd;
            height: 40px;
            background: white;
        }

        .qty-side-btn {
            flex: 0 0 40px;
            height: 100%;
            border: none;
            background: white;
            color: #111;
            font-size: 22px;
            font-weight: 700;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background 0.15s;
            padding: 0;
            line-height: 1;
        }

        .qty-side-btn:hover {
            background: #f0f0f0;
        }

        .trash-btn {
            background: white;
            color: #e53935;
            font-size: 16px;
        }

        .trash-btn:hover {
            background: #fff0f0;
        }

        .trash-btn svg {
            width: 18px;
            height: 18px;
            stroke: #e53935;
        }

        .qty-count {
            flex: 1;
            text-align: center;
            font-weight: 700;
            font-size: 14px;
            color: #222;
            background: white;
            border-left: 1.5px solid #ddd;
            border-right: 1.5px solid #ddd;
        }

        .product-card.clickable-chart {
            cursor: pointer;
        }

        .product-card.clickable-chart:hover {
            box-shadow: 0 6px 28px rgba(102,126,234,0.25);
        }

        /* Chart modal */
        .chart-modal-overlay {
            display: none;
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.55);
            z-index: 1100;
            align-items: center;
            justify-content: center;
        }

        .chart-modal-overlay.active { display: flex; }

        .chart-modal {
            background: white;
            border-radius: 16px;
            padding: 24px;
            max-width: 700px;
            width: 94%;
            max-height: 85vh;
            overflow-y: auto;
            position: relative;
        }

        .chart-modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 12px;
        }

        .chart-modal-title {
            font-size: 1.1rem;
            font-weight: 700;
            color: #333;
            flex: 1;
            margin-right: 12px;
        }

        .chart-modal-close {
            background: none;
            border: none;
            font-size: 24px;
            cursor: pointer;
            color: #666;
            padding: 4px 8px;
            border-radius: 4px;
        }

        .chart-modal-close:hover { background: #f0f0f0; }

        .chart-modal-stats {
            display: flex;
            gap: 16px;
            margin-bottom: 16px;
            flex-wrap: wrap;
        }

        .chart-stat {
            background: #f8f9fa;
            border-radius: 10px;
            padding: 10px 16px;
            flex: 1;
            min-width: 120px;
        }

        .chart-stat-label {
            font-size: 12px;
            color: #888;
            margin-bottom: 2px;
        }

        .chart-stat-value {
            font-size: 1.2rem;
            font-weight: 700;
        }

        .chart-stat-value.current { color: #667eea; }
        .chart-stat-value.low { color: #28a745; }
        .chart-stat-value.high { color: #dc3545; }

        .chart-canvas-wrap {
            position: relative;
            height: 300px;
        }

        .chart-no-data {
            text-align: center;
            padding: 60px 20px;
            color: #888;
        }

        /* Last updated bar */
        .footer-bar {
            position: fixed;
            bottom: 16px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(16, 16, 18, 0.82);
            border: 1px solid rgba(255, 255, 255, 0.08);
            color: rgba(255, 255, 255, 0.75);
            padding: 12px 22px;
            border-radius: 14px;
            font-size: 13px;
            box-shadow: 0 4px 22px rgba(0, 0, 0, 0.35);
            backdrop-filter: blur(14px);
            -webkit-backdrop-filter: blur(14px);
            z-index: 900;
            display: flex;
            align-items: center;
            gap: 14px;
            white-space: nowrap;
        }

        .footer-bar-item {
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .footer-bar-label {
            color: rgba(255, 255, 255, 0.35);
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 0.6px;
            font-weight: 600;
        }

        .footer-bar-value {
            color: rgba(255, 255, 255, 0.8);
        }

        .footer-bar-sep {
            width: 1px;
            height: 16px;
            background: rgba(255, 255, 255, 0.15);
            flex-shrink: 0;
        }
        .toast {
        position: fixed;
        bottom: 24px;
        right: 24px;
        padding: 14px 20px;
        border-radius: 8px;
        color: white;
        font-size: 14px;
        z-index: 9999;
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.3s ease;
        max-width: 300px;
        }
        .toast.show {
            opacity: 1;
            transform: translateY(0);
        }
        .toast.success { background: #22c55e; }
        .toast.error   { background: #ef4444; }
        .toast.info    { background: #3b82f6; }             
            