/* --- 1. Typography and General Styles --- */

html {
  scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', 'Century Gothic', 'Avenir', 'Avenir Next', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f9f9f9;
    color: #666666;
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

input, button, textarea, select {
    font-family: inherit;
}

.container {
    margin: 0 auto;
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

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;
    display: flex;
    justify-content: 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%;
}

#budget-modal .modal-content,
.filters-menu,
.facet-container ul {
  overscroll-behavior: contain;
}

/* --- 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: 40px;
    display: block;
    width: auto;
    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: #5e3b8a;
    font-size: 34px;
    font-weight: 200;
    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-shown {
    white-space: nowrap;
    text-overflow: ellipsis;
}

#search-input-field::placeholder {
    color: #4B0082;
    opacity: 0.5;
    overflow: hidden;
    text-overflow: ellipsis;
}

#search-input-field {
    field-sizing: content;
    font-size: 18px;
    letter-spacing: -0.50px;
    -webkit-appearance: none;
    appearance: none;
    background: none;
    font-weight: 600;
    width: 100%;
    padding: 1px 100px 3px 55px;
    border: none;
    outline: none;
    box-sizing: border-box;
    color: #4B0082;
    min-width: 100px;
    flex-grow: 1;
    resize: none;
    overflow-y: auto;
    max-height: 35px;
    white-space: normal;
    word-wrap: break-word;
    display: block;
    scrollbar-width: none;  
    -ms-overflow-style: none;  
}

#search-input-field.multi-line {
    font-size: 16px;
    line-height: 1;
}

.search-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
    min-width: 180px;
    height: 45px;
    background: #f9f5fc;
    border: 1px solid 1px solid #c5b0e0;
    border-radius: 50px;
    display: flex;
    align-items: center;
    margin: 0 auto;
    box-sizing: border-box;
    transition: all 0.25s ease-in-out; 
}

.search-wrapper:focus-within {
    border-color: #4B0082; 
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(75, 0, 130, 0.15);
}


.search-wrapper .search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 25px;
    height: 25px;
    z-index: 1;
    display: flex;
}

/* --- 2.1. Currency Toogle --- */

.currency-toggle-button-searchbar {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #ffffff;
    border: 1px solid #c5b0e0;
    color: #c5b0e0;
    padding: 4px 8px;
    border-radius: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    z-index: 3;
    white-space: nowrap;
    margin-left: auto;
}


.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 {
    color: #4B0082;
    border-color: #4B0082;
}

.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. BÚSQUEDAS RÁPIDAS --- */

/* --- 3.1. Contenedor Principal y Layout --- */

.search-buttons-wrapper {
    position: relative;
    box-sizing: border-box;
    margin-bottom: 10px;
    text-align: center;
    min-height: 52px; 
    contain: layout;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.quick-search-edit-container {
    display: none;
    align-self: flex-end;
    margin-bottom: 12px;
}

.search-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.search-button-placeholder {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 5px 10px;
    font-family: 'DM Sans', 'DM Sans Fallback', sans-serif;
    font-size: 12px;
    border: 1px solid #a4a4a444;
    background-color: transparent;
    color: #a4a4a488;
    border-radius: 4px;
    pointer-events: none;
    animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 0.3;
  }
}

/* --- 3.2. Estilos de Botones (Modo Visualización) --- */

.search-buttons button {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    width: auto;
    margin: 0;
    padding: 5px 10px;
    font-family: 'DM Sans', 'DM Sans Fallback', sans-serif;
    font-weight: 500;
    font-size: 12px;
    border: 1px solid #a4a4a488;
    background-color: transparent;
    color: #A4A4A4;
    cursor: pointer;
    border-radius: 4px;
    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;
    border: 1px solid #4B0082; 
}

.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;
}

/* --- 3.3. Controles de Edición --- */

.edit-searches-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    color: #A4A4A4;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s ease;
}

.edit-searches-btn .edit-trigger {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-weight: 600;
    transition: color 0.2s ease;
}

.edit-trigger {
    color: #4B0082;
}

.edit-searches-btn:hover,
.edit-searches-btn:hover .edit-trigger {
    color: #4B0082;
}

.edit-searches-btn .edit-icon-svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.edit-searches-btn.is-editing {
    font-weight: 600;
    color: #4B0082;
}

.edit-searches-btn.is-editing:hover {
    color: #8A2BE2;
}

.search-buttons-wrapper.is-editing .search-buttons button {
    gap: 6px;
}

.search-buttons-wrapper.is-editing .search-buttons button > span {
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
    cursor: text;
}

.remove-search-btn {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    color: #A4A4A4;
    font-size: 18px;
    font-weight: 400;
    line-height: 1;
    margin-left: 2px;
    display: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

.remove-search-btn:hover {
    color: #d93025;
}

.search-buttons-wrapper.is-editing .remove-search-btn {
    display: inline-block;
}

.add-search-btn {
    display: none;
    border-style: dashed !important;
    color: #6a0dad;
    background-color: transparent !important;
    font-weight: 600;
}

.search-buttons-wrapper.is-editing .add-search-btn {
    display: inline-flex;
}

/* --- 4. Product Cards --- */

#products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    min-height: 40vh;
    gap: 16px;
    padding: 10px 16px 20px 16px;
}

.product {
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: fit-content;
    gap: 4px;
    position: relative;
}

.product-card-actions {
    align-self: flex-end;
    margin-bottom: 1px;
    width: auto;
}

.product-main-info {
    display: flex;
    align-items: flex-start;
    gap: 4x;
    width: 100%;
}

.product h2 {
    font-size: 12px;
    text-align: left;
    font-weight: 600;
    color: #555555;
    line-height: 1.4;
    margin: 0;
    flex-grow: 1;
}

.product-content-wrapper {
    margin-top: auto;
    width: 100%;
}

/* --- 4.1. Product Image --- */

.product-image-wrapper {
    flex: 0 0 85px;
    width: 85px;
}

.product img {
    width: 100%;
    height: 75px;
    max-height: 100px;
    object-fit: contain;
    border-radius: 8px;
    aspect-ratio: 1 / 1;
    opacity: 0;
    transform: scale(0.95);
    filter: blur(5px);
    will-change: transform, opacity, filter;
}

.product img.loaded {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
    pointer-events: none;
    transition: 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;
}

/* --- 4.2. Copy Button --- */

.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;
}

/* --- 4.3. Store and Prices Info --- */

/* --- Bloque de Tiendas y Precios (Diseño Compacto y Minimalista) --- */

ul.stores {
    width: 100%;
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 10px 6px;
}

/* 2. La etiqueta de cada tienda */
.stores li {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 8px;
    border-radius: 6px;
    background-color: transparent;
    border: 1.25px solid #e9ecef;
    text-align: left;
    min-height: 70px;
    box-sizing: border-box;
    width: 100%
}

ul.stores li {
  position: relative;
}

/* 3. Contenedor del nombre */
.store-info {
    width: 100%;
    margin: 0;
}

.store-info .location-icon-svg {
    display: none;
}

/* 4. Estilo para el nombre de la tienda*/
ul.stores li .store-info > a.store-link,
ul.stores li .store-info > span.store-name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 9px;
    font-weight: 700;
    color: #495057;
    line-height: 1.25;
    margin: 0;
}

/* 5. Contenedor del precio */
.price-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-top: 6px;
    padding: 0;
}

/* 6. Estilo del precio principal */
ul.stores li .price {
    font-size: 14px;
    font-weight: 700;
    color: #212529;
    line-height: 1;
}

/* 7. Estilo del icono detalles */

.details-indicator-icon {
  position: absolute;
  bottom: 8.5px;
  right: 4px;
  width: 12px;
  height: 12px;
  color: #a0a0a0;
  opacity: 1;
}

/* Estilo del icono cuando se pasa el ratón por encima de la tarjeta (solo escritorio) */
ul.stores li.clickable:hover .details-indicator-icon {
  color: #4B0082;
  opacity: 1;
}

/* Estilo del icono cuando la tienda está resaltada por el filtro */
ul.stores li.highlighted-store .details-indicator-icon {
  color: #7c3aed;
  opacity: 1;
}

/* --- 4.4. Expire Label --- */

/* --- Etiqueta de Expiración de Precio (Corregida) --- */

.price-expiry-info {
    display: inline-block;
    margin-top: 4px; 
    padding: 2px 6px;
    font-size: 9px;
    font-weight: 600;
    color: #ffffff;
    background-color: #DE3163;
    border-radius: 1px;
}

ul.stores li:has(.price-expiry-info) {
  grid-column: 1 / -1;
}

/* --- 4.5. Highlight Store --- */

.stores li.highlighted-store {
  background-color: #f0eaff;
  border: 1px solid #7c3aed;
  transition: all 0.2s ease-in-out;
}

.stores li.highlighted-store .store-name {
  font-weight: 900 !important;
  color: #5b21b6 !important;
}

/* --- 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;
    letter-spacing: -0.02em;
    border: 1.35px solid #4B0082;
    border-radius: 4px;
    cursor: pointer;
    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-size: 13px;
    font-weight: 600;
    padding: 4px 12px;
    border: 1px solid #e5e7eb;
    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-size: 10px;
    font-weight: 700;
    color: white;
    background-color: #ff4d4d;
    padding: 2px 6px;
    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;
}

/* --- 7.1. Budget Modal (Inside) --- */
#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;
}

/* --- 7.2. Budget Modal (Header) --- */

#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;
}

/* --- 7.3. Budget Modal (Moneda) --- */

#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: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    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;
}

/* --- 7.4. Budget Modal (Trash Can) --- */

#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);
}

/* --- 7.5. Budget Modal (Close) --- */

#close-budget-modal {
    font-size: 24px;
    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);
}

/* --- 7.6. Budget Modal (Explain Text) --- */

#budget-modal .budget-explanation {
    font-size: 10px;
    font-weight: 500;
    color: #8f7cc7;
    margin-bottom: 0;
    padding: 6px 8px;
    border-radius: 4px;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
    margin-top: 0px;
    flex-shrink: 0;
}

/* --- 7.7. Budget Modal (Product List) --- */

#budget-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.8rem;
    margin-top: 0;
}

#budget-list > li {
    background-color: #F8F5FA;
    padding: 0.6rem;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
    position: relative;
    z-index: 1; 
}

#budget-list > li:first-child {
    margin-top: 0.8rem;
}

#budget-list > li > .budget-store-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    border: none;
    padding: 8px 4px;
    margin-bottom: 8px;
    border-bottom: 1px solid #e5ddee;
    cursor: pointer;
    text-align: left;
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #F8F5FA;
}

#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: 500;
    border: 1px solid #777;
    border-radius: 2px;
    padding: 1px 6px;
    margin-left: 5px;
    white-space: nowrap;
    opacity: 0.6;
}

.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;
    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 */
}

.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;
}

.budget-product-item .budget-item-total-label {
    font-weight: 400;
}

.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;
}

.budget-store-header-content {
    font-size: 11px;
    color: #4B0082;
    font-weight: bold;
    line-height: 1.6;
    padding-bottom: 4px;
}

.budget-store-header-content .price-total {
    color: black;
}

.budget-store-header .toggle-icon {
    width: 18px;
    height: 18px;
    color: #8c78f0;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    flex-shrink: 0;
}

.budget-store-header:hover {
    background-color: #f9f5fc;
}

.budget-store-header[aria-expanded="false"] .toggle-icon {
    transform: rotate(-90deg);
}

.budget-store-products-list {
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), 
                opacity 0.3s ease-in-out;
    max-height: 2000px;
    opacity: 1;
}

.budget-filter-group .budget-filter-list.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    margin-bottom: 0;
}

/* --- 7.8. Budget Modal (Empty) --- */

.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;
}

/* --- 7.7.1. Budget Modal (Purchase Toggle Button & Layout) --- */

