/* Shared product card ("etiqueta"): home showcase, product carousel and shop loop. */

.nc-card-grid,
.catalog-products ul.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  justify-content: start;
  gap: clamp(1rem, 2.4vw, 1.75rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nc-card-grid::before,
.nc-card-grid::after,
.catalog-products ul.products::before,
.catalog-products ul.products::after {
  display: none;
}

body ul.products[class*="columns-"] li.product.nc-card-item,
body ul.products li.product.nc-card-item,
.nc-card-grid > li.nc-card-item {
  display: flex;
  min-width: 0;
  width: auto;
  float: none;
  clear: none;
  margin: 0;
  padding: 0;
}

.nc-card-item > .nc-card {
  flex: 1;
}

.nc-card {
  container-type: inline-size;
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  border: 1px solid var(--nc-line-light);
  border-radius: 0.35rem;
  background: var(--nc-digital-paper-raised);
  color: var(--nc-color-text);
  transition:
    border-color var(--nc-motion-base) var(--nc-ease-out),
    box-shadow var(--nc-motion-base) var(--nc-ease-out),
    transform var(--nc-motion-base) var(--nc-ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .nc-card:hover {
    border-color: var(--nc-official-latte);
    box-shadow: 0 0.9rem 2rem rgba(48, 30, 22, 0.1);
    transform: translateY(-0.2rem);
  }

  .nc-card:hover .nc-card__image {
    transform: scale(1.03);
  }
}

/* Square product photo. */
.nc-card__media {
  position: relative;
  display: grid;
  margin: 0.75rem 0.75rem 0;
  aspect-ratio: 1 / 1;
  place-items: center;
  overflow: hidden;
  border-radius: 0.25rem;
  background: var(--nc-digital-sand);
}

.nc-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--nc-motion-slow) var(--nc-ease-out);
}

.nc-card__media-fallback {
  width: 38%;
  height: 56%;
  border: 1px solid var(--nc-line-light);
  border-radius: 0.25rem;
  background: linear-gradient(145deg, var(--nc-digital-brown-700), #2d1b15);
}

.nc-card__promo {
  position: absolute;
  bottom: 0.6rem;
  left: 0.6rem;
  max-width: calc(100% - 1.2rem);
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: var(--nc-official-caffe);
  color: var(--nc-official-papel);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.25;
  text-align: center;
  text-transform: uppercase;
}

.nc-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1rem 1.1rem 0;
}

.nc-card__origin {
  margin: 0;
  color: var(--nc-color-text-muted);
  font-size: var(--nc-text-eyebrow);
  font-weight: 700;
  letter-spacing: var(--nc-tracking-eyebrow);
  line-height: 1.4;
  text-transform: uppercase;
}

.nc-card__title {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  font-family: var(--nc-body-font);
  font-size: clamp(1rem, 0.96rem + 0.15vw, 1.05rem);
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.3;
  overflow-wrap: break-word;
  text-wrap: balance;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.nc-card__link {
  color: inherit;
  text-decoration: none;
}

/* Stretched link: the whole card is clickable without nesting interactive elements. */
.nc-card__link::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  content: "";
}

.nc-card .nc-card__link:focus-visible {
  outline: none;
}

.nc-card__link:focus-visible::after {
  outline: 3px solid var(--nc-color-focus-light);
  outline-offset: 3px;
}

.nc-card__notes {
  margin-top: auto;
  padding-top: 0.1rem;
}

/* Tasting-note tags: three warm brand-derived tints cycling; text stays Caffe-dark (AA on every tint). */
.nc-card__notes li {
  border-color: transparent;
  background: #f3e1c7;
  color: #4e342e;
}

.nc-card__notes li:nth-child(3n + 2) {
  background: #f1ddd2;
  color: #5a3326;
}
.nc-card__notes li:nth-child(3n) {
  background: #e8e6d2;
  color: #484027;
}

.nc-card__buy {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.9rem 1.1rem 1.1rem;
}

.nc-card__body + .nc-card__buy {
  margin-top: 0.4rem;
}

