@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:ital,wght@0,100..900;1,100..900&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@100..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&family=Inter+Tight:ital,wght@0,100..900;1,100..900&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Sora:wght@100..800&family=Vibur&display=swap');

/* === 1. Typography and General Styles === */

body {
    font-family: 'Inter Tight', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f9f9f9;
    color: #666666;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

.container {
    margin: 0 auto;
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

/* === 1.5. Main Tagline === */
.main-tagline {
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    font-size: 58px;
    color: transparent;
    background-image: linear-gradient(to right, #4B0082 0%, #A020F0 50%, #2a0346 100%);
    -webkit-background-clip: text;
    background-clip: text;
    text-align: center;
    margin-top: 5px;
    margin-bottom: 25px;
    padding: 0 20px;
    line-height: 0.9;
    letter-spacing: -2.25px;
    background-size: 200% 100%;
    animation: animatedGradientLoop 11s linear infinite;
  }

@keyframes animatedGradientLoop {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
  }

/* === 2. Search Bar and Background === */
.search-background {
    background-color: rgba(75, 0, 130, 1); 
    padding: 15px 25px;
    width: 100%;
    margin: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 10px;
    box-sizing: border-box;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: none;
    border-radius: 0;
    box-shadow: none;
}


.search-logo {
    margin: 0;
    text-align: left;
    flex-shrink: 0;
}

.search-logo img {
    max-width: 250px;
    height: 50px;
    display: block;
    min-width: 150px;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

#searchbox {
    flex-grow: 1;
    flex-shrink: 1;
    display: flex;
    justify-content: center;
    min-width: 0;
}


#search-input-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    flex-grow: 1;
}

.search-reset-button {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    position: absolute;
    right: 70px;
    top: 45%;
    transform: translateY(-50%);
    z-index: 2;
    cursor: pointer;
    color: #4B0082;
    font-size: 34px;
    font-family: 'Inter Tight', sans-serif;
    font-weight: 200;
    line-height: 1.5;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s, visibility 0.2s;
}

#search-input-field:not(:placeholder-shown) ~ .search-reset-button {
    visibility: visible;
    opacity: 1;
}

#search-input-field::placeholder {
    color: #4B0082;
}

#search-input-field {
    -webkit-appearance: none;
    appearance: none;
    background: none;
    line-height: normal;
    font-family: 'Inter Tight', sans-serif;
    font-weight: 500;
    font-size: 19px;
    width: 100%;
    padding: 8px 80px 8px 50px;
    border: none;
    outline: none;
    box-sizing: border-box;
    color: var(--auth-primary-color-darker);
    min-width: 100px;
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#search-input-field::-webkit-search-cancel-button,
#search-input-field::-webkit-search-decoration,
#search-input-field::-webkit-search-results-button,
#search-input-field::-webkit-search-results-decoration {
    display: none;
}

.search-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
    min-width: 180px;
    height: 40px;
    background: #FFFFFF;
    border-radius: 2px;
    display: flex;
    align-items: center;
    margin: 0 auto;
    box-sizing: border-box;
}

.search-wrapper .search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    pointer-events: none;
    z-index: 1;
    display: flex;
}

.currency-toggle-button-searchbar {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #ffffff;
    border: none;
    color: #55555587;
    padding: 4px 8px;
    border-radius: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: 'Inter Tight', sans-serif;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    transition: background-color 0.2s, box-shadow 0.2s, color 0.2s;
    z-index: 3;
    white-space: nowrap;
    margin-left: auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); 
}


.currency-toggle-button-searchbar svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

.currency-toggle-button-searchbar .currency-text {
    display: inline-block;
}

.currency-toggle-button-searchbar:hover {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15); /* Sombreado un poco más pronunciado al pasar el ratón */
    color: #333333; /* Texto ligeramente más oscuro al pasar el ratón */
}

.currency-toggle-button-searchbar:disabled {
    color: #aaa;
    border-color: #eee;
    background-color: #f9f9f9;
    cursor: not-allowed;
    opacity: 0.7;
}

.currency-toggle-button-searchbar:disabled svg {
    stroke: #aaa;
}

.currency-toggle-button-searchbar[style*="display: none"] ~ .search-reset-button {
    right: 25px;
}
.currency-toggle-button-searchbar[style*="display: none"] ~ #search-input-field {
    padding-right: 50px;
}

/* === 3. Search Buttons === */

.search-buttons-wrapper {
    position: relative;
    padding: 0 15px; 
    box-sizing: border-box;
    margin-bottom: 15px;
    overflow: hidden; 
}

.search-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 0;
}

.search-buttons button {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    width: auto;
    margin: 0;
    padding: 5px 10px;
    font-family: 'Inter Tight', sans-serif;
    font-weight: 500;
    font-size: 12px;
    border: 1px solid #a4a4a488;
    background-color: transparent;
    color: #A4A4A4;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.3s, color 0.3s, border-color 0.3s;
    text-align: center;
    flex-shrink: 0;
}

.search-buttons button:hover {
    border: 1.2px solid #A4A4A4;
}

.search-button-icon {
    width: 1.6em;
    height: 1.6em;
    stroke: #A4A4A4;
    transition: stroke 0.3s;
    flex-shrink: 0;
}

.search-buttons button.active,
.search-buttons button:focus {
    color: #4B0082;
    outline: none;
    border: 1.5px solid transparent; 
    background: 
        linear-gradient(white, white) padding-box,
        linear-gradient(to right, #4B0082, #8A2BE2, #ADD8E6) border-box;
        transition: color 0.3s ease, background 0.3s ease; 
}

.search-buttons button.active .search-button-icon,
.search-buttons button:focus .search-button-icon {
    stroke: #4B0082;
}

.search-buttons button.active .search-button-icon path,
.search-buttons button:focus .search-button-icon path {
    stroke-width: 2;
}

/* === 4. Product List (Base - Desktop) === */
#products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    min-height: 40vh;
    gap: 20px;
    padding: 10px 20px 20px 20px;
}

.product {
    background-color: #fff;
    border: 1px solid #eceaf2;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    position: relative;
    flex-direction: column;
    justify-content: space-between;
    height: fit-content;
}

.product-card-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 5;
    display: flex;
}

.copy-product-button {
    background-color: transparent;
    border: none;
    color: #666666;
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    transition: color 0.2s ease, transform 0.1s ease;
    opacity: 0.6;
}

.copy-product-button:hover {
    color: #4B0082;
    transform: scale(1.1);
}
.copy-product-button:active {
    transform: scale(0.95);
}

.copy-product-button .clipboard-icon,
.copy-product-button .clipboard-icon-success {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.product img {
    width: 100%;
    height: auto;
    max-height: 100px;
    object-fit: contain;
    margin-bottom: 10px;
    border-radius: 5px;
    opacity: 0;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    transform: scale(0.95);
    aspect-ratio: 1 / 1;
}

.product img.loaded {
    opacity: 1;
    transform: scale(1);
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.product img.loaded[data-reloaded="true"] {
    transition: none;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.product h2 {
    font-size: 14px;
    margin: 10px 0;
    color: #666666;
    text-align: center;
    font-family: 'Inter Tight', sans-serif;
}

ul.stores {
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
}

ul.stores li {
    padding: 8px 8px;
    border-top: 1px solid #eee;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Inter Tight', sans-serif;
    font-weight: 500;
}

ul.stores li:first-child {
    border-top: none;
}

ul.stores li .store-info {
    display: flex;
    align-items: center;
    flex-grow: 1;
    margin-right: 8px;
    min-width: 0;
}

ul.stores li .store-info img {
    width: 15px;
    height: 15px;
    margin-right: 5px;
    margin-top: 8px;
    flex-shrink: 0;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

ul.stores li .store-info > p,
ul.stores li .store-info > span.store-name,
ul.stores li .store-info > a.store-link {
    flex-grow: 1;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #555;
}

ul.stores li .price {
    margin-left: 10px;
    font-family: 'Inter Tight', sans-serif;
    font-weight: 700;
    color: #000000;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 2px;
}

/* === 4.5. Product Analysis Block === */

.product-analysis-block {
  display: none;
  justify-content: center;
  flex-wrap: wrap;
  text-align: center;
  padding: 10px 0;
  border-top: 1.25px solid #f0f0f0;
  border-bottom: 1.25px solid transparent;
  border-image: linear-gradient(to right, transparent 0%, #00CC99 15%, #4C0383 50%, #00CC99 85%, transparent 100%) 1;
  margin: 10px 0;
  gap: 8px;
}

.product-analysis-block .price-decimal-bs {
    font-size: 0.65em;
}

.analysis-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1;
    flex-basis: 40px;
}

.analysis-item span {
    font-size: 11px;
    font-family: 'Inter Tight', sans-serif;
    color: #333;
    margin-bottom: 2px;
    font-weight: 500;
    opacity: 0.9;
}

.analysis-item strong {
    font-size: 11px;
    font-family: 'Inter Tight', sans-serif;
    font-weight: 400;
    color: #888;
}

body.analysis-mode-active .product-analysis-block {
    display: flex;
}

.nutrition-block-container.analysis-feature {
    display: none;
}

body.analysis-mode-active .product-analysis-block,
body.analysis-mode-active .nutrition-block-container.analysis-feature {
    display: flex;
}

/* === 5. No Results Message === */
.no-results {
    font-size: 16px;
    color: #4B0082;
    text-align: center;
    padding: 10px;
    grid-column: 1 / -1;
}

.no-results img {
    max-width: 100%;
    height: auto;
    max-height: 200px;
    margin-bottom: 0px;
        pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* === 6. Add to Budget Button (Base) === */
.add-to-budget {
    background-color: white;
    color: #4B0082;
    font-size: 16px;
    border: 1.35px solid #4B0082;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Inter Tight', sans-serif;
    transition: all 0.3s ease;
    margin-top: 15px;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.3;
    padding: 8px 10px;
    stroke: currentColor;
}

.add-to-budget-content-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.add-to-budget svg {
    width: 1.25em;
    height: 1.25em;
    flex-shrink: 0;
    margin-right: 1.5px;
}

.add-to-budget-text {
    display: inline;
    flex-shrink: 1;
    flex-grow: 0;
    text-align: center;
    font-weight: 600;
}

.add-to-budget:hover {
    background-color: #f5f5f5;
}

.add-to-budget:active {
    background-color: #4B0082;
    color: white;
    border-color: #4B0082;
}

/* === 7. Budget Modal and Related Styles === */
#open-budget-modal-wrapper {
    position: static;
    width: auto;
    padding: 0;
    text-align: right;
    flex-shrink: 0;
}

#open-budget-modal {
    background-color: transparent;
    color: white;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.5px;
    padding: 4px 12px;
    border: 1px solid #fff;
    border-radius: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
}

#open-budget-modal:hover {
    background-color: var(--auth-primary-color-darker);
}

#open-budget-modal .budget-button-icon {
    width: 1.4em;
    height: 1.4em;
    flex-shrink: 0;
    margin-top: 1px;
}

.budget-item-counter {
    font-family: 'DM Sans', sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: white;
    background-color: #ff4d4d;
    padding: 2px 8px;
    border-radius: 10px;
    line-height: 1;
    display: none;
    transition: opacity 0.2s ease-in-out;
}

.budget-item-counter.no-items {
    color: #a0a0a0;
    background-color: #300252;
}

/* --- ESTILOS BASE PARA EL MODAL DE PRESUPUESTO --- */
#budget-modal {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s, background-color 0.3s ease;
}