.budget-product-item .product-image-actions-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    gap: 8px;
}

.product-image-actions-wrapper .product-image {
    margin: 0 !important;
}

.budget-product-item .product-info {
    gap: 8px;
    align-items: flex-start;
}

.purchase-toggle-button {
    background-color: #fff1f3;
    color: #DE3163;
    border: 1px solid #ffccd5;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 8px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1.2;
    white-space: nowrap;
    transition: all 0.2s ease-in-out;
    width: 100%;
    box-sizing: border-box;
}

.purchase-toggle-button:hover {
    background-color: #DE3163;
    color: white;
    border-color: #DE3163;
}

.purchase-toggle-button.active {
    background-color: #28a745;
    color: white;
    border-color: #28a745;
}

.budget-product-item.is-purchased {
    opacity: 0.6;
    background-color: #f5f5f5;
    transition: opacity 0.3s ease, background-color 0.3s ease;
}

.budget-product-item.is-purchased .budget-item-name-text {
    text-decoration: line-through;
    text-decoration-thickness: 1.5px;
}

/* --- Botón 'Comprar Aquí' --- */

.purchase-here-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 10px;
    width: 80%;
    margin-top: auto; 
    font-weight: 600;
    cursor: pointer;
    box-sizing: border-box;
    transition: all 0.15s ease-in-out;
    background-color: transparent;
    border: 1px solid #e0e0e0;
    color: #a0a0a0;
}

.purchase-here-btn:hover:not(.active) {
    border-color: #888;
    color: #333;
}

.purchase-here-btn.active {
    background-color: #f0e6ff;
    color: #4B0082;
    font-weight: 700;
    border: 1.25px solid #4B0082;
}

.purchase-marked-count {
    font-size: 10px;
    font-weight: 600;
    border-radius: 2px;
    padding: 1px 6px;
    margin-left: 5px;
    white-space: nowrap;
    color: #4B0082;
    border: 1px solid #4B0082;
    background-color: #f0e6ff;
}

/* --- 7.9. Budget Modal (Filters) --- */

.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;
    border-radius: 4px;
}

/* --- Estilo unificado para los Toggles de Filtro --- */
.budget-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background-color: transparent;
    border: none;
    padding: 8px 4px;
    margin-bottom: 4px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    color: #4B0082;
    text-align: left;
}

.budget-filter-header .toggle-icon {
    width: 18px;
    height: 18px;
    color: #8c78f0;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    flex-shrink: 0;
}

.budget-filter-header[aria-expanded="false"] .toggle-icon {
    transform: rotate(-90deg);
}

/* --- Contenedores y Animación de Listas --- */
.budget-filter-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), 
                opacity 0.3s ease-in-out,
                margin-top 0.4s ease,
                margin-bottom 0.4s ease;
    max-height: 500px;
    opacity: 1;
    margin-top: 8px;
    margin-bottom: 8px;
}

.budget-filter-list.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    margin-bottom: 0;
}

.budget-filter-list::-webkit-scrollbar {
    display: none;
}

.budget-filter-list {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.budget-filters-list-style .budget-filter-group li {
    margin: 0;
    padding: 0;
    flex-shrink: 0;
}

/* --- Estilos para los Botones de Filtro (Chips) --- */
.budget-filter-button {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    font-weight: 500;
    font-size: 10px;
    border: 1px solid #a4a4a488;
    background: transparent;
    color: #666;
    cursor: pointer;
    border-radius: 2px;
    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: 20px;
    padding: 1px 5px;
    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 la Cuadrícula de Filtro de Productos --- */
.budget-product-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 8px;
    flex-direction: row;
}

.budget-product-filter-item {
    background-color: transparent;
    border: 1px solid #ddd;
    display: flex;
    border-radius: 25px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
    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: 35px;
    height: 35px;
    object-fit: contain;
    border-radius: 4px;
}

.budget-product-filter-item.active {
    border: 1.2px solid #6a0dad;
    background-color: #8f7cc7;
}

.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;
}

/* --- 7.9. 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-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;
    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;
}

#main-budget-tab-content {
    padding-top: 0;
}

/* --- 7.10. Budget Modal (Tabs Price Drops) --- */

.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: 400;
    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: 500;
    color: black;
    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.9em;
    height: 0.9em;
    margin-left: 0px;
}

.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;
}

.price-drop-item .price-difference {
    color: #F33A6A;
    font-size: 9px;
    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;
    padding: 2px 4px;
    border: 1px solid #5D76A9;
    color: #5D76A9;
    border-radius: 3px;
    font-size: 0.8em;
    font-weight: 700;
    margin-top: -1px;
    vertical-align: middle;
    opacity: 0.6;
}

.lowest-price-badge .lowest-price-icon {
    width: 1em;
    height: 1em;
    margin-right: 2px;
    color: #5D76A9;
    vertical-align: middle;
    opacity: 0.6;
}

.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);
}


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;
}

/* --- Estilos para el Modal de Presupuesto --- */
.price-drop-subheader {
    font-size: 12px;
    font-weight: 500;
    color: #4a148c;
    margin-top: 20px;
    margin-bottom: 10px;
    padding-bottom: 5px;
    letter-spacing: 0.02em;
    border-bottom: 1px solid #e0e0e0;
    width: 100%;
}

.price-drop-subheader:first-child {
    margin-top: 5px;
}

.price-drops-list > .price-drop-subheader {
    grid-column: 1 / -1;
}


/* --- 8. General Action Button Styles (NEW GLOBAL CLASS) --- */
.main-action-button {
    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;
}

/* --- 9. Filters and Facets (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 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background-color: transparent;
    border: none;
    padding: 8px 4px;
    margin-top: 12px;
    border-top: 1px solid #f0f0f0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #4B0082;
    transition: background-color 0.2s ease;
    margin-bottom: 0;
}

.facet-container h3:hover {
    background-color: #f9f5fc;
}

.facet-container h3 .toggle-icon {
    width: 18px;
    height: 18px;
    color: #8c78f0;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.facet-container h3[aria-expanded="false"] .toggle-icon {
    transform: rotate(-90deg);
}

.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;
    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: 20px;
    position: relative;
}

.facet-container li button::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border: 1.2px solid #a0a0a0;
    border-radius: 20px;
    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 70%;
    background-size: 75%;
}

.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;
    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;
}

/* --- 9.1 Filters and Facets (Store Filter) --- */

.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;
    transition: all 0.2s ease-in-out;
    position: relative;
    overflow: visible !important;
}

.improved-badge {
    position: absolute;
    top: -11px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #10B981;
    color: white;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 8px;
    line-height: 1;
    border: 2px solid #ffffff; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); 
    z-index: 10;
    pointer-events: none;
    white-space: nowrap;
}

/* --- Ajuste para Modo Oscuro --- */
.dark-mode .improved-badge {
    background-color: #34D399;
    color: #064E3B;
    border-color: #282a2d; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.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 (Body) --- */
#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;
    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;
}

#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;
}

/* --- 16. Card Labels + Assets (Status) --- */

.product-status-label {
    display: inline-flex;
    align-items: center;
    padding: 3px 6px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    pointer-events: none;
    font-family: 'DM Sans', Courier, monospace;
    border-radius: 20px;
    letter-spacing: -0.02em;
}

.product-labels-container {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.product-status-label.status-nuevo {
    background-color: lightgreen;
    color: darkgreen;
}

.product-status-label.status-lanzamiento {
    background-color: #FFDC58;
    color: #71412C;
}

.product-status-label.status-preguntar-por {
  background-color: #4d3452;
  color: white;
}

.product-status-label:not(:first-child) {
    top: calc(10px + 1.8em);
}

/* --- 16.1. Card Labels + Assets (AI Label) --- */

.product-status-label.status-imagine-result {
  border: 1px solid #ab47bc;
  font-size: 11px;
  padding: 2px 4px;
  border-radius: 4px;
  color: #ab47bc;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  gap: 1px;
  background-color: transparent; 
}

.product-status-label.status-imagine-result svg {
  width: 1em;
  height: 1em;
  stroke-width: 3;
}

/* --- 16.3 Card Labels + Assets (External Link) --- */

.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: 3px;
    margin-bottom: -1px;
}

.store-info .store-link:hover {
    text-decoration: underline;
    color: #0056b3;
}

/* --- 16.4. Card Labels + Assets (Nutrition Styles) --- */

.extra-info-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.8rem;
    margin-top: 0.3rem;
    width: 100%;
}

.nutrition-block-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.18rem;
    margin-top: 0.35rem;
}

.nutrition-block {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.22rem;
    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.45em 0.3em;
    width: 6ch;
    min-width: 42px;
    max-width: 58px;
    min-height: 4.7em;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
    border: 1px solid #555555;
    font-size: 0.71rem;
    opacity: 0.75;
}

.nutrition-name {
    font-size: 0.75em;
    color: #555555;
    font-weight: 500;
    margin-bottom: 0.12em;
    line-height: 1;
}

.nutrition-value {
    font-size: 0.9em;
    font-weight: 700;
    color: #555555;
    margin: 0;
    line-height: 1;
}

.nutrition-unit-info {
    font-size: 0.6rem;
    font-weight: 500;
    color: #555555;
    margin-top: 0.12rem;
    line-height: 1.1;
    text-align: center;
    opacity: 0.8;
    width: 100%;
}

.ingredients-container {
    text-align: left;
    padding: 0 8px;
}

.ingredients-link {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px 8px;
    border-radius: 2px;
    background-color: #fdfcff;
    border: 1.25px solid #5e3b8a;
    color: #5e3b8a;
    font-size: 10px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.ingredients-icon {
    width: 1.3em;
    height: 1.3em;
    flex-shrink: 0;
}

.ingredients-link:hover {
    background-color: #f8f5fc;
    border-color: #b5a5d1;
}

/* --- 16.5. Card Labels + Assets (Fluoride Styles) --- */

.fluoride-info-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    margin-bottom: 8px;
}

.fluor-badge-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    text-align: center;
    font-size: 12px;
    line-height: 0.9;
    /*margin: 8px auto 8px auto;*/
    margin: 0;
    justify-content: center;
    letter-spacing: -0.05em;
    padding: 0 8px;
}

.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;
}

.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;*/
    margin: 0;
    color: #666666dd;
    line-height: 1.2;
    cursor: help;
    display: inline-block;
}

.product-title-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    margin-bottom: 5px;
    padding: 0 5px;
    box-sizing: border-box;
}

.product-title-container h2 {
    margin-bottom: 0;
}

/* --- 16.6. Card Labels + Assets (Price Per Unit) --- */

.store-price-per-unit {
    display: block;
    margin-top: 4px;
    font-size: 10px;
    font-weight: 600;
    color: #666666;
    opacity: 0.8;
    line-height: 1.2;
    white-space: nowrap;
}

.price-bs::after {
    content: attr(data-decimals);
    font-size: 0.75em;
    font-weight: 600;
    position: relative;
    top: -0.25em;
    margin-left: -0.5px;
}

.store-price-per-unit .price-bs::after {
    content: attr(data-decimals);
    font-size: inherit;
    font-weight: 600;
    position: static;
    top: auto;
    margin-left: 0;
    vertical-align: initial;
}

/* --- 16.7. Product Analysis Block (CORREGIDO Y MEJORADO) --- */

.product-analysis-block {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: center;
    gap: 8px 10px;
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background-color: transparent;
}

.analysis-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex-shrink: 0;
    padding: 0 5px;
    font-size: 12px;
    font-weight: 500;
    color: #212529;
}

.analysis-item span {
    display: block;
    margin-bottom: 3px;
    font-size: 9px;
    font-weight: 700;
    color: #495057;
}

.analysis-item strong {
    display: inline-flex !important;
    align-items: baseline;
}

.analysis-item strong .price-bs {
    font-size: 12px;
}

.analysis-item strong .price-bs::after {
    font-size: 0.8em;
    top: -0.25em;
    color: #212529;
}

