/* Reviva — mobile / tablet */

img, video, svg {
  max-width: 100%;
  height: auto;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
}

.af-container {
  width: min(1180px, calc(100% - 2rem));
}

/* Tablet */
@media (max-width: 1100px) {
  .af-catalog-grid--dense {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .af-trust__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
}

@media (max-width: 1024px) {
  .af-card-grid,
  .af-card-grid--4,
  .af-card-grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .af-footer__grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .af-post-grid,
  .af-catalog-grid,
  .af-catalog-grid--dense {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .af-faq-grid {
    grid-template-columns: 1fr;
  }
  .af-hero h1 {
    max-width: 12ch;
    line-height: 1.18;
  }
}

/* Mobile drawer + sticky CTA */
@media (max-width: 768px) {
  .af-container {
    width: min(1180px, calc(100% - 1.5rem));
  }

  .af-header__inner {
    flex-wrap: nowrap;
    gap: 0.75rem;
    padding: 0.7rem 0;
  }

  .af-logo img,
  .af-header__brand .custom-logo {
    height: 34px;
    max-width: 150px;
  }

  .af-nav-toggle {
    display: block;
    margin-left: auto;
    z-index: 220;
  }

  .af-nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(8, 17, 32, 0.45);
    z-index: 190;
  }
  .af-nav-backdrop.is-open {
    display: block;
  }

  .af-nav {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(300px, 86vw);
    max-width: 100%;
    background: var(--af-white);
    transform: translateX(100%);
    transition: transform 0.28s ease;
    padding: 5rem 1.35rem 2rem;
    box-shadow: -8px 0 28px rgba(10, 40, 75, 0.18);
    z-index: 200;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .af-nav.is-open {
    transform: translateX(0);
  }
  .af-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
  }
  .af-nav__list a {
    display: block;
    padding: 0.75rem 0.25rem;
    font-size: 1rem;
    border-bottom: 1px solid var(--af-line);
  }

  .af-header__actions {
    gap: 0.4rem;
    order: 2;
  }
  .af-header__actions .af-btn {
    padding: 0.4rem 0.7rem;
    font-size: 0.78rem;
  }
  .af-header__actions .af-btn--primary {
    display: none;
  }

  .af-sticky-cta {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid var(--af-border);
    z-index: 90;
  }

  .af-hero {
    padding: 2.75rem 0 2.25rem;
  }
  .af-hero__grid,
  .af-split-grid,
  .af-auth-shell {
    grid-template-columns: 1fr !important;
  }
  .af-hero__visual {
    order: -1;
    min-height: 0;
    margin-bottom: 0.5rem;
  }
  .af-hero__visual img {
    max-height: 240px;
    width: 100%;
    object-fit: cover;
  }
  .af-hero h1 {
    font-size: clamp(1.7rem, 7vw, 2.35rem);
    max-width: none;
  }
  .af-hero__subhead {
    font-size: 0.98rem;
  }

  .af-trust__grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
  }
  .af-trust__item {
    text-align: left;
  }

  .af-section {
    padding: 2.75rem 0;
  }
  .af-section__title {
    font-size: clamp(1.45rem, 5.5vw, 1.9rem);
  }
  .af-section__lead {
    font-size: 0.95rem;
    margin-bottom: 1.35rem;
  }

  .af-card-grid,
  .af-card-grid--4,
  .af-card-grid--3,
  .af-post-grid,
  .af-catalog-grid,
  .af-catalog-grid--dense,
  .af-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
  }

  .af-product-card__body {
    padding: 0.75rem 0.85rem 0.95rem;
  }
  .af-product-card__body h3 {
    font-size: 0.95rem;
  }
  .af-product-card .af-btn-group .af-btn {
    width: 100%;
  }

  .af-footer__grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .af-footer__legal {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    font-size: 0.8rem;
  }

  .af-announcement__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .af-auth-shell__brand {
    padding: 2rem 1.25rem 1rem !important;
  }
  .af-auth-shell__form {
    padding: 1rem 1.25rem 2.5rem !important;
  }
  .af-auth-card {
    max-width: 100%;
  }

  .af-form fieldset {
    padding: 1rem;
  }

  .af-gate__card {
    margin: 1rem;
    padding: 1.5rem 1.15rem;
    max-width: calc(100vw - 2rem);
  }

  body {
    padding-bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px));
  }
  .page-template-page-apply-for-access-php .af-sticky-cta,
  .page-template-page-access-login-php .af-sticky-cta {
    display: none;
  }
  .page-template-page-apply-for-access-php,
  .page-template-page-access-login-php {
    padding-bottom: 0;
  }
  .af-page,
  .af-home,
  .af-portal {
    scroll-margin-bottom: 5rem;
  }

  .af-woocommerce ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .af-single-product__grid {
    grid-template-columns: 1fr !important;
  }

  .af-btn-group--center {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Small phones */
@media (max-width: 480px) {
  .af-container {
    width: calc(100% - 1.25rem);
  }

  .af-hero {
    padding: 2.25rem 0 1.75rem;
  }
  .af-hero__visual img {
    max-height: 200px;
  }

  .af-section {
    padding: 2.25rem 0;
  }

  .af-trust__grid {
    grid-template-columns: 1fr;
  }

  /* Keep product grids 2-up for scanability; stack content cards */
  .af-card-grid,
  .af-card-grid--4,
  .af-card-grid--3,
  .af-form-grid,
  .af-split-grid {
    grid-template-columns: 1fr;
  }
  .af-catalog-grid,
  .af-catalog-grid--dense,
  .af-woocommerce ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.65rem;
  }

  .af-btn-group .af-btn {
    width: 100%;
  }
  .af-btn-group {
    flex-direction: column;
  }

  .af-header__actions .af-btn--ghost {
    padding: 0.35rem 0.55rem;
  }
}

/* alpha-fulfillment-theme:responsive.css */
