/* Shared mobile corrections, loaded after the theme and page styles. */
.mobile-ticker-help { display: none; }

@media (max-width: 900px) {
  /* Astra's fixed input height leaves too little room for the selected text
     once the publisher's padding is applied. Let the line box set the height. */
  body select,
  body input:not([type]),
  body input:is([type="text"], [type="search"], [type="tel"], [type="email"], [type="url"], [type="number"], [type="password"], [type="date"]) {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: auto !important;
    min-height: 3.25em !important;
    padding: .625em .75em !important;
    font-size: max(16px, 1rem);
    line-height: 1.5 !important;
    vertical-align: middle;
  }

  /* Keep the native, accessible picker, with space reserved for its arrow. */
  body select:not([multiple]):not([size]),
  body select[size="1"]:not([multiple]) {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 2.5em !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='10' viewBox='0 0 16 10'%3E%3Cpath d='M2 2l6 6 6-6' fill='none' stroke='%2319333d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .75em center;
    background-size: 1em .625em;
  }

  .county-choice,
  .preference-extras > *,
  .plan-filters > *,
  .submission-form label,
  .interest-chip > span {
    min-width: 0;
  }

  .interest-chip > span,
  .preference-extras button,
  .submission-form button {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  /* A fixed theme control otherwise covers the help text and form labels. */
  #ast-scroll-top { display: none !important; }

  /* On phones, show one complete business/offer and let visitors swipe.
     The second group exists only to make the desktop animation seamless. */
  .deals-section > .wrap {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .deals-heading { grid-column: 1; grid-row: 1; }
  .ticker-controls {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    min-width: 0;
  }
  #deals-all {
    flex: 1;
    width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  #deals-pause { display: none; }
  .deal-viewport {
    grid-column: 1;
    grid-row: 3;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
  }
  .deal-track {
    display: block;
    width: 100%;
    animation: none !important;
    transform: none !important;
    will-change: auto;
  }
  .deal-group {
    display: flex;
    align-items: stretch;
    width: 100%;
    gap: 12px;
    padding: 0;
  }
  .deal-group[aria-hidden="true"] { display: none; }
  .deal-item {
    box-sizing: border-box;
    flex-direction: column;
    align-items: stretch;
    flex: 0 0 100%;
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: 104px;
    height: auto;
    white-space: normal;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }
  .deal-item .deal-photo {
    width: 100%;
    height: clamp(180px, 45vw, 240px);
    flex: 0 0 auto;
    border-radius: 6px;
  }
  .deal-item .deal-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
  .deal-item .deal-photo > span {
    height: 100%;
    font-size: 24px;
  }
  .deal-text {
    width: 100%;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .deal-text :is(span, strong, small) {
    white-space: normal;
    overflow: visible;
    line-height: 1.4;
  }
  .mobile-ticker-help {
    display: block;
    grid-column: 1;
    grid-row: 4;
    margin: 0;
    color: var(--ink, #19333d);
    font-size: 14px;
    line-height: 1.5;
  }
}

/* Give the homepage photo breathing room above the mobile discovery box. */
@media (max-width: 600px) {
  #home.hero #hero-search { margin-top: calc(clamp(72px, 22vw, 110px) + 168px); }
  header .header-row a.newsletter-header-cta {
    font-size: 12px;
    line-height: 1.35;
    min-height: 48px;
    max-width: 148px;
    min-width: 0;
    text-align: center;
    justify-content: center;
    white-space: normal;
  }
}
