#startanimation {
    background-color: var(--color-primary);
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;

    opacity: 1;
    animation-name: startbg;
    animation-duration: .5s;
    animation-delay: 2s;
    animation-timing-function: ease-out;
    animation-fill-mode: forwards;
}

@keyframes startbg {
    0%   {opacity: 1;}
    100% {opacity: 0;}
  }

#startanimation .logo{
    margin: 0px auto;
    font-size:2em;
    padding-top:125px;
}

#startanimation .logo img{
    width:170px;

    animation-name: startlogo;
    animation-duration: .5s;
    animation-delay: 2s;
    animation-timing-function: ease-out
}

@keyframes startlogo {
    0%   {width: 170px;}
    100% {width: 360px;}
  }

#startanimation.is-hidden{
    display:none;
}

/* ---------- Store-Banner (Header) ---------- */

.app-header {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    background: var(--color-primary);
    color:#fff;
    display: flex;
    align-items: center;
    padding: 0 10px 10px;
    box-shadow: -1px 10px 20px 5px rgba(0, 0, 0, 0.5);
    -webkit-box-shadow: -1px 10px 20px 5px rgba(0, 0, 0, 0.3);
}

.app-header #logo{
    width:45px;
}

.app-header h1{
    font-size: 1.5em;
    font-weight: normal; 
    margin-left:10px;   
}

.app-main #header-images{
    display: flex;
    justify-content: center;
    position: relative;
    margin-bottom: 32vh;
}

.app-main #header-images img{
    position: absolute;
}

.app-main #header-images img#img-kundin{
    z-index: 1;
    height:30vh;
    width:auto; 
}

.app-main #header-images img#img-store{
    margin-top:-65px;
    opacity: .5;
}

.app-main #starttext{
    padding: 0 var(--space-4);
    max-height: 2em;
    opacity: 1;
    overflow: hidden;
    transition: opacity 0.3s ease, max-height 0.35s ease, margin 0.35s ease;
}

/* ---------- Hero-Uebergaenge (Tippen im Suchfeld / Marktwechsel) ----------
   .is-hero-collapsed schiebt die beiden Kopfgrafiken seitlich auseinander
   und blendet sie aus; da #header-images margin-bottom gleichzeitig
   einklappt, rueckt alles Nachfolgende (Suchfeld, Suchergebnisse) per
   normalem Dokumentfluss von selbst nach oben - kein manuell berechneter
   transform-Offset noetig. .is-search-exiting ist NUR fuer den
   Marktwechsel-Ausflug: die Suchmaske verschwindet stattdessen nach unten,
   waehrend die Marktliste weiter unten einfaehrt (siehe .store-list).
   Beide Klassen werden auf .app-main gesetzt (existiert in index.html UND
   abfahrt.html); die Zielelemente selbst gibt es teils nur in abfahrt.html -
   ohne sie greifen die Regeln unten einfach nicht. */

.app-main #header-images {
    transition: margin-bottom 0.4s ease;
}

.app-main #header-images img {
    transition: transform 0.35s ease, opacity 0.3s ease;
}

.app-main.is-hero-collapsed #header-images {
    margin-bottom: 0;
}

.app-main.is-hero-collapsed #header-images img#img-kundin {
    transform: translateX(-130%);
    opacity: 0;
}

.app-main.is-hero-collapsed #header-images img#img-store {
    transform: translateX(130%);
    opacity: 0;
}

.app-main.is-hero-collapsed #starttext {
    opacity: 0;
    max-height: 0;
    margin: 0;
}

#page-search {
    transition: transform 0.35s ease 0.3s, opacity 0.3s ease 0.3s;
}

.app-main.is-search-exiting #page-search {
    transform: translateY(60px);
    opacity: 0;
    pointer-events: none;
}

/* Kopfgrafiken, Begruessungstext und Markt-Banner nur auf der Startseite
   (Suche) - sie liegen ausserhalb jeder [data-page]-Sektion (siehe Router in
   navigation.js, der nur .page-Elemente ein-/ausblendet) und waeren sonst
   auf jeder Seite sichtbar. :has() prueft, ob #page-search gerade die
   sichtbare Seite ist; negativ formuliert ("nicht Startseite"), damit
   spaeter neu hinzukommende Seiten automatisch mit abgedeckt sind, ohne
   diese Regel einzeln erweitern zu muessen. Betrifft nur abfahrt.html -
   index.html hat weder #header-images/#starttext, noch liegt dessen
   #storeBannerBtn in .app-main (sondern im festen Header), bleibt also
   unveraendert immer sichtbar. */
