/* styles.css */
html {
    font-size: 100%; /* Set base font size */
    line-height: 1.5; /* Set base line height */
    -webkit-text-size-adjust: 100%; /* Prevent font scaling in landscape */
    -ms-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

/* Define CSS variables */
:root {
    --primary-color: #6E0E0A; /* Rojo vino */
    --secondary-color: #D8943C; /* Mostaza */
    --accent-color: #ffc107; /* Yellow */
    --menu-color: rgba(241, 241, 241, 0.8);
    --dark-color: #262A2C;
    --cream-color: #ece4da;
    --verdecito-color: #809848;
    --greish-color: #4c5457;
    --main-font: "Arial", sans-serif;
    --heading-font: "Roboto", sans-serif;
    --font-size-small: 12px; /* Reduced size */
    --font-size-medium: 14px; /* Reduced size */
    --font-size-large: 18px; /* Increased size */
    --font-weight: 400;
    --spacing-small: 4px; /* Reduced size */
    --spacing-medium: 8px; /* Reduced size */
    --spacing-large: 24px;
    --border-radius-small: 4px;
    --border-radius-large: 8px;
    --box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
    --transition-duration: 0.3s;
    --transition-timing: ease-in-out;
}

/* Initial state of the app */
body {
    font-family: Arial, sans-serif;
    margin-top: 10px !important;
    margin-bottom: 40px !important;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: relative;
    background-color: var(--secondary-color);
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--spacing-medium);
    opacity: 0; /* Initially hide the app */
    transition: opacity 0.5s ease-in-out; /* Smooth transition for opacity */
}

body.loaded {
    opacity: 1; /* Fully visible when loaded */
}


#mainBody {
    width: 100%;
    max-width: 800px;
    background-color: white;
    padding: 10px;
    border-radius: 8px;
}

/* Header styling */
h1 {
    text-align: center;
    margin-bottom: var(--spacing-large);
    font-family: var(--heading-font);
    color: var(--primary-color);
}

/* Language selector styling */
#choose-language {
    margin-right: var(--spacing-small);
}

#language-select {
    margin-bottom: var(--spacing-large);
}

.language-flags {
    display: flex;
    justify-content: center;
    margin: var(--spacing-large) 0;
}

.flag {
    width: 34px;
    height: 34px;
    cursor: pointer;
    transform: scale(1);
    margin: 0 var(--spacing-medium);
}

.flag.grey {
    filter: grayscale(80%) blur(0.3px) brightness(1.1); /* Adjust brightness */
    transform: scale(0.95); /* Adjust scale to the desired size */
}


/* Specific item styling */
.item h2 {
    margin: 0;
    font-size: var(--font-size-large); /* Reduced size */
    font-family: var(--heading-font);
    color: var(--dark-color);
}

.item p {
    margin: 0;
    font-size: var(--font-size-small); /* Reduced size */
}

.crossed {
    text-decoration: line-through;
    position: relative;
}

.crossed::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px; /* Adjust height as needed */
    background-color: var(--secondary-color);
    opacity: 0.5; /* Adjust opacity for better visibility */
    transform: translateY(-50%);
    z-index: -1; /* Ensure it appears behind the discount price */
}

.search-filter-container {
    display: flex;
    height: 40px;
    align-items: center;
    margin-bottom: var(--spacing-small);
    background-color: var(--secondary-color);
    padding: var(--spacing-small);
    border-radius: var(--border-radius-small);
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 8px;
    z-index: 999;
}

#search-input {
    flex-grow: 1;
    padding: var(--spacing-small);
    border: solid 2px var(--primary-color) !important; /* Solid border with color from CSS variable */
    border-radius: 6px !important;
    background-color: var(--secondary-color);
    color: #fff;
    outline: none;
    height: 75%;
    max-width: 100%; /* Adjust the width to be smaller */
}


#search-input::placeholder {
    color: rgba(255, 255, 255, 0.6); /* 0.1 is the opacity value */
}

#filter-button {
    padding: var(--spacing-medium); /* Increase the padding to make it larger */
    margin-left: var(--spacing-small);
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: var(--border-radius-small);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    height: 100%;
    min-width: 150px; /* Ensure the button is larger */
}