#budget-modal.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    background-color: rgba(0, 0, 0, 0.7);
    transition-delay: 0s;
}

#budget-modal .modal-content {
    position: relative;
    background-color: white;
    overflow-y: auto;
    height: auto;
    max-height: calc(100vh - 40px);
    width: 100%;
    max-width: 550px;
    border-radius: 4px;
    border: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transform: scale(0.95) translateY(10px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.3s ease;
}

#budget-modal.show .modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

#budget-modal .modal-header {
     position: sticky;
     top: 0;
     background-color: #fff;
     z-index: 1002;
     padding: 12px 14px;
     display: flex;
     align-items: center;
     justify-content: space-between;
     border-bottom: 1px solid #e0e0e0;
     gap: 10px;
     flex-shrink: 0;
 }

 .modal-header-main-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-grow: 1;
    min-width: 0;
    flex-wrap: wrap;
    gap: 8px;
 }

 .modal-header-left-group {
     display: flex;
     align-items: center;
     gap: 8px;
     flex-shrink: 0;
 }

 #budget-modal .modal-header h2#budget-modal-title {
     font-size: 16px;
     color: #4B0082;
     font-weight: 600;
     margin: 0;
     display: inline-flex;
     align-items: center;
     gap: 3px;
     white-space: nowrap;
 }

 #budget-modal .modal-header-icon {
     width: 1.15em;
     height: 1.15em;
     flex-shrink: 0;
     margin-bottom: 1.25px;
 }

 #modal-currency-toggle-container {
     display: flex;
     align-items: center;
     flex-shrink: 0;
 }

 #modal-currency-toggle-btn {
     position: static;
     right: auto;
     top: auto;
     transform: none;
     margin-left: 0;
     z-index: auto;
     background-color: transparent;
     border: 1px solid #d1c8e0;
     color: #A4A4A4;
     padding: 0.2rem 0.5rem;
     border-radius: 4px;
     cursor: pointer;
     display: inline-flex;
     align-items: center;
     gap: 2px;
     font-family: 'Inter Tight', sans-serif;
     font-size: 10px;
     font-weight: 600;
     line-height: 1;
     transition: background-color 0.2s, border-color 0.2s, color 0.2s;
     white-space: nowrap;
 }

 #modal-currency-toggle-btn svg {
     width: 1.3em;
     height: 1.3em;
     stroke: currentColor;
 }

 #modal-currency-toggle-btn .currency-text {
     display: inline-block;
 }

 #modal-currency-toggle-btn:hover {
     border-color: #4B0082;
     color: #4B0082;
 }

 #modal-currency-toggle-btn:disabled {
     color: #aaa;
     border-color: #eee;
     background-color: #f9f9f9;
     cursor: not-allowed;
     opacity: 0.7;
 }

 #modal-currency-toggle-btn:disabled svg {
     stroke: #aaa;
 }

 #budget-modal .clear-budget-button {
     padding: 0.25rem;
     color: #ff4d4d;
     background-color: transparent;
     border: none;
     border-radius: 50%;
     cursor: pointer;
     margin: 0;
     display: inline-flex;
     align-items: center;
     justify-content: center;
     flex-shrink: 0;
     width: 30px;
     height: 30px;
     transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out, transform 0.1s ease-in-out;
 }
 #budget-modal .clear-budget-button svg {
     width: 1.5em;
     height: 1.5em;
     position: relative;
 }
 #budget-modal .clear-budget-button svg path {
     stroke-width: 2;
 }
 #budget-modal .clear-budget-button:hover {
     color: #d32f2f;
     background-color: rgba(255, 77, 77, 0.1);
 }
 
#close-budget-modal {
    font-size: 24px;
    font-family: 'Inter Tight', sans-serif;
    font-weight: 200;
    color: #888;
    cursor: pointer;
    background-color: transparent;
    border: none;
    line-height: 0;
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out, transform 0.1s ease-in-out;
    margin-top: -3px;
}

#close-budget-modal:hover {
    color: #4B0082;
    background-color: rgba(75, 0, 130, 0.1);
}

#close-budget-modal:active {
    background-color: rgba(75, 0, 130, 0.2);
    transform: scale(0.95);
}

#budget-modal .budget-explanation {
     font-size: 10px;
     font-weight: 500;
     color: #8f7cc7;
     background-color: #f8f6f679;
     margin-bottom: 0;
     padding: 10px 15px;
     border-radius: 4px;
     text-align: left;
     width: 100%;
     box-sizing: border-box;
     margin-top: 0px;
     flex-shrink: 0;
}

#budget-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.8rem;
    margin-top: 0.8rem;
}

#budget-list > li {
    background-color: #F8F5FA;
    padding: 0.6rem;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

#budget-list > li > strong {
    display: block;
    font-size: 11px;
    color: #4B0082;
    margin-bottom: 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid #e5ddee;
    line-height: 1.3;
}
#budget-list > li > strong .store-name,
#budget-list > li > strong .total-label,
#budget-list > li > strong .price-total {
    color: #4B0082;
    font-weight: bold;
}
#budget-list > li > strong .price-total {
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 2px;
    color: black;
}

#budget-list > li > ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
}

#budget-list > li > ul > li.budget-product-item {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    padding: 0.5rem; 
    border-radius: 4px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    font-size: 10px; 
    color: #333;
    margin-bottom: 0;
}

.budget-product-item .product-info {
    display: flex;
    margin-bottom: 5px;
    flex-grow: 1;
}

.budget-product-item .product-info img {
    width: 35px;
    height: 35px;
    object-fit: contain;
    margin-right: 6px;
    margin-top: 10px;
    flex-shrink: 0;
    border-radius: 3px;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.budget-product-item .product-details {
    flex-grow: 1;
    min-width: 0;
    padding-right: 1.2rem;
    box-sizing: border-box;
}

.budget-product-item .budget-item-name {
    font-weight: 500;
    margin-bottom: 2px;
    color: #333;
    font-size: 10px;
    line-height: 1.25;
}

.store-product-count {
    font-size: 10px;
    color: #777;
    font-weight: normal;
    margin-left: 5px;
    white-space: nowrap;
}

.budget-product-item .remove-button {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    font-size: 0.8rem;
    line-height: 1;
    color: #ff4d4d;
    background-color: transparent;
    border: 1px solid #ffc0cb;
    padding: 0 0.2rem;
    cursor: pointer;
    border-radius: 3px;
    z-index: 2;
}
.budget-product-item .remove-button:hover {
    background-color: #ffebee;
    color: #d32f2f;
}

.budget-product-item .quantity-price-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    margin-top: auto;
    padding-top: 3px;
}

