/* RELM: card de produto do Rio (snipplets/grid/item.tpl) com o visual RELM. Só CSS: formulários,
   classes js-*, data-* e componentes do item.tpl intactos.
   Usado em: Kits em destaque (Home), listagem (category/search) e produtos relacionados (product).
   Carregado por snipplets/relm/relm-head.tpl nesses templates. */

:is(.relm-kits, .template-category .js-product-table, .template-search .js-product-table, .template-product .js-swiper-related) {
  /* variáveis de cor do Rio, só dentro das grades: botão, selos e textos do card */
  --main-foreground: var(--relm-verde-escuro);
  --button-background: var(--relm-verde-botao);
  --button-foreground: var(--relm-creme);
  --label-background: var(--relm-amarelo);
  --label-foreground: var(--relm-verde-escuro);
  font-family: var(--relm-font-text);
}

/* O fundo do card é um ::before dentro da calha da coluna, para não depender de quais filhos o item.tpl renderiza
   (com ou sem o container de compra rápida). */
:is(.relm-kits, .template-category .js-product-table, .template-search .js-product-table, .template-product .js-swiper-related) .item-product { position: relative; margin-bottom: 0; padding-left: 10px; padding-right: 10px; }
:is(.relm-kits, .template-category .js-product-table, .template-search .js-product-table, .template-product .js-swiper-related) .item-product::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 10px; right: 10px; z-index: 0;
  background: var(--relm-creme-card);
  border-radius: 18px;
  box-shadow: 0 1px 0 rgba(14, 42, 20, .06), 0 10px 30px -18px rgba(14, 42, 20, .35);
  transition: box-shadow .25s ease;
}
:is(.relm-kits, .template-category .js-product-table, .template-search .js-product-table, .template-product .js-swiper-related) .item-product:hover::before { box-shadow: 0 1px 0 rgba(14, 42, 20, .06), 0 18px 40px -20px rgba(14, 42, 20, .45); }
:is(.relm-kits, .template-category .js-product-table, .template-search .js-product-table, .template-product .js-swiper-related) .item-product > * { position: relative; z-index: 1; }
:is(.relm-kits, .template-category .js-product-table, .template-search .js-product-table, .template-product .js-swiper-related) .item-image { border-radius: 18px 18px 0 0; background: var(--relm-creme-card); }
:is(.relm-kits, .template-category .js-product-table, .template-search .js-product-table, .template-product .js-swiper-related) .item-description { padding: 18px 20px 22px; text-align: left; }
:is(.relm-kits, .template-category .js-product-table, .template-search .js-product-table, .template-product .js-swiper-related) .item-link { color: var(--relm-verde-escuro); text-decoration: none; }
:is(.relm-kits, .template-category .js-product-table, .template-search .js-product-table, .template-product .js-swiper-related) .item-name {
  font-family: var(--relm-font-title); font-weight: 400; font-size: 20px; line-height: 1.25;
  margin-bottom: 10px !important;
}
:is(.relm-kits, .template-category .js-product-table, .template-search .js-product-table, .template-product .js-swiper-related) .item-price-container { font-size: 15px; }
:is(.relm-kits, .template-category .js-product-table, .template-search .js-product-table, .template-product .js-swiper-related) .item-price { color: var(--relm-verde-botao); font-size: 22px; font-weight: 700; }
:is(.relm-kits, .template-category .js-product-table, .template-search .js-product-table, .template-product .js-swiper-related) .price-compare { color: var(--relm-verde-escuro); opacity: .6; }
:is(.relm-kits, .template-category .js-product-table, .template-search .js-product-table, .template-product .js-swiper-related) .item-installments { font-size: 13px; opacity: .8; }
:is(.relm-kits, .template-category .js-product-table, .template-search .js-product-table, .template-product .js-swiper-related) .item-actions .btn,
:is(.relm-kits, .template-category .js-product-table, .template-search .js-product-table, .template-product .js-swiper-related) .js-item-quickshop .btn,
:is(.relm-kits, .template-category .js-product-table, .template-search .js-product-table, .template-product .js-swiper-related) .js-item-quickshop input[type="submit"] {
  width: 100%;
  border-radius: 999px;
  padding: 12px 18px;
  font-family: var(--relm-font-text);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .02em;
  text-transform: none;
}
:is(.relm-kits, .template-category .js-product-table, .template-search .js-product-table, .template-product .js-swiper-related) .label {
  border-radius: 999px;
  padding: 5px 12px;
  font-family: var(--relm-font-text);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .02em;
}

/* Área da imagem padronizada em 1:1. O componente do Rio dá a cada foto um padding-bottom inline
   com a proporção dela (100%, 102,3%, 102,9%...), o que desalinhava os cards; !important é a única forma
   de vencer o style="" inline. A foto preenche o quadrado com object-fit: cover. */
:is(.relm-kits, .template-category .js-product-table, .template-search .js-product-table, .template-product .js-swiper-related) .item-image > .position-relative {
  padding-bottom: 0 !important;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}
:is(.relm-kits, .template-category .js-product-table, .template-search .js-product-table, .template-product .js-swiper-related) .item-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: center;
  /* o Rio centraliza com left: 50% + translateX(-50%) !important (.img-absolute-centered) */
  -webkit-transform: none !important;
  transform: none !important;
}

/* Espaço entre a grade da listagem e o rodapé (os cards não têm margin-bottom; durante a animação
   de entrada do Rio, fade-in-up, eles descem 30px e o rodapé ficava por cima) */
.template-category .js-category-body,
.template-search .js-category-body { padding-bottom: 64px; }
@media (min-width: 768px) {
  .template-category .js-category-body,
  .template-search .js-category-body { padding-bottom: 96px; }
}

/* produtos relacionados (slider): o item não tem calha (p-0); o espaço vem do Swiper */
.template-product .js-swiper-related .item-product.js-item-slide::before { left: 0; right: 0; }

/* celular com 2 colunas: card mais compacto */
@media (max-width: 767px) {
  :is(.template-category, .template-search) .product-grid-mobile-2 .item-product { padding-left: 6px; padding-right: 6px; }
  :is(.template-category, .template-search) .product-grid-mobile-2 .item-product::before { left: 6px; right: 6px; border-radius: 14px; }
  :is(.template-category, .template-search) .product-grid-mobile-2 .item-image { border-radius: 14px 14px 0 0; }
  :is(.template-category, .template-search) .product-grid-mobile-2 .item-description { padding: 12px 12px 14px; }
  :is(.template-category, .template-search) .product-grid-mobile-2 .item-name { font-size: 16px; }
  :is(.template-category, .template-search) .product-grid-mobile-2 .item-price { font-size: 17px; }
  :is(.template-category, .template-search) .product-grid-mobile-2 .js-item-quickshop .btn,
  :is(.template-category, .template-search) .product-grid-mobile-2 .js-item-quickshop input[type="submit"] { padding: 10px 12px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  :is(.relm-kits, .template-category .js-product-table, .template-search .js-product-table, .template-product .js-swiper-related) .item-product::before { transition: none; }
}