#filter-button:hover {
    background-color: var(--primary-color) !important;
}

.search-icon {
    margin-right: var(--spacing-small);
    color: #fff;
}

/* Category Title */
.category-title {
        color: var(--secondary-color);
        font-family: 'Lato', sans-serif; /* Use the Lato font with a fallback to sans-serif */
        font-weight: 500; /* Set the font weight to 500 */
        font-size: 24px; /* Adjust the font size as needed */
        margin-bottom: -3px;
        margin-left: 20px;
        letter-spacing: 1.5px;
}

/* New item list styles */
#items-container {
    list-style: none;
    padding: 0;
}

#items-container .item {
    background-color: #f9f9f9;
    padding: var(--spacing-small); /* Reduced size */
    margin-bottom: 10px;
    border-radius: 5px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    padding-left: var(--spacing-medium); /* Add left padding */
    padding-right: var(--spacing-medium); /* Add right padding */
}

#items-container .item:hover {
    background-color: rgb(255, 252, 238);
}

.item-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    gap: 10px;
}

.item-details .item-name {
    flex-basis: 85%;
    flex-grow: 1;
    display: flex; /* Add display flex to align checkbox and title */
}

#items-container .item .item-details input[type="checkbox"] {
    margin-right: 2px; /* Ensure the margin is applied */
    font-size: var(--font-size-large);
    transform: scale(1.4);
}


.item-details .item-price {
    flex-basis: 15%;
    flex-grow: 0;
    text-align: right;
}

.item-id {
    font-size: 8px !important;
    color: var(--greish-color);
}

.item-category, .item-tags {
    display: none;
}

/* Main list prices */
.price, .discount-price {
    font-family: 'Lato', sans-serif;
    font-size: 20px !important;
    color: var(--primary-color);
    font-weight: 400; /* Reduced weight */
}

.discount-price {
    color: var(--secondary-color);
    padding: 2px 5px;
    white-space: nowrap;
}

.price.crossed {
    font-size: 16px !important;
    text-decoration: line-through;
    color: #999;
    font-weight: 300;
}

/* styles.css or popup.css */
.no-items-message {
    text-align: center;
    font-size: 1em;
    color: var(--primary-color);
    margin: var(--spacing-medium) 0;
    padding: var(--spacing-small);
}

/* Item name styling */
.item-details .item-name h2 {
    font-family: 'Lato', sans-serif;
    font-size: 19px;
    font-weight: 400; /* Reduced from default (400) to lighter (300) */
    color: var(--dark-color);
    margin: 0;
}

/* For mobile devices */
@media (max-width: 600px) {
    .search-filter-container {
        flex-direction: row;
        align-items: center;
    }

    #filter-button {
        width: auto;
        margin-top: 0;
        min-width: 100px;
    }

    body {
        margin: 4px;
        padding: 2px;
    }

    #mainBody {
        padding: 6px;
    }

        /* Adjust layout for mobile view */
    .item-details {
    flex-direction: row;
    align-items: center;
    }

    .item-name, .item-price {
    flex: 1;
    }

    .item-name h2 {
    margin-right: var(--spacing-medium);
    }

    .item-price {
    align-items: flex-end;
    justify-content: flex-end;
    }

    /* Increase the size of the checkbox and add margin */
    .item-checkbox {
    transform: scale(1.5) !important;
    margin-right: 10px !important;
    }

    .item-details {
        flex-direction: row;
        align-items: center;
    }

    .item-name, .item-price {
        flex: 1;
    }

    .item-name .item-id {
        margin-top: 5px;
        color: var(--greish-color);
        font-weight: 400 !important;
    }

    .item-name h2 {
        margin: 0;
        padding: 0;
        font-size: var(--font-size-medium);
        font-weight: 300; /* Ensure consistency in mobile */
    }

    .item-price {
        align-items: flex-end;
        justify-content: flex-end;
    }
}


/* TABLET */
@media (min-width: 601px) and (max-width: 1024px) {
    body {
        max-width: 800px;
        margin: 0 auto;
        padding: 0 var(--spacing-medium);
    }

    .item-details {
        flex-direction: column;
        align-items: flex-start;
    }

    .item-price {
        align-items: flex-start;
        margin-top: var(--spacing-medium);
    }
}
