/**
 * Storefront mobile polish — load after tenant-public-chrome.css (+ lux-sales.css when present).
 * Touch targets, safe areas, no horizontal drift, readable announcement/footer on narrow screens.
 */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
}

/* Safe-area: chrome sits under system bars on notched devices when viewport-fit=cover */
.tpc-wrap {
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
}

.tpc-announcement {
  padding-top: max(9px, env(safe-area-inset-top, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

.tpc-navbar {
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

.tpc-nav-logo-img {
  max-width: min(72vw, 220px);
  height: auto;
  max-height: 40px;
  object-fit: contain;
}

@media (max-width: 480px) {
  .tpc-announcement {
    font-size: 12px;
    padding-bottom: 10px;
    gap: 6px 8px;
  }

  .tpc-announcement-text {
    flex: 1 1 12rem;
    min-width: 0;
  }

  /* Long CTAs must wrap instead of forcing horizontal scroll */
  .tpc-announcement-link {
    white-space: normal;
    text-align: center;
    line-height: 1.35;
    word-break: break-word;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    padding: 8px 6px;
    margin: -4px -6px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .tpc-nav-logo {
    min-height: 44px;
    padding: 4px 0;
    box-sizing: border-box;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
}

.tpc-site-footer {
  padding-bottom: max(1.25rem, calc(env(safe-area-inset-bottom, 0px) + 0.75rem));
}

@media (max-width: 768px) {
  .tpc-footer-links li {
    margin-bottom: 0.55rem;
  }

  .tpc-footer-links a {
    display: inline-block;
    padding: 0.5rem 0;
    min-height: 44px;
    line-height: 1.45;
    box-sizing: border-box;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .tpc-footer-bottom {
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
  }
}

/* LP base: comfortable gutters on very small phones */
@media (max-width: 380px) {
  .container {
    padding-left: max(14px, env(safe-area-inset-left, 0px));
    padding-right: max(14px, env(safe-area-inset-right, 0px));
  }
}

/* Hero: slightly shorter on small viewports so fold content stays reachable */
@media (max-width: 640px) {
  .hero-section {
    height: min(600px, 78vh);
    min-height: 420px;
  }

  .hero-content .container {
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }

  .btn-hero-search {
    min-height: 48px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
}

/* Lux sales (when stylesheet loaded): grids + sticky bar + CTAs */
@media (max-width: 640px) {
  .lux-offer-card-grid {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .lux-social-proof__grid {
    grid-template-columns: 1fr;
  }

  .lux-sticky-cta__inner {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .lux-sticky-cta__btn {
    min-height: 48px;
    padding: 0.75rem 1.25rem;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    width: 100%;
    max-width: 22rem;
    margin-left: auto;
    margin-right: auto;
  }

  .lux-btn-primary-lg,
  .lux-btn-ghost {
    min-height: 48px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
}

/* Sticky promo bar: reserve space for home indicator + bar padding */
body:has(#lux-sticky-bar) {
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}
