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

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: #f4f4f4;
    padding: 20px;
}

body.no-scroll {
    overflow: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Logo and motto centered */
.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.logo {
    font-size: 28px;
    font-weight: bold;
    color: #2196F3;
}

.motto {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

/* Hero section with background image */
.hero-section {
    background-image: url('/images/cumparaturi-supermarket.jpg');
    background-size: cover;
    background-position: center;
    padding: 40px 20px;
    margin-bottom: 30px;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 5px;
}

.search-container {
    display: flex;
    width: 100%;
    max-width: 600px;
    position: relative;
    z-index: 1;
    margin-bottom: 20px;
}

#search-input {
    flex: 1;
    padding: 12px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#search-button {
    padding: 12px 24px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#search-button:hover {
    background-color: #45a049;
}

.search-clear {
    position: absolute;
    right: 60px; /* Position it just before the search button */
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    font-size: 18px;
    visibility: hidden; /* Hide initially */
}

.search-clear.visible {
    visibility: visible;
}

/* delivery address */
.delivery-options {
    width: 100%;
    max-width: 600px;
    margin-top: 15px;
    position: relative;
    z-index: 1;
}

.delivery-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.delivery-checkbox input {
    margin-right: 8px;
}

.disclaimer {
    font-size: 12px;
    margin-top: 5px;
    opacity: 0.8;
}

.address-fields {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.address-fields.hidden {
    display: none;
}

.street-autocomplete {
    position: relative;
    flex: 1;
}

#street-name {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#street-number {
    width: 80px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.street-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
    display: none;
}

.street-suggestion {
    padding: 10px;
    cursor: pointer;
}

.street-suggestion:hover {
    background-color: #f5f5f5;
}

/* Shopping list toggle button */
.list-toggle-container {
    position: relative;
    z-index: 1;
}

.list-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 16px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.list-button:hover {
    background-color: #e9e9e9;
}

.list-button svg {
    height: 18px;
    width: auto;
    margin-right: 8px;
}

/* Sticky shopping list toggle for mobile */
.sticky-list-toggle {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: white;
    padding: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 100;
    justify-content: center;
}

.sticky-list-toggle.visible {
    display: flex;
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 99;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.back-to-top.visible {
    opacity: 1;
}

.back-to-top:hover {
    background-color: #0b7dda;
}

.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 30px 0;
    font-size: 18px;
    color: #666;
}

.loader {
    margin-top: 15px;
    width: 40px;
    height: 30px;
    --c:no-repeat linear-gradient(#000 0 0);
    background:
            var(--c) 0    100%/8px 30px,
            var(--c) 50%  100%/8px 20px,
            var(--c) 100% 100%/8px 10px;
    position: relative;
    clip-path: inset(-100% 0);
}

.loader:before{
    content: "";
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #000;
    left: -16px;
    top: 0;
    animation:
            l5-1 2s   linear infinite,
            l5-2 0.5s cubic-bezier(0,200,.8,200) infinite;
}

@keyframes l5-1 {
    0%   {left:-16px;transform:translateY(-8px)}
    100% {left:calc(100% + 8px);transform:translateY(22px)}
}

@keyframes l5-2 {
    100% {top:-0.1px}
}

.hidden {
    display: none;
}

.store-tabs {
    display: none;
    overflow-x: auto;
    scroll-behavior: smooth;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
    white-space: nowrap;
}

.tab-button {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    position: relative;
    color: #666;
}

.tab-button.active {
    color: #2196F3;
    font-weight: bold;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #2196F3;
}

.results-container {
    display: none;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 20px;
    padding-bottom: 20px;
}

.store-tabs.visible, .results-container.visible {
    display: flex;
}

.store-column {
    flex: 0 0 300px;
    min-width: 300px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.store-column h2 {
    background-color: #f8f8f8;
    color: #333;
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid #ddd;
}

.products {
    padding: 10px;
}

.product-card {
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.product-image {
    width: 100%;
    height: 150px;
    object-fit: contain;
    margin-bottom: 10px;
}

.product-title {
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
    text-decoration: none;
}

.product-title:hover {
    color: #2196F3;
    text-decoration: underline;
}

.product-price {
    color: #e63946;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

.original-price {
    color: #999;
    text-decoration: line-through;
    font-size: 14px;
    margin-left: 5px;
}

.add-to-cart-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    margin-top: auto;
    transition: background-color 0.2s;
}

.add-to-cart-btn:hover {
    background-color: #45a049;
}

/* Shopping List Modal for Desktop */
.shopping-list-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.shopping-list-modal.visible {
    display: flex;
}

.shopping-list-modal-content {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.shopping-list-header {
    padding: 15px;
    background-color: #f8f8f8;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px 8px 0 0;
}

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

.close-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
}

.clear-btn {
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 14px;
}

.shopping-list-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

/* Desktop view with columns */
.shopping-list-content {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.stores-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    width: 100%;
}

.store-section {
    flex: 1;
    min-width: 300px;
    background-color: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #ddd;
    padding: 15px;
}

.empty-cart {
    width: 100%;
    text-align: center;
    color: #999;
    margin-top: 20px;
}

.store-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    margin-bottom: 10px;
}

.store-total {
    font-weight: bold;
    color: #2196F3;
}

.cart-item {
    display: grid;
    grid-template-columns: 3fr 1fr 2fr 1fr 30px;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    align-items: center;
}

.cart-item-name {
    font-size: 14px;
}

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

.cart-item-quantity {
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-quantity span {
    margin: 0 5px;
    min-width: 20px;
    text-align: center;
}

.quantity-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background-color: #f8f8f8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-total {
    font-weight: bold;
    color: #e63946;
    font-size: 14px;
}

.remove-item-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: #f44336;
    cursor: pointer;
}

.shopping-list-footer {
    padding: 15px;
    background-color: #f8f8f8;
    border-top: 1px solid #ddd;
    border-radius: 0 0 8px 8px;
}

/* Mobile Shopping List Slide-in */
.shopping-list-container {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    transition: right 0.3s ease;
    z-index: 1000;
}

.shopping-list-container.visible {
    right: 0;
    overflow-y: auto; /* Allow scrolling inside the shopping list */
}

.shopping-list {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

/* Notification */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1100;
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

/* Items count indicator */
.items-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #e63946;
    color: white;
    font-size: 12px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive Styles */
@media (min-width: 769px) {
    .shopping-list-container {
        display: none; /* Hide slide-in on desktop */
    }

    .sticky-list-toggle {
        display: none; /* Hide sticky toggle on desktop */
    }

    .back-to-top {
        display: none; /* Hide back to top on desktop */
    }
}

@media (max-width: 768px) {
    .results-container {
        flex-direction: row;
        overflow-x: auto;
    }

    .store-column {
        flex: 0 0 90%;
        min-width: 90%;
        margin-right: 10px;
    }

    .shopping-list-modal {
        display: none; /* Hide modal on mobile */
    }

    /* Adjust cart item layout for mobile */
    .cart-item {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto auto;
    }

    .cart-item-name {
        grid-column: span 2;
    }

    .cart-item-price {
        grid-row: 2;
    }

    .cart-item-quantity {
        grid-row: 2;
    }

    .cart-item-total {
        grid-row: 3;
    }

    .remove-item-btn {
        grid-row: 3;
    }

    /* For mobile, store sections display in a column */
    .stores-container {
        flex-direction: column;
    }

    .store-section {
        width: 100%;
    }
}
