/* Todas as categorias (/loja/ e /categoria-produtos/): atalhos → departamentos com foto → subcategorias → prateleiras.
   Mobile primeiro. Fotos com proporção fixa (sem salto de layout); blocos da mesma fileira sempre com a mesma altura. */

.cg-cab { padding: 16px 0 12px; }
.cg-cab h1 { font-size: 27px; color: var(--azul); }
.cg-cab p { margin: 4px 0 0; color: var(--suave); font-size: 15px; line-height: 1.45; }
.cg-cab .btn-link { font-size: 15px; min-height: 24px; }

/* ------------------------------------------------ atalhos */
.cg-atalhos ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cg-at { display: flex; align-items: center; gap: 10px; height: 100%; min-height: 64px; padding: 10px 12px 10px 10px; border-radius: var(--r-s); background: #fff; box-shadow: inset 0 0 0 1px var(--linha); text-decoration: none; }
.cg-at-ico { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 10px; background: #E7F1F7; color: var(--azul); }
.cg-at-ico .i { width: 21px; height: 21px; }
.cg-at-txt { display: grid; min-width: 0; line-height: 1.25; }
.cg-at-txt b { font-size: 14.5px; color: var(--texto); }
.cg-at-txt small { display: none; font-size: 12.5px; color: var(--suave); } /* a dica aparece a partir do tablet */
.cg-atalhos li:first-child .cg-at-ico { background: #FCE6F2; color: var(--rosa-btn); } /* ofertas: a única com a cor de destaque */

/* ------------------------------------------------ títulos das seções */
.cg-sec { margin-top: 24px; }
.cg-tit { font-size: 21px; color: var(--azul); margin-bottom: 10px !important; }

/* ------------------------------------------------ departamentos */
.cg-deps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cg-dep a { display: flex; flex-direction: column; height: 100%; border-radius: var(--r); background: #fff; box-shadow: var(--sombra); overflow: hidden; text-decoration: none; color: var(--texto); }
.cg-dep a:focus-visible { outline-offset: 3px; border-radius: var(--r); }
.cg-dep-foto { position: relative; display: block; aspect-ratio: 1 / 1; overflow: hidden; background: #EEF2F5; }
.cg-dep-foto img, .cg-sub-foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cg-dep-foto .g3l-semfoto, .cg-sub-foto .g3l-semfoto { position: absolute; inset: 0; background: #E7F1F7; color: var(--azul); }
.cg-dep-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 12px; }
.cg-dep-txt b { font-size: 15px; line-height: 1.25; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cg-dep-txt small { font-size: 13px; color: var(--suave); }
.cg-dep-n { display: none; } /* "· 6 subcategorias": só a partir do tablet (no celular quebrava em 2 linhas) */
.cg-dep-cta { display: inline-flex; align-items: center; gap: 2px; margin-top: auto; padding-top: 10px; color: var(--azul-link); font-weight: 700; font-size: 15px; }
.cg-dep-cta .i { width: 18px; height: 18px; }

/* destaque (o departamento com mais produtos): a linha inteira, foto ao lado do texto */
.cg-dep--destaque { grid-column: 1 / -1; }
.cg-dep--destaque a { flex-direction: row; }
.cg-dep--destaque .cg-dep-foto { flex: 0 0 calc((100% - 10px) / 2); }
.cg-dep--destaque .cg-dep-txt { flex: 1; min-width: 0; justify-content: center; padding: 14px 16px; }
.cg-dep--destaque .cg-dep-txt b { font: 400 23px/1.15 var(--marca); color: var(--azul); min-height: 0; }
.cg-dep--destaque .cg-dep-txt small { font-size: 14px; margin-top: 2px; }
.cg-dep--destaque .cg-dep-cta { margin-top: 0; }

/* ------------------------------------------------ subcategorias por departamento */
.cg-grupos { display: grid; gap: 10px; }
.cg-grupo { background: #fff; border-radius: var(--r); box-shadow: var(--sombra); padding: 4px 14px 14px; }
.cg-grupo-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cg-grupo-cab h3 { font-size: 18px; color: var(--azul); min-width: 0; }
.cg-ver { display: inline-flex; align-items: center; flex: none; min-height: 44px; color: var(--azul-link); font-weight: 700; font-size: 14px; text-decoration: none; }
.cg-ver .i { width: 18px; height: 18px; }
.cg-subs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px; }
.cg-sub { display: flex; flex-direction: column; gap: 1px; height: 100%; text-decoration: none; color: var(--texto); border-radius: 12px; }
.cg-sub-foto { position: relative; display: block; aspect-ratio: 1 / 1; border-radius: 12px; overflow: hidden; background: #EEF2F5; margin-bottom: 6px; }
.cg-sub-nome { font-size: 14px; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cg-sub small { font-size: 12.5px; color: var(--suave); }

/* fotos aparecem suavemente ao carregar (a 1ª fileira não espera) */
html.js .cg img:not([loading="eager"]):not(.is-ok) { opacity: 0; animation: g3l-mostra 0s 3s forwards; }
html.js .cg img { transition: opacity .18s ease-out, transform .25s var(--ease-sai, ease-out); }

/* toque: resposta imediata */
@media (hover: none) {
	.cg-at:active, .cg-dep a:active { background-color: #EEF3F7; }
	.cg-dep a:active img, .cg-sub:active img { transform: scale(.97); }
}
/* mouse: a foto cresce um pouco, o nome ganha sublinhado */
@media (hover: hover) {
	.cg-at:hover { box-shadow: inset 0 0 0 1.5px var(--azul2); }
	.cg-dep a:hover img, .cg-sub:hover img { transform: scale(1.04); }
	.cg-dep a:hover b, .cg-sub:hover .cg-sub-nome { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
	.cg-ver:hover { text-decoration: underline; text-underline-offset: 3px; }
}
@media (prefers-reduced-motion: reduce) { html.js .cg img { transition: none; } .cg-dep a:hover img, .cg-sub:hover img, .cg-dep a:active img, .cg-sub:active img { transform: none; } }

@media (max-width: 359px) {
	.cg-atalhos ul { grid-template-columns: 1fr; }
	.cg-dep--destaque .cg-dep-txt b { font-size: 20px; }
}

/* ------------------------------------------------ tablet: 3 colunas */
@media (min-width: 600px) {
	.cg-atalhos ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.cg-at-txt small, .cg-dep-n { display: inline; }
	.cg-deps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
	.cg-dep--destaque .cg-dep-foto { flex-basis: calc((100% - 24px) / 3); }
	.cg-dep--destaque .cg-dep-txt { padding: 20px 24px; }
	.cg-dep--destaque .cg-dep-txt b { font-size: 28px; }
	.cg-subs { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
}
@media (min-width: 900px) {
	.cg-atalhos ul { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}

/* ------------------------------------------------ computador: 4 colunas, destaque 2×2 */
@media (min-width: 1024px) {
	.cg-cab { padding: 24px 0 16px; }
	.cg-cab h1 { font-size: 34px; }
	.cg-sec { margin-top: 32px; }
	.cg-tit { font-size: 24px; margin-bottom: 14px !important; }
	.cg-deps { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-flow: dense; gap: 16px; }
	.cg-dep-foto { aspect-ratio: 4 / 3; }
	.cg-dep-txt { padding: 12px 14px 14px; }
	.cg-dep-txt b { font-size: 16px; }
	.cg-dep--destaque { grid-column: span 2; grid-row: span 2; }
	.cg-dep--destaque a { flex-direction: column; }
	.cg-dep--destaque .cg-dep-foto { flex: 1 1 auto; aspect-ratio: auto; min-height: 220px; }
	.cg-dep--destaque .cg-dep-txt { flex: none; flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 14px; padding: 16px 20px 18px; }
	.cg-dep--destaque .cg-dep-txt b { font-size: 30px; flex-basis: 100%; }
	.cg-dep--destaque .cg-dep-cta { margin-left: auto; padding-top: 0; }
	.cg-grupos { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: dense; gap: 16px; }
	.cg-grupo { padding: 8px 20px 20px; }
	.cg-grupo--largo { grid-column: 1 / -1; }
	.cg-subs { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 16px 14px; }
	.cg-grupo--largo .cg-subs { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
}