.budget-product-item .quantity-control {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.budget-product-item .quantity-btn {
    background-color: #f7f2fc;
    border: 1px solid #f7f2fc;
    color: #4B0082;
    cursor: pointer;
    font-size: 11px;
    line-height: 1;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.budget-product-item .quantity-btn:hover {
    background-color: #e9e4f5;
    border-color: #c0b5d7;
    color: #3a0061;
}
.budget-product-item .quantity-btn:active {
    background-color: #d1c8e0;
    transform: scale(0.95);
}

.budget-product-item .quantity-input {
    width: 28px;
    height: 22px;
    text-align: center;
    border: 1px solid #d1c8e0;
    border-radius: 4px;
    padding: 1px 0; 
    font-size: 10px;
    font-family: 'Inter Tight', sans-serif;
    color: #333;
    background-color: #fff;
    box-sizing: border-box;
}
.budget-product-item .quantity-input::-webkit-outer-spin-button,
.budget-product-item .quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.budget-product-item .quantity-input:focus {
    outline: none;
    border-color: #8c78f0;
    box-shadow: 0 0 0 1px rgba(140, 120, 240, 0.2); /* Smaller shadow */
}

.store-toggle-icon {
    font-size: 14px;
    font-weight: 400;
    margin-right: 5px;
    border-radius: 50px;
    color: #8c78f0;
    transition: transform 0.2s ease-in-out;
    display: inline-block;
    text-align: center;
}

.budget-store-products-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 1000px;
    overflow-y: auto;
    opacity: 1;
}

.budget-store-products-list.collapsed {
    max-height: 0;
    opacity: 0;
}

/* Subtotal price */
.budget-product-item .budget-item-total-price {
    font-size: 10px;
    color: #555;
    margin: 0;
    text-align: center;
    white-space: normal;
    width: 100%;
    line-height: 1.3;
    font-weight: 600;
}
.budget-product-item .budget-item-total-price strong {
    font-weight: 600;
    color: #4B0082;
    margin-left: 2px;
}

.budget-item-unit-price-line {
    margin: 0; 
}

.budget-item-unit-price {
    font-size: 10px;
    color: #777;
    white-space: nowrap;
}

.budget-item-quantity-prefix {
    font-weight: 800;
    color: #4B0082;
}

.budget-item-subtotal {
    font-size: 10px;
    color: #333;
    margin: 0 0 2px 0;
    font-weight: 500;
}

.empty-budget {
    text-align: center;
}

.empty-budget .purple-text { 
    text-align: center;
    padding: 0 10px;
    font-size: 14px;
}

.empty-budget img {
    max-width: 100%;
    height: auto;
    margin-top: 30px;
    max-height: 220px;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Budget filters section */
.budget-filters.budget-filters-list-style {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 8px 10px;
    margin-top: 8px;
    margin-bottom: 10px;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    background-color: #fdfcff;
}

.budget-filters-list-style .budget-filter-group h3 {
    font-size: 11px;
    font-weight: 600;
    color: #4B0082;
    margin: 0 0 6px 0;
    padding-bottom: 3px;
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    margin-left: -10px;
    padding-left: 0;
}
.budget-filters-list-style .budget-filter-group h3:focus-visible {
    outline: 2px solid #8c78f0;
    outline-offset: 1px;
}

.filter-list-toggle-icon {
    font-size: 14px;
    font-weight: 400;
    margin-right: 5px;
    color: #8c78f0;
    display: inline-block;
    text-align: center;
    min-width: 1em;
    line-height: 1;
}

.budget-filters-list-style .budget-filter-group ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-bottom: 5px;
}

.budget-filters-list-style .budget-filter-group ul.collapsed {
    display: none;
}

.budget-filters-list-style .budget-filter-group ul::-webkit-scrollbar {
    display: none;
}
.budget-filters-list-style .budget-filter-group ul {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.budget-filters-list-style .budget-filter-group li {
    margin: 0;
    padding: 0;
    flex-shrink: 0;
}

.budget-filter-button {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    font-family: 'Inter Tight', sans-serif;
    font-weight: 500;
    font-size: 11px;
    border: 1px solid #a4a4a488;
    background: transparent;
    color: #666;
    cursor: pointer;
    border-radius: 5px;
    text-align: center;
    white-space: nowrap;
    box-sizing: border-box;
}

.budget-filter-button:hover {
    border-color: #888;
    color: #333;
}

.budget-filter-button.active {
    color: #4B0082;
    border-color: #4B0082;
    background-color: #f0e6ff;
    font-weight: 600;
}
.budget-filter-button.active:hover {
    border-color: #4B0082;
    background-color: #e0d1f5;
}

.budget-filter-count {
    display: inline-block;
    background-color: #eaeaea;
    color: #555;
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 9px;
    font-weight: 500;
    line-height: 1.3;
    margin-left: 5px;
    flex-shrink: 0;
}

.budget-filter-button.active .budget-filter-count {
    background-color: #4B0082;
    color: white;
    font-weight: bold;
}

/* Estilos para el contenedor del filtro de productos (GRID) */
.budget-product-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 8px;
    padding-top: 5px;
    padding-bottom: 5px;
    margin-left: 0;
    list-style: none;
}

/* Estilos para cada item de producto en el filtro */
.budget-product-filter-item {
    background-color: transparent;
    border: 1px solid #ddd;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    height: 100%;
    text-align: center;
    font-size: 0.7em;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    aspect-ratio: 1 / 1;
}

.budget-product-filter-item img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    border-radius: 4px;
}

.budget-product-filter-item.active {
    border: 1.2px solid #6a0dad;
}

.budget-product-filter-item:hover:not(.active) {
    background-color: #eaeaea;
    border-color: #bbb;
}

.budget-product-filter-item:focus-visible {
    outline: 2px solid #6a0dad;
    outline-offset: 1.5px;
}

.budget-filter-product-button.clear-selection-button:hover:not(:disabled) {
    background-color: #c82333;
}

.budget-filter-product-button.clear-selection-button:disabled {
    background-color: #e0e0e0;
    cursor: not-allowed;
    color: #a0a0a0;
}

.budget-filters-list-style h3 {
    padding-left: 0;
    padding-right: 0;
}

/* === 7.1. Budget Modal Tabs === */
.budget-tabs {
    display: flex;
    justify-content: flex-start;
    margin-top: 10px;
    margin-left: 5px;
    margin-right: 5px;
    border-bottom: 1px solid #e0e0e0;
    padding-top: 5px; 
    padding-bottom: 0;
    flex-shrink: 0;
}

.budget-tabs .tab-button {
    background-color: transparent;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-family: 'Inter Tight', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #666666;
    border-bottom: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.budget-tabs .tab-button:hover:not(.active) {
    color: #4B0082;
}

.budget-tabs .tab-button.active {
    color: #4B0082;
    font-weight: 700;
    border-bottom: 1.5px solid #4B0082;
    font-size: 13px;
}

.budget-tabs .tab-button:focus {
     outline: none;
}

.tab-count {
    background-color: #ff4d4d;
    color: white;
    font-size: 10px; 
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 15px;
    text-align: center;
    display: inline-block;
    opacity: 0;
    transform: scale(0.8); 
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tab-count.has-items {
    opacity: 1;
    transform: scale(1);
}

#main-budget-tab-count.tab-count { 
    background-color: #ff4d4d;
}

#price-drops-count.tab-count {
    background-color: #ff4d4d;
}

.tab-content {
    display: none;
    padding: 10px 15px;
    box-sizing: border-box;
    flex-grow: 1;
    overflow-y: auto; 
    padding-bottom: 20px; 
}

.tab-content.active {
    display: block;
}

.price-drops-list {
    list-style: none;
    padding: 0.6rem;
    border-radius: 5px;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
}

.price-drop-item {
    background-color: #fff;
    padding: 0.5rem;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
}

.price-drop-item-content {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 5px;
}

.price-drop-image-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 35px;
    flex-shrink: 0;
    margin-bottom: 3px;
}

.price-drop-image {
    width: 35px;
    height: 35px;
    object-fit: contain;
}

.price-drop-percentage {
    font-size: 9px;
    font-weight: 600;
    color: black;
    background-color: yellow;
    padding: 2px 4px;
    border-radius: 3px;
    margin-top: 2px;
    line-height: 1;
    white-space: nowrap;
}

