/* Mobile & tablet — all breakpoints in one place */

/* Safe areas (notched phones) */
body {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.site-header,
.nav-mobile,
.pdp-sticky,
.modal-backdrop {
  padding-left: max(0px, env(safe-area-inset-left));
  padding-right: max(0px, env(safe-area-inset-right));
}

.pdp-sticky {
  padding-bottom: env(safe-area-inset-bottom);
}

/* Prevent iOS input zoom */
.form-grid input,
.form-grid textarea,
#subscribe-email {
  font-size: 16px;
}

/* Touch-friendly targets */
.btn,
.tab,
.menu-toggle,
.pdp__thumb,
.faq-item__btn,
.nav-mobile a {
  min-height: 44px;
}

.menu-toggle {
  min-width: 44px;
}

.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

img,
video,
iframe {
  max-width: 100%;
}

/* ——— Phone (max 599px) ——— */
@media (max-width: 599px) {
  :root {
    --header-h: 64px;
    --space-section: clamp(3rem, 10vw, 4.5rem);
  }

  .container {
    width: min(100% - 1.5rem, var(--max));
  }

  .header__inner {
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
  }

  .logo__img {
    height: 1.65rem;
    max-width: 8.5rem;
  }

  .logo__mark {
    font-size: 1.35rem;
  }

  .logo__sub {
    font-size: 0.58rem;
    max-width: 11rem;
    line-height: 1.3;
  }

  .hero {
    min-height: calc(100svh - var(--header-h));
  }

  .hero__content {
    padding-block: 1.75rem 2.25rem;
    max-width: 100%;
  }

  .hero h1 {
    font-size: clamp(1.7rem, 7.5vw, 2.2rem);
    line-height: 1.15;
    word-break: break-word;
    margin-bottom: 0.85rem;
  }

  .hero p {
    font-size: 0.94rem;
    max-width: 100%;
  }

  .hero__cta {
    flex-direction: column;
    align-items: stretch;
  }

  .hero__cta .btn {
    width: 100%;
  }

  .section__title {
    font-size: clamp(1.65rem, 7vw, 2rem);
  }

  .section__lead {
    margin-bottom: 1.75rem;
    font-size: 0.92rem;
  }

  .tabs {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.25rem;
    margin-inline: -0.25rem;
    padding-inline: 0.25rem;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tab {
    flex-shrink: 0;
    padding: 0.55rem 1rem;
    font-size: 0.75rem;
  }

  .products-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .product-card__title {
    font-size: 0.78rem;
    line-height: 1.35;
    word-break: break-word;
  }

  .product-card__desc {
    font-size: 0.88rem;
  }

  .trust__inner {
    flex-direction: column;
    text-align: center;
  }

  .trust__chips {
    justify-content: center;
  }

  .howto__media img {
    height: min(280px, 55vw);
  }

  .story__media img {
    height: min(260px, 55vw);
  }

  .story__copy h2 {
    font-size: clamp(1.7rem, 7vw, 2.1rem);
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
  }

  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: 92svh;
    overflow-y: auto;
    border: 0;
    border-top: 1px solid var(--line);
    padding: 1.25rem 1rem calc(1.25rem + env(safe-area-inset-bottom));
  }

  .modal h3 {
    font-size: 1.45rem;
    padding-right: 0.5rem;
  }

  .faq-item__btn {
    font-size: 0.92rem;
    padding: 1rem 0;
  }

  .faq-item.is-open .faq-item__panel {
    max-height: 420px;
  }

  .footer__grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .footer__bottom {
    text-align: center;
    font-size: 0.78rem;
  }

  /* Product page — phone */
  .pdp {
    padding-top: calc(var(--header-h) + 1.1rem);
  }

  .pdp__title {
    font-size: clamp(1.55rem, 7vw, 2rem);
    word-break: break-word;
  }

  .pdp__lead,
  .pdp__body {
    font-size: 0.94rem;
    max-width: 100%;
  }

  .pdp__media {
    min-height: 220px;
    padding: 0.85rem;
  }

  .pdp__media img {
    max-height: 260px;
  }

  .pdp__thumbs {
    grid-template-columns: repeat(2, minmax(0, 110px));
  }

  .pdp__badge-icons {
    justify-content: space-between;
    gap: 0.65rem 0.5rem;
  }

  .pdp__badge-card {
    width: calc(33.33% - 0.4rem);
    min-width: 5rem;
  }

  .pdp__badge-icons .pdp-ing-img {
    width: 3.4rem;
    height: 3.4rem;
  }

  .pdp__badge-card-label {
    font-size: 0.6rem;
  }

  .pdp__actions {
    flex-direction: column;
  }

  .pdp__actions .btn {
    width: 100%;
  }

  .pdp__casip {
    grid-template-columns: 1fr;
  }

  .pdp__casip-media {
    max-width: 100%;
  }

  .pdp__casip-media img {
    width: 100%;
    max-height: none;
  }

  .pdp__group-head {
    flex-direction: row;
    align-items: center;
    gap: 0.7rem;
  }

  .pdp__groups {
    grid-template-columns: 1fr;
  }

  .pdp-ing-img {
    width: 3rem;
    height: 3rem;
  }

  .pdp__group h3 {
    font-size: 0.9rem;
    line-height: 1.35;
  }

  .pdp__list li {
    font-size: 0.9rem;
  }

  .pdp__prose p,
  .pdp__prose-line {
    font-size: 0.9rem;
    overflow-wrap: anywhere;
  }

  .pdp-sticky__inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    padding: 0.75rem 0;
  }

  .pdp-sticky__meta {
    text-align: center;
  }

  .pdp-sticky__meta strong {
    white-space: normal;
    font-size: 0.88rem;
  }

  .pdp-sticky .btn {
    width: 100%;
  }

  .page-product {
    padding-bottom: 7.5rem;
  }

  .pdp-related .products-grid {
    grid-template-columns: 1fr;
  }
}