/* --- 16.8. Card Labels + Assets (Best Value) --- */

/* === ESTILOS PARA BADGES DE PRODUCTO === */

.value-badge-container {
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
}

.value-badge {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
}

.value-badge.value-badge-good-value {
    background-color: #17a2b8;
    color: whitesmoke;
    padding: 4px 8px;
    border-radius: 2px;
}

.value-badge-container:not(:empty) {
    height: auto;
    margin: 5px 0 8px 0;
}

.value-price-highlight {
  display: inline;
  color: #17a2b8;
  font-weight: 900;
}

/* --- 16.9. Card Labels + Assets (Food Combos + Extras) --- */

.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;
}

/* --- 16.10. Toggles de Detalles del Producto (Análisis, Nutrición y Tiendas) --- */

.product-details-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px; 
    width: 100%;
}

.product-details-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    width: 100%;
    background-color: transparent;
    border: none;
    padding: 8px 4px;
    margin-top: 12px;
    border-top: 1px solid #f0f0f0;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    color: #6a0dad;
    transition: background-color 0.2s ease;
}

.product-details-toggle:hover {
    background-color: #f9f5fc;
}

.product-details-toggle .toggle-icon {
    width: 16px;
    height: 16px;
    color: #8c78f0;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.collapsible-container {
    display: grid;
    gap: 12px;
    overflow: hidden;
    /*transition: max-height 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), 
                opacity 0.3s ease-in-out,
                padding-top 0.4s ease,
                padding-bottom 0.4s ease,
                margin-top 0.4s ease;*/
    max-height: 500px;
    opacity: 1;
    padding-top: 8px;
    padding-bottom: 4px;
    margin-top: -8px;
}

/* --- ESTADOS COLAPSADOS --- */

/* Estilos para el bloque de Análisis colapsado */
body.analysis-collapsed .collapsible-analysis {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
}
body.analysis-collapsed .analysis-toggle {
    margin-bottom: -4px;
}
body.analysis-collapsed .analysis-toggle .toggle-icon {
    transform: rotate(-90deg);
}

/* Estilos para el bloque de Nutrición colapsado */
body.nutrition-collapsed .collapsible-nutrition {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
}
body.nutrition-collapsed .nutrition-toggle {
    margin-bottom: -4px;
}
body.nutrition-collapsed .nutrition-toggle .toggle-icon {
    transform: rotate(-90deg);
}

/* Estilos para el bloque de Tiendas colapsado */
body.stores-collapsed .collapsible-stores {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
}
body.stores-collapsed .stores-toggle {
    margin-bottom: -4px;
}
body.stores-collapsed .stores-toggle .toggle-icon {
    transform: rotate(-90deg);
}

/* --- 17. 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;
}

/* --- Visibility Control (Mr. Hyde) --- */
#products,
#pagination-controls {
    display: none;
    visibility: hidden;
    opacity: 0;
}

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 #products:has(.no-results) {
    display: block;
    text-align: center;
}

/* --- 18. Auth Modal --- */
:root {
    --auth-font-family: 'DM Sans', 'Century Gothic', 'Avenir', 'Avenir Next', 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;
    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: 600;
    letter-spacing: -0.02em;
    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;
}

/* --- 19. Profile Modal --- */

.user-auth-standalone-absolute {
    position: relative;
}

.user-profile-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: #f0f0f0;
    color: #333;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    user-select: none;
    border: 1px solid #e0e0e0;
}

.user-profile-icon:hover,
.user-profile-icon:focus {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    outline: none;
}

.user-profile-icon .initials {
    line-height: 1;
}

.profile-menu {
    position: absolute;
    top: calc(100% + 10px);
    width: 280px;
    background-color: #ffffff;
    color: #333333;
    border-radius: 12px;
    z-index: 1000;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}

.profile-menu.active {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0s;
}

.profile-menu-section {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.profile-menu-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.profile-menu-item,
.profile-menu-item-static {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 8px;
}

.profile-menu-item.editable {
    justify-content: space-between;
}

#profile-display-name {
    font-weight: 500;
    color: #111;
}

.profile-menu-item-static label {
    font-size: 12px;
    color: #888888;
    margin-bottom: 4px;
    display: block;
}

.readonly-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 8px;
}

#profile-username {
    word-break: break-all;
    color: #555;
    margin-right: 8px;
}

.copy-icon-btn:focus {
    outline: none;
}

.edit-icon-btn,
.copy-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.edit-icon-btn svg,
.copy-icon-btn svg {
    width: 18px;
    height: 18px;
    fill: #999;
    transition: fill 0.2s ease;
}

.edit-icon-btn:hover svg,
.copy-icon-btn:hover svg {
    fill: #111;
}

#display-name-edit {
    padding: 8px 12px;
}

#profile-display-name-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    background-color: #f9f9f9;
    color: #333;
    box-sizing: border-box; 
}

#profile-display-name-input:focus {
    outline: none;
    border-color: #888;
}

.edit-controls {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.profile-button {
    flex: 1;
    background-color: #4B0082;
    color: white;
    border: none;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s ease;
}

.profile-button:hover {
    background-color: #111;
}

.profile-button.secondary {
    background-color: white;
    color: #555;
    border: 1px solid #ccc;
    opacity: 0.8;
}

.profile-button.secondary:hover {
    color: #D32F2F;
    border: 1px solid #D32F2F;
}

.profile-menu-full-button {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    background: none;
    border: none;
    color: #333;
    text-align: left;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.profile-menu-full-button:hover {
    background-color: #f5f5f5;
}

.profile-menu-full-button svg {
    width: 20px;
    height: 20px;
    stroke: #555;
    fill: #555;
    flex-shrink: 0;
}

.profile-menu-full-button.logout {
    color: #D32F2F;
}

.profile-menu-full-button.logout svg {
    stroke: #D32F2F;
    fill: transparent;
}

.profile-menu-full-button.logout:hover {
    background-color: #FFEBEE;
}

.hidden {
    display: none !important;
}
.profile-message {
    font-size: 12px;
    margin-top: 4px;
    min-height: 18px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.profile-message.visible {
    opacity: 1;
}

.profile-message.error {
    color: #D32F2F;
}

.profile-message.success {
    color: #388E3C;
}

.copy-tooltip {
    position: fixed;
    background-color: #2c2c2c;
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    transform: translateY(5px) scale(0.95);
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
    
    pointer-events: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.copy-tooltip.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

#new-access-key-display {
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    background-color: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    word-break: break-all;
}

.profile-note {
    font-size: 12px;
    color: #888;
    margin-top: 8px;
}

/* --- 20. Tooltip --- */

.tooltip {
    position: absolute;
    z-index: 1100;
    background-color: #333;
    color: #fff;
    padding: 10px 15px;
    border-radius: 8px;
    max-width: 280px;
    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;
}

/* --- 21. Store Mode --- */

/* --- :root Variables (Sin cambios) --- */
:root {
    --schedule-font-size: 12px;
    --schedule-font-weight: 600;
    --schedule-line-height: 1.4;
    --schedule-icon-size: 12px;
    --schedule-gap: 4px;
    --status-open-color: #28a745;
    --status-closed-color: #dc3545;
    --status-24h-color: #28a745;
    --schedule-details-color: #6c757d;
}

/* 
==============================================
--- Bloques Refactorizados y Agrupados ---
==============================================
*/

/* --- A. Estilos Base para Tarjetas (Store & detail) --- */
.store-card,
.detail-card {
    display: flex;
    flex-direction: column;
    padding: 15px;
    border-radius: 8px;
    background-color: #fff;
    border: 1px solid #eceaf2;
}

.detail-card {
    background-color: #fdfcff;
    border-color: #f0f0f0;
}

/* --- B. Contenido Principal de Tarjetas (Store & detail) --- */
.store-card-content,
.detail-card-content {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}
.detail-card-content {
    gap: 12px;
}

/* --- C. Contenedores de Imágenes (Store & detail) --- */
.store-card-image-container,
.detail-card .store-card-image-container {
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
}

.store-card-image,
.detail-card .store-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- D. Contenedores de Atributos/Insignias (Store & detail) --- */
.store-card-attributes,
.detail-card .store-card-attributes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
    justify-content: flex-start;
}

/* --- E. Insignias de Atributos (Store & detail) --- */
.store-card .attribute-badge,
.detail-card .attribute-badge {
    background-color: #f0e6ff;
    color: #4B0082;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 500;
}

.detail-card .attribute-badge {
    text-transform: capitalize;
}

/* --- F. Bloques de Texto (Store & detail) --- */
.store-card-text-content,
.detail-info .store-card-text-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* --- G. Títulos con color principal --- */
.search-mode-option.active,
#store-details-modal .modal-header h2,
.city-header {
    color: #4B0082;
}
.search-mode-option {
     color: #4B0082;
}

/* Contenedor del título (h2/h4) ahora es un flexbox para alinear los spans */
.store-card-header h2,
.detail-info h4 {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    margin: 0;
}

/* Estilo para el nombre de la cadena (ej. "Farmatodo") */
.store-card__chain-name {
    font-size: 14px;
    font-weight: 600;
    color: #4B0082;
}

/* Estilo para el nombre de la sucursal (ej. "Los Palos Grandes") */
.store-card__detail-name {
    font-size: 12px;
    font-weight: 600;
    color: #777;
}

/* --- H. Estados Oculto/Visible para Elementos Flotantes --- */
.search-mode-dropdown,
#store-details-modal {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.search-mode-dropdown.visible,
#store-details-modal.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* --- Estilos Específicos por Componente ---*/

/* --- 21.1 Search Mode Dropdown --- */
.search-mode-selector {
    position: relative;
    display: flex;
    align-items: center;
}

.search-mode-trigger {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    line-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-mode-trigger:focus,
.search-mode-trigger:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

.search-mode-trigger .search-icon {
    width: 30px;
    height: 30px;
}

.search-mode-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #eee;
    z-index: 101;
    width: 150px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: none;
}

.search-mode-dropdown.visible {
    transform: translateX(-50%);
}

.search-mode-option {
    display: flex;
    align-items: center;
    gap: 2px;
    width: 100%;
    padding: 6px 8px;
    border: none;
    background-color: transparent;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.search-mode-option:hover {
    background-color: #f5f5f5;
}

.search-mode-option.active {
    background-color: #f0e6ff;
    font-weight: 700;
}

.search-mode-option svg {
    width: 16px;
    height: 16px;
    fill: transparent;
    flex-shrink: 0;
    transition: fill 0.2s ease;
    margin-bottom: 1px;
}

.search-mode-option[data-mode="products"] svg {
    height: 15px;
    width: 15px;
    transform: scaleX(-1);
}

/* --- 21.2 Contenedor y Tarjeta de Tienda --- */
#stores-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 10px 20px 20px 20px;
    align-items: start; 
    transition: opacity 0.1s ease-in-out; 
}

.store-card-image-container {
    width: 65px;
    height: 65px;
}

.store-card-info {
    flex-grow: 1;
    min-width: 0;
}

.store-card-header {
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

.store-card-header .location-icon-svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    margin-top: 2px;
    color: #887EA6; 
}

.store-card-header h2 {
    font-size: 14px;
    font-weight: 500;
    margin: 0;
    line-height: 1.3;
}

.store-card-address {
    font-size: 12px;
    color: #555;
    margin: 0;
    line-height: 1.4;
}

/* --- 21.3 Estilos de Horario de la Tienda --- */
.schedule-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 8px;
    font-size: var(--schedule-font-size);
    font-weight: var(--schedule-font-weight);
    line-height: var(--schedule-line-height);
    margin-left: 1.5px; 
}

.store-card-schedule {
    display: flex;
    align-items: flex-start;
    gap: var(--schedule-gap);
}

.store-card-schedule svg {
    width: var(--schedule-icon-size);
    height: var(--schedule-icon-size);
    flex-shrink: 0;
    margin-top: 2px;
}

.store-card-schedule-details {
    padding-left: calc(var(--schedule-icon-size) + var(--schedule-gap));
    color: var(--schedule-details-color);
}

.countdown-details {
    font-weight: 400;
    opacity: 0.8;
    margin-left: 2px;
}

.store-card-schedule.status-open { color: var(--status-open-color); }
.store-card-schedule.status-closed { color: var(--status-closed-color); }
.store-card-schedule.status-24h { color: var(--status-24h-color); }


/* --- 21.4 Estilos de Visibilidad por Modo --- */
body.search-mode-stores #products,
body.search-mode-stores #product-filters-wrapper {
    display: none;
}