.app-main:not(:has(#page-search:not([hidden]))) #header-images,
.app-main:not(:has(#page-search:not([hidden]))) #starttext,
.app-main:not(:has(#page-search:not([hidden]))) #storeBannerBtn {
    display: none;
}

.store-banner {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    min-height: var(--header-height);
    padding: 0 var(--space-4);
    font-weight: 600;
    font-size: var(--font-size-base);
}

.store-banner__icon {
    width: 20px;
    height: 20px;
    color: var(--color-accent);
    flex-shrink: 0;
}

.store-banner__name {
    flex: 1;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.store-banner__name--placeholder {
    color: var(--color-muted);
    font-weight: 500;
}

.store-banner__chevron {
    color: var(--color-muted);
    flex-shrink: 0;
}

/* ---------- Buttons ---------- */

.start-btn.btn{
    border-radius: var(--radius-sm);
    padding: 20px var(--space-5);
    gap: var(--space-2);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: var(--touch-target);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: var(--font-size-base);
    transition: transform 0.1s ease, background-color 0.15s ease;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--color-primary);
    color: #ffffff;
}

.btn-primary:active {
    background: var(--color-primary-dark);
}

.btn-secondary {
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text);
}

.btn-block {
    width: 100%;
}

.btn-danger-text {
    color: var(--color-danger);
    font-weight: 600;
    min-height: var(--touch-target);
    padding: var(--space-2) var(--space-3);
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: var(--touch-target);
    padding: var(--space-2) var(--space-1);
    font-weight: 600;
    color: var(--color-text);
    align-self: flex-start;
}

/* ---------- Suchfeld ---------- */

.search-field {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    /* padding: var(--space-4); */
    min-height: 52px;
    box-shadow: var(--shadow-card);
    position: relative;
}

.search-field__icon {
    width: 20px;
    height: 20px;
    color: var(--color-muted);
    flex-shrink: 0;
    margin-left: 15px;
    position: absolute;
}

.search-field input {
    /* flex: 1; */
    min-height: 44px;
    font-size: var(--font-size-lg);
    color: var(--color-text);
    padding: 15px 32px 15px 45px;
}

.search-field input::placeholder {
    color: var(--color-muted);
}

.search-field__clear {
    color: var(--color-muted);
    width: 28px;
    height: 28px;
    /* display: flex;
    align-items: center;
    justify-content: center; */
    margin-left: -25px;
    position: absolute;
    right:10px;
}

/* ---------- Karten allgemein ---------- */

.card {
    background: var(--color-surface);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: var(--space-4);
}

.section-title {
    font-size: var(--font-size-lg);
    font-weight: 700;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

/* ---------- Produktkarte (Suchergebnisse) ---------- */

.product-card {
    display: flex;
    gap: var(--space-3);
    width: 100%;
    background: var(--color-surface);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: var(--space-3);
    text-align: left;
    align-items: center;
}

.product-card__image {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-sm);
    background: var(--color-background);
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card__image .icon {
    width: 28px;
    height: 28px;
    color: var(--color-muted);
}

.product-card__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.product-card__brand {
    font-size: var(--font-size-sm);
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.product-card__name {
    font-weight: 600;
    font-size: var(--font-size-base);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-card__location {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-accent);
    margin-top: var(--space-1);
}

.product-card__location .icon {
    width: 14px;
    height: 14px;
}

.product-card__location--muted {
    color: var(--color-muted);
    font-weight: 500;
}

/* ---------- Bottom Navigation ---------- */

.bottom-nav {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: 100%;
    max-width: var(--app-max-width);
    height: var(--bottom-nav-height);
    display: flex;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    z-index: var(--z-bottom-nav);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-muted);
    position: relative;
}

.bottom-nav__item .icon {
    width: 24px;
    height: 24px;
}

.bottom-nav__item.is-active {
    color: var(--color-primary);
}

.bottom-nav__badge {
    position: absolute;
    top: 2px;
    right: calc(50% - 22px);
    background: var(--color-accent);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ---------- Standort-Anzeige (Produktdetail) ---------- */

.location-panel {
    background: var(--color-primary-light);
    border-radius: var(--radius-card);
    padding: var(--space-5) var(--space-4);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.location-panel__label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--color-primary-dark);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.location-panel__main {
    font-size: var(--font-size-location);
    font-weight: 800;
    color: var(--color-primary-dark);
    line-height: 1.1;
}

.location-panel__detail {
    display: flex;
    justify-content: center;
    gap: var(--space-5);
}

.location-panel__detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.location-panel__detail-value {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-text);
}

.location-panel__detail-key {
    font-size: var(--font-size-sm);
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.location-panel__note {
    font-size: var(--font-size-sm);
    color: var(--color-muted);
}

/* ---------- Badge / Chip ---------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-pill);
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.badge-success {
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
}

.badge-neutral {
    background: var(--color-background);
    color: var(--color-muted);
}

.badge-warning {
    background: var(--color-accent-light);
    color: var(--color-accent);
}

.badge-danger {
    background: var(--color-danger-light);
    color: var(--color-danger);
}

.confidence-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

/* ---------- Leerzustaende / Fehler ---------- */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-3);
    padding: var(--space-6) var(--space-4);
    color: var(--color-muted);
}

.empty-state .icon {
    width: 40px;
    height: 40px;
    color: var(--color-border);
}

.empty-state__title {
    font-weight: 700;
    font-size: var(--font-size-lg);
    color: var(--color-text);
}

.empty-state--error .icon {
    color: var(--color-danger);
}

/* ---------- Ladeanzeige ---------- */

.spinner {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    animation: spin 0.7s linear infinite;
    margin: var(--space-5) auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- Marktliste (Marktauswahl) ---------- */

.store-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    /* Faehrt beim Rendern (auch beim Marktwechsel-Ausflug) von unten nach
       oben ein - spielt automatisch erneut, da innerHTML das Element bei
       jedem Aufruf von renderStoreSelectPage() frisch einfuegt. */
    animation: storeListEnter 0.4s ease-out;
}

@keyframes storeListEnter {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.store-option {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    padding: var(--space-4);
    box-shadow: var(--shadow-card);
    text-align: left;
}

.store-option.is-selected {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.store-option__icon {
    color: var(--color-primary);
    flex-shrink: 0;
}

.store-option__body {
    flex: 1;
    min-width: 0;
}

.store-option__name {
    font-weight: 700;
}

.store-option__address {
    font-size: var(--font-size-sm);
    color: var(--color-muted);
}

/* ---------- Einkaufsliste ---------- */

.shopping-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.shopping-list__item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    background: var(--color-surface);
    border-radius: var(--radius-card);
    padding: var(--space-3) var(--space-4);
    box-shadow: var(--shadow-card);
}

.shopping-list__checkbox {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
}

.shopping-list__item.is-checked .shopping-list__checkbox {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.shopping-list__body {
    flex: 1;
    min-width: 0;
}

.shopping-list__name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shopping-list__item.is-checked .shopping-list__name {
    color: var(--color-muted);
    text-decoration: line-through;
}

.shopping-list__location {
    font-size: var(--font-size-sm);
    color: var(--color-muted);
}

.shopping-list__remove {
    width: var(--touch-target);
    height: var(--touch-target);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-muted);
    flex-shrink: 0;
}

/* ---------- Mini-Standort-Illustration ---------- */

.aisle-map {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
    background: var(--color-background);
    border-radius: var(--radius-card);
    padding: var(--space-3);
}

.aisle-map__cell {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: var(--space-3) var(--space-2);
    text-align: center;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-muted);
}

.aisle-map__cell--active {
    background: var(--color-accent-light);
    border-color: var(--color-accent);
    color: var(--color-accent);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
}

.aisle-map__cell--active .icon {
    color: var(--color-accent);
    width: 18px;
    height: 18px;
}

/* ---------- Formulare (Standort melden/korrigieren, Markt/Produkt anlegen) ---------- */

.form-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.form-field__label {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-muted);
}

.form-field input {
    min-height: var(--touch-target);
    padding: 0 var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-base);
    background: var(--color-surface);
}

.form-field input:focus-visible {
    border-color: var(--color-primary);
}

.form-error {
    color: var(--color-danger);
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.form-hint {
    color: var(--color-muted);
    font-size: var(--font-size-sm);
}

.location-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    background: var(--color-surface);
    border-radius: var(--radius-card);
    padding: var(--space-4);
    box-shadow: var(--shadow-card);
}

.location-form__actions {
    display: flex;
    gap: var(--space-3);
}

.location-form__actions .btn {
    flex: 1;
}

/* ---------- Standort-Panel: Confidence/Bestaetigen/Korrigieren ---------- */

.location-panel__meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
}

.location-panel__stats {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--font-size-sm);
    color: var(--color-text);
}

.location-panel__stats .icon {
    width: 14px;
    height: 14px;
}

.location-panel__stats--muted {
    color: var(--color-muted);
}

.location-panel__buttons {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.location-feedback {
    text-align: center;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-primary-dark);
}

.location-feedback--error {
    color: var(--color-danger);
}

/* ---------- EAN-Fallback (Suche ohne Treffer) ---------- */

.ean-fallback {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

/* ---------- Markt hinzufuegen (Marktauswahl) ---------- */

.add-store-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-border);
}

/* ---------- Kartierungsgrad (Marktseite) ---------- */

.coverage-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.coverage-card__percentage {
    font-weight: 800;
    font-size: var(--font-size-lg);
    color: var(--color-primary-dark);
}

.coverage-bar {
    height: 10px;
    border-radius: var(--radius-pill);
    background: var(--color-background);
    overflow: hidden;
}

.coverage-bar__fill {
    height: 100%;
    background: var(--color-primary);
    border-radius: var(--radius-pill);
}

.coverage-card__detail {
    font-size: var(--font-size-sm);
    color: var(--color-muted);
}