.price-drop-item .product-info {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.price-drop-item .price-drop-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
    font-size: 10px;
    line-height: 1.25;
     display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.price-drop-item .price-drop-store {
    font-size: 10px;
    font-weight: 600;
    color: #666;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 1px;
}

.price-drop-item .store-link {
    color: #666;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.price-drop-item .store-link svg {
    width: 0.85em;
    height: 0.85em;
    margin-left: 3px;
}

.price-drop-item .price-drop-details {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 2px;
    font-size: 10px;
    margin-left: calc(35px + 8px);
    flex-wrap: wrap;
    padding-top: 1px;
    margin-top: 0;
}

.price-drop-item .old-price {
    text-decoration: line-through;
    color: #999;
}

.price-drop-item .price-arrow {
    color: #555;
    font-size: 1em;
}

.price-drop-item .new-price {
    font-weight: 700;
    color: #50C878;
    font-size: 1em;
}

.price-drop-item .price-difference {
    color: #F33A6A;
    font-size: 0.95em;
    font-weight: 600;
    white-space: nowrap;
    padding: 3px;
    border-radius: 4px;
}

.price-drops-list > .empty-budget:only-child {
    grid-column: 1 / -1;
}

.lowest-price-badge {
    display: inline-flex;
    align-items: center;
    color: #4B0082;
    font-family: 'Inter Tight', sans-serif;
    font-size: 0.8em;
    font-weight: 800;
    margin-top: 2px;
    vertical-align: middle;
    opacity: 0.8;
}

.lowest-price-badge .lowest-price-icon {
    width: 1.3em;
    height: 1.3em;
    margin-right: 1px;
    fill: transparent;
    vertical-align: middle;
}

.price-drop-today-badge {
    background-color: #007bff;
    color: white;
    padding: 2px 6px;
    border-radius: 2px;
    font-size: 0.7em;
    font-weight: bold;
    white-space: nowrap;
    line-height: 1;
}

.price-drop-item:has(.price-drop-today-badge) {
    box-shadow: 0 1px 4px rgba(0, 123, 255, 0.15);
}

/* === 7.5. General Action Button Styles (NEW GLOBAL CLASS) === */
.main-action-button {
    font-family: 'Inter Tight', sans-serif;
    font-weight: 600;
    background: white;
    border: 1.5px solid #d1d5db;
    color: #666666;
    cursor: pointer;
    border-radius: 20px;
    text-align: center;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.25s ease-in-out;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    vertical-align: middle;
    padding: 8px 14px;
}

.main-action-button:hover,
.main-action-button:focus {
    background: white;
    color: #4B0082;
    border-color: #4B0082;
    outline: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.main-action-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.main-action-button svg {
    stroke: currentColor;
    flex-shrink: 0;
    line-height: 0;
}

#analysis-mode-toggle svg {
    width: 1.3em;
    height: 1.3em;
}

/* === 8. Filters (Sidebar and Button Base) === */
.filters-button {
    justify-content: center;
    margin: 20px auto 10px auto;
    width: auto;
    min-width: 140px;
    max-width: 300px;
    padding: 10px 18px;
    font-size: 14px;
}

.filters-button svg {
    width: 1.25em;
    height: 1.25em;
}

.filters-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 300px;
    height: 100%;
    background: white;
    transition: left 0s;
    padding: 20px;
    z-index: 1001;
    overflow-y: auto;
    box-sizing: border-box;
}

.filters-menu.open {
    left: 0;
}

#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 1000;
}

#overlay.show {
    display: block;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.filters-header h2 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.filters-header button#close-filters {
    background: none;
    border: none;
    font-size: 28px;
    color: #888;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
    transition: color 0.2s;
}

.filters-header button#close-filters:hover {
    color: #333;
}

.facet-container {
    padding: 0;
    margin-bottom: 20px;
    border-radius: 3px;
    max-height: none;
}

.facet-container h3 {
    font-size: 14px;
    font-weight: 600;
    color: #4B0082;
    margin-bottom: 10px;
    padding-bottom: 6px;
    padding-left: 0;
    margin-top: 0;
    border-bottom: 1px solid #eee;
}

.facet-container ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 5px;
}

.facet-container li {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 0;
    padding: 0;
    cursor: pointer;
}

.facet-container li button {
    background-color: transparent;
    border: none;
    font-size: 14px;
    font-family: 'Inter Tight', sans-serif;
    color: #666;
    font-weight: normal;
    display: block;
    width: 100%;
    padding: 8px 8px 8px 28px;
    margin: 0;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    border-radius: 3px;
    position: relative;
}

.facet-container li button::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 1.2px solid #a0a0a0;
    border-radius: 5px;
    background-color: #fff;
    transition: border-color 0.2s, background-image 0.2s, background-color 0.2s;
    box-sizing: border-box;
}

.facet-container li button.active::before {
    border-color: #4B0082;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%234B0082' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 8.5 6 11.5 13 4.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 70%;
}

.facet-container li button.active {
    color: #4B0082;
    font-weight: 600;
    background-color: transparent;
}

.facet-container li button:focus {
    outline: none;
}

.facet-count {
    display: inline-block;
    background-color: #eee;
    color: #555;
    border-radius: 12px;
    padding: 1px 8px;
    font-size: 11px;
    font-weight: 500;
    line-height: 16px;
    margin-left: auto;
    margin-right: 5px;
    flex-shrink: 0;
}

.facet-container li button {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-right: 5px;
    width: 100%;
    box-sizing: border-box;
    position: relative;
}

.facet-container li button span:not(.facet-count) {
    flex-grow: 1;
    margin-right: 5px;
}

.facet-container li button.active .facet-count {
    background-color: #4B0082;
    color: white;
    font-weight: bold;
}

.filters-content .facet-container > h3 {
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    user-select: none;
    margin-bottom: 0.5em;
}

.filter-list-toggle-icon {
    margin-right: 4px;
    font-weight: light;
    font-family: 'Inter', sans-serif;
    color: #8c78f0;
    font-size: 1em;
    width: 1em;
    text-align: center;
    margin-bottom: 2px;
}

.filters-content .facet-container ul {
    overflow: hidden;
    max-height: 1000px;
    opacity: 1;
    margin-top: 0;
}

.filters-content .facet-container ul.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

.store-filter-mode {
    display: flex;
    margin-top: 4px;
    margin-bottom: 12px;
}

/* === ESTILOS MEJORADOS PARA BOTONES DE MODO DE TIENDA === */

.store-mode-button {
    flex: 1;
    padding: 8px 10px;
    border: 1.5px solid #e5e7eb;
    background-color: #fff;
    color: #6b7280;
    cursor: pointer;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Inter Tight', sans-serif;
    transition: all 0.2s ease-in-out;
    position: relative;
}

.store-mode-button:first-child {
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}

.store-mode-button:last-child {
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
    margin-left: -1.5px;
}

.store-mode-button:hover:not(.active) {
    border-color: #c5b0e0;
    color: #4B0082;
    background-color: #f7f2fc;
    z-index: 2;
}

.store-mode-button.active,
.store-mode-button:focus-visible {
    background-color: #4B0082;
    color: #fff;
    border-color: #4B0082;
    font-weight: 600;
    z-index: 3;
    box-shadow: 0 1px 3px rgba(75, 0, 130, 0.1);
    outline: none;
}

.store-mode-button.active:hover {
    outline: none;
}

.filters-content .facet-container ul {
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 250px;
    opacity: 1;
    margin-top: 0;
    padding-right: 5px;
    /*transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;*/
}

.filters-content .facet-container ul.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    overflow: hidden;
}

/* === 10. Active Filters === */
#active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 5px 15px;
    min-height: 0;
    margin-bottom: 5px;
}

.filter-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 20px;
    padding: 6px 12px;
    border: 1px solid #d1d5db;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    letter-spacing: -0.5px;
    color: #666666;
    font-weight: 500;
    background-color: transparent;
    transition: all 0.2s ease-in-out;
    white-space: nowrap;
}

.filter-badge .remove-filter {
    background: none;
    border: none;
    color: #4B0082;
    margin-left: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: light;
    padding: 0 2px;
    transition: color 0.2s;
    align-items: center;
}

.filter-badge .remove-filter:hover {
    color: #b02a37;
}

/* === 11. Footer === */
footer {
    padding: 25px;
    text-align: center;
    display: flex;
    background-color: #F5F5F5;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    border-top: 1px solid #eee;
}

footer p {
    margin: 0;
    font-size: 13px;
    color: #666666;
}

.instagram-icon {
    width: 18px;
    height: 18px;
    vertical-align: middle;
}

footer a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

footer a:hover .instagram-icon {
    opacity: 0.8;
}

/* === 12. Floating Bubble === */
.floating-bubble {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(75, 0, 130, 0.9);
    color: white;
    padding: 12px 24px;
    border-radius: 999px;
    font-size: 16px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
    z-index: 1050;
    text-align: center;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
    max-width: 90%;
    white-space: nowrap;
    pointer-events: none;
}

.floating-bubble.show {
    opacity: 1;
    transform: translateX(-50%) scale(1.05);
}

.floating-bubble.hide {
    opacity: 0;
    transform: translateX(-50%) scale(0.95);
}

/* === 13. Layout Toggle & Mobile Action Buttons === */
.mobile-action-buttons {
    display: block;
    text-align: center;
    padding: 0 30px;
    margin-bottom: 10px;
}

.layout-toggle-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
    margin: 0;
    padding: 0;
}

.layout-toggle-button {
    padding: 8px 12px;
    font-size: 13px;
    line-height: 1.2;
    gap: 6px;
    vertical-align: middle;
}

#analysis-mode-toggle {
    display: none;
}

body.results-active #analysis-mode-toggle {
    display: inline-flex;
}

#layout-toggle-label {
    display: none;
}

#layout-toggle-label .icon-wrapper {
    display: inline-block;
    line-height: 0;
}

/* === 14. Scrollbar === */
::-webkit-scrollbar {
    width: 5px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background-color: #d1d1d1;
    border-radius: 10px;
    border: 1.5px solid #f9f9f9;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #b0b0b0;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #d1d1d1 #f9f9f9;
}