body.search-mode-stores #stores-container,
body.search-mode-stores #store-filters-wrapper {
    display: block;
}

body.search-mode-stores #stores-container {
    display: grid;
    padding-top: 0;
}

body.search-mode-stores .filters-button {
    margin-bottom: 0;
}

body.search-mode-stores #search-results-message p {
    margin-top: 10px;
}

/* --- 21.5 Store detailes Modal --- */
#store-details-modal {
    display: none;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    padding: 20px;
    box-sizing: border-box;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

#store-details-modal.show {
    display: flex;
    transition-delay: 0s;
}

#store-details-modal .modal-content {
    position: relative;
    background-color: white;
    overflow-y: auto;
    height: auto;
    max-height: calc(100vh - 80px);
    width: 100%;
    max-width: 500px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.3s ease;
}

#store-details-modal.show .modal-content {
    transform: scale(1);
    opacity: 1;
}

#store-details-modal .modal-header {
    position: sticky;
    top: 0;
    background-color: #fff;
    z-index: 2;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

#store-details-modal .modal-header h2 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

#close-store-details-modal {
    font-size: 24px;
    font-weight: 200;
    color: #888;
    cursor: pointer;
    background-color: transparent;
    border: none;
    line-height: 0;
}

#store-details-modal .modal-body {
    padding: 10px 20px 20px 20px;
    overflow-y: auto;
}

.detail-group-city {
    margin-bottom: 20px;
}
.detail-group-city:last-child {
    margin-bottom: 0;
}
.city-header {
    font-size: 14px;
    font-weight: 600;
    padding-bottom: 8px;
    margin-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.municipio-group details {
    margin-bottom: 4px;
    border-left: 1px solid #e0e0e0;
    padding-left: 8px;
}
.municipio-group summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    padding: 8px 4px;
    list-style: none;
}
.municipio-group summary::-webkit-details-marker {
    display: none;
}
.municipio-group summary .toggle-icon {
    width: 18px;
    height: 18px;
    color: #8c78f0;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform: rotate(-90deg);
    flex-shrink: 0;
}
.municipio-group details[open] > summary .toggle-icon {
    transform: rotate(0deg);
}
.details-container {
    padding-top: 10px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.detail-card .store-card-image-container {
    width: 55px;
    height: 55px;
}

.detail-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.detail-info h4 {
    font-size: 13px;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}
.detail-info .schedule-wrapper {
    margin-top: 8px;
    font-size: 11px;
}

/* --- Efectos Hover --- */
ul.stores li.clickable {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
ul.stores li.clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

/* --- Estilo para el sufijo de la sucursal, ej: (plaza) --- */
.detail-card__suffix {
    display: inline-flex;
    align-items: center;
    background-color: transparent;
    color: #777;
    border: 1.5px solid #777;
    padding: 2px 5px;
    margin-bottom: 2.5px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    margin-left: 4px;
    text-transform: capitalize;
    vertical-align: middle;
    opacity: 0.8;
}

/* --- Estilo para el contador del municipio, ej: (1) --- */
.municipio-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #e0e0e0;
    color: #555;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 4px;
    line-height: 1;
    opacity: 0.8;
}

.municipio-group .summary-content {
    display: flex;
    align-items: center;
}

.municipio-icon {
    color: #4B0082;
    width: 18px;
    height: 18px;
    margin-right: 4px;
    flex-shrink: 0;
}

#store-details-modal .modal-header h2 {
    display: flex;
    align-items: center;
}

/* Estilo para la nueva etiqueta "BETA" */
.beta-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    margin-left: 10px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #A9A9A9;
    border: 1.5px solid #A9A9A9;
    background-color: transparent;
    border-radius: 8px;
    line-height: 1;
}

/* --- 21.6 Estilos para el Nivel "Zona" (Anidado) --- */

/* Contenedor del grupo de Zona, con indentación */
.zona-group {
    padding-left: 15px;
    margin-top: 5px;
    margin-bottom: 10px;
}

/* El <summary> de la Zona */
.zona-group summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    padding: 6px 4px;
    list-style: none;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}
.zona-group summary:hover {
    background-color: #f5f5f5;
}

.zona-group summary::-webkit-details-marker {
    display: none;
}

/* El contenido del <summary> de la Zona (texto + contador) */
.zona-group .summary-content {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* El contador de la Zona (reutiliza el estilo del de municipio) */
.zona-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f0f0;
    color: #666;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
}

/* La flecha del <summary> de la Zona */
.zona-group summary .toggle-icon {
    width: 16px;
    height: 16px;
    color: #aaa;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform: rotate(-90deg);
    flex-shrink: 0;
}
.zona-group details[open] > summary .toggle-icon {
    transform: rotate(0deg);
}

/* Contenedor de las tarjetas de sucursal dentro de la Zona */
.zona-group .details-container {
    padding-top: 10px;
    padding-left: 12px;
    border-left: 1px solid #f0f0f0;
    margin-left: 4px;
}

.municipio-group details[open] > .zona-group {
    border-left: none;
}

.municipio-group details[open] {
    padding-left: 4px;
}

/* --- 22. AI Overviews --- */

.ai-response-wrapper {
  display: flex;
  flex-direction: column;
}

#search-results-message .ai-disclaimer-message {
  margin: 0 0 0 0;
  font-size: 11px;
  color: rgba(76, 3, 128, 0.521);
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
}

#search-results-message .ai-overview-message {
    max-width: 600px;
    width: 100%;
    padding: 8px 16px;
    box-sizing: border-box;
    background-color: #f9f5fc;
    border-radius: 8px;
    border: 1.5px solid transparent; 
    background-image: 
    linear-gradient(#f9f5fc, #f9f5fc),
    linear-gradient(120deg, #4B0082, #A020F0, #2a0346);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    font-style: normal;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.4;
    color: #4B0082;
    text-align: left;
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInAiMessage 0.5s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

#search-results-message .ai-overview-message::before {
    content: url('data:image/svg+xml,<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.9996 7V11M9.9996 2V6M17.9996 16V20M2.9996 9H6.9996M7.9996 4H11.9996M15.9996 18H19.9996M13.9996 7L16.828 9.82843M19.5162 3.74612L20.0819 4.3118C20.4779 4.70782 20.6759 4.90583 20.7501 5.13416C20.8154 5.335 20.8154 5.55135 20.7501 5.75219C20.6759 5.98052 20.4779 6.17853 20.0819 6.57454L6.52508 20.1314C6.12906 20.5274 5.93105 20.7254 5.70272 20.7996C5.50188 20.8649 5.28553 20.8649 5.08469 20.7996C4.85636 20.7254 4.65835 20.5274 4.26234 20.1314L3.69665 19.5657C3.30063 19.1697 3.10262 18.9717 3.02844 18.7433C2.96318 18.5425 2.96318 18.3262 3.02844 18.1253C3.10262 17.897 3.30063 17.699 3.69665 17.303L17.2535 3.74612C17.6495 3.3501 17.8475 3.15209 18.0758 3.0779C18.2767 3.01265 18.493 3.01265 18.6939 3.0779C18.9222 3.15209 19.1202 3.3501 19.5162 3.74612Z" stroke="%234B0082" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"></path></svg>');
    display: block;
    width: 1.25em;
    height: 1.25em;
    flex-shrink: 0;
    align-self: flex-start;
    transform: translateY(2px);
}

@keyframes fadeInAiMessage {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- 23. Image Slider Styles (CORREGIDO) --- */

.image-slider-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
}

.slider-wrapper {
    display: flex;
    width: 200%;
    height: 100%;
    transition: none;
}

.slider-item {
    width: 50%;
    height: 100%;
    flex-shrink: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-item img {
    width: 100%;
    height: 100%;
    margin-top: 15px;
    object-fit: contain;
    display: block;
}

/* --- Botones de Navegación del Slider --- */
.slider-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.3);
    color: white;
    border: none;
    padding: 8px 6px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    opacity: 0.25;
    transition: opacity 0.3s ease, background-color 0.3s ease;
    line-height: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-slider-container:hover .slider-nav-btn {
    opacity: 1;
}

.slider-nav-btn:hover {
    background-color: rgba(0, 0, 0, 0.6);
}

.slider-nav-btn.prev {
    left: 8px;
}

.slider-nav-btn.next {
    right: 8px;
}

/* --- Etiquetas de Status (Nuevo/Viejo Look) --- */
.image-status-label {
    position: absolute;
    top: 0px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 900;
    color: white;
    pointer-events: none;
    z-index: 5;
}

.status-nuevo-look {
    background-color: #10B981; /* Verde para "Nuevo" */
}

.status-viejo-look {
    background-color: #6c757d; /* Gris para "Viejo" */
}

.price .price-range {
    font-size: 0.8em;
}

.stores li.is-price-range {
  opacity: 0.45;
}

/* --- 24. PRICE SLIDER STYLES  --- */

#price-filter-container .native-slider-container {
    padding: 20px 8px 10px 8px;
    position: relative;
}

#price-filter-container .native-slider-values {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #4B0082;
    font-weight: 600;
    margin-bottom: 15px;
}

#price-filter-container .native-slider-inputs {
    position: relative;
    height: 14px;
    display: flex;
    align-items: center;
}

#price-filter-container input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
    width: 100%;
    position: absolute;
    left: 0;
    margin: 0;
    pointer-events: none; 
}

#price-filter-container input[type="range"]::-webkit-slider-thumb {
    pointer-events: auto;
}
#price-filter-container input[type="range"]::-moz-range-thumb {
    pointer-events: auto;
}

#price-filter-container input[type="range"]#price-slider-min {
    z-index: 1;
}
#price-filter-container input[type="range"]#price-slider-max {
    z-index: 2;
}

/* Estilo de la barra (track) */
#price-filter-container input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: #e0d1f5;
    border-radius: 2px;
}

#price-filter-container input[type="range"]#price-slider-max::-webkit-slider-runnable-track {
    background: transparent;
}

/* (thumb)  */
#price-filter-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    margin-top: -6px;
    width: 14px;
    height: 14px;
    background: #4B0082;
    border-radius: 50%;
    border: none;
    transition: transform 0.2s ease;
}

#price-filter-container input[type="range"]:active::-webkit-slider-thumb {
    transform: scale(1.15);
}

#price-filter-container input[type="range"]:focus,
#price-filter-container input[type="range"]:focus-visible {
    outline: none;
}

/*DARK MODE STYLES*/

#theme-toggle-btn .moon { display: none;}
#theme-toggle-btn .sun { display: block; fill: none; }

