/* Recherche produit alimentaire — v3.0.0 — smartphone */

.ia-off {
    font-size: 14px;
}

.ia-off__section-panel {
    margin-bottom: 10px;
    padding: 0;
    overflow: hidden;
    background: #fff;
}

.ia-off__section-toggle {
    height: 64px;
    min-height: 64px;
    padding: 12px 14px;
}

.ia-off__desktop-entries-toggle { background: var(--rpa-search-bg); }
.ia-off__desktop-search-toggle { background: var(--rpa-history-bg); }
.ia-off__desktop-product-toggle { background: var(--rpa-product-bg); }

.ia-off__section-number {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    font-size: 16px;
    font-weight: 400;
}

.ia-off__desktop-entries-toggle-title,
.ia-off__desktop-search-toggle-title,
.ia-off__desktop-product-toggle-title {
    font-size: 18px;
}

.ia-off__desktop-entries-chevron,
.ia-off__desktop-search-chevron,
.ia-off__desktop-product-chevron {
    font-size: 18px;
}

.ia-off__desktop-section-subtitle {
    display: none;
}

.ia-off__entries-collapsible,
.ia-off__search-collapsible,
.ia-off__product-collapsible {
    padding: 12px;
}

.ia-off__entries-collapsible {
    display: block;
}

.ia-off__entries-collapsible > * + * {
    margin-top: 12px;
}

.ia-off__desktop-channel {
    display: none;
}

.ia-off__mobile-channel {
    display: block;
}

.ia-off__mobile-option {
    margin-top: 12px;
}

.ia-off__mobile-hide {
    display: none;
}

.ia-off__search {
    flex-wrap: wrap;
}

.ia-off__search input[type="text"],
.ia-off__search input[type="search"] {
    width: 100%;
    flex: 1 1 100%;
}

.ia-off button:not(.ia-off__section-toggle):not(.ia-off__suggestion):not(.ia-off__image-lightbox-backdrop),
.ia-off .ia-off__import-button,
.ia-off .ia-off__upc-use,
.ia-off .ia-off__capture-button {
    min-width: 72px;
    min-height: 34px;
    font-size: 14px;
    font-weight: 600;
}

.ia-off__upc-result-list {
    grid-template-columns: 1fr;
}

.ia-off__upc-result-item {
    grid-template-columns: 58px minmax(0, 1fr);
}

.ia-off__upc-result-photo {
    width: 58px;
    height: 58px;
}

.ia-off__upc-use {
    grid-column: 1 / -1;
    width: 100%;
}

.ia-off__suggestion-thumb {
    display: none;
}

.ia-off__suggestion-row {
    display: block;
}

/* History */
.ia-off__show-all-form,
.ia-off__storage-transfer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.ia-off__saved-item {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 8px 10px;
    padding: 10px;
}

.ia-off__saved-thumb-wrap {
    grid-column: 1;
    grid-row: 1 / 3;
    width: 52px;
    height: 68px;
}

.ia-off__saved-item-content {
    grid-column: 2;
}

.ia-off__saved-item-heading {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px;
    align-items: start;
}

.ia-off__saved-item-heading h3 {
    grid-column: 1 / -1;
}

.ia-off__delete-saved-form {
    margin: 0;
}

.ia-off__saved-display-button,
.ia-off__delete-saved {
    white-space: normal;
}

/* Product */
.ia-off__card {
    display: block;
}

.ia-off__nova-bar {
    margin: 0 0 12px;
    border-radius: 7px;
}

.ia-off__nova-label,
.ia-off__nova-right {
    gap: 5px;
}

.ia-off__score-logo {
    max-height: 34px;
}

.ia-off__recall-summary {
    grid-template-columns: 34px minmax(0, 1fr);
    margin-bottom: 12px;
}

.ia-off__header {
    display: block;
    margin-bottom: 12px;
}

.ia-off__image {
    display: block;
    width: 120px;
    height: 120px;
    margin: 0 auto 12px;
}

.ia-off__card-actions {
    margin-bottom: 12px;
}

.ia-off__nutrition-heading {
    flex-wrap: wrap;
}

.ia-off__nutrition-info-trigger {
    margin-left: auto;
}

.ia-off__table th,
.ia-off__table td {
    padding: 6px 7px;
    font-size: 13px;
}

