@import url("compartilhado.css");

:root {
  --template-content-width: 65%;
  --template-mobile-width: 90%;
  --template-card-radius: 12px;
}

/* Uma única régua de largura para todas as páginas do template. */
@media (min-width: 900px) {
  .container,
  .shared-header__inner,
  .shared-footer__main,
  .shared-footer__assets {
    width: var(--template-content-width) !important;
    max-width: none !important;
    margin-inline: auto !important;
  }

  .container {
    padding-inline: 0 !important;
  }
}

@media (max-width: 899px) {
  .container,
  .shared-header__inner,
  .shared-footer__main,
  .shared-footer__assets {
    width: var(--template-mobile-width) !important;
    max-width: none !important;
    margin-inline: auto !important;
  }
}

/* Base visual única para cards de fotos/produtos das três páginas. */
:where(.product-card, .cherry-card, .related-card) {
  min-width: 0;
  width: 100%;
}

:where(.product-visual, .cherry-card__media, .related-card__image) {
  aspect-ratio: 4 / 5;
  border-radius: var(--template-card-radius);
}

:where(.product-visual > img, .cherry-card__clip img, .related-card__clip img) {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

:where(.buy-now-btn, .cherry-card__buy, .related-buy) {
  width: 100%;
  border-radius: 999px;
}

/* Componente global: formato e animação dos cards exibidos na página de produto. */
.template-product-card {
  position: relative;
  min-width: 0;
  width: 100%;
  cursor: pointer;
  transition: transform .45s ease !important;
}

.template-product-card__media {
  position: relative;
  aspect-ratio: 4 / 5 !important;
  overflow: visible;
}

.template-product-card__clip {
  overflow: hidden;
  border-radius: 15px !important;
  background: #f5e7ee;
  box-shadow: 0 4px 16px rgba(74, 45, 56, .08);
  transition: box-shadow .45s ease !important;
}

.template-product-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .7s ease, opacity .25s ease !important;
}

.template-product-card__content {
  padding-top: 13px;
}

.template-product-card__badge {
  position: absolute;
  z-index: 3;
  top: 15px;
  left: -7px;
  padding: 8px 14px 8px 19px;
  border-radius: 0 9px 9px 0;
  background: #f7bad1;
  color: #553440;
  font-size: .72rem;
  font-weight: 700;
}

.template-product-card__favorite,
.template-product-card__share {
  position: absolute;
  z-index: 4;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
}

.template-product-card__favorite {
  top: 10px;
  right: 10px;
  width: 42px !important;
  height: 42px !important;
  background: rgba(255, 255, 255, .95) !important;
  color: #f04d5b !important;
}

.template-product-card__share {
  right: 10px;
  bottom: 10px;
  width: 45px !important;
  height: 45px !important;
  background: #52303d !important;
  color: #fff !important;
  box-shadow: 0 10px 25px rgba(42, 33, 48, .2) !important;
}

.template-product-card__title {
  max-width: calc(100% - 48px);
  margin-bottom: 6px;
  font-weight: 500;
  line-height: 1.25;
}

.template-product-card__buy {
  display: block;
  width: 100%;
  margin-top: 10px;
  border-radius: 999px;
  transition: filter .25s ease, transform .25s ease !important;
}

@media (any-hover: hover) and (any-pointer: fine) {
  html body .template-product-card:hover {
    transform: translateY(-6px) !important;
  }

  html body .template-product-card:hover .template-product-card__clip {
    box-shadow: 0 22px 46px rgba(137, 112, 218, .2), 0 10px 28px rgba(245, 102, 180, .15) !important;
  }

  html body .template-product-card:hover .template-product-card__image {
    transform: scale(1.045) !important;
    filter: none !important;
  }

  html body .template-product-card:hover .template-product-card__favorite,
  html body .template-product-card:hover .template-product-card__share {
    transform: none !important;
  }

  html body .template-product-card:hover .template-product-card__buy {
    transform: translateY(-1px) !important;
    filter: saturate(1.25) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .template-product-card,
  .template-product-card__clip,
  .template-product-card__image,
  .template-product-card__favorite,
  .template-product-card__share,
  .template-product-card__buy {
    transition: none !important;
    transform: none !important;
    filter: none !important;
  }
}

/* Contenção horizontal real no iOS — somente celular. */
@media (max-width: 639px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overflow-x: clip;
  }

  body > * {
    max-width: 100%;
  }

  .products-secondary,
  .products-secondary .container {
    min-width: 0;
    max-width: 100%;
  }

  .products-secondary .product-grid {
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
    padding-inline: 0;
    box-sizing: border-box;
  }

  .products-secondary .product-card,
  .products-secondary .product-visual,
  .products-secondary .product-info {
    min-width: 0;
    max-width: 100%;
  }

  .shared-header,
  .shared-footer,
  main,
  section {
    max-width: 100%;
  }
}
