/* Touch tablets (pointer: coarse, ≥768px) — e.g. Galaxy Tab 1280px landscape.
   Overrides desktop width rules without affecting mouse desktop or phones. */

html.is-touch-tablet,
html.is-touch-tablet body {
  overflow-x: hidden;
}

html.is-touch-tablet:not(.is-touch-tablet-landscape) .site-header {
  width: 100%;
  max-width: 100vw;
  left: 0;
  right: 0;
  padding-inline: 0;
}

html.is-touch-tablet:not(.is-touch-tablet-landscape) .header-inner {
  width: min(calc(100% - 24px), 100%);
  max-width: calc(100vw - 24px);
  margin-inline: auto;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
}

html.is-touch-tablet:not(.is-touch-tablet-landscape) .site-nav {
  position: absolute;
  left: 12px;
  right: 12px;
  top: calc(100% + 10px);
  display: none;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  z-index: 10;
}

html.is-touch-tablet:not(.is-touch-tablet-landscape) .site-header.is-open .site-nav {
  display: flex;
}

html.is-touch-tablet:not(.is-touch-tablet-landscape) .site-nav a,
html.is-touch-tablet:not(.is-touch-tablet-landscape) .site-nav button {
  padding: 12px 10px;
  text-align: left;
  white-space: normal;
}

html.is-touch-tablet:not(.is-touch-tablet-landscape) .nav-toggle {
  display: block;
  justify-self: end;
}

html.is-touch-tablet:not(.is-touch-tablet-landscape) .header-cta {
  justify-self: end;
}

/* Home landing — tablet portrait layout instead of desktop 100dvh flex */
html.is-touch-tablet:not(.is-touch-tablet-landscape).page-home .home-top,
html.is-touch-tablet:not(.is-touch-tablet-landscape) body.page-home .home-top {
  display: block;
  min-height: auto;
}

html.is-touch-tablet:not(.is-touch-tablet-landscape).page-home .home-landing,
html.is-touch-tablet:not(.is-touch-tablet-landscape).page-home .home-landing-screen {
  display: block;
  min-height: auto;
  background: var(--ink);
}

html.is-touch-tablet:not(.is-touch-tablet-landscape).page-home .home-landing-screen {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: min(100svh, 100dvh);
}

html.is-touch-tablet:not(.is-touch-tablet-landscape).page-home .home-landing .hero {
  grid-row: 1;
  flex: none;
  min-height: clamp(380px, 68vh, 620px);
  position: relative;
  overflow: hidden;
  padding: clamp(88px, 11vh, 108px) 0 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

html.is-touch-tablet:not(.is-touch-tablet-landscape) .hero-media,
html.is-touch-tablet:not(.is-touch-tablet-landscape) .hero-overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

html.is-touch-tablet:not(.is-touch-tablet-landscape) .hero-overlay {
  display: block;
  opacity: 1;
  visibility: visible;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(5, 7, 11, 0.88) 0%, rgba(5, 7, 11, 0.66) 46%, rgba(5, 7, 11, 0.12) 100%),
    linear-gradient(0deg, rgba(5, 7, 11, 0.55), rgba(5, 7, 11, 0.08));
}

html.is-touch-tablet:not(.is-touch-tablet-landscape).page-home .home-top .hero > .container.hero-grid {
  grid-template-columns: 1fr;
  width: min(calc(100% - 40px), 860px);
  margin-inline: auto;
  align-items: end;
}

html.is-touch-tablet:not(.is-touch-tablet-landscape) .hero-bento--desktop {
  display: none !important;
}

html.is-touch-tablet:not(.is-touch-tablet-landscape) .hero-bento--mobile {
  display: grid !important;
}

html.is-touch-tablet:not(.is-touch-tablet-landscape).page-home .home-intro.home-intro--dock {
  grid-row: 2;
  margin-top: 0;
  padding: clamp(12px, 2dvh, 18px) 0 max(6px, env(safe-area-inset-bottom, 0px));
  background: var(--ink);
  color: #fff;
}

html.is-touch-tablet:not(.is-touch-tablet-landscape).page-home .home-trust {
  display: block;
  background: #fff;
  padding: 14px 0 22px;
}

html.is-touch-tablet:not(.is-touch-tablet-landscape).page-home .home-trust .hero-bento {
  width: min(calc(100% - 40px), 860px);
  margin-inline: auto;
}

