/* Fanzine Puerto Rico — Calculadora de precios */

.fpr-price-tool,
.fpr-price-tool * {
  box-sizing: border-box;
}

.fpr-price-tool {
  --fpr-pink: #d6014b;
  --fpr-pink-dark: color-mix(in srgb, var(--fpr-pink), #000 22%);
  --fpr-black: #1d1d1f;
  --fpr-charcoal: #29292d;
  --fpr-text: #333338;
  --fpr-muted: #6b6b72;
  --fpr-border: #d9d9de;
  --fpr-soft: #f5f5f7;
  --fpr-white: #fff;
  --fpr-yellow: #ffcf33;
  --fpr-blue: #edf5f8;
  --fpr-max-width: 1040px;

  container-name: fpr-calculator;
  container-type: inline-size;

  width: 100%;
  max-width: var(--fpr-max-width);
  margin: 0 auto;
  overflow: hidden;

  color: var(--fpr-text);
  background: var(--fpr-white);
  border: 1px solid var(--fpr-border);
  border-radius: 16px;
  box-shadow: 0 2px 4px rgb(0 0 0 / 4%), 0 16px 38px rgb(0 0 0 / 10%);

  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

.fpr-price-tool__header {
  position: relative;
  overflow: hidden;
  padding: 36px;
  color: var(--fpr-white);
  background: linear-gradient(135deg, var(--fpr-black) 0%, var(--fpr-charcoal) 64%, #35101e 100%);
  border-bottom: 6px solid var(--fpr-pink);
}

.fpr-price-tool__header-content {
  position: relative;
  z-index: 2;
  max-width: 740px;
}

.fpr-price-tool__pattern {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(6, auto);
  gap: 10px 16px;
  width: 290px;
  color: rgb(255 255 255 / 26%);
  font-family: "Courier New", "DejaVu Sans", Arial, sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 1px 0 rgb(0 0 0 / 35%);
  transform: rotate(-5deg);
  pointer-events: none;
  user-select: none;
}

.fpr-price-tool__badge {
  display: inline-block;
  margin-bottom: 14px;
  padding: 5px 11px;
  color: var(--fpr-black);
  background: var(--fpr-yellow);
  border: 2px solid var(--fpr-black);
  border-radius: 4px;
  box-shadow: 3px 3px 0 var(--fpr-pink);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
  transform: rotate(-1deg);
}

.fpr-price-tool__header h2 {
  max-width: 100%;
  margin: 0 0 10px;
  padding: 0;
  color: var(--fpr-white);
  font-family: "Special Elite", Georgia, serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: normal;
  text-wrap: balance;
  overflow-wrap: break-word;
  hyphens: auto;
}

.fpr-price-tool__header p {
  max-width: 700px;
  margin: 0;
  color: rgb(255 255 255 / 88%);
  font-size: 1rem;
  line-height: 1.65;
}

.fpr-price-tool__section {
  padding: 30px 36px;
  background: var(--fpr-white);
  border-bottom: 1px solid var(--fpr-border);
}

.fpr-price-tool__section:nth-of-type(even) {
  background: #fafafa;
}

.fpr-price-tool__section-heading {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 24px;
}

.fpr-price-tool__step {
  display: inline-flex;
  flex: 0 0 38px;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  color: var(--fpr-white);
  background: var(--fpr-pink);
  border: 2px solid var(--fpr-black);
  border-radius: 50%;
  box-shadow: 3px 3px 0 var(--fpr-black);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
}

.fpr-price-tool__section-heading h3 {
  margin: 0 0 3px;
  padding: 0;
  color: var(--fpr-black);
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.3;
}

.fpr-price-tool__section-heading p {
  margin: 0;
  color: var(--fpr-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.fpr-price-tool__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 23px 28px;
}

.fpr-price-tool__grid--single {
  grid-template-columns: minmax(0, 1fr);
}

.fpr-price-tool__grid--single .fpr-field {
  max-width: 600px;
}

.fpr-field {
  min-width: 0;
}

.fpr-field label {
  display: block;
  margin-bottom: 7px;
  color: var(--fpr-black);
  font-size: 0.94rem;
  font-weight: 800;
  line-height: 1.35;
}

.fpr-field small {
  display: block;
  margin-top: 7px;
  color: var(--fpr-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.fpr-input-group {
  display: flex;
  align-items: stretch;
  overflow: hidden;
  width: 100%;
  background: var(--fpr-white);
  border: 2px solid var(--fpr-border);
  border-radius: 8px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.fpr-input-group__prefix,
.fpr-input-group__suffix {
  display: flex;
  flex: 0 0 48px;
  align-items: center;
  justify-content: center;
  color: var(--fpr-black);
  background: var(--fpr-soft);
  font-size: 1rem;
  font-weight: 800;
}

.fpr-input-group__prefix {
  border-right: 1px solid var(--fpr-border);
}

.fpr-input-group__suffix {
  border-left: 1px solid var(--fpr-border);
}

.fpr-price-tool input[type="number"] {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: 48px;
  margin: 0;
  padding: 10px 13px;
  color: var(--fpr-black);
  background: transparent;
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0;
  box-shadow: none !important;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
}

.fpr-input-group:focus-within {
  background: #fffafd;
  border-color: var(--fpr-pink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--fpr-pink), transparent 86%);
}

.fpr-price-tool__actions {
  padding: 30px 36px 18px;
  background: var(--fpr-white);
}

.fpr-price-tool__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  margin: 0;
  padding: 14px 24px;
  color: var(--fpr-white) !important;
  background: var(--fpr-pink) !important;
  border: 2px solid var(--fpr-black) !important;
  border-radius: 8px !important;
  box-shadow: 4px 4px 0 var(--fpr-black) !important;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.fpr-price-tool__button:hover {
  background: var(--fpr-pink-dark) !important;
  box-shadow: 2px 2px 0 var(--fpr-black) !important;
  transform: translate(2px, 2px);
}

.fpr-price-tool__button:focus-visible {
  outline: 3px solid var(--fpr-yellow);
  outline-offset: 4px;
}

.fpr-price-tool__button:active {
  box-shadow: none !important;
  transform: translate(4px, 4px);
}

.fpr-price-tool__results {
  margin: 12px 36px 30px;
  padding: 26px 28px;
  color: var(--fpr-black);
  background: var(--fpr-blue);
  border: 2px solid var(--fpr-black);
  border-left: 8px solid var(--fpr-pink);
  border-radius: 8px;
  box-shadow: 5px 5px 0 rgb(29 29 31 / 16%);
  animation: fpr-price-tool-show 0.28s ease-out;
}

.fpr-price-tool__results[hidden] {
  display: none;
}

.fpr-price-tool__results h3 {
  margin: 0 0 16px;
  color: var(--fpr-black);
  font-size: 1.25rem;
  font-weight: 800;
}

.fpr-price-tool__results p {
  margin: 0;
}

.fpr-price-tool__summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
}

.fpr-price-tool__summary-item {
  padding: 12px 14px;
  background: rgb(255 255 255 / 62%);
  border: 1px solid rgb(29 29 31 / 12%);
  border-radius: 7px;
}

.fpr-price-tool__summary-item span {
  display: block;
  margin-bottom: 3px;
  color: var(--fpr-muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
}

.fpr-price-tool__summary-item strong {
  color: var(--fpr-pink-dark);
  font-size: 1rem;
  line-height: 1.25;
}

.fpr-price-tool__final-price {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 20px 0 12px;
  padding: 18px 20px;
  background: var(--fpr-white);
  border: 2px solid var(--fpr-black);
  border-radius: 8px;
  box-shadow: 4px 4px 0 var(--fpr-pink);
}

.fpr-price-tool__final-price span {
  font-size: 0.95rem;
  font-weight: 800;
}

.fpr-price-tool__final-price strong {
  color: var(--fpr-pink);
  font-size: clamp(1.55rem, 4vw, 2.2rem);
  line-height: 1;
  white-space: nowrap;
}

.fpr-price-tool__note {
  margin: 12px 0 0 !important;
  color: var(--fpr-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.fpr-price-tool__error {
  color: #8b112a;
  background: #fff2f5;
  border-color: #8b112a;
  border-left-color: var(--fpr-pink);
}

.fpr-price-tool__strings {
  display: none;
}

.fpr-price-tool__footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 20px;
  padding: 17px 36px;
  color: rgb(255 255 255 / 82%);
  background: var(--fpr-black);
  border-top: 4px solid var(--fpr-pink);
  font-size: 0.76rem;
  line-height: 1.4;
}

.fpr-price-tool__footer strong {
  color: var(--fpr-white);
}

@keyframes fpr-price-tool-show {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/*
 * Container queries respond to the actual module width, not only the viewport.
 * This fixes narrow columns on tablets such as a Galaxy Tab S8+ in landscape.
 */
@container fpr-calculator (max-width: 760px) {
  .fpr-price-tool {
    border-radius: 10px;
  }

  .fpr-price-tool__header,
  .fpr-price-tool__section,
  .fpr-price-tool__actions {
    padding-right: 22px;
    padding-left: 22px;
  }

  .fpr-price-tool__header h2 {
    font-size: clamp(1.65rem, 8.5cqw, 2.15rem);
    line-height: 1.12;
  }

  .fpr-price-tool__grid,
  .fpr-price-tool__summary {
    grid-template-columns: 1fr;
  }

  .fpr-price-tool__grid--single .fpr-field {
    max-width: none;
  }

  .fpr-price-tool__pattern {
    top: 22px;
    right: -18px;
    width: 230px;
    gap: 9px 13px;
    font-size: 1rem;
  }

  .fpr-price-tool__results {
    margin-right: 22px;
    margin-left: 22px;
    padding: 22px 20px;
  }

  .fpr-price-tool__footer {
    flex-direction: column;
    padding-right: 22px;
    padding-left: 22px;
  }
}

@container fpr-calculator (max-width: 520px) {
  .fpr-price-tool__header h2 {
    font-size: clamp(1.55rem, 9.5cqw, 1.95rem);
    overflow-wrap: anywhere;
  }

  .fpr-price-tool__final-price {
    flex-direction: column;
    align-items: flex-start;
  }
}

@container fpr-calculator (max-width: 420px) {
  .fpr-price-tool__header,
  .fpr-price-tool__section,
  .fpr-price-tool__actions {
    padding-right: 17px;
    padding-left: 17px;
  }

  .fpr-price-tool__results {
    margin-right: 17px;
    margin-left: 17px;
  }

  .fpr-price-tool__pattern {
    right: -54px;
    opacity: 0.92;
  }
}

/* Fallback for older browsers without container-query support. */
@media (max-width: 760px) {
  .fpr-price-tool__header,
  .fpr-price-tool__section,
  .fpr-price-tool__actions {
    padding-right: 22px;
    padding-left: 22px;
  }

  .fpr-price-tool__header h2 {
    font-size: clamp(1.65rem, 7vw, 2.15rem);
  }

  .fpr-price-tool__grid,
  .fpr-price-tool__summary {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fpr-price-tool *,
  .fpr-price-tool *::before,
  .fpr-price-tool *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