.dark-mode {
    background-color: #202124;
    color: #a0a0a0;

    #theme-toggle-btn .moon { display: block; }
    #theme-toggle-btn .sun { display: none; }

    .tooltip {
        border: 0.5px solid #444;
    }
    .error-message {
        background-color: rgba(255, 77, 77, 0.15);
        color: #ff8a80;
        border-color: rgba(255, 77, 77, 0.4);
    }
    
    .purple-text {
        color: #c39eff;
        strong, b {
        color: #c39eff;
      }
    }
    
    .main-tagline {
        background-image: linear-gradient(to right, #c39eff 0%, #a020f0 50%, #e1c0ff 100%);
    }
    .search-background {
        background-color: transparent;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border-bottom: 1px solid #3c4043;
    }
    #search-input-field::placeholder {
        color: #a0a0a0;
        opacity: 0.8;
    }
    #search-input-field {
        color: #e0e0e0;
    }
    .search-wrapper {
        background: #303134;
        border: 1px solid #5f6368;
        .search-icon {
            filter: brightness(0) invert(1) opacity(0.4);
        }
        &:focus-within {
            border-color: #c39eff;
            box-shadow: 0 5px 25px rgba(0, 0, 0, 0.4);
        }
    }
    .search-reset-button {
        color: #a0a0a0;
    }
    .currency-toggle-button-searchbar {
        background-color: transparent;
        border: 1px solid #5f6368;
        color: #a0a0a0;
        &:hover {
            color: #c39eff;
            border-color: #c39eff;
        }
    }
    .search-buttons button {
        border: 1px solid #5f6368;
        background-color: #303134;
        color: #a0a0a0;
        .search-button-icon {
            stroke: #a0a0a0;
        }
        &.active, &:focus {
            color: #c39eff;
            border-color: #c39eff;
            .search-button-icon {
                stroke: #c39eff;
            }
        }
    }
    .search-button-placeholder {
        border-color: #5f636888;
        color: #a0a0a066;
    }
    .search-buttons-wrapper {
        &::before {
            background: linear-gradient(to right, rgba(32, 33, 36, 1) 0%, rgba(32, 33, 36, 0.8) 40%, rgba(32, 33, 36, 0) 100%);
        }
        &::after {
            background: linear-gradient(to left, rgba(32, 33, 36, 1) 0%, rgba(32, 33, 36, 0.8) 40%, rgba(32, 33, 36, 0) 100%);
        }
    }
    .edit-searches-btn {
        color: #a0a0a0;

    .edit-trigger {
        color: #c39eff;
    }

    &:hover {
        color: #c39eff;

    .edit-trigger {
        color: #c39eff;
      }
    }

    &.is-editing {
        color: #c39eff;

    &:hover {
        color: #ffffff;
      }
    }
  }

    .remove-search-btn {
        color: #888;
        &:hover {
        color: #ff8a80;
        }
    }

    .add-search-btn {
        color: #c39eff;
        border-color: #5f6368 !important;
    }

    .search-buttons-wrapper.is-editing .search-buttons button > span {
        text-decoration-color: #9e78f0;
    }

    .main-action-button {
        background-color: #303134;
        border-color: #5f6368;
        color: #e0e0e0;
        box-shadow: none;

        &:hover, &:focus {
            background-color: #3c4043;
            border-color: #c39eff;
            color: #c39eff;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        }
    }
    .product {
        background-color: #282a2d;
        border: 1px solid #3c4043;
    }
    .product h2 {
        color: #e0e0e0;
    }
    .copy-product-button {
        color: #a0a0a0;
        &:hover {
            color: #c39eff;
        }
    }

    .details-indicator-icon {
        color: #888;
    }


    ul.stores li {
        border: 1.25px solid #3c4043;
        background-color: #303134;
        .store-info > a.store-link,
        .store-info > span.store-name {
            color: #ccc1da;
        }
        .price {
            color: #f0f0f0;
        }
    }

    ul.stores li.clickable:hover .details-indicator-icon {
    color: #c39eff;
    }
    
    ul.stores li.highlighted-store .details-indicator-icon {
    color: #e0e0e0;
    opacity: 0.8;
    }
    
    .stores li.highlighted-store {
        background-color: #3a2d44;
        border-color: #c39eff; 
    }
    .stores li .store-name {
        color: #c39eff !important;
    }
                
    .store-link {
        color: #c39eff !important;
        font-weight: 600 !important;
                    
    svg {
        stroke: #c39eff !important;
            }
        }
    
    .store-price-per-unit {
        color: #a0a0a0;
    }
    .no-results {
        color: #c39eff;
    }
    .status-nuevo-look {
        background-color: #34D399;
        color: #202124;
    }
    .status-viejo-look {
        background-color: #5f6368;
        color: #e0e0e0;
    }
    .add-to-budget {
        background-color: transparent;
        color: #c39eff;
        border: 1.35px solid #c39eff;
        &:hover {
            background-color: #3a2d44;
        }
        &:active {
            background-color: #c39eff;
            color: #202124;
            border-color: #c39eff;
        }
    }
    #open-budget-modal {
        background-color: transparent;
        color: #f0f0f0;
        border: 1px solid #5f6368;
    }
    .budget-item-counter.no-items {
        color: #a0a0a0;
        background-color: #4a3d55;
    }
    #budget-modal {
        background-color: rgba(0, 0, 0, 0.8);
        .modal-content {
            background-color: #282a2d;
            border: 1px solid #5f6368;
        }
        .modal-header {
            background-color: #282a2d;
            border-bottom: 1px solid #3c4043;
            h2#budget-modal-title {
                color: #c39eff;
            }
        }
        #close-budget-modal {
            color: #a0a0a0;
            &:hover {
                color: #c39eff;
                background-color: rgba(195, 158, 255, 0.1);
            }
        }
        .budget-explanation {
            color: #a0a0a0;
            strong {
                color: #e0e0e0;
            }
        }
    }
    #modal-currency-toggle-btn {
        border: 1px solid #5f6368;
        color: #a0a0a0;
        &:hover {
            border-color: #c39eff;
            color: #c39eff;
        }
    }
    .budget-filters.budget-filters-list-style {
        border-top: 1px solid #3c4043;
        border-bottom: 1px solid #3c4043;
        background-color: #202124;
    }

    .budget-filter-header {
        color: #c39eff;
        border-bottom-color: #3c4043;
        .toggle-icon {
            color: #c39eff;
        }
    }
    /*.budget-filters-list-style .budget-filter-group::after {
        background: linear-gradient(to bottom, rgba(32, 33, 36, 0), rgba(32, 33, 36, 1) 80%);
    }*/
    .budget-filter-button {
        background: transparent;
        border: 1px solid #c39eff;
        color: #c39eff;

        .budget-filter-count { 
            background-color: transparent;
            border: 1px solid #c39eff;
            color: #c39eff;
        }

        &.active, &:hover {
            background-color: #c39eff;
            color: #202124;

            .budget-filter-count {
                background-color: #202124;
                border-color: #202124;
                color: #c39eff;
            }
        }
    }
    .budget-tabs {
        border-bottom: 1px solid #3c4043;
        .tab-button {
            color: #a0a0a0;
            &:hover:not(.active) {
                color: #c39eff;
            }
            &.active {
                color: #c39eff;
                border-bottom: 1.5px solid #c39eff;
            }
        }
    }
    #budget-list > li {
        background-color: #202124;
        > .budget-store-header {
            background-color: #202124;
            border-bottom: 1px solid #3c4043;
            .budget-store-header-content {
                .store-name {
                    color: #a0a0a0;
                }
                .total-label {
                    color: #a0a0a0;
                }
                .price-total {
                    color: #c39eff;
                    font-weight: bold;
                }
            }
            .toggle-icon {
                color: #c39eff;
            }
        }
        > ul > li.budget-product-item {
            background-color: #282a2d;
            border: 1px solid #3c4043;
            color: #e0e0e0;
        }
    }
    .store-product-count {
        color: #a0a0a0;
        border-color: #a0a0a0;
        opacity: 0.8;
    }
    .budget-product-item {
        .budget-item-name, .budget-item-subtotal {
            color: #e0e0e0;
        }
        .budget-item-quantity-prefix {
            color: #c39eff;
            font-weight: 700;
        }
        .quantity-input {
            border: 1px solid #5f6368;
            color: #e0e0e0;
            background-color: #303134;
        }
        .quantity-btn {
            background-color: transparent;
            border: 1px solid #c39eff;
            color: #c39eff;
            font-weight: bold;
            &:hover {
                background-color: rgba(195, 158, 255, 0.1);
                border-color: #c39eff;
                color: #c39eff;
            }
        }
    }
    /* --- Dark Mode Styles for Purchase Toggle --- */
    .purchase-toggle-button {
        background-color: transparent;
        border-color: #ff4d4d;
        color: #ff4d4d;

        &:hover {
            background-color: #ff4d4d;
            color: #202124;
        }

        &.active {
            background-color: #50C878;
            border-color: #50C878;
            color: #202124;
        }
    }

    .budget-product-item.is-purchased {
        opacity: 0.5;
        background-color: #202124;

    .budget-item-name-text {
        text-decoration-color: #ff4d4d;
    }
  }
    .purchase-here-btn {
        border-color: #5f6368;
        color: #a0a0a0;
    }

    .purchase-here-btn:hover:not(.active) {
        border-color: #c39eff;
        color: #c39eff;
    }

    .purchase-here-btn.active {
        background-color: #3a2d44;
        color: #c39eff;
        border-color: #c39eff;
    }
    .purchase-marked-count {
        color: #c39eff;
        border-color: #c39eff;
        background-color: #3a2d44;
    }

    .filters-menu {
        background: #282a2d;
    }
    #overlay {
        background: rgba(0, 0, 0, 0.8);
    }
    .filters-header {
        border-bottom: 1px solid #3c4043;
        h2 { color: #e0e0e0; }
        button#close-filters {
            color: #a0a0a0;
            &:hover { color: #e0e0e0; }
        }
    }
    .facet-container h3 {
        border-top: 1px solid #3c4043;
        color: #c39eff;
        &:hover { background-color: #3c4043; }
    }
    .store-mode-button {
        border: 1.5px solid #3c4043;
        background-color: #282a2d;
        color: #a0a0a0;
        &:hover:not(.active) {
            border-color: #5f6368;
            color: #c39eff;
            background-color: #3c4043;
        }
        &.active {
            background-color: #c39eff;
            color: #202124;
            border-color: #c39eff;
        }
    }
    footer {
        background-color: #282a2d;
        border-top: 1px solid #3c4043;
        p { color: #a0a0a0; }
        .instagram-icon {
            filter: invert(0.8);
        }
    }
    ::-webkit-scrollbar-thumb {
        background-color: #555;
        border: 1.5px solid #202124;
    }
    ::-webkit-scrollbar-thumb:hover {
        background-color: #777;
    }
    * {
        scrollbar-color: #555 #202124;
    }
    .pagination-container button {
        background-color: #282a2d;
        border: 1px solid #5f6368;
        color: #c39eff;
        &:hover:not(:disabled):not(.active) {
            background-color: #3c4043;
            border-color: #5f6368;
        }
        &.active {
            background-color: #c39eff;
            color: #202124;
            border-color: #c39eff;
        }
    }
    #search-results-message {
        p {
            color: #a0a0a0;
            strong {
                color: #e0e0e0;
            }
        }
        .ai-disclaimer-message {
            color: rgba(195, 158, 255, 0.521);
        }
        .ai-overview-message {
            background-color: #3a2d44;
            background-image: linear-gradient(#3a2d44, #3a2d44), linear-gradient(120deg, #c39eff, #a020f0, #4a3d55);
            color: #e0e0e0;
            &::before {
                content: url('data:image/svg+xml,<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.9996 7V11M9.9996 2V6M17.9996 16V20M2.9996 9H6.9996M7.9996 4H11.9996M15.9996 18H19.9996M13.9996 7L16.828 9.82843M19.5162 3.74612L20.0819 4.3118C20.4779 4.70782 20.6759 4.90583 20.7501 5.13416C20.8154 5.335 20.8154 5.55135 20.7501 5.75219C20.6759 5.98052 20.4779 6.17853 20.0819 6.57454L6.52508 20.1314C6.12906 20.5274 5.93105 20.7254 5.70272 20.7996C5.50188 20.8649 5.28553 20.8649 5.08469 20.7996C4.85636 20.7254 4.65835 20.5274 4.26234 20.1314L3.69665 19.5657C3.30063 19.1697 3.10262 18.9717 3.02844 18.7433C2.96318 18.5425 2.96318 18.3262 3.02844 18.1253C3.10262 17.897 3.30063 17.699 3.69665 17.303L17.2535 3.74612C17.6495 3.3501 17.8475 3.15209 18.0758 3.0779C18.2767 3.01265 18.493 3.01265 18.6939 3.0779C18.9222 3.15209 19.1202 3.3501 19.5162 3.74612Z" stroke="%23c39eff" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"></path></svg>');
            }
        }
    }
    .product-status-label.status-imagine-result {
        color: #c39eff;
        border-color: #c39eff;
        background-color: rgba(195, 158, 255, 0.1);
    }
    .product-details-toggle {
        color: #e0e0e0;
        border-top: 1px solid #887EA6;
        &:hover {
            background-color: #3c4043;
        }
        .toggle-icon {
            color: #9e78f0;
        }
    }
    .product-analysis-block {
        border-color: #3c4043;
    }
    .analysis-item {
        color: #e0e0e0;
        span {
            color: #a0a0a0;
        }
    }
    .analysis-item strong .price-bs {
        color: #e0e0e0;

        &::after {
            color: #e0e0e0;
        }
    }

    .nutrition-item-shape {
    border-color: #a0a0a0;
    }
    .nutrition-name,
    .nutrition-unit-info {
        color: #a0a0a0;
    }
    .nutrition-value {
        color: #fff;
    }

    .ingredients-link {
        background-color: transparent;
        border-color: #a0a0a0;
        color: #a0a0a0;

        &:hover {
        background-color: rgba(195, 158, 255, 0.1);
        border-color: #c39eff;
        color: #c39eff;
        }
    }
    .value-badge.value-badge-good-value {
        background-color: darkslategray;
        color: #17a2b8;
        border: 1px solid #17a2b8;
    }
    .value-price-highlight {
        display: inline;
        color: #79D9D9;
    }
    .product .product-name-ppm {
        background-color: rgba(195, 158, 255, 0.1);
        border-color: #9e78f0;
        color: #c39eff;
    }
    .fluor-badge-recommended {
        color: #9e78f0;

        .fluor-badge-icon {
            color: #9e78f0;
            }
        }
    .fluor-badge-no-info {
        color: #ff7d7d;

        .fluor-badge-icon {
            color: #ff7d7d;
        }
    }
    .price-drop-percentage {
        background-color: #FFDC58;
        color: black;
    }
    .price-drop-item {
        background-color: #282a2d;
        border-color: #3c4043;
    }
    .price-drop-name, .price-drop-store {
        color: #e0e0e0;
    }
    .lowest-price-badge {
        background-color: transparent;
        border-color: #c39eff;
        color: #c39eff;
        .lowest-price-icon {
            color: #c39eff;
        }
    }
    .price-drop-subheader {
        color: #c39eff;
        border-bottom-color: #3c4043;
    }
    .budget-filter-button,
    .filter-badge {
        background: transparent;
        border-color: #c39eff;
        color: #c39eff;
        &.active, &:focus {
            background-color: #c39eff;
            color: #202124;
        }
    }
    .filter-badge .remove-filter {
        color: #c39eff;
        opacity: 0.8;
        &:hover {
            color: #f0f0f0;
            opacity: 1;
        }
    }

    #price-filter-container .native-slider-values {
        color: #c39eff;
    }

    #price-filter-container input[type="range"]::-webkit-slider-runnable-track {
        background: #3a2d44;
    }

    #price-filter-container input[type="range"]::-webkit-slider-thumb {
        background: #c39eff;
    }

    .facet-container li button {
        color: #a0a0a0;

        .facet-count {
            background-color: transparent;
            border: 1px solid #c39eff;
            color: #c39eff;
        }

        &::before {
            border-color: #c39eff;
            background-color: transparent;
        }

        &.active {
            color: #e0e0e0;
            font-weight: 600;

            .facet-count {
                background-color: #c39eff;
                border-color: #c39eff;
                color: #202124;
                font-weight: 600;
            }

            &::before {
                background-color: #c39eff;
                border-color: #c39eff;
                background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23282a2d' 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");
            }
        }

        &:hover:not(.active) {
            color: #e0e0e0;
        }
    }
    .profile-menu {
        background-color: #282a2d;
        border-color: #3c4043;
        color: #a0a0a0;

        .profile-menu-section {
            border-bottom-color: #3c4043;
        }

        #profile-display-name, #profile-username {
            color: #e0e0e0;
        }

        .edit-icon-btn svg, .copy-icon-btn svg {
            fill: #a0a0a0;
            &:hover {
                fill: #e0e0e0;
            }
        }

        #display-name-edit {
            padding-bottom: 8px;
        }

        #profile-display-name-input {
            background-color: #303134;
            border-color: #5f6368;
            color: #e0e0e0;
            &:focus {
                border-color: #c39eff;
                background-color: #282a2d;
            }
        }

        .profile-button {
            background-color: #c39eff;
            color: #202124;
            &:hover {
                background-color: #e0e0e0;
            }
            &.secondary {
                background-color: transparent;
                color: #a0a0a0;
                border-color: #5f6368;
                &:hover {
                    color: #e0e0e0;
                    border-color: #a0a0a0;
                }
            }
        }

        .profile-menu-full-button {
            color: #e0e0e0;
            &:hover {
                background-color: #3c4043;
            }
            svg {
            stroke: #e0e0e0;
            }
            &.logout {
                color: #ff4d4d;
                svg {
                    stroke: #ff4d4d;
                }
                &:hover {
                    background-color: rgba(255, 77, 77, 0.1);
                }
            }
        }
    }
    .search-mode-dropdown {
        background-color: #282a2d;
        border-color: #3c4043;
    }
    .search-mode-option {
        color: #e0e0e0;
        svg {
            fill: #e0e0e0;
            opacity: 0.8
        }
        &:hover {
            background-color: #3c4043;
        }
        &.active {
            color: #c39eff;
            background-color: #3a2d44;
            svg {
                fill: #c39eff;
            }
        }
    }
        #auth-modal {
        background-color: #282a2d;
        border: 1px solid #3c4043;

        #auth-modal-title {
            color: #e0e0e0;
        }

        #close-auth-modal {
            color: #a0a0a0;
            &:hover {
                background-color: #3c4043;
                color: #e0e0e0;
            }
        }

        p, .auth-switch-text {
            color: #a0a0a0;
        }

        .link-button {
            color: #c39eff;
            &:hover {
                color: #e0e0e0;
                border-bottom-color: #e0e0e0;
            }
        }

        input[type="text"], input[type="password"] {
            background-color: #303134;
            border-color: #5f6368;
            color: #e0e0e0;
            &:focus {
                border-color: #c39eff;
                background-color: #282a2d;
            }
        }

        .auth-button {
            background-color: #c39eff;
            color: #202124;
            &:hover {
                background-color: #e0e0e0;
            }
        }
    }

    /* --- ESTILOS PARA TARJETAS DE TIENDAS Y SUCURSALES --- */
    .store-card,
    #store-details-modal .detail-card {
        background-color: #282a2d;
        border-color: #3c4043;

        .store-card__chain-name {
            color: #c39eff;
        }

        .store-card__detail-name {
            color: #a0a0a0;
        }

        .store-card-address {
            color: #a0a0a0;
        }

        .detail-card__suffix {
            background-color: transparent;
            color: #a0a0a0;
            border: 1px solid #a0a0a0;
        }

        .schedule-wrapper {
            .store-card-schedule {
                &.status-open,
                &.status-24h {
                    color: #50C878;
                }
                &.status-closed {
                    color: #ff4d4d;
                }
            }
            .store-card-schedule-details {
                color: #a0a0a0;
            }
        }

        .store-card-attributes {
            border-top-color: #3c4043;
        }

        .attribute-badge {
            background-color: #3a2d44;
            color: #c39eff;
        }
    }

    /* --- ESTILOS ESPECÍFICOS DEL MODAL DE SUCURSALES Y SUS ELEMENTOS --- */
    #store-details-modal {
        .modal-content {
            background-color: #282a2d;
            border: 1px solid #3c4043;
        }

        .modal-header {
            background-color: #282a2d;
            border-bottom-color: #3c4043;

            h2 {
                color: #c39eff;
            }
        }

        #close-store-details-modal {
            color: #a0a0a0;
        }
        
        .beta-badge {
            color: #777;
            border-color: #777;
        }

        .city-header {
            color: #c39eff;
            border-bottom-color: #3c4043;
        }

        .municipio-group {
            details {
                border-left-color: #5f6368;
            }
            summary {
                color: #e0e0e0;
            }
        }

        /* INICIO DE LA CORRECCIÓN */
        .municipio-icon {
            color: #c39eff;
        }
        .municipio-count {
            background-color: #3c4043;
            color: #e0e0e0;
        }
        
        .zona-group summary {
            color: #c0c0c0;
            &:hover {
                background-color: #3c4043;
            }
        }

        .zona-count {
            background-color: #3c4043;
            color: #a0a0a0;
        }

        .zona-group .details-container {
            border-left-color: #5f6368;
        }
    }

    ul.stores li.clickable:hover {
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    }
}
/* --- 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) {

    :root {
        --schedule-font-size: 12px;
        --schedule-gap: 5px;
        --schedule-icon-size: 13px;
    }

    /* --- Home Mobile --- */

    .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;
    }

    /* --- Serach Buttons Mobile --- */

    .search-buttons {
        display: inline-flex;
        justify-content: flex-start;
        max-width: 100%;
        box-sizing: border-box;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 10px;
        -ms-overflow-style: none;
        scrollbar-width: none;
        margin-bottom: 20px; 
        padding-left: 20px;
        padding-right: 20px;
        padding-top: 2px;
    }
    
    .search-buttons button {
        font-size: 12px;
        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%);
    }

    .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%);
    }

    /* --- Result Message + Bubble Mobile --- */
    body.results-active #search-results-message {
        display: block;
        margin-top: 10px;
        margin-bottom: 5px;
        padding: 2px 10px;
        font-size: 14px;
    }

    body.results-active #search-results-message p {
        font-size: 12px;
        margin-top: 5px;
    }

    .floating-bubble {
        font-size: 14px;
        padding: 10px 20px;
        z-index: 1050;
    }

    body.results-active #search-results-message .ai-overview-message {
        width: 90%;
        font-size: 12px;
        margin: 10px 20px 10px 20px;
    }

    body.results-active #search-results-message .ai-disclaimer-message {
        font-size: 8px;
        letter-spacing: 0;
        margin-top: -10px;
    }

    /* --- (Store Mode Mobile) --- */

    /* --- A. Estilos Agrupados para Móvil --- */

    /* Insignias en ambas tarjetas (comparten padding) */
    .store-card .attribute-badge,
    .detail-card .attribute-badge {
        padding: 3px 8px;
    }

    /* --- Estilos Específicos por Componente ---*/

    /* --- 1. Search Mode Dropdown --- */
    .search-mode-dropdown {
        width: 120px;
        padding: 6px;
        gap: 2px;
        top: calc(100% + 12px);
        left: 50px;
        z-index: 1002;
        border-radius: 6px;
    }

    .search-mode-dropdown.visible {
        transform: translateX(-50%);
    }

    .search-mode-option {
        padding: 4px 7px;
        font-size: 10px;
        gap: 2px;
    }

    /* Se aplica a todos los SVGs dentro de la opción, eliminando la necesidad de una regla duplicada */
    .search-mode-option svg {
        width: 13px;
        height: 13px;
    }

    /* --- 2. Contenedor Principal de Tiendas --- */
    body.search-mode-stores.results-active #search-results-message {
        min-height: 2em;
        margin-top: 8px;
        margin-bottom: 0;
    }

    body.search-mode-stores .mobile-action-buttons {
        margin-top: 8px;
    }

    /* --- 3. Tarjeta de Tienda (Store Card) --- */
    .store-card__chain-name {
        font-size: 12px;
    }

    .store-card__detail-name {
        font-size: 11px;
    }

    .store-card-address {
        font-size: 10px;
    }

    .detail-card .attribute-badge {
        font-size: 10px; 
    }

    .store-card-header .location-icon-svg {
        width: 12.5px;
        height: 12.5px;
        margin-top: 1px;
    }

    .store-card .attribute-badge {
        font-size: 10px;
    }

    .schedule-wrapper {
        font-size: 11px;
    }
    .store-card-schedule svg {
        height: 12.5px;
        width: 12.5px;
        margin-top: 1.25px;
    }   
    /* --- 4. Modal de Sucursales (detailes Modal) --- */
    #store-details-modal .modal-body {
        padding: 8px 15px 15px 15px;
    }

    .city-header {
        font-size: 13px;
        padding-bottom: 6px;
        margin-bottom: 8px;
    }

    .municipio-group summary {
        font-size: 13px;
    }

    .municipio-count {
        font-size: 9px;
        padding: 1px 6px;
    }

    .details-container {
        gap: 10px;
    }

    .detail-card {
        padding: 12px;
        gap: 10px;
    }

    .detail-card .store-card-image-container {
        width: 45px;
        height: 45px;
    }

    .detail-info h4 {
        font-size: 12px;
    }

    #store-details-modal .modal-header h2 {
        font-size: 14px;
    }
    .zona-group summary {
        font-size: 11px;
    }
    .beta-badge {
        font-size: 9px;
        padding: 1px 6px;
        margin-left: 8px;
    }

    .detail-card__suffix {
        font-size: 8px;
        padding: 2px 5px;
        margin-left: 2px;
    }

    /* --- User Profile Mobile --- */
    .auth-button-simple {
        margin-top: 8px;
        margin-right: 6px;
    }

    .user-profile-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
        margin-top: 8px;
        margin-right: 12px;
    }
    
    .profile-menu {
        position: fixed;
        width: 80vw;
        max-width: 300px;
        left: 50%;
        top: 135px;
        transform: translateX(-50%) translateY(-10px);
    }

    .profile-menu.active {
        transform: translateX(-50%) translateY(0);
    }

    /* --- Searchbar and Header Mobile --- */

    .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: 3px 6px;
        font-size: 9px;
    }

    .currency-toggle-button-searchbar svg {
        width: 12px;
        height: 12px;
    }

    .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: 15px;
        height: 23px;
        width: 23px;
    }

    #searchbox {
        width: 90%;
        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: 14px;
        max-height: 30px;
        padding-left: 45px;
        padding-top: 2px;
    }

    #search-input-field.multi-line {
        font-size: 12px;
        line-height: 1;
    }

    .search-reset-button {
        right: 55px;
        font-size: 30px;
        }

    /* --- Budget Modal Mobile --- */

    #open-budget-modal-wrapper {
        position: static;
        width: 100%;
        text-align: center;
        padding: 0;
        margin-top: 1px;
    }

    #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 Modal Tabs Mobile --- */

    .budget-tabs {
        margin-left: 2px;
        margin-right: 2px;
        padding-top: 3px;
    }

    .budget-tabs .tab-button {
        padding: 8px 10px;
        font-size: 11px;
        gap: 4px;
    }

    .budget-tabs .tab-button.active {
        font-size: 11.5px;
    }

    .tab-count {
        font-size: 9px;
        padding: 1px 5px;
    }

    .tab-content {
        padding: 8px 10px;
        padding-bottom: 15px;
    }

    #budget-modal {
        align-items: flex-end;
        padding: 0;
    }

    #budget-modal .modal-content {
        width: 100%;
        max-width: 100%; 
        height: 60vh;
        min-height: 20vh;
        max-height: 95vh;
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
        transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    }

    #budget-modal.show .modal-content {
        transform: translateY(0);
    }
    
    .resize-handle {
        width: 40px;
        height: 5px;
        background-color: #d0d0d0;
        border-radius: 2.5px;
        margin: 8px auto;
        cursor: grab;
        flex-shrink: 0;
    }

    .dark-mode .resize-handle {
        background-color: #5f6368;
    }

    #budget-modal .tab-content {
        overflow-y: auto;
    }

    /* --- Budget Modal Mobile List --- */
    
    .budget-filters-list-style .budget-filter-group {
        position: relative;
    }

    .budget-filters-list-style .budget-filter-group ul {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        overflow-y: auto;
        max-height: 80px; 
        overflow-x: hidden;
        white-space: normal;
        -ms-overflow-style: none;  /* IE and Edge */
        scrollbar-width: none;  /* Firefox */
    }

    .budget-filters-list-style .budget-filter-group ul::-webkit-scrollbar {
        display: none;
    }

    .budget-filters-list-style .budget-filter-group::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 30px;
        /*background: linear-gradient(to bottom, rgba(253, 252, 255, 0), rgba(253, 252, 255, 0.5) 80%);*/
        pointer-events: none; 
        border-radius: 0 0 5px 5px;
        z-index: 1;
    }
    .budget-filter-header {
        font-size: 9.5px;
    }    

    .budget-item-counter {
        font-size: 8px;
        padding: 2px 6px;
    }

    .facet-container {
        margin-bottom: 12px;
    }

    .budget-filters.budget-filters-list-style {
        gap: 8px;
    }

    .budget-filter-button {
        padding: 3px 7px;
        font-size: 8.5px;
    }

    .budget-filter-count {
        font-size: 8px;
        margin-left: 4px;
    }

    .budget-product-filter-grid {
        gap: 6px;
    }

    .budget-product-filter-item {
        padding: 6px;
        border-radius: 20px;
    }

    .budget-product-filter-item img {
        width: 30px; 
        height: 30px;
    }

    #budget-list {
        gap: 0.7rem;
        margin-top: 0.7rem;
    }

    #budget-list > li {
        padding: 0.5rem;
    }

    #budget-list > li > .budget-store-header {
        padding: 2px 4px;
        margin-bottom: 6px;
        font-size: 9px;
    }

    #budget-list > li > ul {
        gap: 0.5rem;
    }

    #budget-list > li > ul > li.budget-product-item {
        padding: 0.4rem;
        font-size: 9.5px;
    }

    .budget-product-item .product-info {
        margin-bottom: 4px;
    }

    .budget-product-item .product-info img {
        width: 32px;
        height: 32px;
        margin-right: 5px;
        margin-top: 8px;
    }

    .budget-product-item .product-details {
        padding-right: 1.1rem;
    }

    .budget-product-item .budget-item-name {
        font-size: 9px;
        margin-bottom: 1px;
    }

    .store-product-count {
        font-size: 9px;
    }

    .purchase-marked-count {
        font-size: 9px;
    }

    .budget-product-item .remove-button {
        top: 0.3rem;
        right: 0.3rem;
        aspect-ratio: 1/1;
        font-size: 0.75rem;
    }

    .budget-product-item .quantity-price-controls {
        gap: 2px;
        padding-top: 2px;
    }

    .budget-product-item .quantity-control {
        gap: 4px;
    }

    .budget-product-item .quantity-btn {
        width: 15px;
        height: 15px;
        font-size: 10px;
    }

    .budget-product-item .quantity-input {
        width: 26px;
        height: 20px;
        font-size: 9px;
    }

    .budget-product-item .budget-item-total-price,
    .budget-item-unit-price,
    .budget-item-subtotal {
        font-size: 9px;
    }

    .budget-store-header-content {
        font-size: 10px;
    }

    /* --- Budget Modal Mobile Drops --- */

    .price-drops-list {
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .price-drop-item {
        padding: 0.4rem;
    }

    .price-drop-item-content {
        gap: 6px;
        margin-bottom: 4px;
    }

    .price-drop-image-container {
        width: 32px;
    }

    .price-drop-image {
        width: 32px;
        height: 32px;
    }

    .price-drop-percentage {
        font-size: 8px;
        padding: 1px 3px;
    }

    .price-drop-item .price-drop-name {
        font-size: 9px;
    }

    .price-drop-item .price-drop-store {
        font-size: 9px;
    }

    .price-drop-item .price-drop-details {
        font-size: 9.5px;
        margin-left: calc(32px + 6px);
    }

    .price-drop-item .price-difference {
        padding: 2px;
    }

    .price-drop-subheader {
        font-size: 11px;
        margin-top: 15px;
        margin-bottom: 8px;
    }

    /* --- Action Buttons Mobile --- */
    .mobile-action-buttons {
        -ms-overflow-style: none;
        scrollbar-width: none;
        margin: 10px auto 10px auto;
        max-width: 90%;
    }

    .mobile-action-buttons::-webkit-scrollbar {
        display: none;
    }

    body.results-active .mobile-action-buttons {
        display: flex;
        justify-content: center;
        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;
    }

    body.search-mode-stores.results-active .mobile-action-buttons {
        justify-content: center;
    }

    .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;
    }

    #active-filters {
        padding: 5px 12px;
        margin-bottom: 10px;
        gap: 6px;
    }

    .filters-menu {
        width: 85%;
        max-width: 300px;
    }

    body.results-active .mobile-action-buttons .filters-button {
        margin: 0;
        justify-content: center;
        font-size: 13px;
        width: 140px;
        flex-shrink: 0;
    }

    .purchase-here-btn {
        font-size: 9px;
    }

    #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-label .icon-grid,
    #layout-toggle-label .icon-list {
        display: none;
    }

    #layout-toggle-label.shows-list-icon-action .icon-list {
        display: inline-block;
    }

    #layout-toggle-label.shows-grid-icon-action .icon-grid {
        display: inline-block;
    }

    .product-status-label {
        font-size: 8px;
    }

    .product-status-label.status-imagine-result {
        font-size: 9px;
    }

    .product-status-label.status-imagine-result svg {
        width: 0.9em;
        height: 0.9em;
    }

    /* --- UNIVERSAL RULE: GRID STORES --- */
    body.results-active #products ul.stores {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 10px 6px;
        align-items: stretch;
        margin-top: 8px;
    }

    body.results-active #products ul.stores li {
        padding: 8px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    .value-badge.value-badge-good-value {
        padding: 4px 6px;
        font-size: 10px;
    }

    .image-status-label {
        font-size: 8.75px;
        padding: 2px 4px;
    }

    /* --- [MODO CUADRÍCULA POR DEFECTO]: Se aplica cuando el toggle NO está chequeado --- */
    
    body.results-active #products.grid-view {
        grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
        gap: 12px;
        padding: 10px 12px 15px 12px;

        & .product {
            padding: 10px;
            align-items: flex-start;
        }

        & .product-main-info {
            flex-direction: column;
            align-items: flex-start;
            gap: 10px;
        }

        & .product-image-wrapper {
            width: 100%;
            margin-bottom: 4px;
        }
        
        & .product img {
            width: 100%;
            height: 95px;
            object-fit: contain;
        }

        & .product h2 {
            font-size: 12px;
            margin: 0;
            line-height: 1.3;
            text-align: left;
        }

        & ul.stores li {
            font-size: 12px;
        }
        
        & .add-to-budget {
            font-size: 11px;
            height: 30px;
            padding: 4px 8px;
            line-height: 1;
            margin-top: 15px;
            width: 100%; 
            align-self: stretch;
        }

        & .add-to-budget svg {
            width: 1.2em;
            height: 1.2em;
            margin-left: -5px;
        }

        /* Estilos Compactos para Componentes Nutricionales */
        & .extra-info-container {
            gap: 0.5rem;
            margin-top: 0.2rem;
            align-items: flex-start;
        }

        & .nutrition-block-container {
            gap: 0.1rem;
            margin-top: 0.25rem;
            align-items: flex-start;
        }
        
        & .nutrition-block {
            gap: 0.18rem;
            justify-content: center;
        }

        & .nutrition-item-shape {
            font-size: 0.60rem;
            padding: 0.35em 0.20em;
            min-width: 36px;
            min-height: 4.2em;
        }
        
        & .nutrition-unit-info {
            font-size: 0.55rem;
            margin-top: 0.1rem;
        }

        & .ingredients-link {
            font-size: 9px;
            padding: 3px 6px;
            gap: 2px;
            font-weight: 700;
        }

        & .ingredients-icon {
            width: 1.1em;
            height: 1.1em;
        }

        & .store-info > a.store-link,
        & .store-info > span.store-name {
            font-size: 9px;
            font-weight: 600;
        }

        & .price {
            font-size: 13px;
        }

        & .store-price-per-unit {
            font-size: 8px;
            font-weight: 500;
            margin-top: 1.5px;
        }

        & .price-expiry-info {
            font-size: 0.65em;
            margin-top: 1px;
            padding: 1.5px 3px;
        }
    }

    body.results-active #products.grid-view ul.stores {
        /* Propiedades de Layout (de la primera regla) */
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); 
        gap: 8px 6px;
        /* Propiedades de Scroll y Contenedor (de la segunda regla) */
        max-height: 360px;
        overflow-y: auto;
        padding-right: 5px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    
    /* --- Chips Fade --- */

    body.results-active #products.grid-view .collapsible-stores {
        position: relative;
    }
    body.results-active #products.grid-view .collapsible-stores::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 15px;
        background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff 80%);
        pointer-events: none;
    }
    body.dark-mode.results-active #products.grid-view .collapsible-stores::after {
    background: linear-gradient(to bottom, rgba(40, 42, 45, 0), #282a2d 80%);
    }

    /* --- [MODO LISTA]: Se aplica cuando SÍ está chequeado el toggle --- */
    body.results-active #products.list-view {

        grid-template-columns: 1fr;
        gap: 20px;
        padding: 10px 20px 20px 20px;

        & .product {
            padding: 15px;
        }
        
        & .product-main-info {
            flex-direction: row;
            align-items: flex-start;
            gap: 12px;
        }

        & .product-image-wrapper {
            flex: 0 0 85px;
            width: 85px;
        }
        
        & .product img {
            height: auto;
        }

        & .product h2 {
            font-size: 13px;
            margin: 10px 0;
            line-height: normal;
            text-align: left;
        }

        & ul.stores li {
            font-size: 14px;
        }
        
        & .add-to-budget {
            font-size: 16px;
            padding: 10px 15px;
            margin-top: 15px;
        }
    }
    
    /* --- Smaller Mobile Screens (<= 400px) --- */
    @media (max-width: 400px) {
        .search-background {
            padding: 8px 8px;
        }

        .search-logo {
            margin: 0 0 -10px 0;
        }

        .search-logo img {
            max-width: 220px;
            height: 40px;
        }

        #searchbox {
            width: 85%;
            margin: 0 auto 3px auto;
        }

        .search-wrapper {
            height: 38px;
        }
        
        
        body.results-active #products.grid-view {
        & .product h2 {
            font-size: 11px;
        }

        & .product img {
            width: 100%;
            height: 80px;
            object-fit: contain;
        }

        &  .add-to-budget {     
            font-size: 10px;
            height: 28px;
            }

        & .add-to-budget svg {
            width: 1.25em;
            height: 1.25em;
            margin-left: -2px;
            }    
        }

        .main-tagline {
            font-size: 54px;
            letter-spacing: -2.25px;
        }

        .budget-product-item .budget-item-name {
            font-size: 8.5px;
        }

        .auth-button-simple {
            font-size: 0.6rem;
        }
    }
    
    @media (max-width: 381px) {
        body.results-active #products.grid-view {
        &  .add-to-budget {     
            font-size: 9px;
            }
        }
    }
}

    & ul.stores li:only-child {
        grid-column: 1 / -1;
    }