/* Extra-small phones */
@media (max-width: 379px) {
  .container {
    width: min(100% - 1.1rem, var(--max));
  }

  .hero h1 {
    font-size: 1.55rem;
  }

  .pdp__badge-card {
    width: 100%;
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
    gap: 0.75rem;
  }

  .pdp__badge-icons {
    flex-direction: column;
  }

  .logo__sub {
    max-width: 9rem;
  }
}

/* ——— Tablet portrait (600px – 899px) ——— */
@media (min-width: 600px) and (max-width: 899px) {
  :root {
    --header-h: 68px;
    --space-section: clamp(3.5rem, 7vw, 5rem);
  }

  .container {
    width: min(100% - 2rem, var(--max));
  }

  .header__inner {
    grid-template-columns: 1fr auto;
  }

  .hero {
    min-height: calc(100svh - var(--header-h));
  }

  .hero__content {
    max-width: 34rem;
    padding-block: 2.25rem 2.75rem;
  }

  .hero h1 {
    font-size: clamp(2.1rem, 5vw, 2.85rem);
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  .howto__grid,
  .story__grid,
  .contact__grid {
    grid-template-columns: 1fr;
  }

  .footer__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pdp {
    padding-top: calc(var(--header-h) + 1.75rem);
  }

  .pdp__grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .pdp__media {
    min-height: 360px;
  }

  .pdp__media img {
    max-height: 420px;
  }

  .pdp__casip {
    grid-template-columns: minmax(280px, 360px) 1fr;
    gap: 1.5rem;
  }

  .pdp__badge-icons {
    gap: 1rem 1.25rem;
  }

  .pdp__specs {
    grid-template-columns: max-content 1fr;
  }

  .pdp__specs dd {
    margin-top: 0;
    padding-left: 1rem;
  }

  .page-product {
    padding-bottom: 6rem;
  }
}

/* ——— Tablet landscape / small laptop (900px – 1023px) ——— */
@media (min-width: 900px) and (max-width: 1023px) {
  .products-grid {
    grid-template-columns: repeat(2, minmax(0, 380px));
    justify-content: center;
  }

  .nav-desktop {
    gap: 1rem;
  }

  .nav-desktop a {
    font-size: 0.72rem;
  }

  .pdp__grid {
    gap: 2rem;
  }

  .pdp__casip {
    grid-template-columns: minmax(320px, 400px) 1fr;
  }
}

/* Mobile menu overlay + full panel */
@media (max-width: 899px) {
  .nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 18, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 65;
  }

  .nav-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .nav-mobile {
    inset: var(--header-h) 0 0;
    max-height: none;
    height: auto;
    min-height: calc(100svh - var(--header-h));
    overflow-y: auto;
    padding: 1.25rem 1.25rem 2rem;
    transform: translateX(100%);
    opacity: 1;
    border-bottom: 0;
    z-index: 75;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .nav-mobile.is-open {
    transform: translateX(0);
  }

  .nav-mobile .btn {
    margin-top: 0.5rem;
  }

  body.menu-open {
    overflow: hidden;
    touch-action: none;
  }
}

@media (min-width: 900px) {
  .nav-overlay {
    display: none;
  }

  .nav-mobile {
    display: none;
  }
}

/* Landscape phone — shorter hero */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding-block: 0;
  }

  .hero__content {
    padding-block: 1.5rem 1.25rem;
  }

  .hero h1 {
    font-size: clamp(1.5rem, 5vw, 2rem);
    margin-bottom: 0.5rem;
  }

  .hero p {
    margin-bottom: 1rem;
    font-size: 0.88rem;
  }

  .hero__cta {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .hero__cta .btn {
    width: auto;
  }
}

/* Large desktop polish */
@media (min-width: 1200px) {
  .hero__content {
    max-width: 46rem;
  }

  .pdp__details {
    max-width: 980px;
  }
}
