/*
  Ultracell V20.43 — Product Card + Maintenance Banner Fix
  Correção final incremental do catálogo mobile:
  1) foto do produto preenche 100% do espaço do card;
  2) banner/aviso de manutenção fica contido e alinhado;
  3) nome do produto deixa de cortar de forma agressiva.
  Build: 20-44-xiaomi-android-scroll-fix
*/

@media (max-width: 760px) {
  body.v19-store-mobile-active {
    overflow-x: hidden !important;
  }

  body.v19-store-mobile-active .v19-app,
  body.v19-store-mobile-active .v19-page,
  body.v19-store-mobile-active .v19-grid,
  body.v19-store-mobile-active #v19-product-grid {
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  /* 1) Banner/aviso de manutenção: card real, sem texto solto e sem estouro lateral. */
  body.v19-store-mobile-active .v19-topbar + .catalog-dev-notice-v19,
  body.v19-store-mobile-active .catalog-dev-notice-v19.is-text,
  body.v19-store-mobile-active .catalog-dev-notice.is-text:not(.is-image) {
    box-sizing: border-box !important;
    width: calc(100% - 24px) !important;
    max-width: calc(100% - 24px) !important;
    min-width: 0 !important;
    margin: 10px auto 12px !important;
    padding: 12px 14px !important;
    border-radius: 22px !important;
    border: 1px solid rgba(226, 232, 240, .98) !important;
    background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.98)) !important;
    color: #111827 !important;
    box-shadow: 0 12px 26px rgba(15, 23, 42, .075) !important;
    display: grid !important;
    grid-template-columns: 30px minmax(0, 1fr) !important;
    grid-auto-rows: auto !important;
    gap: 2px 9px !important;
    align-items: start !important;
    justify-content: stretch !important;
    text-align: left !important;
    overflow: hidden !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
    white-space: normal !important;
    contain: layout paint !important;
    touch-action: pan-y !important;
  }

  body.v19-store-mobile-active .catalog-dev-notice-v19.is-text::before,
  body.v19-store-mobile-active .catalog-dev-notice.is-text:not(.is-image)::before {
    content: '⚠' !important;
    grid-column: 1 !important;
    grid-row: 1 / span 2 !important;
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    border-radius: 12px !important;
    display: grid !important;
    place-items: center !important;
    background: #fff7ed !important;
    color: #c2410c !important;
    font-size: 14px !important;
    font-weight: 1000 !important;
    line-height: 1 !important;
  }

  body.v19-store-mobile-active .catalog-dev-notice-dot {
    display: none !important;
  }

  body.v19-store-mobile-active .catalog-dev-notice-v19.is-text strong,
  body.v19-store-mobile-active .catalog-dev-notice.is-text:not(.is-image) strong,
  body.v19-store-mobile-active .catalog-dev-notice-v19.is-text span:not(.catalog-dev-notice-dot),
  body.v19-store-mobile-active .catalog-dev-notice.is-text:not(.is-image) span:not(.catalog-dev-notice-dot) {
    grid-column: 2 !important;
    min-width: 0 !important;
    max-width: 100% !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
    line-height: 1.18 !important;
  }

  body.v19-store-mobile-active .catalog-dev-notice-v19.is-text strong,
  body.v19-store-mobile-active .catalog-dev-notice.is-text:not(.is-image) strong {
    color: #0f172a !important;
    font-size: clamp(12px, 3.55vw, 14px) !important;
    font-weight: 1000 !important;
    letter-spacing: -.02em !important;
  }

  body.v19-store-mobile-active .catalog-dev-notice-v19.is-text span:not(.catalog-dev-notice-dot),
  body.v19-store-mobile-active .catalog-dev-notice.is-text:not(.is-image) span:not(.catalog-dev-notice-dot) {
    color: #334155 !important;
    font-size: clamp(12px, 3.45vw, 14px) !important;
    font-weight: 650 !important;
  }

  /* 2) Cards: componente mais estável para título grande e ações no rodapé. */
  body.v19-store-mobile-active .v19-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
    padding: 10px 10px calc(22px + env(safe-area-inset-bottom, 0px)) !important;
    align-items: stretch !important;
    background: #eef2f7 !important;
  }

  body.v19-store-mobile-active .v19-product {
    min-width: 0 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    border-radius: 24px !important;
    border: 1px solid rgba(226,232,240,.96) !important;
    background: #ffffff !important;
    box-shadow: 0 12px 28px rgba(15,23,42,.07) !important;
    overflow: hidden !important;
  }

  /* 3) Foto do produto: preencher 100% da área da mídia. */
  body.v19-store-mobile-active .v19-product-media {
    position: relative !important;
    width: 100% !important;
    aspect-ratio: 1 / 1 !important;
    height: auto !important;
    min-height: clamp(150px, 44vw, 198px) !important;
    max-height: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 0 !important;
    overflow: hidden !important;
    background: radial-gradient(circle at 48% 18%, rgba(255,255,255,.16), transparent 34%), linear-gradient(145deg, #111827, #293244) !important;
    color: #fff !important;
    font-weight: 1000 !important;
    text-align: center !important;
    line-height: 1.14 !important;
    isolation: isolate !important;
  }

  body.v19-store-mobile-active .v19-product-media img {
    position: absolute !important;
    inset: 0 !important;
    z-index: 1 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    min-height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    object-fit: cover !important;
    object-position: center center !important;
    box-sizing: border-box !important;
    transform: none !important;
  }

  body.v19-store-mobile-active .v19-product-media.is-dark,
  body.v19-store-mobile-active .v19-product-media:not(:has(img)) {
    background: radial-gradient(circle at 45% 20%, rgba(255,255,255,.22), transparent 32%), linear-gradient(145deg, #111827, #293244) !important;
    color: #ffffff !important;
  }

  body.v19-store-mobile-active .v19-product-media.is-zoomable-product-photo::after {
    z-index: 5 !important;
    top: 8px !important;
    right: 8px !important;
    width: 36px !important;
    height: 36px !important;
    background: rgba(17, 24, 39, .72) !important;
    color: #fff !important;
    box-shadow: 0 10px 24px rgba(0,0,0,.20) !important;
  }

  body.v19-store-mobile-active .v19-premium-label {
    z-index: 4 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    background: var(--v19-premium-main, #101828) !important;
    color: var(--v19-premium-text, #fff) !important;
    pointer-events: none !important;
  }

  body.v19-store-mobile-active .v19-product-info {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 12px 10px 13px !important;
    overflow: visible !important;
  }

  /* 4) Nome do produto: sem corte agressivo. */
  body.v19-store-mobile-active .v19-name {
    display: block !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    margin: 0 !important;
    color: #101828 !important;
    font-size: clamp(14px, 4.05vw, 18px) !important;
    line-height: 1.08 !important;
    font-weight: 1000 !important;
    letter-spacing: -.04em !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
    -webkit-line-clamp: unset !important;
    line-clamp: unset !important;
    -webkit-box-orient: initial !important;
  }

  body.v19-store-mobile-active .v19-meta {
    min-height: 0 !important;
    margin-top: 2px !important;
    color: #64748b !important;
    font-size: clamp(10px, 2.95vw, 12px) !important;
    line-height: 1.23 !important;
    font-weight: 850 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body.v19-store-mobile-active .v19-stars {
    margin-top: 4px !important;
  }

  body.v19-store-mobile-active .v19-price {
    margin-top: 0 !important;
    font-size: clamp(24px, 7.2vw, 32px) !important;
    line-height: .98 !important;
  }

  body.v19-store-mobile-active .v19-add-row {
    margin-top: auto !important;
    padding-top: 8px !important;
    display: grid !important;
    grid-template-columns: minmax(72px, .82fr) minmax(96px, 1.18fr) !important;
    gap: 8px !important;
    align-items: center !important;
  }

  body.v19-store-mobile-active .v19-qty,
  body.v19-store-mobile-active .v19-add {
    min-height: 48px !important;
  }
}

@media (max-width: 360px) {
  body.v19-store-mobile-active .v19-grid {
    gap: 10px !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  body.v19-store-mobile-active .v19-product {
    border-radius: 21px !important;
  }

  body.v19-store-mobile-active .v19-product-media {
    min-height: 136px !important;
  }

  body.v19-store-mobile-active .v19-product-info {
    padding: 10px 8px 12px !important;
  }

  body.v19-store-mobile-active .v19-name {
    font-size: 13.5px !important;
    line-height: 1.08 !important;
  }

  body.v19-store-mobile-active .v19-add-row {
    grid-template-columns: 70px minmax(86px, 1fr) !important;
    gap: 7px !important;
  }
}