/* =========================================
            MODO NAVIDAD JOJOJO
   ========================================= */

/* --- 1. CONFIGURACIÓN BASE DEL BODY (FONDO) --- */

/* MODO CLARO: Verde Esmeralda Profundo (#0D3B28) */
body:not(.dark-mode):has(.filter-badge button[title*="navidad" i]),
body:not(.dark-mode):has(.filter-badge button[aria-label*="navidad" i]) {
    background-color: #0D3B28 !important;
    background-image: none !important;
    color: #E0F2F1 !important; 
}

/* MODO OSCURO: Verde Bosque Nocturno (#0F291E) */
body.dark-mode:has(.filter-badge button[title*="navidad" i]),
body.dark-mode:has(.filter-badge button[aria-label*="navidad" i]) {
    background-color: #0F291E !important;
    background-image: none !important;
    color: #a0a0a0 !important;
}

/* --- 2. ENCABEZADO TRANSPARENTE --- */
body:has(.filter-badge button[title*="navidad" i]) .search-background,
body:has(.filter-badge button[aria-label*="navidad" i]) .search-background {
    background-color: transparent !important;
    backdrop-filter: blur(10px);
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: none !important;
}

/* --- 3. BOTONES DE BÚSQUEDA --- */

/*  Borde y Sombra Rojos */
body:has(.filter-badge button[title*="navidad" i]) .main-action-button,
body:has(.filter-badge button[title*="navidad" i]) .search-buttons button,
body:has(.filter-badge button[aria-label*="navidad" i]) .main-action-button,
body:has(.filter-badge button[aria-label*="navidad" i]) .search-buttons button {
    border-color: #CD202C !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3) !important;
    transition: transform 0.2s, box-shadow 0.2s;
}

