/* VetUberaba — Guia de raças bovinas (guia-racas-bovinas.html). Celular primeiro; no PC fica centralizado e com mais colunas. */
.rc-main { padding-bottom: 110px; }
.rc-wrap { max-width: 980px; margin: 0 auto; }
.rc-wrap [hidden], .rc-sheet[hidden], .rc-topo[hidden] { display: none !important; }

/* Abertura */
.rc-top { display: flex; align-items: center; gap: 14px; margin: 0 0 14px; padding: 14px 16px; border-radius: 18px; background: #fff; box-shadow: 0 4px 14px rgba(20, 64, 42, .10); }
.rc-top img { width: 72px; height: 72px; flex: 0 0 72px; object-fit: contain; }
.rc-top h2 { margin: 0 0 4px; font-size: 17px; line-height: 1.25; color: var(--primary-blue); }
.rc-top p { margin: 0; font-size: 13.5px; line-height: 1.45; color: #4b5563; }
.rc-top b { color: var(--primary-blue); }

/* Busca + letras (fica visível ao rolar) */
.rc-find { position: sticky; top: 0; z-index: 30; margin: 0 -24px 6px; padding: 8px 24px 8px; background: var(--bg-color, #f4f6f8); }
.rc-search { position: relative; display: flex; align-items: center; }
.rc-search > i { position: absolute; left: 15px; font-size: 19px; color: var(--primary-blue); pointer-events: none; }
.rc-input { width: 100%; box-sizing: border-box; min-height: 52px; padding: 12px 52px 12px 46px; font: inherit; font-size: 16px; color: #1f2937; background: #fff; border: 2px solid #d9e0e8; border-radius: 14px; outline: none; -webkit-appearance: none; appearance: none; }
.rc-input:focus { border-color: var(--primary-blue); box-shadow: 0 0 0 4px rgba(27, 59, 100, .1); }
.rc-input::placeholder { color: #8a97a5; }
.rc-input::-webkit-search-cancel-button, .rc-input::-webkit-search-decoration { display: none; -webkit-appearance: none; }
.rc-clear { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 10px; background: #e8eff8; color: var(--primary-blue); font-size: 16px; cursor: pointer; -webkit-tap-highlight-color: transparent; }

.rc-az { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.rc-az::-webkit-scrollbar { display: none; }
.rc-az button { flex: 0 0 auto; min-width: 38px; height: 38px; padding: 0 8px; border: 1px solid #e0e6ed; border-radius: 11px; background: #fff; color: var(--primary-blue); font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.rc-az button:active { background: var(--primary-blue); color: #fff; }

/* Filtros */
.rc-chips { display: flex; gap: 8px; overflow-x: auto; padding: 8px 2px 12px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.rc-chips::-webkit-scrollbar { display: none; }
.rc-chips .vu-chip { min-height: 40px; padding: 8px 14px; font-size: 14px; white-space: nowrap; -webkit-tap-highlight-color: transparent; }
.rc-chips .vu-chip small { margin-left: 4px; font-size: 11.5px; font-weight: 700; opacity: .65; }

.rc-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.rc-count { margin: 0; font-size: 13.5px; font-weight: 700; color: #4b5563; }
.rc-view { display: inline-flex; flex: 0 0 auto; background: #e8eff8; border-radius: 12px; padding: 3px; }
.rc-view button { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; border: 0; background: transparent; font: inherit; font-size: 13px; font-weight: 700; color: var(--primary-blue); padding: 0 12px; border-radius: 10px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.rc-view button.is-on { background: #fff; box-shadow: 0 1px 4px rgba(27, 59, 100, .18); }

/* Seções por letra */
.rc-sec + .rc-sec { margin-top: 26px; }
.rc-sec-h { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; scroll-margin-top: 100px; }
.rc-sec-l { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; background: var(--secondary-orange); color: #fff; font-size: 19px; font-weight: 800; box-shadow: 0 3px 8px rgba(235, 130, 35, .3); }
.rc-sec-n { font-size: 12.5px; font-weight: 700; color: #6b7280; }

/* Cartões */
.rc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rc-card { display: flex; flex-direction: column; width: 100%; padding: 0; margin: 0; overflow: hidden; text-align: left; font: inherit; color: inherit; background: #fff; border: 1px solid #e5e9ef; border-radius: 16px; box-shadow: 0 2px 8px rgba(27, 59, 100, .06); cursor: pointer; -webkit-appearance: none; appearance: none; -webkit-tap-highlight-color: transparent; transition: transform .12s, box-shadow .15s; }
.rc-card:active { transform: scale(.975); }
.rc-card:focus-visible { outline: 3px solid var(--secondary-orange); outline-offset: 2px; }
.rc-ph { display: block; position: relative; padding-top: 66.6%; background: #e8eff8; overflow: hidden; }
.rc-ph img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.rc-tx { display: block; padding: 10px 12px 12px; min-width: 0; }
.rc-nm { display: block; font-size: 15.5px; font-weight: 800; line-height: 1.25; color: var(--primary-blue); overflow-wrap: anywhere; }
.rc-or { display: flex; align-items: flex-start; gap: 5px; margin-top: 5px; font-size: 12.5px; font-weight: 600; line-height: 1.35; color: #3f7a2b; }
.rc-or i { flex: 0 0 auto; margin-top: 1px; font-size: 14px; }
.rc-or span { min-width: 0; overflow-wrap: anywhere; }
.rc-ds { display: none; margin-top: 6px; font-size: 13.5px; line-height: 1.5; color: #4b5563; }

/* Modo lista: foto pequena + texto completo */
.is-lista .rc-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.is-lista .rc-card { flex-direction: row; align-items: stretch; }
.is-lista .rc-ph { flex: 0 0 116px; padding-top: 0; min-height: 96px; }
.is-lista .rc-tx { padding: 11px 13px 12px; }
.is-lista .rc-ds { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }

.rc-empty { text-align: center; background: #fff; border: 1px dashed #cdd6e0; border-radius: 16px; padding: 26px 18px; }
.rc-empty p { margin: 0 0 14px; font-size: 14.5px; line-height: 1.6; color: #4b5563; }
.rc-nota { margin: 26px 0 0; font-size: 12.5px; line-height: 1.55; color: #6b7280; }
.rc-nota i { vertical-align: -2px; color: var(--primary-blue); }

/* Voltar ao topo */
.rc-topo { position: fixed; right: 16px; bottom: calc(86px + env(safe-area-inset-bottom, 0px)); z-index: 60; width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: var(--primary-blue); color: #fff; font-size: 20px; box-shadow: 0 6px 16px rgba(27, 59, 100, .35); cursor: pointer; -webkit-tap-highlight-color: transparent; }

/* Ficha da raça: sobe do rodapé no celular, janela centralizada no PC */
html.rc-lock, html.rc-lock body { overflow: hidden; }
.rc-sheet { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: flex-end; justify-content: center; }
.rc-sheet-bg { position: absolute; inset: 0; background: rgba(15, 28, 46, .55); opacity: 0; transition: opacity .2s; }
.rc-sheet.is-on .rc-sheet-bg { opacity: 1; }
.rc-sheet-box { position: relative; width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; background: #fff; border-radius: 24px 24px 0 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, .25); outline: none; transform: translateY(100%); transition: transform .26s cubic-bezier(.2, .8, .2, 1); padding-bottom: env(safe-area-inset-bottom, 0px); }
.rc-sheet.is-on .rc-sheet-box { transform: translateY(0); }
.rc-sheet-drag { touch-action: pan-x; }
.rc-grip { display: block; width: 44px; height: 5px; margin: 9px auto 9px; border-radius: 3px; background: #cfd7e0; }
.rc-sheet-img { position: relative; background: #e8eff8; }
.rc-sheet-img img { display: block; width: 100%; height: auto; max-height: 46vh; object-fit: cover; }
.rc-x { position: absolute; right: 12px; top: 12px; z-index: 2; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .95); color: var(--primary-blue); font-size: 18px; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.rc-sheet-body { position: relative; padding: 16px 20px 6px; }
.rc-letra { position: absolute; right: 18px; top: 10px; font-size: 44px; font-weight: 800; line-height: 1; color: #eef2f7; pointer-events: none; }
.rc-sheet-body h2 { margin: 0 0 8px; padding-right: 44px; font-size: 22px; line-height: 1.2; color: var(--primary-blue); overflow-wrap: anywhere; }
.rc-sheet-or { display: flex; align-items: flex-start; gap: 7px; margin: 0 0 10px; font-size: 14.5px; line-height: 1.4; color: #3f7a2b; }
.rc-sheet-or i { flex: 0 0 auto; margin-top: 1px; font-size: 17px; }
.rc-sheet-or b { color: #2f5c20; }
.rc-sheet-ds { margin: 0 0 14px; font-size: 16px; line-height: 1.6; color: #374151; overflow-wrap: anywhere; }
.rc-sheet-ds p { margin: 0 0 10px; }
.rc-sheet-ds p:last-child { margin-bottom: 0; }
.rc-sheet-alt { margin: -2px 0 10px; font-size: 13.5px; line-height: 1.45; color: #6b7280; overflow-wrap: anywhere; }
.rc-sheet-alt b { color: #4b5563; }
.rc-sheet-alt[hidden], .rc-sheet-or[hidden] { display: none; }
.rc-share { gap: 7px; }
.rc-sheet-nav { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px 14px; background: #fff; border-top: 1px solid #eef0f3; }
.rc-sheet-nav .vu-btn { min-height: 48px; padding: 0 14px; font-size: 14.5px; }
.rc-sheet-nav .vu-btn[disabled] { opacity: .4; }
.rc-pos { flex: 1; text-align: center; font-size: 12.5px; font-weight: 700; color: #6b7280; }
.rc-sheet.is-troca .rc-sheet-img img, .rc-sheet.is-troca .rc-sheet-body { animation: rcTroca .22s ease-out; }
@keyframes rcTroca { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }

@media (min-width: 640px) {
    .rc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
    .is-lista .rc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rc-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(27, 59, 100, .14); }
    .rc-sheet { align-items: center; }
    .rc-sheet-box { border-radius: 24px; max-height: 88vh; transform: translateY(24px) scale(.98); opacity: 0; transition: transform .22s, opacity .22s; }
    .rc-sheet.is-on .rc-sheet-box { transform: none; opacity: 1; }
    .rc-grip { display: none; }
    .rc-sheet-drag { padding-top: 0; }
    .rc-topo { bottom: 28px; right: 28px; }
    .rc-find { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
}
@media (min-width: 960px) {
    .rc-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .is-lista .rc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 340px) {
    .rc-nm { font-size: 14.5px; }
    .rc-view button i { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .rc-sheet-box, .rc-sheet-bg, .rc-card { transition: none; }
    .rc-sheet.is-troca .rc-sheet-img img, .rc-sheet.is-troca .rc-sheet-body { animation: none; }
}
html.lite .rc-card { box-shadow: none; transition: none; }
html.lite .rc-sheet-box, html.lite .rc-sheet-bg { transition: none; }

/* A barra de busca fica visível ao rolar: o contêiner do app corta só o excesso lateral, sem virar área de rolagem */
body[data-page="guia-racas-bovinas"] .app-container { overflow-x: clip; }
