/* ORTHENA – responsive layer (tablet + mobile). Inline styles are desktop; these rules adapt them. */
html, body { overflow-x: hidden; }
[data-burger] { display: none !important; }

@media (max-width: 1320px) {
  [style*="min-width: 1320px"] { min-width: 0 !important; }
}

/* ---------- Header: burger from 1100px down ---------- */
@media (max-width: 1100px) {
  header { padding-left: 16px !important; padding-right: 16px !important; gap: 12px !important; position: relative; }
  header > nav { display: none !important; }
  header [style*="border-radius: 999px"][style*="border: 1px solid"] { display: none !important; }
  [data-burger] { display: flex !important; order: -1; }
  header > div { margin-left: auto !important; gap: 16px !important; }
  header > a:first-of-type:not([data-burger]) { position: absolute; left: 50%; transform: translateX(-50%); }
  header { justify-content: space-between !important; }
  html.nav-open header > nav {
    display: flex !important; flex-direction: column !important; align-items: stretch !important; gap: 0 !important;
    position: absolute; top: 100%; left: 0; right: 0; z-index: 80; background: #ffffff;
    border-top: 1px solid #e3e6e2; box-shadow: 0 18px 40px rgba(6,48,24,0.14); padding: 6px 16px 14px;
  }
  html.nav-open header > nav > a { padding: 14px 4px !important; font-size: 16px !important; border-bottom: 1px solid #eef0ec; background-size: 0 0 !important; }
  [data-screen-label^="Menü"] { display: none !important; }
}


/* ---------- Ankündigungsleiste: Tablet + Mobile ---------- */
@media (max-width: 1100px) {
  [style*="grid-template-columns: 1fr auto 1fr"] { grid-template-columns: minmax(0, 1fr) !important; padding: 0 14px !important; }
  [style*="grid-template-columns: 1fr auto 1fr"] > :first-child,
  [style*="grid-template-columns: 1fr auto 1fr"] > :last-child { display: none !important; }
  [style*="grid-template-columns: 1fr auto 1fr"] > span[style*="position: relative"] { width: 100% !important; max-width: 100% !important; }
  [style*="grid-template-columns: 1fr auto 1fr"] > span[style*="position: relative"] > a { font-size: 14px !important; overflow: hidden; text-overflow: ellipsis; }
}

/* ---------- Tablet ---------- */
@media (max-width: 1024px) {
  [style*="grid-template-columns: repeat(5, minmax"],
  [style*="grid-template-columns: repeat(6, minmax"] { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  [style*="grid-template-columns: minmax(260px"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  [style*="grid-template-columns: minmax(260px"] > :first-child { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  /* two-column page layouts stack */
  [style*="grid-template-columns: minmax(0px, 1"],
  [style*="grid-template-columns: 260px"], [style*="grid-template-columns: 240px"], [style*="grid-template-columns: 245px"],
  [style*="grid-template-columns: 238px"], [style*="grid-template-columns: 230px"],
  [style*="grid-template-columns: 400px"], [style*="grid-template-columns: 460px"] { grid-template-columns: minmax(0, 1fr) !important; }
  [style*="grid-template-columns: repeat(4, minmax"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  [style*="grid-template-columns: repeat(3, minmax"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }

  section[data-screen-label], footer[data-screen-label] { padding-left: 20px !important; padding-right: 20px !important; margin-left: 0 !important; margin-right: 0 !important; }
  section[data-screen-label] { gap: 28px !important; }
  [style*="position: sticky"] { position: static !important; }
  section *, footer * { max-width: 100%; }
  section [style*="display: flex"]:not([style*="flex-direction: column"]) { flex-wrap: wrap; }

  [style*="font-size: 5"], [style*="font-size: 6"], [style*="font-size: 7"] { font-size: 38px !important; line-height: 1.15 !important; }
  [style*="font-size: 4"] { font-size: 32px !important; line-height: 1.2 !important; }

  /* drawers / overlays full width */
  [data-screen-label="Warenkorb-Drawer"], [data-screen-label="Größenratgeber"] { width: 100vw !important; }
  [style*="position: fixed"][style*="width: 400px"] { width: auto !important; left: 12px !important; right: 12px !important; bottom: 12px !important; }
  [data-screen-label="Chat"] { width: calc(100vw - 24px) !important; right: 12px !important; }

  /* checkout */
  [data-screen-label="Kasse"] > div { padding: 24px 18px 40px !important; border-right: none !important; justify-content: center !important; }
  [data-screen-label="Kasse"] > div:last-child { order: -1; }
}

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
  [style*="grid-template-columns: repeat(3, minmax"],
  [style*="grid-template-columns: repeat(5, minmax"],
  [style*="grid-template-columns: repeat(6, minmax"],
  [style*="grid-template-columns: minmax(260px"] { grid-template-columns: minmax(0, 1fr) !important; }
  [style*="grid-template-columns: 1fr 1fr 1fr"] { grid-template-columns: 1fr !important; }
  section[data-screen-label], footer[data-screen-label] { padding-left: 16px !important; padding-right: 16px !important; }
  section[data-screen-label] { padding-top: 32px !important; padding-bottom: 40px !important; }

  [style*="font-size: 5"], [style*="font-size: 6"], [style*="font-size: 7"] { font-size: 30px !important; }
  [style*="font-size: 4"] { font-size: 28px !important; }
  [style*="font-size: 3"] { font-size: 24px !important; line-height: 1.25 !important; }
  h1 { font-size: 28px !important; line-height: 1.2 !important; }
  h2 { font-size: 23px !important; line-height: 1.25 !important; }

  header { height: 58px !important; }
  header img { height: 46px !important; }
  header label, header a[href*="#suche"] { display: none !important; }

  /* announcement bar: centered message only */
  [style*="grid-template-columns: 1fr auto 1fr"] { height: 38px !important; }
  [style*="grid-template-columns: 1fr auto 1fr"] > span[style*="position: relative"] { height: 38px !important; }
  [style*="grid-template-columns: 1fr auto 1fr"] > span[style*="position: relative"] > a { height: 38px !important; font-size: 12.5px !important; letter-spacing: 0 !important; }

  section [style*="white-space: nowrap"] { white-space: normal !important; }
  section [style*="padding: 40px"], section [style*="padding: 36px"], section [style*="padding: 32px"] { padding: 20px !important; }
  [style*="min-height: 880px"], [style*="min-height: 680px"] { min-height: 0 !important; }
}

/* ---------- Startseite mobile (wie Referenz) ---------- */
@media (max-width: 900px) {
  /* Vergleichstabelle Podologen bleibt 3-spaltig */
  [style*="grid-template-columns: minmax(0px, 1fr) 118px 118px"] { grid-template-columns: minmax(0, 1fr) 86px 86px !important; }
  [data-screen-label="Passform"] { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  [data-screen-label="Passform"] > div { min-width: 760px; }
}
@media (max-width: 600px) {
  /* Header: Burger links, Logo mittig, Icons rechts */
  header { justify-content: space-between !important; }
  header > a:first-of-type:not([data-burger]) { position: absolute; left: 50%; transform: translateX(-50%); }
  header > div { margin-left: 0 !important; gap: 14px !important; }

  /* Hero: Text zentriert oben, Bild darunter */
  [data-screen-label="Hero"] { min-height: 600px !important; align-items: flex-start !important; }
  [data-screen-label="Hero"] > div:last-child { align-items: center !important; text-align: center !important; padding: 28px 18px 30px !important; margin: 0 auto; }
  [data-screen-label="Hero"] > div:nth-child(2) { background: linear-gradient(180deg, rgba(0,0,0,0.42) 0%, rgba(0,0,0,0.12) 55%, rgba(0,0,0,0) 80%) !important; }
  [data-screen-label="Hero"] > div:last-child > div { justify-content: center !important; }
  [data-screen-label="Hero"] h1 { font-size: 30px !important; }
  [data-screen-label="Hero"] > div:last-child > div { flex-wrap: nowrap !important; gap: 10px !important; }
  [data-screen-label="Hero"] > div:last-child > div > div { width: 96px !important; }
  [data-screen-label="Hero"] > div:last-child > div:first-child { flex-wrap: wrap !important; gap: 6px !important; }

  /* Presse: horizontal scrollbar */
  [data-screen-label="Presse"] { display: flex !important; overflow-x: auto; gap: 24px !important; padding: 18px 16px !important; }
  [data-screen-label="Presse"] > * { flex: 0 0 auto; min-width: 110px; }
  [data-screen-label="Presse"] > span:first-child { border-right: none !important; padding-right: 0 !important; min-width: 0; }

  /* Bestseller + Kundenstimmen der Startseite als Swipe-Karussell */
  [data-screen-label="Startseite"] [data-screen-label="Bestseller"] [style*="grid-template-columns"],
  [data-screen-label="Kundenstimmen"] [style*="grid-template-columns"] { display: flex !important; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px !important; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
  [data-screen-label="Startseite"] [data-screen-label="Bestseller"] [style*="grid-template-columns"] > * { flex: 0 0 47%; scroll-snap-align: start; }
  [data-screen-label="Kundenstimmen"] [style*="grid-template-columns"] > * { flex: 0 0 86%; scroll-snap-align: start; }
  [data-screen-label="Startseite"] [data-screen-label="Bestseller"] > div:first-child { flex-direction: column !important; align-items: flex-start !important; }

  /* Schuhfinder: Auswahlfelder untereinander */
  [data-screen-label="Schuhfinder"] [style*="grid-template-columns: repeat(4, minmax"] { grid-template-columns: minmax(0, 1fr) !important; }

  /* Bewertungs-Badges nebeneinander */
  [data-screen-label="Bewertungen"] > div { flex-wrap: nowrap !important; gap: 12px !important; width: 100%; }
  [data-screen-label="Bewertungen"] > div > div { width: auto !important; flex: 1 1 0; padding: 14px 10px !important; }
  [data-screen-label="Bewertungen"] > div > div > span:first-child { font-size: 22px !important; }

  /* Footer: Logo + Newsletter voll, Links 2-spaltig */
  footer [style*="grid-template-columns: minmax(260px"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 32px 20px !important; }
  footer [style*="grid-template-columns: minmax(260px"] > :nth-child(1),
  footer [style*="grid-template-columns: minmax(260px"] > :nth-child(2) { grid-column: 1 / -1; }
}

/* ---------- Mobile: Such-Icon + Bestseller-Button unten ---------- */
[data-msearch] { display: none !important; }
@media (max-width: 600px) {
  [data-msearch] { display: flex !important; order: -1; margin-left: -6px; }
  html.msearch-open header label, html.msearch-open header a[href*="#suche"] {
    display: flex !important; position: absolute; top: 100%; left: 0; right: 0; width: auto !important; max-width: none !important;
    height: 50px !important; margin: 0 !important; border-radius: 0 !important; border-left: none !important; border-right: none !important;
    padding: 0 16px !important; background: #ffffff !important; z-index: 85; box-shadow: 0 10px 24px rgba(6,48,24,0.10);
  }
  [data-screen-label="Startseite"] [data-screen-label="Bestseller"] > div:first-child { display: contents !important; }
  [data-screen-label="Startseite"] [data-screen-label="Bestseller"] h2 { order: 1; }
  [data-screen-label="Startseite"] [data-screen-label="Bestseller"] [style*="grid-template-columns"] { order: 2; }
  [data-screen-label="Startseite"] [data-screen-label="Bestseller"] > div:first-child > a { order: 3; align-self: center; }
}

/* ---------- Startseite mobile: Feinschliff nach Referenz ---------- */
@media (max-width: 900px) {
  section img { object-fit: contain; }
  [style*="grid-template-columns: minmax(0px, 1fr) 118px 118px"] { grid-template-columns: minmax(0, 1fr) 96px 96px !important; gap: 0 8px !important; }
  [style*="grid-template-columns: minmax(0px, 1fr) 118px 118px"] img { height: auto !important; width: 92px !important; max-height: 40px; }
  [style*="grid-template-columns: minmax(0px, 1fr) 118px 118px"] > span { font-size: 12.5px !important; }
  [style*="grid-template-columns: minmax(0px, 1fr) 118px 118px"] > span:nth-child(3n+1) { padding: 10px 4px !important; min-height: 40px !important; }
}
@media (max-width: 600px) {
  [data-screen-label="Presse"] { flex-wrap: wrap !important; overflow: visible !important; justify-content: space-between !important; gap: 14px 12px !important; padding: 18px 16px 20px !important; }
  [data-screen-label="Presse"] > span:first-child { flex: 0 0 100% !important; text-align: center !important; font-size: 12px !important; }
  [data-screen-label="Presse"] > :not(:first-child) { flex: 1 1 0 !important; min-width: 0 !important; height: auto !important; align-items: center !important; text-align: center !important; }
  [data-screen-label="Presse"] > :not(:first-child), [data-screen-label="Presse"] > :not(:first-child) * { font-size: 12px !important; line-height: 1.3 !important; text-align: center !important; }
  [data-screen-label="Presse"] { align-items: flex-start !important; }
  [data-screen-label="Presse"] > :not(:first-child) { justify-content: flex-start !important; gap: 8px !important; }
  [data-screen-label="Komfort"] > div:first-child { min-height: 380px !important; }
  [data-screen-label="Podologen"] > div:last-child { min-height: 320px !important; }
  [data-screen-label="Podologen"] > div:first-child { padding: 24px 18px !important; }
  [data-screen-label="Schuhfinder"] { margin-left: 10px !important; margin-right: 10px !important; padding: 22px 14px !important; }
  [data-screen-label="Schuhfinder"] > div:first-child { text-align: center !important; align-items: center !important; }
  [data-screen-label="Schuhfinder"] [style*="grid-template-columns: repeat(4, minmax"] > a { width: 100%; justify-content: center; }
  [data-screen-label="Kategorien"] h2, [data-screen-label="Bewertungen"] h2 { text-align: center; font-size: 20px !important; }
  [data-screen-label="Kundenstimmen"] h2, [data-screen-label="Bestseller"] h2 { font-size: 22px !important; }
  [data-screen-label="Kategorien"] [style*="grid-template-columns"] span[style*="font-size: 15.5px"] { font-size: 14.5px !important; }
  [data-screen-label="Kundenstimmen"] [style*="grid-template-columns"]::-webkit-scrollbar,
  [data-screen-label="Startseite"] [data-screen-label="Bestseller"] [style*="grid-template-columns"]::-webkit-scrollbar { height: 3px; }
  [data-screen-label="Kundenstimmen"] [style*="grid-template-columns"]::-webkit-scrollbar-track,
  [data-screen-label="Startseite"] [data-screen-label="Bestseller"] [style*="grid-template-columns"]::-webkit-scrollbar-track { background: #d9ddd6; margin: 0 22%; border-radius: 3px; }
  [data-screen-label="Kundenstimmen"] [style*="grid-template-columns"]::-webkit-scrollbar-thumb,
  [data-screen-label="Startseite"] [data-screen-label="Bestseller"] [style*="grid-template-columns"]::-webkit-scrollbar-thumb { background: #1c2720; border-radius: 3px; }
  [data-screen-label="Kundenstimmen"] [style*="grid-template-columns"],
  [data-screen-label="Startseite"] [data-screen-label="Bestseller"] [style*="grid-template-columns"] { padding-bottom: 22px !important; }
  [data-screen-label="Banner"] { min-height: 320px !important; }
  [data-screen-label="Banner"] h2 { font-size: 26px !important; }
}