/* === 15. General Cleanup and Improvements === */
ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

a {
    color: #007bff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #8c78f0;
    outline-offset: 1px;
}

#layout-toggle-checkbox:focus + main #layout-toggle-label {
    outline: 2px solid #8c78f0;
    outline-offset: 1px;
}

button {
    cursor: pointer;
}

.purple-text {
    color: #4B0082;
}

.mensaje-inicial {
    font-size: 16px;
    color: #666;
    text-align: center;
    margin-top: 50px;
    padding: 20px;
    font-weight: 400;
    grid-column: 1 / -1;
}

#search-results-message {
    color: #444;
    text-align: center;
}

#search-results-message p {
    padding: 5px 10px;
    font-size: 16px;
    margin: 0;
    color: #444;
    margin-top: 15px;
}

.product-top-section {
    position: relative;
    display: block;
    width: 100%;
}

.product-status-label {
    position: absolute;
    z-index: 10;
    padding: 4px 8px;
    font-size: 8px;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    pointer-events: none;
    font-family: 'Inter', Courier, monospace;
    border-radius: 20px;
    letter-spacing: -0.02em;
}

.product-status-label.status-nuevo {
    background-color: lightgreen;
    color: darkgreen;
}

.product-status-label.status-lanzamiento {
    background-color: #FF99CC;
    color: #800020;
}

.product-status-label.status-preguntar-por {
  background-color: #4d3452;
  color: white;
}

.store-info .store-link {
    color: #555;
    text-decoration: none;
    display: inline;
    cursor: pointer;
    transition: color 0.2s ease;
}

.store-info .store-link svg {
    width: 1em;
    height: 1em;
    opacity: 0.8;
    display: inline-block;
    vertical-align: baseline;
    margin-left: 4px;
    margin-bottom: -0.5px;
}

.store-info .store-link:hover {
    text-decoration: underline;
    color: #0056b3;
}

.extra-info-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    margin-top: 0.3rem;
    width: 100%;
}

.nutrition-block-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.5rem;
}

.nutrition-block {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.3rem;
    width: 100%;
}

.nutrition-item-shape {
    border-top-left-radius: 50% 0.8em;
    border-top-right-radius: 50% 0.8em;
    border-bottom-left-radius: 50% 0.8em;
    border-bottom-right-radius: 50% 0.8em;
    background-color: transparent;
    padding: 0.6em 0.4em;
    width: 6ch;
    min-width: 45px;
    max-width: 60px;
    min-height: 5em;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
    border: 1.8px solid #555555;
    font-size: 0.75rem;
    opacity: 0.75;
}

.nutrition-name {
    font-size: 0.75em;
    color: #555555;
    font-weight: 500;
    margin-bottom: 0.2em;
    line-height: 1;
}

.nutrition-value {
    font-size: 0.9em;
    font-weight: 700;
    color: #555555;
    margin: 0;
    line-height: 1;
}

.nutrition-unit-info {
    font-family: Inter Tight, sans-serif;
    font-size: 0.6rem;
    font-weight: 500;
    color: #555555;
    margin-top: 0.2rem;
    line-height: 1.1;
    text-align: center;
    opacity: 0.8;
}

.ingredients-container {
    text-align: center;
}

.ingredients-link {
    font-family: DM Sans, sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    color: #6a0dad;
    text-decoration: underline;
    text-decoration-style: dotted;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
    letter-spacing: -0.02em;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.ingredients-icon {
    width: 1.1em;
    height: 1.1em;
    flex-shrink: 0;
}

.ingredients-link:hover {
    opacity: 1;
    color: #550099;
}

.price-decimal-bs {
    font-size: 0.75em;
    vertical-align: super;
    line-height: 0;
    position: relative;
    top: 0.08em;
    font-weight: 700;
}


#budget-modal .budget-product-item .budget-item-subtotal-line .price-decimal-bs {
    font-weight: 600;
}

ul.stores li .price,
.budget-product-item .budget-item-total-price strong,
.budget-product-item .budget-item-unit-price,
.price-drop-item .old-price,
.price-drop-item .new-price,
.price-drop-item .price-difference {
    white-space: nowrap;
}

/* === 16. Pagination Styles === */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px 20px;
    gap: 6px;
    flex-wrap: wrap;
}

.pagination-container button {
    background-color: #fff;
    border: 1px solid #ddd;
    color: #4B0082;
    padding: 8px 12px;
    margin: 0;
    cursor: pointer;
    border-radius: 20px;
    font-size: 12px;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
    min-width: 35px;
    text-align: center;
}

.pagination-container button:hover:not(:disabled):not(.active) {
    background-color: #f7f2fc;
    border-color: #c5b0e0;
}

.pagination-container button.active {
    background-color: #4B0082;
    color: #fff;
    border-color: #4B0082;
    cursor: default;
}

.pagination-container button:disabled {
    color: #aaa;
    cursor: not-allowed;
    background-color: #f9f9f9;
    border-color: #eee;
}

.pagination-container span,
.pagination-container button[disabled][textContent="..."] {
    padding: 8px 5px;
    color: #aaa;
    background-color: transparent;
    border: none;
}

/* === Loading State Spinner (NUEVO) === */
    /*body.loading::after {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    width: 3em;
    height: 3em;
    border: 0.4em solid rgba(75, 0, 130, 0.25);
    border-left-color: #4B0082;
    border-radius: 50%;
    z-index: 1100;
    animation: loadingSpinnerSpin 0.8s linear infinite, loadingSpinnerFadeIn 0.3s ease-out forwards;
    background-color: transparent;
    padding: 0;
    font-size: 1rem;
}

@keyframes loadingSpinnerSpin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes loadingSpinnerFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

body.loading::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 1099;
    animation: loadingSpinnerFadeIn 0.3s ease-out forwards;
}
*/

/* === Visibility Control (Mr. Hyde) === */
#products,
#pagination-controls {
    display: none;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

body.results-active #products,
body.results-active #pagination-controls {
    visibility: visible;
    opacity: 1;
}

body.results-active #products {
    display: grid;
}

body.results-active #pagination-controls {
    display: flex;
}

body.results-active #search-results-message {
    display: block;
}

body.results-active #products:has(.no-results) {
    display: block;
    text-align: center;
}

/* =============================================== */
/* === 17. AUTENTICACIÓN MODAL (Datauth)       === */
/* =============================================== */

:root {
    --auth-font-family: 'Inter Tight', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --auth-primary-color: #4B0082;
    --auth-primary-color-darker: #3a0061;
    --auth-primary-color-rgb: 75, 0, 130;

    --auth-text-color-primary: #1d1d1f;
    --auth-text-color-secondary: #58585b;
    --auth-text-color-placeholder: #86868b;
    --auth-text-on-primary: #FFFFFF;

    --auth-background-color: #FFFFFF;
    --auth-surface-color: #F9F9F9;
    
    --auth-border-color-soft: #EAEAEA;
    --auth-border-color-input: #D2D2D7;

    --auth-error-color: #d93025;
    --auth-error-background-color: #fce8e6;

    --auth-border-radius-large: 12px;
    --auth-border-radius-medium: 8px;
    
    --auth-shadow-modal: 0px 16px 48px rgba(0, 0, 0, 0.12), 0px 4px 12px rgba(0, 0, 0, 0.08);
    --auth-shadow-button-hover: 0px 6px 12px rgba(var(--auth-primary-color-rgb), 0.2);
    --auth-shadow-button-active: 0px 2px 4px rgba(var(--auth-primary-color-rgb), 0.15);
    --auth-transition-duration: 0.25s;
    --auth-transition-timing: cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Estructura Base y Visibilidad del Modal --- */
#auth-modal {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    min-width: 320px;
    max-width: 400px;
    background-color: var(--auth-background-color);
    color: var(--auth-text-color-secondary);
    border: none;
    border-radius: var(--auth-border-radius-large);
    box-shadow: var(--auth-shadow-modal);
    z-index: 1001;
    padding: 2rem;
    box-sizing: border-box;
    display: none;
    font-family: var(--auth-font-family);
    overflow: hidden;
}

#auth-modal.visible {
    display: block;
    animation: authModalFadeIn var(--auth-transition-duration) var(--auth-transition-timing) forwards;
}

@keyframes authModalFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(15px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

/* --- Cabecera del Modal --- */
#auth-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--auth-border-color-soft);
}

#auth-modal-title {
    font-family: var(--auth-font-family);
    font-weight: 600;
    font-size: 1.4rem;
    color: #555;
    margin: 0;
    line-height: 1.3;
}

#close-auth-modal {
    background: transparent;
    border: none;
    color: var(--auth-text-color-placeholder);
    font-size: 1.6rem;
    font-weight: 200;
    font-family: 'Inter Tight', sans-serif;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--auth-transition-duration) var(--auth-transition-timing), color var(--auth-transition-duration) var(--auth-transition-timing);
}
#close-auth-modal:hover {
    color: var(--auth-primary-color);
    background-color: rgba(var(--auth-primary-color-rgb), 0.08);
}