/* MODO CLARO: Botones Oscuros (#062518) con Texto Claro */
body:not(.dark-mode):has(.filter-badge button[title*="navidad" i]) .main-action-button,
body:not(.dark-mode):has(.filter-badge button[title*="navidad" i]) .search-buttons button {
    background-color: #062518 !important;
    color: #E0F2F1 !important;
}
/* Iconos Rojos */
body:not(.dark-mode):has(.filter-badge button[title*="navidad" i]) .search-button-icon,
body:not(.dark-mode):has(.filter-badge button[title*="navidad" i]) .main-action-button svg {
    stroke: #CD202C !important;
}

/* MODO OSCURO: Botones integrados (#163326) con Texto Rojo Pastel */
body.dark-mode:has(.filter-badge button[title*="navidad" i]) .main-action-button,
body.dark-mode:has(.filter-badge button[title*="navidad" i]) .search-buttons button {
    background-color: #163326 !important;
    color: #FF8A80 !important;
    border-color: #8B0000 !important;
}
body.dark-mode:has(.filter-badge button[title*="navidad" i]) .search-button-icon,
body.dark-mode:has(.filter-badge button[title*="navidad" i]) .main-action-button svg {
    stroke: #FF8A80 !important;
}

/* Estado ACTIVO (Rojo Sólido) */
body:has(.filter-badge button[title*="navidad" i]) .search-buttons button.active,
body:has(.filter-badge button[aria-label*="navidad" i]) .search-buttons button.active {
    background-color: #CD202C !important;
    color: #FFFFFF !important;
    border-color: #FFFFFF !important;
}
body:has(.filter-badge button[title*="navidad" i]) .search-buttons button.active .search-button-icon {
    stroke: #FFFFFF !important;
}