/* RepairFlow / search */
html.is-touch-tablet.page-home #geraetesuche.device-search-section.pm-repairflow-mount {
  min-height: auto !important;
  padding-block: clamp(56px, 8vh, 88px);
  justify-content: flex-start !important;
}

html.is-touch-tablet.page-home #geraetesuche > .container,
html.is-touch-tablet .pm-lab--main-page-demo .device-search-section.pm-repairflow-mount > .container {
  width: min(calc(100% - 40px), 920px);
  max-width: 100%;
  margin-inline: auto;
}

html.is-touch-tablet .pm-lab--main-page-demo [data-lab-shell-window] {
  width: 100%;
  max-width: min(100%, 880px);
  margin-inline: auto;
}

html.is-touch-tablet .pm-lab--main-page-demo [data-device-search-mount] [data-device-brand-chips],
html.is-touch-tablet .pm-lab--main-page-demo [data-device-search-mount] [data-popular-devices],
html.is-touch-tablet .pm-lab--main-page-demo [data-device-search-mount] [data-device-search-results] {
  max-width: 100%;
  min-width: 0;
}

html.is-touch-tablet .reviews .review-shell,
html.is-touch-tablet .review-shell {
  width: min(calc(100% - 40px), var(--container, 1180px));
  margin-inline: auto;
}

html.is-touch-tablet .review-status {
  min-height: 120px;
}

/* Tablet landscape: desktop-nearer header + hero (overrides portrait tablet rules above) */
@media (min-width: 768px) and (max-width: 1180px) and (orientation: landscape) {
  html.is-touch-tablet .site-header {
    width: 100%;
    max-width: 100vw;
    left: 0;
    right: 0;
    padding-inline: 0;
  }

  html.is-touch-tablet .header-inner {
    width: min(var(--container, 1180px), calc(100% - 48px));
    max-width: none;
    margin-inline: auto;
    grid-template-columns: auto 1fr auto auto;
    gap: clamp(12px, 2vw, 20px);
  }

  html.is-touch-tablet .site-nav {
    position: static;
    left: auto;
    right: auto;
    top: auto;
    display: flex !important;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: clamp(12px, 2vw, 22px);
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    z-index: auto;
  }

  html.is-touch-tablet .site-nav a,
  html.is-touch-tablet .site-nav button {
    padding: 8px 0;
    text-align: center;
    white-space: nowrap;
  }

  html.is-touch-tablet .nav-toggle {
    display: none !important;
  }

  html.is-touch-tablet.page-home .home-landing-screen {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    min-height: 100dvh;
  }

  html.is-touch-tablet.page-home .home-top .hero {
    grid-row: 1;
    min-height: 0;
    padding: clamp(84px, 10vh, 104px) 0 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
  }

  html.is-touch-tablet.page-home .home-top .hero > .container.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
    gap: clamp(20px, 4vw, 40px);
    align-items: center;
    align-content: center;
    width: min(calc(100% - 48px), 1040px);
    margin-inline: auto;
    flex: 1 1 auto;
  }

  html.is-touch-tablet.page-home .home-top .hero-copy {
    padding: 0;
    align-self: center;
  }

  html.is-touch-tablet.page-home .home-top .hero-bento--desktop {
    align-self: center;
  }

  html.is-touch-tablet .hero-bento--desktop {
    display: grid !important;
  }

  html.is-touch-tablet .hero-bento--mobile {
    display: none !important;
  }

  html.is-touch-tablet.page-home .home-trust {
    display: none;
  }

  html.is-touch-tablet .hero-media,
  html.is-touch-tablet .hero-overlay {
    inset: 0;
    width: 100%;
    height: 100%;
  }

  html.is-touch-tablet .hero-media img {
    object-fit: cover;
    object-position: center center;
    width: 100%;
    height: 100%;
  }

  html.is-touch-tablet.page-home .home-intro.home-intro--dock {
    grid-row: 2;
    margin-top: 0;
    padding: clamp(14px, 2.5dvh, 22px) 0 max(10px, env(safe-area-inset-bottom, 0px));
    align-self: end;
  }

  html.is-touch-tablet.page-home .home-intro.home-intro--dock .home-intro-grid {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: end;
    gap: 18px 24px;
    width: min(calc(100% - 48px), 1040px);
    margin-inline: auto;
  }
}