/* --- Cuerpo del Modal --- */
#auth-modal-body {
    text-align: left;
}

/* --- Párrafos y Texto de Apoyo --- */
#auth-modal-body p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--auth-text-color-secondary);
    margin-top: 0.75rem;
    margin-bottom: 1.5rem;
}

/* --- Inputs de Texto --- */
#auth-modal input[type="text"],
#auth-modal input[type="password"] {
    width: 100%;
    padding: 0.9rem 1.1rem;
    margin-bottom: 1.25rem;
    border: 1px solid var(--auth-border-color-input);
    border-radius: var(--auth-border-radius-medium);
    font-size: 1rem;
    font-family: var(--auth-font-family);
    font-weight: 400;
    color: var(--auth-text-color-primary);
    background-color: var(--auth-surface-color);
    box-sizing: border-box;
    transition: border-color var(--auth-transition-duration) var(--auth-transition-timing), 
                background-color var(--auth-transition-duration) var(--auth-transition-timing);
}
#auth-modal input[type="text"]::placeholder,
#auth-modal input[type="password"]::placeholder {
    color: var(--auth-text-color-placeholder);
    opacity: 1;
}
#auth-modal input[type="text"]:focus,
#auth-modal input[type="password"]:focus {
    border-color: #4B0082;
    background-color: var(--auth-background-color);
}

/* --- Botones de Acción del Modal --- */
.auth-button {
    background-color: var(--auth-primary-color);
    color: var(--auth-text-on-primary);
    border: none;
    padding: 0.9rem 1.75rem;
    text-align: center;
    text-decoration: none;
    display: block;
    width: 100%;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--auth-font-family);
    letter-spacing: 0.01em;
    border-radius: var(--auth-border-radius-medium);
    cursor: pointer;
    transition: background-color var(--auth-transition-duration) var(--auth-transition-timing), 
                transform var(--auth-transition-duration) var(--auth-transition-timing), 
                box-shadow var(--auth-transition-duration) var(--auth-transition-timing);
    box-sizing: border-box;
    margin-top: 0.75rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}
.auth-button:hover {
    background-color: var(--auth-primary-color-darker);
    transform: translateY(-2px);
    box-shadow: var(--auth-shadow-button-hover);
}
.auth-button:active {
    transform: translateY(0px) scale(0.99);
    background-color: var(--auth-primary-color-darker);
    box-shadow: var(--auth-shadow-button-active);
}
.auth-button:disabled {
    background-color: #C5B8D3;
    color: rgba(255,255,255,0.8);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.8;
}

/* --- Mensajes de Error --- */
.error-message {
    color: var(--auth-error-color);
    background-color: var(--auth-error-background-color);
    padding: 0.85rem 1.1rem;
    border-radius: var(--auth-border-radius-medium);
    margin-top: 0.75rem;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid var(--auth-error-color);
    text-align: left;
    display: none;
}
.error-message.visible {
    display: block;
    animation: fadeInError 0.3s ease-out;
}
@keyframes fadeInError {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}


/* --- Estilos para #auth-step-1 (Registro) y #auth-step-login (Login) --- */
#auth-step-1 > p:first-of-type {
    font-size: 1.05rem;
    color: var(--auth-text-color-primary);
    font-weight: 500;
    margin-bottom: 1rem;
}
#auth-step-login h4 {
    font-family: var(--auth-font-family);
    font-size: 1.1rem;
    color: var(--auth-primary-color);
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

/* --- Texto para cambiar entre Registro/Login --- */
.auth-switch-text {
    font-size: 0.9rem;
    text-align: center;
    margin-top: 1.75rem;
    color: var(--auth-text-color-secondary);
}
.link-button {
    background: none;
    border: none;
    color: var(--auth-primary-color);
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
    padding: 0.2em 0.1em;
    font-size: inherit;
    font-family: var(--auth-font-family);
    border-bottom: 1.5px solid transparent;
    transition: color var(--auth-transition-duration) var(--auth-transition-timing), 
                border-color var(--auth-transition-duration) var(--auth-transition-timing);
}
.link-button:hover {
    color: var(--auth-primary-color-darker);
    border-bottom-color: var(--auth-primary-color-darker);
}

/* --- Estilos para #auth-step-2 (Mostrar Credenciales) --- */
#auth-step-2 > p:first-of-type {
    margin-top: 0.75rem;
    margin-bottom: 1.75rem;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--auth-text-color-primary);
    text-align: center;
    line-height: 1.2;
}
#auth-step-2 strong {
    color: var(--auth-primary-color);
    font-weight: 700;
}

#auth-step-2 .auth-credential-display {
    margin-bottom: 1.25rem;
}
#auth-step-2 .auth-credential-display label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--auth-text-color-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
#auth-step-2 .auth-credential-display input[type="text"] {
    background-color: var(--auth-surface-color);
    color: var(--auth-text-color-primary);
    border: 1px solid var(--auth-border-color-input);
    font-weight: 500;
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    margin-bottom: 0;
    cursor: default;
}
#auth-step-2 .auth-credential-display input[type="text"]:focus {
    box-shadow: none;
    border-color: var(--auth-border-color-input);
}

#copy-all-auth-data-button {
    background-color: rgba(var(--auth-primary-color-rgb), 0.08);
    color: var(--auth-primary-color);
    border: 1px solid rgba(var(--auth-primary-color-rgb), 0.2);
    font-weight: 600;
    padding: 0.8rem 1.5rem;
    margin-top: 1.75rem;
    margin-bottom: 1.25rem;
}
#copy-all-auth-data-button:hover {
    background-color: rgba(var(--auth-primary-color-rgb), 0.12);
    border-color: rgba(var(--auth-primary-color-rgb), 0.3);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(var(--auth-primary-color-rgb),0.1);
}

#auth-step-2 .auth-note {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--auth-text-color-secondary);
    margin-top: 0.25rem;
    margin-bottom: 1.75rem;
    text-align: center;
    line-height: 1.5;
}

/* --- Botón "Entrar" en la barra de navegación superior --- */
.auth-button-simple {
    padding: 0.25rem 0.5rem;
    color: var(--auth-text-on-primary);
    background-color: transparent;
    border:none;
    font-weight: 700;
    font-family: var(--auth-font-family);
    font-size: 0.8rem;
    line-height: 1;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 1px;
}
.auth-button-simple:hover {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    transform: translateY(-1px);
}
.auth-button-simple:active {
    transform: translateY(0px);
}

.auth-button-icon {
    width: 1.3em;
    height: 1.3em;
    flex-shrink: 0;
}

.user-auth-standalone-absolute {
    flex-shrink: 0;
    margin-left: auto;
}

.price-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-left: 10px;
}

ul.stores li .price {
    margin-left: 0;
}

.store-price-per-unit {
    display: none;
    margin-top: 5px;
    font-size: 11px;
    font-family: 'Inter Tight', sans-serif;
    font-weight: 400;
    color: #666666;
    opacity: 0.8;
    line-height: 1.2;
    white-space: nowrap;
}

body.analysis-mode-active .store-price-per-unit {
    display: block;
}

.store-price-per-unit .price-decimal-bs {
    vertical-align: baseline;
    font-size: 1em;
    font-weight: inherit;
    top: 0;
    position: static;
}

.value-badge-container {
  margin: 0;
  height: 0;
  overflow: hidden;
  text-align: center;
  width: 100%;
}

body.analysis-mode-active .value-badge-container:not(:empty) {
  height: auto;
  margin: 5px 0 8px 0;
}

.value-price-highlight {
  display: none; 
}

body.analysis-mode-active .value-price-highlight {
  display: inline;
  color: #17a2b8;
  font-weight: bold;
}

.product-title-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 5px;
    padding: 0 5px;
    box-sizing: border-box;
}

.product-title-container h2 {
    margin-bottom: 0;
}

.product .product-name-ppm {
    font-weight: 700;
    font-size: 10px;
    border: 1px solid #6666667a;
    border-radius: 3px;
    padding: 2px 4px;
    margin: 4px 0 0 0;
    color: #666666dd;
    line-height: 1.2;
    cursor: help;
    display: inline-block;
}

 .fluor-badge-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    text-align: center;
    font-size: 12px;
    line-height: 0.9;
    font-family: 'DM Sans', sans-serif;
    margin: 8px auto 8px auto;
    justify-content: center;
    letter-spacing: -0.05em;
    padding: 0 8px;
}

body.analysis-mode-active .fluor-badge-line {
    display: flex;
}

.fluor-badge-line .fluor-badge-icon {
    width: 1.2em;
    height: 1.2em;
    flex-shrink: 0;
    margin-top: -2px;
}

.fluor-badge-recommended {
    color: #8f7cc7;
    font-weight: 800;
}

.fluor-badge-no-info {
    color: #e7186bba;
    font-weight: 800;
}