.nc-card__price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.1rem 0.5rem;
  margin: 0;
  color: var(--nc-color-text);
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.nc-card__price ins {
  order: 1;
  text-decoration: none;
}
.nc-card__price del {
  order: 2;
  color: var(--nc-color-text-muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.nc-card__offers {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.nc-card__installments {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin: 0;
  max-width: 100%;
  color: var(--nc-color-text-muted);
  /* Always one line: the size follows the card width (container query units), capped at the regular size. */
  font-size: clamp(0.68rem, 4.6cqi, 0.85rem);
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
  white-space: nowrap;
}

.nc-card__installments-icon {
  flex: 0 0 auto;
  margin-top: 0.12em;
  color: var(--nc-official-caffe);
}
/* WooCommerce core styles turn every strong inside a shop loop item into a block; keep the amount inline. */
.nc-card__installment-amount,
.woocommerce ul.products li.product .nc-card__installment-amount {
  display: inline;
  color: var(--nc-official-caffe);
  font-weight: 800;
}

.nc-card__offer-note {
  opacity: 0.9;
}

/* Price paying by transfer: same one-line scale as the installments line, amount in brand color. */
.nc-card__transfer {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin: 0;
  max-width: 100%;
  color: var(--nc-color-text-muted);
  font-size: clamp(0.68rem, 4.6cqi, 0.85rem);
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
  white-space: nowrap;
}

.nc-card__transfer-icon {
  flex: 0 0 auto;
  margin-top: 0.12em;
  color: var(--nc-official-caffe);
}

.nc-card__transfer-amount,
.woocommerce ul.products li.product .nc-card__transfer-amount {
  display: inline;
  color: var(--nc-official-caffe);
  font-weight: 800;
}

/* Buy action sits above the stretched link. */
.nc-card.nc-card a.nc-card__action.button {
  position: relative;
  z-index: 2;
  /* Flex centres the label inside the 44px min-height (a block box left it stuck to the top padding). */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 2.75rem;
  margin-top: 0.35rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--nc-official-caffe);
  border-radius: 0.2rem;
  border-color: var(--nc-official-caffe);
  background: var(--nc-official-caffe);
  color: var(--nc-official-papel);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  touch-action: manipulation;
  transition:
    background-color var(--nc-motion-base) ease,
    border-color var(--nc-motion-base) ease,
    color var(--nc-motion-base) ease,
    opacity var(--nc-motion-base) ease;
}

/* Shop loop: WooCommerce's `.woocommerce ul.products li.product .button` (4 classes + 2 types) sets inline-block. */
.woocommerce ul.products li.product a.nc-card__action.button {
  display: flex;
  align-items: center;
  justify-content: center;
}

.nc-card.nc-card a.nc-card__action.button:hover {
  border-color: var(--nc-digital-brown-700);
  background: var(--nc-digital-brown-700);
  color: var(--nc-official-papel);
  transform: none;
}

.nc-card.nc-card a.nc-card__choose.button {
  background: transparent;
  color: var(--nc-official-caffe);
}

.nc-card.nc-card a.nc-card__choose.button:hover {
  color: var(--nc-official-papel);
}

.nc-card.nc-card a.nc-card__action.button:focus-visible {
  outline: 3px solid var(--nc-color-focus-light);
  outline-offset: 3px;
  box-shadow: none;
}

.nc-card__add.loading {
  opacity: 0.65;
  pointer-events: none;
}
.nc-card.nc-card a.nc-card__add.button.added {
  border-color: var(--nc-digital-brown-700);
  background: var(--nc-digital-brown-700);
}

/* The cart drawer opens on add; WooCommerce's inline "view cart" link is redundant. */
.nc-card .added_to_cart {
  display: none;
}

.nc-card__soldout {
  margin: 0.35rem 0 0;
  padding: 0.7rem 0;
  border-top: 1px solid var(--nc-line-light);
  color: var(--nc-color-text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .nc-card:hover {
    transform: none;
  }
  .nc-card:hover .nc-card__image {
    transform: none;
  }
}

/* Narrow cards (home carousel on tablets): drop the card icon so the one-line installments keep a readable size. */
@container (max-width: 16rem) {
  .nc-card__installments,
  .nc-card__transfer {
    font-size: clamp(0.72rem, 5cqi, 0.85rem);
  }
  .nc-card__installments-icon,
  .nc-card__transfer-icon {
    display: none;
  }
}
