/* Rosaifa 4.14.6 — customer-facing mobile consistency hardening. */

@media (max-width: 760px) {
  /* Shared page frame and headings. */
  .rf-content-area,
  .rf-full-width-page,
  .rf-routine-page,
  .rf-guide-page { min-width: 0; }
  .rf-content-area { padding-block: 36px 54px; }
  .rf-content-area .rf-content-container,
  .rf-content-area .rf-narrow-container { min-width: 0; }
  .rf-page-header .rf-display,
  .rf-entry-header .rf-display,
  .rf-empty-state .rf-display,
  .rf-routine-finder-intro .rf-display,
  .rf-guide-hero .rf-display,
  .rf-v47-quiz-intro .rf-display,
  .rf-v48-hero .rf-display,
  .rf-v412-policy-hero .rf-display {
    overflow-wrap: anywhere;
    text-wrap: balance;
  }
  .rf-page-header,
  .rf-entry-header { margin-bottom: 22px; }
  .rf-page-header .rf-display,
  .rf-entry-header .rf-display { margin-bottom: 0; }
  .rf-entry-featured { border-radius: 18px; margin-bottom: 24px; overflow: hidden; }
  .rf-entry-content > :first-child { margin-top: 0; }
  .rf-entry-content blockquote { font-size: 21px; margin-block: 26px; padding-left: 17px; }
  .rf-entry-content .alignwide,
  .rf-entry-content .alignfull { margin-left: 0; transform: none; width: 100%; }

  /* Forms: consistent touch sizes and no iOS/Android text zoom surprises. */
  .rf-main input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  .rf-main select,
  .rf-main textarea,
  .woocommerce input.input-text,
  .woocommerce select,
  .woocommerce textarea {
    box-sizing: border-box;
    font-size: 16px !important;
    max-width: 100%;
  }
  .rf-main textarea { resize: vertical; }
  .rf-main form { min-width: 0; }

  /* Search, empty states and pagination. */
  .rf-empty-state { margin-block: 42px; }
  .rf-empty-state h1 { font-size: clamp(38px, 11vw, 48px); }
  .rf-404-search {
    display: grid;
    gap: 9px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding-right: 0;
    width: 100%;
  }
  .navigation.pagination { margin-top: 34px; max-width: 100%; }
  .navigation.pagination .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  /* Shop/archive controls stay readable at every narrow width. */
  .rf-p5-help-disclosure .rf-p5-assist-links {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .rf-p5-help-disclosure .rf-p5-assist-links a {
    align-items: center;
    display: flex;
    justify-content: center;
    min-width: 0;
    overflow-wrap: anywhere;
    text-align: center;
  }
  .rf-p5-active-filters { max-width: 100%; overflow-x: auto; padding-bottom: 3px; }

  /* Cart, checkout and account: reduce card bulk without hiding information. */
  .rf-v411-commerce-head h1,
  .rf-v411-account-welcome h1,
  .rf-v411-login-intro h1 { overflow-wrap: anywhere; text-wrap: balance; }
  .rf-p7-cart-trust > a,
  .rf-p7-cart-trust > div { min-height: 0 !important; padding: 14px; }
  .woocommerce-cart .cart_totals,
  .woocommerce-checkout #order_review,
  .woocommerce-account .woocommerce-MyAccount-content { min-width: 0; }
  .woocommerce-account .woocommerce-MyAccount-navigation {
    margin-inline: -2px;
    padding-inline: 2px;
    scrollbar-width: none;
  }

  /* Guide, consultation, routine and intelligence pages. */
  .rf-routine-page { padding-block: 36px 72px !important; }
  .rf-routine-finder-intro h1,
  .rf-v47-quiz-intro h1 { font-size: clamp(38px, 11vw, 46px) !important; line-height: 1.02; }
  .rf-routine-form,
  .rf-v47-quiz,
  .rf-v47-profile-card { padding: 18px 16px; }
  .rf-guide-page { padding-block: 34px 72px !important; }
  .rf-guide-hero { gap: 18px !important; padding-block: 8px 34px !important; }
  .rf-guide-hero h1 { font-size: clamp(38px, 11vw, 46px) !important; line-height: 1.02; }
  .rf-guide-hero-card { min-height: 0 !important; padding: 20px !important; }
  .rf-guide-basic { margin-bottom: 42px !important; }
  .rf-guide-skin { padding: 18px !important; }
  .rf-guide-skin-head .rf-display { font-size: clamp(36px, 10vw, 43px) !important; }
  .rf-v48-intel { padding: 30px 16px 72px !important; }
  .rf-v48-hero { margin-bottom: 20px; padding: 22px 17px !important; }
  .rf-v48-hero h1 { font-size: clamp(36px, 10.5vw, 44px) !important; line-height: 1.01; }
  .rf-v48-compat,
  .rf-v48-ingredient-card,
  .rf-v48-saved-card > header { padding: 18px 16px; }

  /* Comparison tray remains separate from the fixed quick navigation. */
  .rf-v48-compare-tray {
    bottom: calc(76px + env(safe-area-inset-bottom)) !important;
    gap: 8px;
    left: 8px;
    padding: 10px 11px;
    right: 8px;
    transform: none;
    width: auto;
  }
  .rf-v48-compare-tray > div { min-width: 0; }
  .rf-v48-compare-tray strong {
    font-size: 16px !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .rf-v48-compare-tray .rf-button { flex: 0 0 auto; min-height: 42px; padding-inline: 13px; }

  /* Policy, QC and contact pages. */
  .rf-v412-policy-page,
  .rf-v412-contact-page { padding-block: 34px 68px !important; }
  .rf-v412-policy-highlight { margin-block: 22px 36px; padding: 20px 16px; }
  .rf-v412-policy-highlight article,
  .rf-v412-eligibility-grid article,
  .rf-v412-contact-grid > a { padding: 18px 16px; }
  .rf-v412-policy-section { margin-block: 38px; }
  .rf-v412-contact-strip { gap: 20px; margin-top: 38px; padding-top: 26px; }
  .rf-v410-qc-page,
  .rf-v410-concern-page { padding-block: 34px 68px !important; }
  .rf-v410-verify-box,
  .rf-v410-tamper-note,
  .rf-v410-guarantee,
  .rf-v410-concern-form { border-radius: 18px; }

  /* Reviews and long fact rows. */
  .rf-v49-review-filter { justify-content: stretch; }
  .rf-v49-review-filter label { display: grid; gap: 7px; width: 100%; }
  .rf-v49-review-filter select { margin-left: 0; min-width: 0; width: 100%; }
  .rf-v49-complete-routine,
  .rf-v49-program-reco { border-radius: 18px; }

  /* Drawers and fixed surfaces respect the dynamic viewport. */
  .rf-mobile-drawer,
  .rf-mobile-drawer-inner,
  .rf-v3-drawer,
  .rf-cart-drawer { max-height: 100dvh; }
  .rf-mobile-search-panel,
  .rf-search-results-drawer { max-width: 100%; }
}

@media (max-width: 420px) {
  .rf-404-search { grid-template-columns: 1fr; }
  .rf-404-search .rf-button { width: 100%; }
  .rf-p5-help-disclosure .rf-p5-assist-links { grid-template-columns: 1fr !important; }
  .rf-v48-compare-tray strong { max-width: 30vw; }
  .rf-v48-compare-tray > button { padding-inline: 4px; }
}