/* --- 4. VISIBILIDAD "EDITAR" --- */

body:not(.dark-mode):has(.filter-badge button[title*="navidad" i]) .edit-searches-btn,
body:not(.dark-mode):has(.filter-badge button[aria-label*="navidad" i]) .edit-searches-btn {
    color: #E0F2F1 !important;
    opacity: 0.9;
}

body:not(.dark-mode):has(.filter-badge button[title*="navidad" i]) .edit-trigger,
body:not(.dark-mode):has(.filter-badge button[aria-label*="navidad" i]) .edit-trigger {
    color: #FF5252 !important;
    font-weight: 700 !important;
}

/* --- 5. BADGE DEL FILTRO (Etiqueta "Navidad") --- */
.filter-badge:has(button[title*="navidad" i]),
.filter-badge:has(button[aria-label*="navidad" i]) {
    background-color: #CD202C !important;
    color: #FFFFFF !important;
    border: 1px solid #FFFFFF !important;
    box-shadow: 0 0 15px rgba(205, 32, 44, 0.6);
    font-weight: 700;
}
.filter-badge:has(button[title*="navidad" i]) .remove-filter,
.filter-badge:has(button[aria-label*="navidad" i]) .remove-filter {
    color: #FFFFFF !important;
}

/* --- 6. MENSAJES DE RESULTADOS --- */
body:has(.filter-badge button[title*="navidad" i]) #search-results-message p,
body:has(.filter-badge button[title*="navidad" i]) #search-results-message strong {
    color: #E0F2F1 !important;
}

/* --- 7. CORRECCIÓN DE GRADIENTES (Evita manchas grises) --- */

/* Gradientes para MODO CLARO (#0D3B28) */
body:not(.dark-mode):has(.filter-badge button[title*="navidad" i]) .search-buttons-wrapper::before,
body:not(.dark-mode):has(.filter-badge button[aria-label*="navidad" i]) .search-buttons-wrapper::before {
    background: linear-gradient(to right, #0D3B28 0%, rgba(13, 59, 40, 0.8) 40%, rgba(13, 59, 40, 0) 100%) !important;
}
body:not(.dark-mode):has(.filter-badge button[title*="navidad" i]) .search-buttons-wrapper::after,
body:not(.dark-mode):has(.filter-badge button[aria-label*="navidad" i]) .search-buttons-wrapper::after {
    background: linear-gradient(to left, #0D3B28 0%, rgba(13, 59, 40, 0.8) 40%, rgba(13, 59, 40, 0) 100%) !important;
}

/* Gradientes para MODO OSCURO (#0F291E) */
body.dark-mode:has(.filter-badge button[title*="navidad" i]) .search-buttons-wrapper::before,
body.dark-mode:has(.filter-badge button[aria-label*="navidad" i]) .search-buttons-wrapper::before {
    background: linear-gradient(to right, #0F291E 0%, rgba(15, 41, 30, 0.8) 40%, rgba(15, 41, 30, 0) 100%) !important;
}
body.dark-mode:has(.filter-badge button[title*="navidad" i]) .search-buttons-wrapper::after,
body.dark-mode:has(.filter-badge button[aria-label*="navidad" i]) .search-buttons-wrapper::after {
    background: linear-gradient(to left, #0F291E 0%, rgba(15, 41, 30, 0.8) 40%, rgba(15, 41, 30, 0) 100%) !important;
}

/* --- 8. OTRAS FACETAS --- */

body:has(.filter-badge button[title*="navidad" i]) .filter-badge:not(:has(button[title*="navidad" i])),
body:has(.filter-badge button[aria-label*="navidad" i]) .filter-badge:not(:has(button[aria-label*="navidad" i])) {
    color: #E0F2F1 !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    background-color: rgba(0, 0, 0, 0.2) !important;
}

/* X' */
body:has(.filter-badge button[title*="navidad" i]) .filter-badge:not(:has(button[title*="navidad" i])) .remove-filter,
body:has(.filter-badge button[aria-label*="navidad" i]) .filter-badge:not(:has(button[aria-label*="navidad" i])) .remove-filter {
    color: rgba(255, 255, 255, 0.7) !important;
}
body:has(.filter-badge button[title*="navidad" i]) .filter-badge:not(:has(button[title*="navidad" i])) .remove-filter:hover,
body:has(.filter-badge button[aria-label*="navidad" i]) .filter-badge:not(:has(button[aria-label*="navidad" i])) .remove-filter:hover {
    color: #FFFFFF !important;
}

/* Test Optimización */
.product, 
.store-card, 
.price-drop-item {
    contain: layout style; 
    transform: translateZ(0);
}