/* ==========================================================
   CumpleHits - Selector de formatos de tarjeta
   Shortcode: [gm_card_formats]
   ========================================================== */

.gm-card-formats {
  --gm-cf-primary: #ff4d6d;
  --gm-cf-primary-dark: #d9365a;
  --gm-cf-orange: #ff8a00;
  --gm-cf-orange-light: #ffb347;
  --gm-cf-purple: #3f2b63;
  --gm-cf-text: #37275f;
  --gm-cf-muted: #716684;
  --gm-cf-border: #efe4ec;
  --gm-cf-disabled-bg: #eeeeee;
  --gm-cf-disabled-border: #d5d5d5;
  --gm-cf-disabled-text: #9b9b9b;

  width: 100%;
  text-align: center;
  box-sizing: border-box;
}

.gm-card-formats *,
.gm-card-formats *::before,
.gm-card-formats *::after {
  box-sizing: border-box;
}

/* Preview */

.gm-card-formats__preview-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 460px;
  margin-bottom: 18px;
  overflow: hidden;
}

.gm-card-formats__preview {
  display: block;
  width: auto;
  max-width: 320px;
  max-height: 420px;
  height: auto;
  object-fit: contain;
  border-radius: 22px;
  box-shadow: 0 18px 42px rgba(40, 20, 60, 0.22);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.gm-card-formats__preview.is-changing {
  opacity: 0.72;
  transform: scale(0.985);
}

/* Título */

.gm-card-formats__title {
  margin: 14px 0 18px;
  color: #ffffff;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.3;
}

/* Selector */

.gm-card-formats__selector {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
  margin: 0 auto;
}

/* Card base */

.gm-card-formats__option {
  position: relative;
  min-height: 132px;
  padding: 17px 14px 15px;
  border: 2px solid var(--gm-cf-border);
  border-radius: 18px;
  background: linear-gradient(180deg, #fffdfb 0%, #fff7f3 100%);
  color: var(--gm-cf-text);
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  outline: none;
  box-shadow: 0 12px 24px rgba(45, 22, 68, 0.14);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    opacity 0.18s ease;
}

.gm-card-formats__option:hover:not(.is-disabled):not(:disabled),
.gm-card-formats__option:focus-visible:not(.is-disabled):not(:disabled) {
  transform: translateY(-3px);
  border-color: #ff8799;
  box-shadow: 0 16px 32px rgba(45, 22, 68, 0.2);
}

.gm-card-formats__option.is-active {
  border-color: var(--gm-cf-primary);
  box-shadow:
    0 15px 30px rgba(45, 22, 68, 0.18),
    0 0 0 4px rgba(255, 77, 109, 0.22);
}

/* Check de seleccionado */

.gm-card-formats__option.is-active::after {
  content: "✓";
  position: absolute;
  top: -13px;
  right: -10px;
  width: 31px;
  height: 31px;
  border-radius: 50%;
  background: var(--gm-cf-primary);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 900;
  border: 3px solid #ffffff;
  box-shadow: 0 6px 14px rgba(255, 77, 109, 0.35);
}

/* Contenido de la card */

.gm-card-formats__icon {
  display: block;
  font-size: 30px;
  line-height: 1;
  margin-bottom: 8px;
}

.gm-card-formats__label {
  display: block;
  color: var(--gm-cf-text);
  font-size: 16px;
  font-weight: 850;
  line-height: 1.2;
  margin-bottom: 5px;
}

.gm-card-formats__description {
  display: block;
  color: var(--gm-cf-muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.25;
  margin-bottom: 5px;
}

.gm-card-formats__size {
  display: block;
  color: var(--gm-cf-text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

/* Estado deshabilitado */

.gm-card-formats__option.is-disabled,
.gm-card-formats__option:disabled {
  background: linear-gradient(180deg, #f2f2f2 0%, #e9e9e9 100%);
  border-color: var(--gm-cf-disabled-border);
  color: var(--gm-cf-disabled-text);
  cursor: not-allowed;
  box-shadow: none;
  opacity: 1;
  transform: none;
}

.gm-card-formats__option.is-disabled:hover,
.gm-card-formats__option:disabled:hover {
  transform: none;
  border-color: var(--gm-cf-disabled-border);
  box-shadow: none;
}

.gm-card-formats__option.is-disabled .gm-card-formats__icon,
.gm-card-formats__option:disabled .gm-card-formats__icon {
  filter: grayscale(1);
  opacity: 0.45;
}

.gm-card-formats__option.is-disabled .gm-card-formats__label,
.gm-card-formats__option:disabled .gm-card-formats__label,
.gm-card-formats__option.is-disabled .gm-card-formats__description,
.gm-card-formats__option:disabled .gm-card-formats__description,
.gm-card-formats__option.is-disabled .gm-card-formats__size,
.gm-card-formats__option:disabled .gm-card-formats__size {
  color: var(--gm-cf-disabled-text);
}

.gm-card-formats__status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 9px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #dedede;
  color: #8c8c8c;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

/* Botón descargar */

.gm-card-formats__download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 280px;
  margin-top: 18px;
  padding: 16px 28px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--gm-cf-orange-light) 0%, var(--gm-cf-orange) 100%);
  color: #ffffff !important;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.4px;
  text-decoration: none !important;
  text-transform: uppercase;
  box-shadow: 0 12px 24px rgba(255, 138, 0, 0.28);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    filter 0.18s ease;
}

.gm-card-formats__download::before {
  content: "⬇";
  font-size: 17px;
  line-height: 1;
}

.gm-card-formats__download:hover,
.gm-card-formats__download:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(255, 138, 0, 0.35);
  filter: brightness(1.03);
}

.gm-card-formats__download.is-disabled {
  pointer-events: none;
  background: #d8d8d8;
  color: #999999 !important;
  box-shadow: none;
}

/* Empty */

.gm-card-formats--empty {
  padding: 18px;
  border-radius: 14px;
  background: #f5f5f5;
  color: #777777;
  font-weight: 700;
}

/* Responsive */

@media (max-width: 900px) {
  .gm-card-formats__selector {
    gap: 12px;
  }

  .gm-card-formats__option {
    min-height: 126px;
    padding: 15px 10px 13px;
  }

  .gm-card-formats__label {
    font-size: 15px;
  }

  .gm-card-formats__description,
  .gm-card-formats__size {
    font-size: 12px;
  }
}

@media (max-width: 640px) {
  .gm-card-formats__selector {
    grid-template-columns: 1fr;
  }

  .gm-card-formats__option {
    min-height: auto;
    display: grid;
    grid-template-columns: 42px 1fr;
    column-gap: 12px;
    align-items: center;
    text-align: left;
    padding: 15px 16px;
  }

  .gm-card-formats__icon {
    grid-row: span 4;
    margin: 0;
    text-align: center;
  }

  .gm-card-formats__label,
  .gm-card-formats__description,
  .gm-card-formats__size,
  .gm-card-formats__status {
    text-align: left;
  }

  .gm-card-formats__status {
    width: fit-content;
  }

  .gm-card-formats__download {
    width: 100%;
    min-width: 0;
  }

  .gm-card-formats__preview {
    max-width: 280px;
    max-height: 360px;
  }
  .gm-card-formats__preview-wrap {
    height: 390px;
  }
}


