/* ─── Mobile UX (Phase 12, 5, 7, 11 Master-Prompt) ───
   Wird NACH mobile.css geladen → höchste Priorität.
   Grundsatz: nur Mobile-Styles in Media Queries, Desktop bleibt unverändert.
   1rem = 10px. Keine globalen overflow-x-Hacks. */

/* ═══════════════ MOBILE BOTTOM-NAVIGATION ═══════════════ */
.lm-bottom-nav {
  display: none;
}

@media (max-width: 767px) {
  .lm-bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 950;
    background: rgba(255, 255, 255, 0.97);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--lm-border);
    box-shadow: 0 -6px 24px rgba(0, 29, 20, 0.08);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .lm-bottom-nav__item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 54px;
    padding: 6px 2px;
    color: var(--lm-text-soft);
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.1;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--lm-font);
  }

  .lm-bottom-nav__item svg {
    width: 22px;
    height: 22px;
    display: block;
  }

  .lm-bottom-nav__item:active {
    transform: scale(0.97);
  }

  .lm-bottom-nav__item--active {
    color: var(--lm-green-dark);
  }

  .lm-bottom-nav__item--active::after {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--lm-neon);
  }

  .lm-bottom-nav__cart-count {
    position: absolute;
    top: 5px;
    left: calc(50% + 6px);
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--lm-neon);
    color: #001d13;
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .lm-bottom-nav__cart-count[hidden] {
    display: none;
  }

  /* Body unterhalb der Fixed-Bar nicht verdeckt (nur wenn Bar aktiv) */
  body.site-has-bottom-nav {
    padding-bottom: max(64px, calc(62px + env(safe-area-inset-bottom)));
  }

  /* Floating-Hilfe & Back-to-top über der Bar anheben */
  .lm-float-btn--help {
    bottom: calc(76px + env(safe-area-inset-bottom));
  }

  #ast-scroll-top.ast-scroll-to-top-right {
    bottom: calc(76px + env(safe-area-inset-bottom));
    right: calc(12px + env(safe-area-inset-right));
  }
}

/* ═══════════════ PRODUCTSEITE: STICKY ADD-TO-CART statt Bottom-Nav ═══════════════ */
@media (max-width: 767px) {
  body.single-product .lm-bottom-nav {
    display: none;
  }
}

.lm-sticky-cart {
  display: none;
}

@media (max-width: 767px) {
  .lm-sticky-cart {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 950;
    background: rgba(255, 255, 255, 0.97);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--lm-border);
    box-shadow: 0 -6px 24px rgba(0, 29, 20, 0.10);
    padding: 10px 16px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }

  .lm-sticky-cart__price {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--lm-green-dark);
    line-height: 1.2;
    min-width: 0;
    overflow: hidden;
  }

  .lm-sticky-cart__price del {
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--lm-text-muted);
    margin-right: 6px;
  }

  .lm-sticky-cart__price ins {
    text-decoration: none;
  }

  .lm-sticky-cart__btn {
    min-height: 48px;
    padding: 0 22px;
    border: none;
    cursor: pointer;
    background: var(--lm-neon);
    color: #001d13;
    font-size: 1.4rem;
    font-weight: 700;
    font-family: var(--lm-font);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    white-space: nowrap;
  }

  .lm-sticky-cart__btn:active {
    background: var(--lm-neon-hover);
    transform: scale(0.98);
  }
}

@media (max-width: 360px) {
  .lm-sticky-cart {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .lm-sticky-cart__price {
    font-size: 1.6rem;
  }

  .lm-sticky-cart__btn {
    padding: 0 14px;
    font-size: 1.3rem;
  }
}

/* ═══════════════ HOMEPAGE: BESTSELLER / NEUHEITEN ALS HORIZONTALER SCROLLER ═══════════════ */
@media (max-width: 767px) {
  .lm-homepage .lm-product-grid--scroll {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    gap: 14px;
    margin-inline: -16px;
    padding: 4px 16px 14px;
    scroll-padding-inline: 16px;
    scrollbar-width: none;
  }

  .lm-homepage .lm-product-grid--scroll::-webkit-scrollbar {
    display: none;
  }

  .lm-homepage .lm-product-grid--scroll .lm-product-card {
    flex: 0 0 82%;
    max-width: 82%;
    scroll-snap-align: start;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
  }

  .lm-homepage .lm-product-grid--scroll .lm-product-card__image {
    grid-column: 1;
    grid-row: auto;
    aspect-ratio: 4 / 3;
    border-right: none;
    border-bottom: 1px solid var(--lm-border);
  }

  .lm-homepage .lm-product-grid--scroll .lm-product-card__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
  }

  .lm-homepage .lm-product-grid--scroll .lm-product-card__body {
    grid-column: 1;
    grid-row: auto;
    padding: 12px 14px 6px;
  }

  .lm-homepage .lm-product-grid--scroll .lm-product-card__footer {
    grid-column: 1;
    grid-row: auto;
    padding: 10px 14px 14px;
  }
}

/* ═══════════════ KATEGORIEN: 2 SPALTEN MOBIL (ab 340px) ═══════════════ */
@media (min-width: 340px) and (max-width: 767px) {
  .lm-category-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .lm-category-card {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    min-height: 0;
    padding: 16px 14px 16px;
    gap: 10px;
    justify-items: start;
  }

  .lm-category-card__icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
  }

  .lm-category-card__icon img {
    width: 40px;
    height: 40px;
    max-width: 76%;
    max-height: 76%;
  }

  .lm-category-card__name {
    font-size: 1.55rem;
    line-height: 1.25;
  }

  .lm-category-card__count {
    font-size: 1.2rem;
  }

  .lm-category-card__cta {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
  }

  .lm-category-card__cta svg {
    width: 14px;
    height: 14px;
  }
}

/* ═══════════════ FAQ-AKKORDEON (Phase 11) ═══════════════ */
.lm-faq-section {
  padding: 64px 0;
}

.lm-faq-list {
  display: grid;
  gap: 12px;
  max-width: 820px;
  margin-inline: auto;
}

.lm-faq-item {
  background: var(--lm-surface);
  border: 1px solid var(--lm-border);
  border-radius: var(--lm-radius-md);
  overflow: hidden;
}

.lm-faq-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--lm-font);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--lm-text);
  text-align: left;
}

.lm-faq-trigger:focus-visible {
  outline: 3px solid rgba(32, 217, 90, 0.55);
  outline-offset: -3px;
  border-radius: var(--lm-radius-md);
}

.lm-faq-trigger__icon {
  flex-shrink: 0;
  color: var(--lm-green-dark);
  transition: transform var(--lm-transition-normal);
}

.lm-faq-trigger__icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.lm-faq-item.is-open .lm-faq-trigger__icon {
  transform: rotate(45deg);
}

.lm-faq-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.28s ease;
}

.lm-faq-panel__inner {
  padding: 0 20px 20px;
  font-size: 1.35rem;
  line-height: 1.6;
  color: var(--lm-text-soft);
}

.lm-faq-panel__inner p {
  margin: 0;
}

@media (max-width: 767px) {
  .lm-faq-section {
    padding: 48px 0;
  }

  .lm-faq-trigger {
    font-size: 1.35rem;
    line-height: 1.35;
    padding: 16px;
  }

  .lm-faq-panel__inner {
    font-size: 1.25rem;
    padding: 0 16px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lm-faq-panel {
    transition: none;
  }

  .lm-bottom-nav__item,
  .lm-sticky-cart__btn {
    transition: none;
  }
}