.tooltip {
    position: absolute;
    z-index: 1100;
    background-color: #333;
    color: #fff;
    padding: 10px 15px;
    border-radius: 8px;
    max-width: 280px;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    line-height: 1.5;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.tooltip.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.tooltip strong {
    display: block;
    font-size: 14px;
    margin-bottom: 5px;
    color: #f0f0f0;
}

.tooltip p {
    margin: 0;
    color: #dcdcdc;
}

/* --- Estilos para Opciones de Combo --- */

.combo-options-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    width: calc(100% - 1.6rem);
    padding: 0.8rem;
    margin-top: 0.5rem;
    border-top: 1px solid #f0f0f0;
}

.combo-sides-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.combo-sides-title {
    font-size: 0.75rem;
    color: #555;
    margin: 0;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.combo-sides-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
}

.side-badge {
    background-color: #fff;
    border: 1.5px solid #d1d5db;
    color: #374151;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
}

.extras-container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1rem; 
    width: 100%;
    margin-top: 0.8rem;
}

.extra-option-wrapper {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.extra-checkbox {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    width: 14px;
    height: 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 20px;
    background-color: #fff;
    cursor: pointer;
}

.extra-checkbox:hover {
    border-color: #9ca3af;
}

.extra-checkbox:checked {
    border-color: #4B0082;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%234B0082' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 8.5 6 11.5 13 4.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 65%;
}

.extra-label {
    font-size: 0.75rem;
    color: #333;
    cursor: pointer;
}

.extra-label strong {
    color: #166534;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
}

.value-badge-container {
  align-items: center;
  gap: 4px;
  margin-bottom: 3px;
}

/* === Media Queries === */

/* --- Large Screens (Desktops, Laptops >= 1024px) --- */
@media (min-width: 1024px) {
    .floating-bubble {
        font-size: 18px;
        padding: 14px 28px;
    }
}

/* --- Mobile Screens (<= 700px) --- */
@media (max-width: 700px) {

    .main-tagline {
        font-size: 56px;
        margin-top: 15px;
        margin-bottom: 20px;
        letter-spacing: -2.25px;
        padding: 5px 12px;
        animation-duration: 9s;
        line-height: 0.8;
        font-weight: 900;
    }

    .search-buttons {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
        margin-left: -15px;
        margin-right: -15px;
        padding: 0 15px;
        padding-bottom: 10px;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .search-buttons button {
        font-size: 12px;
        padding: 5px 10px;
        gap: 1px;
    }

    .search-buttons button .search-button-icon {
        width: 1.2em;
        height: 1.2em;
    }

    .search-buttons::-webkit-scrollbar {
        display: none;
    }

    .search-buttons-wrapper::before,
    .search-buttons-wrapper::after {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        width: 40px;
        pointer-events: none;
        z-index: 2;
    }

    .search-buttons-wrapper::before {
        left: 0;
        background: linear-gradient(to right,
            rgba(255, 255, 255, 1) 0%,
            rgba(255, 255, 255, 0.8) 40%,
            rgba(255, 255, 255, 0) 100%
        );
        /* box-shadow: 5px 0 10px -5px rgba(0,0,0,0.1); */
    }

    .search-buttons-wrapper::after {
        right: 0;
        background: linear-gradient(to left,
            rgba(255, 255, 255, 1) 0%,
            rgba(255, 255, 255, 0.8) 40%,
            rgba(255, 255, 255, 0) 100%
        );
        /* box-shadow: -5px 0 10px -5px rgba(0,0,0,0.1); */
    }

    /* --- B1. Header & Search Bar (Móvil, logo más cerca de la búsqueda) --- */
    .search-background {
        display: flex;
        flex-direction: column;
        width: 100%;
        align-items: center;
        padding: 8px 15px;
        position: sticky;
        gap: 1px;
    }

    .currency-toggle-button-searchbar {
    right: 8px;
    padding: 4px 7px;
    font-size: 11px;
    }

    .user-auth-standalone-absolute {
        position: absolute;
        top: 2px;
        right: 2px;
        z-index: 5;
    }

    .search-logo {
        width: 100%;
        text-align: center;
        margin: 5px 0 -10px 0;
        position: relative;
        z-index: 1;
    }

    .search-logo img {
        max-width: 250px;
        height: 45px;
        display: inline-block;
        pointer-events: none;
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
    }

    .search-wrapper .search-icon {
        left: 10px;
    }

    #searchbox {
        width: 80%;
        max-width: 500px;
        margin: 0 auto 5px auto;
        display: flex;
        justify-content: center;
        flex-grow: 0;
        position: relative;
    }

    .search-wrapper {
        width: 100%;
        height: 35px;
    }

    #search-input-field {
        font-size: 17px;
        font-weight: 500;
        padding-left: 45px;
        padding-right: 70px;
        letter-spacing: -0.15px;
    }

    .search-reset-button {
        right: 65px;
        font-size: 28px;
        font-family: 'Inter Tight', sans-serif;
    }

    #open-budget-modal {
        font-size: 11px;
        padding: 3px 10px;
        gap: 2px;
    }

    #open-budget-modal .budget-button-icon {
        width: 1.35em;
        height: 1.35em;
        flex-shrink: 0;
        margin-bottom: 2px;
    }

    .budget-item-counter {
        font-size: 8px;
        padding: 2px 6px;
    }

    .analysis-item span {
        font-size: 10px;
    }

    .analysis-item strong {
        font-size: 10px;
    }

    .store-price-per-unit {
    font-family: 'Inter', sans-serif;    
    font-size: 9px;
    }

    #open-budget-modal-wrapper {
        position: static;
        width: 100%;
        text-align: center;
        padding: 0;
        margin-top: 1px;
    }

    .budget-filters-list-style .budget-filter-group ul {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        max-height: calc((30px * 3) + (8px * 2));
        overflow-x: auto;
        white-space: nowrap;
    }

    .budget-filter-button {
        font-size: 9px;
        padding: 4px 8px;
    }

    .budget-filter-count {
    font-size: 8px;
    }

    .budget-product-filter-item img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 4px;
    }

    .mobile-action-buttons {
        margin: 10px auto 10px auto;
        max-width: 90%;
    }

    body.results-active .mobile-action-buttons {
        display: flex;
        justify-content: flex-start;
        align-items: stretch;
        gap: 10px;
        text-align: left;
        margin-top: 15px;
        margin-bottom: 15px;
        overflow: auto;
        flex-wrap: nowrap;
        padding-top: 5px;
        padding-bottom: 5px;
    }

    .mobile-action-buttons::-webkit-scrollbar {
        display: none;
    }
    .mobile-action-buttons {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .filters-button {
        font-size: 13px;
        padding: 8px 12px;
        gap: 6px;
        max-width: 300px;
        width: auto;
        margin-top: 20px;
    }

    .filters-button svg {
        width: 1.1em;
        height: 1.1em;
        flex-shrink: 0;
    }

    .filter-badge {
        font-size: 10px;
    }

    .filter-badge .remove-filter {
        font-size: 10px;
    }
    .auth-button-simple {
        margin-top: 10px;
        margin-right: 10px;
    }

    .combo-sides-title {
    font-size: 0.7rem;
    font-weight: 600;
    }

    .side-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 5px;
    font-size: 0.6rem;
    }

    body.results-active .mobile-action-buttons .filters-button {
        margin: 0;
        justify-content: center;
        font-size: 13px;
        width: 140px;
        flex-shrink: 0;
    }

    #layout-toggle-label .icon-wrapper svg {
        width: 1.1em;
        height: 1.1em;
    }

    body.results-active #layout-toggle-label {
        display: inline-flex;
        margin: 0;
        justify-content: center;
        padding: 8px 10px;
        gap: 6px;
        width: 140px;
        flex-shrink: 0;
    }

    #layout-toggle-checkbox:not(:checked) ~ main #layout-toggle-label .icon-grid {
        display: none;
    }
    #layout-toggle-checkbox:not(:checked) ~ main #layout-toggle-label .icon-list {
        display: inline-block;
    }
    #layout-toggle-checkbox:not(:checked) ~ main #layout-toggle-label .label-text::before {
        content: "Cuadrícula";
    }
    #layout-toggle-checkbox:checked ~ main #layout-toggle-label .icon-grid {
        display: inline-block;
    }
    #layout-toggle-checkbox:checked ~ main #layout-toggle-label .icon-list {
        display: none;
    }
    #layout-toggle-checkbox:checked ~ main #layout-toggle-label .label-text::before {
        content: "Lista";
    }

    body.results-active #products {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 12px;
        padding: 10px 12px 15px 12px;
        min-height: auto;
    }

    body.results-active #products .product {
        padding: 10px;
        background-color: #fff;
        border: 1px solid #eceaf2;
        border-radius: 8px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        height: fit-content;
    }
    body.results-active #products .product img {
        max-height: 90px;
        margin-bottom: 8px;
        width: 100%;
        height: auto;
        object-fit: contain;
        border-radius: 5px;
    }
    body.results-active #products .product h2 {
        font-size: 12px;
        margin: 5px 0 8px 0;
        line-height: 1.3;
        color: #666666;
        text-align: center;
        font-family: 'Inter Tight', sans-serif;
    }

    body.results-active #products ul.stores {
        margin-top: 8px;
        list-style: none;
        padding: 0;
    }
    body.results-active #products ul.stores li {
        font-size: 12px;
        padding: 6px 4px;
        border-top: 1px solid #eee;
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-family: 'Inter Tight', sans-serif;
        font-weight: 500;
    }
    body.results-active #products ul.stores li:first-child {
        border-top: none;
    }
    body.results-active #products ul.stores li .store-info {
        margin-right: 5px;
        min-width: 0;
        display: flex;
        align-items: center;
        flex-grow: 1;
    }
    body.results-active #products ul.stores li .store-info img {
        width: 13px;
        height: 13px;
        margin-right: 4px;
        margin-top: 6px;
        flex-shrink: 0;
    }
    body.results-active #products ul.stores li .store-info > p,
    body.results-active #products ul.stores li .store-info > span.store-name,
    body.results-active #products ul.stores li .store-info > a.store-link {
        white-space: normal;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.3;
        flex-grow: 1;
        margin: 0;
        color: #555;
    }
    body.results-active #products ul.stores li .price {
        font-size: 12px;
        margin-left: auto;
        white-space: nowrap;
        text-align: right;
        flex-shrink: 0;
        padding-left: 5px;
        font-family: 'Inter Tight', sans-serif;
        font-weight: 700;
        color: #000000;
        text-decoration: underline;
        text-decoration-thickness: 1.5px;
        text-underline-offset: 2px;
    }
    body.results-active #products .add-to-budget {
        font-size: 15px;
        font-weight: 600;
        padding: 6px 8px;
        line-height: 1;
    }

    body.results-active #products .add-to-budget svg {
        width: 1.6em;
        height: 1.6em;
        margin-right: 2px;
    }

    body.results-active #products .add-to-budget .add-to-budget-content-wrapper {
        width: 85%;
    }

    body.results-active #layout-toggle-checkbox:not(:checked) ~ main #products .product .product-top-section .product-status-label {
        padding: 2px 6px;
        font-size: 8px;
        font-family: 'Inter Tight', sans-serif;
        margin-top: 1px;
        margin-left: 1px;
    }

    #layout-toggle-checkbox:checked ~ main #products {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 10px 20px 20px 20px;
    }

    #layout-toggle-checkbox:checked ~ main .product {
        padding: 15px;
    }

    #layout-toggle-checkbox:checked ~ main .product img {
        max-height: 100px;
        margin-bottom: 10px;
    }

    #layout-toggle-checkbox:checked ~ main .product h2 {
        font-size: 14px;
        margin: 10px 0;
        line-height: normal;
    }

    #layout-toggle-checkbox:checked ~ main .proteinas {
        font-size: 12px;
        margin-top: 5px;
        margin-bottom: 10px;
    }

    #layout-toggle-checkbox:checked ~ main ul.stores {
        margin: 10px 0 0;
    }

    #layout-toggle-checkbox:checked ~ main ul.stores li {
        padding: 8px 8px;
        font-size: 14px;
    }

    #layout-toggle-checkbox:checked ~ main ul.stores li .store-info {
        margin-right: 8px;
    }

    #layout-toggle-checkbox:checked ~ main ul.stores li .store-info img {
        width: 15px;
        height: 15px;
        margin-right: 5px;
        margin-top: 8px;
    }

    #layout-toggle-checkbox:checked ~ main ul.stores li .store-info > p,
    #layout-toggle-checkbox:checked ~ main ul.stores li .store-info > span.store-name,
    #layout-toggle-checkbox:checked ~ main ul.stores li .store-info > a.store-link {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: normal;
    }

    #layout-toggle-checkbox:checked ~ main ul.stores li .price {
        margin-left: 10px;
        font-size: 14px;
        text-align: left;
        padding-left: 0;
        text-decoration-thickness: 2px;
    }

    #layout-toggle-checkbox:checked ~ main .add-to-budget {
        font-size: 16px;
        padding: 10px 15px;
        margin-top: 15px;
    }

    #layout-toggle-checkbox:checked ~ main #products .add-to-budget svg {
        width: 1.4em;
        height: 1.4em;
        margin-right: 2px;
    }

    /* --- CASO ESPECIAL: 1 SOLO PRODUCTO EN VISTA CUADRÍCULA (MÓVIL) --- */

    body.results-active #layout-toggle-checkbox:not(:checked) ~ main #products > .product:only-child {
        padding: 15px;
    }
    body.results-active #layout-toggle-checkbox:not(:checked) ~ main #products > .product:only-child img {
        max-height: 100px;
        margin-bottom: 10px;
    }
    body.results-active #layout-toggle-checkbox:not(:checked) ~ main #products > .product:only-child h2 {
        font-size: 14px;
        margin: 10px 0;
        line-height: normal;
    }
    body.results-active #layout-toggle-checkbox:not(:checked) ~ main #products > .product:only-child .proteinas {
        font-size: 12px;
        margin-top: 5px;
        margin-bottom: 10px;
    }
    body.results-active #layout-toggle-checkbox:not(:checked) ~ main #products > .product:only-child ul.stores {
        margin: 10px 0 0;
    }
    body.results-active #layout-toggle-checkbox:not(:checked) ~ main #products > .product:only-child ul.stores li {
        padding: 8px 8px;
        font-size: 14px;
    }
    body.results-active #layout-toggle-checkbox:not(:checked) ~ main #products > .product:only-child ul.stores li .store-info {
        margin-right: 8px;
    }
    body.results-active #layout-toggle-checkbox:not(:checked) ~ main #products > .product:only-child ul.stores li .store-info img {
        width: 15px;
        height: 15px;
        margin-right: 5px;
        margin-top: 7px;
    }
    body.results-active #layout-toggle-checkbox:not(:checked) ~ main #products > .product:only-child ul.stores li .store-info > p,
    body.results-active #layout-toggle-checkbox:not(:checked) ~ main #products > .product:only-child ul.stores li .store-info > span.store-name,
    body.results-active #layout-toggle-checkbox:not(:checked) ~ main #products > .product:only-child ul.stores li .store-info > a.store-link {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: normal;
    }
    body.results-active #layout-toggle-checkbox:not(:checked) ~ main #products > .product:only-child ul.stores li .price {
        margin-left: 10px;
        font-size: 14px;
        text-align: left;
        padding-left: 0;
        text-decoration-thickness: 2px;
    }
    body.results-active #layout-toggle-checkbox:not(:checked) ~ main #products > .product:only-child .add-to-budget {
        font-size: 16px;
        padding: 10px 15px;
        margin-top: 15px;
        min-height: auto;
        line-height: 1;
    }

    body.results-active #layout-toggle-checkbox:not(:checked) ~ main #products > .product:only-child .add-to-budget svg {
        width: 1.4em;
        height: 1.4em;
        flex-shrink: 0;
        margin-right: 2px;
    }

    body.results-active #search-results-message {
        display: block;
        margin-top: 10px;
        margin-bottom: 10px;
        padding: 2px 10px;
        font-size: 14px;
    }

    body.results-active #search-results-message p {
        font-size: 14px;
        margin-top: 5px;
    }

    #active-filters {
        padding: 5px 12px;
        margin-bottom: 10px;
        gap: 6px;
    }

    .filters-menu {
        width: 85%;
        max-width: 300px;
    }
    .facet-container h3 {
        font-size: 15px;
    }
    .facet-container li button {
        font-size: 13px;
    }
    .floating-bubble {
        font-size: 14px;
        padding: 10px 20px;
        z-index: 1050;
    }
    .floating-bubble.show {
        opacity: 1;
        transform: translateX(-50%) scale(1.05);
    }
    .floating-bubble.hide {
        opacity: 0;
        transform: translateX(-50%) scale(0.95);
    }

    /* --- Smaller Mobile Screens (<= 360px, anidado dentro de <= 600px) --- */
    @media (max-width: 360px) {

        /* --- C1. Header & Search Bar (Ajustes finos para mayor compactación, dentro de <= 600px) --- */
        .search-background {
            padding: 8px 8px;
        }

        .search-logo {
            margin: 0 0 -10px 0;
        }

        .search-logo img {
            max-width: 220px;
            height: 40px;
        }

        #searchbox {
            width: 85%;
            max-width: 500px;
            display: flex;
            justify-content: center;
            flex-grow: 0;
            position: relative;
            margin: 0 auto 3px auto;
        }

        .search-wrapper {
            height: 38px;
        }

        body.results-active #products .add-to-budget {
            font-size: 13px;
            font-weight: 600;
            padding: 6px 8px;
            min-height: 30px;
            line-height: 1;
        }

        body.results-active #products .add-to-budget svg {
            width: 1.6em;
            height: 1.6em;
            margin-right: 2px;
        }

        .main-tagline {
            font-size: 54px;
            margin-top: 10px;
            margin-bottom: 20px;
            letter-spacing: -2.25px;
            padding: 5px 10px;
            animation-duration: 9s;
            line-height: 0.8;
            font-weight: 900;
        }

        .budget-product-item .budget-item-name {
            font-size: 8.5px;
            font-weight: 600;
        }

        .budget-product-item .product-details {
            padding-right: 1.1rem;
        }

        .auth-button-simple {
            font-size: 0.6rem;
            margin-top: 10px;
            margin-right: 10px;
        }
    }
}