/*
 * TEC · Cards SPC-01 (catálogo), SPC-02 (elección de fragancia) y SPC-04 (flyer/destacado). B03.
 * Escena 4:5 reservada + bloque comercial HTML sobre superficie card. Altura flexible,
 * nombre y presentación íntegros, CTA al final, un solo destino por card.
 */

.tec-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--tec-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

.tec-card-grid > li {
  display: flex;
  min-inline-size: 0;
}

@media screen and (min-width: 1024px) {
  .tec-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* 320 CSS px o reflow: una columna si dos no admiten título y CTA. */
@media screen and (max-width: 359px) {
  .tec-card-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Base común ---------- */
.tec-card {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-inline-size: 0;
  overflow: hidden;
  border-radius: var(--tec-radius-card);
  background: var(--tec-surface-card);
  color: var(--tec-text-primary);
}

.tec-card__link {
  display: flex;
  flex: 1;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
  border-radius: inherit;
}

.tec-card__link:focus-visible {
  outline: var(--tec-focus-width) solid var(--tec-focus-light);
  outline-offset: var(--tec-focus-offset);
}

.tec-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--tec-s1);
  padding: var(--tec-s3);
}

.tec-card__eyebrow {
  margin: 0 0 var(--tec-s1);
  color: var(--tec-text-secondary);
  font-size: var(--tec-type-eyebrow);
  font-weight: 700;
  line-height: var(--tec-leading-eyebrow);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.tec-card__title {
  margin: 0;
  color: var(--tec-text-primary);
  font-family: var(--tec-font-serif);
  font-size: var(--tec-type-card-title);
  font-weight: 400;
  line-height: var(--tec-leading-h3);
  letter-spacing: 0;
  overflow-wrap: break-word;
}

.tec-card__price {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--tec-s2);
  margin: 0;
  color: var(--tec-color-cacao);
  font-size: var(--tec-type-price-card);
  font-weight: 700;
  line-height: var(--tec-leading-ui);
}

.tec-card__price [data-tec-availability] {
  color: var(--tec-status-unavailable);
  font-weight: 700;
}

.tec-card__note {
  margin: 0;
  color: var(--tec-text-secondary);
  font-size: var(--tec-type-help);
  line-height: 1.45;
}

.tec-card__cta {
  display: flex;
  flex-wrap: wrap;
  overflow-wrap: anywhere;
  align-items: center;
  justify-content: space-between;
  gap: var(--tec-s2);
  min-block-size: var(--tec-target);
  margin-block-start: auto;
  padding-block-start: var(--tec-s2);
  border-block-start: var(--tec-border-width) solid var(--tec-border-decorative);
  color: var(--tec-text-primary);
  font-size: var(--tec-type-ui);
  line-height: var(--tec-leading-ui);
}

.tec-card__cta .tec-arrow {
  color: var(--tec-color-cacao);
}

@media (hover: hover) and (pointer: fine) {
  .tec-card__link:hover .tec-card__cta-label {
    text-decoration: underline;
    text-underline-offset: 0.3em;
  }
}

@media screen and (min-width: 1024px) {
  .tec-card__body {
    padding: var(--tec-s4) var(--tec-s5);
  }
}

/* ---------- SPC-01 · estado agotado: visible, sin compra ---------- */
.tec-product-card[data-tec-available='false'] .tec-card__price [data-tec-price] {
  color: var(--tec-text-secondary);
}

/* ---------- SPC-04 · Flyer 4:5 / destacado ancho ---------- */
.tec-editorial-card .tec-scene,
.tec-editorial-card__art {
  position: relative;
  display: block;
  inline-size: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--tec-surface-panel);
}

.tec-editorial-card__art img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}

.tec-editorial-card--featured .tec-card__title {
  font-size: var(--tec-type-h3);
}

@media screen and (min-width: 768px) {
  .tec-editorial-card--featured .tec-card__link {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 5fr);
  }

  .tec-editorial-card--featured .tec-card__body {
    justify-content: center;
    gap: var(--tec-s2);
    padding: var(--tec-s8) var(--tec-s9);
  }

  .tec-editorial-card--featured .tec-card__cta {
    margin-block-start: var(--tec-s5);
  }
}

