/* CrediFlex | Catálogo mobile-first. A cor vem de --catalog-primary, definida pelo painel. */
body.catalog-body {
  --catalog-safe-bottom: env(safe-area-inset-bottom,0px);
  min-width: 0;
  min-height: 100dvh;
  overflow-x: clip !important;
  overflow-y: auto !important;
}
body.catalog-body :where(.catalog-wrap,.catalog-top,.catalog-main,.catalog-listing,.catalog-products,.catalog-product,.catalog-product__details) {
  min-width: 0;
}
body.catalog-body :where(.catalog-product h3,.catalog-product__category,.catalog-detail__info h1) { overflow-wrap: anywhere; }
body.catalog-body :where(.catalog-product__action,.catalog-detail__buy,.catalog-search button,.catalog-hero__cta) {
  min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  touch-action: manipulation;
}
body.catalog-body .catalog-product__picture { overflow: hidden; }
body.catalog-body .catalog-product__picture img {
  display: block; width: 100%; height: 100%;
  object-fit: contain; object-position: center;
}
body.catalog-body .catalog-header { background: var(--catalog-header-band) !important; }
body.catalog-body .catalog-brand__mark { background: var(--catalog-primary); box-shadow: none; }
body.catalog-body .catalog-detail__description { overflow-wrap: anywhere; }
body.catalog-body .catalog-search input { font-size: 16px !important; }
body.catalog-body .catalog-header__nav a { min-height: 44px; }
body.catalog-body :where(.catalog-categories,.catalog-listing,#produtos,#categorias) { scroll-margin-top: 95px; }

@media (max-width: 760px) {
  :root {
    /* Cabeçalho e faixa azul compartilham o mesmo tom, também no mobile. */
    --catalog-header-band: color-mix(in srgb, var(--catalog-primary) 48%, #10213e);
  }
  body.catalog-body {
    padding-bottom: calc(74px + var(--catalog-safe-bottom));
    font-size: 13px;
  }
  body.catalog-body .catalog-wrap {
    width: min(100% - 28px, 540px) !important;
    max-width: calc(100% - 28px) !important;
    margin-inline: auto;
  }
  body.catalog-body .catalog-header {
    top: 0; z-index: 101;
    background: var(--catalog-header-band) !important;
  }
  body.catalog-body .catalog-header__inner {
    min-height: calc(62px + env(safe-area-inset-top,0px));
    padding-top: env(safe-area-inset-top,0px);
    gap: 9px;
  }
  body.catalog-body .catalog-brand { min-width: 0; gap: 8px; }
  body.catalog-body .catalog-brand__mark {
    flex: 0 0 39px; height: 39px; width: 39px; border-radius: 12px;
    background: var(--catalog-primary); color: #fff;
  }
  body.catalog-body .catalog-brand__identity { min-width: 0; }
  body.catalog-body .catalog-brand__identity strong {
    font-size: clamp(14px,4.4vw,18px); font-weight: 700;
    overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  }
  body.catalog-body .catalog-brand__identity small { font-size: 9px; }
  body.catalog-body .catalog-header__nav { gap: 6px; flex: 0 0 auto; }
  body.catalog-body .catalog-header__nav a {
    min-width: 44px; min-height: 44px;
    padding: 8px 10px !important; font-size: 11px;
    border-radius: 12px;
  }
  body.catalog-body .catalog-header__current { display: none !important; }
  body.catalog-body .catalog-top {
    padding-top: 13px;
    background: linear-gradient(to bottom, var(--catalog-header-band) 0%,var(--catalog-header-band) 42%,var(--catalog-bg) 42%,var(--catalog-bg) 100%);
  }
  body.catalog-body .catalog-search { width: 100%; max-width: 100%; min-height: 51px; gap: 9px; }
  body.catalog-body .catalog-search input { min-width: 0; width: 100%; font-size: 16px !important; }
  body.catalog-body .catalog-search button { flex: 0 0 43px; min-height: 42px; }
  body.catalog-body .catalog-hero {
    width: 100%; min-width: 0; min-height: 184px;
    grid-template-columns: minmax(0,1fr) minmax(74px,26%);
    border-radius: 19px;
    overflow: hidden;
  }
  body.catalog-body .catalog-hero__copy { min-width: 0; padding: clamp(15px,4vw,23px); }
  body.catalog-body .catalog-hero h1 {
    font-size: clamp(21px,5.4vw,29px) !important;
    line-height: 1.17 !important; margin: 9px 0;
    max-width: 100%; overflow-wrap: anywhere;
  }
  body.catalog-body .catalog-hero p { font-size: 11px !important; line-height: 1.48; margin-bottom: 12px; }
  body.catalog-body .catalog-hero__cta { font-size: 11px !important; padding: 9px 12px; }
  body.catalog-body .catalog-main { padding-top: 25px; padding-bottom: calc(25px + var(--catalog-safe-bottom)); }
  body.catalog-body .catalog-heading { min-width: 0; gap: 9px; }
  body.catalog-body .catalog-heading h2 { font-size: clamp(19px,5.7vw,24px); line-height: 1.3; }
  body.catalog-body .catalog-categories { margin-bottom: 24px; }
  body.catalog-body .catalog-products {
    width: 100%; min-width: 0; display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: clamp(8px,2.7vw,13px);
  }
  body.catalog-body .catalog-product {
    min-width: 0; height: 100%; display: flex; flex-direction: column;
    border-radius: 16px; overflow: hidden;
  }
  body.catalog-body .catalog-product__picture { width: 100%; aspect-ratio: 1/1; flex: 0 0 auto; }
  body.catalog-body .catalog-product__picture img { padding: 0 !important; max-width: 100%; object-fit: contain; }
  body.catalog-body .catalog-product__details { flex: 1; padding: clamp(9px,2.5vw,13px); gap: 6px; }
  body.catalog-body .catalog-product h3 { font-size: clamp(11px,3.2vw,13px) !important; line-height: 1.4; }
  body.catalog-body .catalog-product__category { font-size: 10px; }
  body.catalog-body .catalog-product__price { font-size: clamp(16px,4.3vw,21px); }
  body.catalog-body .catalog-product__action {
    width: 100%; padding: 10px 8px;
    min-height: 44px; font-size: clamp(10px,2.8vw,12px) !important;
    border-radius: 11px; text-align: center;
  }
  body.catalog-body .catalog-product__action--whatsapp {
    overflow-wrap: anywhere; min-height: 44px;
  }
  body.catalog-body .catalog-mobile-nav {
    left: 0; right: 0; bottom: 0;
    width: 100%; height: auto;
    min-height: calc(67px + var(--catalog-safe-bottom));
    grid-template-columns: repeat(5,minmax(0,1fr));
    gap: 2px;
    padding: 6px max(7px,env(safe-area-inset-right,0px)) calc(6px + var(--catalog-safe-bottom)) max(7px,env(safe-area-inset-left,0px));
    background: #fff !important;
    box-shadow: 0 -5px 18px rgba(19,46,96,.07);
  }
  body.catalog-body .catalog-mobile-nav a {
    min-width: 0; min-height: 54px;
    gap: 3px; padding: 5px 1px;
    font-size: clamp(9px,2.7vw,11px) !important;
    font-weight: 550 !important;
    border-radius: 11px;
    text-align: center;
    touch-action: manipulation;
  }
  body.catalog-body .catalog-mobile-nav a.is-active {
    color: var(--catalog-primary) !important;
    background: color-mix(in srgb, var(--catalog-primary) 8%, #fff);
  }
  body.catalog-body .catalog-mobile-nav a i { font-size: 22px; }
  body.catalog-body .catalog-detail {
    padding-top: 17px;
    padding-bottom: 28px;
    width: min(100% - 28px, 540px) !important;
    max-width: calc(100% - 28px) !important;
  }
  body.catalog-body .catalog-detail__card {
    display: grid; grid-template-columns: minmax(0,1fr);
    border-radius: 18px;
  }
  body.catalog-body .catalog-detail__image { min-height: 220px; max-width: 100%; }
  body.catalog-body .catalog-detail__image img { max-height: 330px; width: 100%; object-fit: contain; }
  body.catalog-body .catalog-detail__info { padding: clamp(15px,4vw,22px); }
  body.catalog-body .catalog-detail__info h1 { font-size: clamp(21px,5.8vw,27px); }
  body.catalog-body .catalog-detail__buy { width: 100%; min-height: 49px; font-size: 13px; }
  body.catalog-body .catalog-detail__description { padding: 17px; }
  body.catalog-body .catalog-footer__inner { overflow-wrap: anywhere; }
  body.catalog-body :where(#produtos,#categorias,.catalog-categories,.catalog-listing) { scroll-margin-top: 92px; }
}
@media (max-width: 360px) {
  body.catalog-body .catalog-wrap,body.catalog-body .catalog-detail {
    width: calc(100% - 20px) !important;
    max-width: calc(100% - 20px) !important;
  }
  body.catalog-body .catalog-brand__identity strong { font-size: 14px; }
  body.catalog-body .catalog-header__store { min-width: 44px; padding-inline: 7px !important; }
  body.catalog-body .catalog-header__store span { display: none !important; }
  body.catalog-body .catalog-hero { grid-template-columns: minmax(0,1fr) 70px; }
  body.catalog-body .catalog-hero__copy { padding: 13px; }
  body.catalog-body .catalog-hero h1 { font-size: 20px !important; }
  body.catalog-body .catalog-hero p { font-size: 10px !important; }
  body.catalog-body .catalog-hero__art { overflow: hidden; }
  body.catalog-body .catalog-product__details { padding: 9px; }
  body.catalog-body .catalog-product__action { font-size: 10px !important; }
}
@media (min-width:761px) and (max-width: 1180px) {
  body.catalog-body .catalog-wrap { width: min(100% - 42px,1220px); }
  body.catalog-body .catalog-products { gap: 15px; }
  body.catalog-body .catalog-product { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  body.catalog-body * { scroll-behavior: auto !important; }
}


/* Ajuste: ícones maiores no menu mobile do catálogo */
@media (max-width: 760px) {
  body.catalog-body .catalog-mobile-nav a { min-height: 58px !important; gap: 4px !important; font-size: clamp(10px,2.8vw,12px) !important; }
  body.catalog-body .catalog-mobile-nav a i, body.catalog-body .catalog-mobile-nav a .bi { font-size: 24px !important; line-height: 1 !important; }
}