/* Mobile modal reference: additive popup */
.ia-off__modal:not([hidden]) {
    padding: max(12px, env(safe-area-inset-top, 0px)) 12px
        max(12px, env(safe-area-inset-bottom, 0px));
}

.ia-off__modal-box {
    width: min(92vw, 680px);
    max-height: calc(100dvh - 32px);
    padding: 16px 14px 14px;
    border-radius: 16px;
}

.ia-off__modal-heading {
    justify-content: flex-start;
    padding-left: 0;
}

.ia-off__modal-heading h3 {
    text-align: left;
}

.ia-off__image-lightbox {
    padding: 12px;
}

.ia-off__image-lightbox-box {
    max-width: 96vw;
    max-height: 92dvh;
}

.ia-off__nova-help-desktop {
    display: none;
}

.ia-off__nova-info-icon {
    display: inline-flex;
    width: 18px;
    height: 18px;
    align-items: center;
    justify-content: center;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}


/* ==========================================================
   v3.0.4 — MOBILE
   ========================================================== */

/* Les accès aux informations restent de simples liens. */
.ia-off .ia-off__storage-info-link.ia-off__text-link,
.ia-off .ia-off__sources-button.ia-off__text-link {
    display: inline;
    width: auto;
    min-width: 0;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: #365f9d;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.35;
    text-align: left;
    text-decoration: underline;
}

/* Bouton unique pour choisir une image de code-barres. */
.ia-off__capture-button[for="ia-off-mobile-file-photo"] {
    width: auto;
    white-space: normal;
}

/* Fiche produit : même largeur et même alignement pour les trois actions. */
.ia-off__card-actions {
    display: grid;
    justify-items: stretch;
    gap: 8px;
}

.ia-off__card-actions form,
.ia-off__save-form {
    width: 100%;
    margin: 0;
}

.ia-off__category-label {
    width: 100%;
}

.ia-off__category-label input[type="text"] {
    width: 100%;
}

.ia-off__card-actions .ia-off__save-product,
.ia-off__card-actions .ia-off__delete-current,
.ia-off__card-actions .ia-off__clear-product {
    width: 100%;
    min-width: 0;
    justify-content: center;
}

/* Indicateurs des additifs lisibles sur smartphone. */
.ia-off__nova-markers-trigger .ia-off__risk-summary {
    margin-left: 8px;
    gap: 5px;
}

.ia-off__nova-markers-trigger .ia-off__risk-dot {
    display: inline-flex;
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    color: #fff;
}

.ia-off__nova-markers-trigger .ia-off__risk-dot--moderate,
.ia-off__nova-markers-trigger .ia-off__risk-dot--unknown {
    color: #222;
}


/* ==========================================================
   v3.0.5 — MOBILE : actions produit et liens d'information
   ========================================================== */

/* Spécificité volontairement supérieure au style générique des boutons. */
.ia-off .ia-off__card-actions button.ia-off__save-product,
.ia-off .ia-off__card-actions button.ia-off__delete-current,
.ia-off .ia-off__card-actions button.ia-off__clear-product {
    display: flex;
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    justify-content: center;
}

/* Les contrôles d'information sont maintenant de vrais liens <a>. */
.ia-off a.ia-off__storage-info-link.ia-off__text-link,
.ia-off a.ia-off__sources-button.ia-off__text-link {
    display: inline;
    width: auto;
    min-width: 0;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #365f9d;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.35;
    text-decoration: underline;
    text-underline-offset: 2px;
}


/* ==========================================================
   v3.0.6 — MOBILE : largeur identique des 3 actions produit
   ========================================================== */
.ia-off .ia-off__card-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: 100%;
    justify-items: stretch;
    align-items: stretch;
}

.ia-off .ia-off__card-actions > form,
.ia-off .ia-off__card-actions > button {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    box-sizing: border-box;
    margin: 0;
}

.ia-off .ia-off__card-actions > form > button,
.ia-off .ia-off__card-actions > button.ia-off__delete-current {
    display: flex;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    box-sizing: border-box;
    justify-content: center;
}

.ia-off .ia-off__card-actions .ia-off__category-label,
.ia-off .ia-off__card-actions .ia-off__category-label input[type="text"] {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