/* ---------- SPC-02 · Fragrance Journey Card ---------- */
.tec-choice {
  position: relative;
  display: flex;
  flex: 1;
  min-inline-size: 0;
  container-type: inline-size;
}

.tec-choice__input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.tec-choice__card {
  display: flex;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  border: var(--tec-border-width) solid var(--tec-border-decorative);
  border-radius: var(--tec-radius-card);
  background: var(--tec-surface-card);
  color: var(--tec-text-primary);
  cursor: pointer;
}

.tec-choice__media {
  display: block;
  flex: none;
}

.tec-choice__body > .tec-card__eyebrow,
.tec-choice__body > .tec-card__title,
.tec-choice__body > .tec-card__note {
  display: block;
}

.tec-choice__status {
  display: block;
  margin-block-start: var(--tec-s2);
  color: var(--tec-status-unavailable);
  font-size: var(--tec-type-help);
  font-weight: 700;
}

.tec-choice__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--tec-s1);
  padding: var(--tec-s4);
  background: var(--tec-surface-card);
}

.tec-choice__control {
  display: flex;
  align-items: center;
  gap: var(--tec-s3);
  box-sizing: border-box;
  min-block-size: var(--tec-target);
  margin-block-start: var(--tec-s4);
  padding: var(--tec-s2) var(--tec-s4);
  border: var(--tec-border-width) solid var(--tec-border-control);
  border-radius: var(--tec-radius-control);
  background: var(--tec-action-secondary-bg);
  color: var(--tec-action-secondary-fg);
  font-size: var(--tec-type-ui);
  font-weight: 700;
  line-height: var(--tec-leading-ui);
}

.tec-choice__indicator {
  flex: none;
  box-sizing: border-box;
  inline-size: 18px;
  block-size: 18px;
  border: var(--tec-selection-width) solid var(--tec-border-control);
  border-radius: 50%;
  background: var(--tec-surface-card);
}

.tec-choice__state {
  display: none;
  margin-inline-start: auto;
  font-weight: 700;
}

/* Seleccionada: borde 2 px con espacio reservado + texto + indicador, nunca solo color. */
.tec-choice__input:checked + .tec-choice__card {
  border-color: var(--tec-selection-border);
  box-shadow: inset 0 0 0 calc(var(--tec-selection-width) - var(--tec-border-width)) var(--tec-selection-border);
}

.tec-choice__input:checked + .tec-choice__card .tec-choice__control {
  border-color: var(--tec-selection-border);
  background: var(--tec-selection-bg);
  color: var(--tec-selection-fg);
}

.tec-choice__input:checked + .tec-choice__card .tec-choice__indicator {
  border-color: var(--tec-selection-border);
  background: radial-gradient(circle, var(--tec-selection-border) 0 4px, transparent 4.5px);
}

.tec-choice__input:checked + .tec-choice__card .tec-choice__state {
  display: inline;
}

.tec-choice__input:focus-visible + .tec-choice__card {
  outline: var(--tec-focus-width) solid var(--tec-focus-light);
  outline-offset: var(--tec-focus-offset);
}

/* Agotada: deshabilitada con texto explícito; la lectura no depende de opacidad. */
.tec-choice__input:disabled + .tec-choice__card {
  cursor: not-allowed;
}

.tec-choice__input:disabled + .tec-choice__card .tec-choice__control {
  border-style: dashed;
  background: var(--tec-surface-card);
  color: var(--tec-text-secondary);
}

.tec-choice__input:disabled + .tec-choice__card .tec-choice__indicator {
  border-style: dashed;
}

@media (hover: hover) and (pointer: fine) {
  .tec-choice__input:not(:disabled):not(:checked) + .tec-choice__card:hover .tec-choice__control {
    background: var(--tec-surface-panel);
  }
}

/* Desktop (RM-SPC-02), mismo corte que la retícula de 2 columnas: foto 4:5 a la izquierda y contenido
   a la derecha. Hasta 1023px, una columna con la foto arriba y la acción debajo. */
@media screen and (min-width: 1024px) {
  .tec-choice__card {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  }

  .tec-choice__body {
    justify-content: center;
    padding: var(--tec-s5) var(--tec-s6);
  }
}

.tec-choice-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--tec-s4);
  margin: 0;
  padding: 0;
  border: 0;
  list-style: none;
}

@media screen and (min-width: 1024px) {
  .tec-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--tec-gap);
  }
}
