:root {
  --pres-font-main: Arial, Helvetica, sans-serif;
}

@font-face {
  font-family: "Tabarra";
  src: url("../fonts/TabarraPro-Black-FFP.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Tabarra";
  src: url("../fonts/TabarraPro-Black-FFP.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Tabarra";
  src: url("../fonts/TabarraPro-Black-FFP.ttf") format("truetype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

.presupuestador-wrap {
  /* Ancho fijo (móvil vertical). La altura la marca el contenido. */
  --pres-fixed-width: 360px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100dvh;
  padding: 8px;
  box-sizing: border-box;
  overflow: auto;
}

.presupuestador-scale {
  width: var(--pres-fixed-width);
  height: auto;
  flex: 0 0 auto;
}

.presupuestador-a4 {
  width: 100%;
  height: auto;
  border: 1px solid #c6c6c6;
  background: #f1f1f1;
  padding: 8px 10px;
  box-sizing: border-box;
  font-family: var(--pres-font-main);
  overflow: visible;
  position: relative;
  container-type: inline-size;
}

.presupuestador-a4-content {
  width: 100%;
  height: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.presupuestador-header-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.presupuestador-footer-actions {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: center;
  gap: 18px;
  flex-wrap: nowrap;
  padding-top: 4px;
}

.presupuestador-cta {
  border: 1px solid #777;
  background: #dddddd;
  color: #111;
  font-size: 11px;
  line-height: 1.1 !important;
  padding: 5px 10px;
  cursor: pointer;
  box-sizing: border-box;
  min-height: 0 !important;
  height: auto !important;
  margin: 0 !important;
  max-width: none;
  text-decoration: none;
}

a.presupuestador-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #111;
  text-decoration: none !important;
}

a.presupuestador-cta:hover,
a.presupuestador-cta:focus {
  color: #111;
  text-decoration: none !important;
}

.presupuestador-cta--customize {
  font-family: "Tabarra", Arial, Helvetica, sans-serif !important;
  font-size: 26px;
  font-weight: 700;
  padding: 8px 14px;
  text-transform: none;
  letter-spacing: normal;
}

.presupuestador-cta--customize .pres-cta-lines {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.05;
  text-align: center;
  font-family: "Tabarra", Arial, Helvetica, sans-serif !important;
  font-weight: 700;
  text-transform: none;
}

.presupuestador-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  flex: 0 0 auto;
  box-sizing: border-box;
  padding: 0 !important;
  margin: 0 !important;
  min-width: 0 !important;
  max-width: none;
  width: auto;
  height: auto !important;
  aspect-ratio: 1 / 1;
  /* La altura la marca Personalizar (stretch); el ancho sigue el aspect-ratio. */
  inline-size: auto;
  block-size: auto;
}

.pres-share-icon.dashicons {
  display: block;
  width: 1em;
  height: 1em;
  font-size: 1em;
  line-height: 1;
  margin: 0;
  speak: never;
}

.presupuestador-subtitle {
  margin: 0;
  text-align: center;
  color: #cc0000;
  font-size: 14px;
  font-style: italic;
  font-weight: 900;
  line-height: 1.2;
}

.presupuestador-subtitle:not(.pres-optimo) {
  font-size: 13px;
  white-space: nowrap;
  line-height: 1.15;
  overflow: hidden;
  color: #111111;
}

.presupuestador-subtitle.pres-optimo {
  margin-top: 2px;
  font-size: 19px;
  color: #111111;
}

.presupuestador-mas-vendido {
  margin: 4px 0 0;
  text-align: center;
  color: #111;
  font-size: 22px;
  font-weight: 900;
  font-style: normal;
  line-height: 1.2;
}

.presupuestador-mas-vendido .pres-price {
  color: #cc0000;
  font-size: 1.15em;
}

.presupuestador-subtitle .pres-price {
  color: #cc0000;
}

.presupuestador-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: transparent;
}

.pres-row {
  border: 1px solid #d5d5d5;
  background: #ffffff;
  height: auto;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 2px 4px;
  box-sizing: border-box;
  line-height: 1;
}

.pres-row-top {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 0;
  line-height: 1;
}

.pres-row-enable {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin: 0;
  cursor: pointer;
}

.pres-row-enable input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.pres-row-enable .pres-tag-square {
  width: 18px;
  height: 18px;
}

.pres-row-title {
  margin: 0;
  font-size: 19px;
  font-weight: 900;
  line-height: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}

.pres-row-unit-inline {
  color: #d10000;
  font-weight: 900;
  font-size: 16px;
  white-space: nowrap;
}

.pres-row-body {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 88px;
  align-items: center;
  gap: 4px;
  min-width: 0;
  min-height: 0;
}

.pres-row-left {
  padding: 0;
  box-sizing: border-box;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0;
}

.pres-row-qty {
  margin-top: 0;
  font-size: 20px;
  line-height: 0.85;
  font-weight: 900;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  max-width: 100%;
}

.pres-qty-btn {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: 0.75;
  padding: 0;
  margin: 0;
  cursor: pointer;
  height: 0.85em;
}

.pres-qty-value {
  display: inline-block;
  min-width: 1.3em;
  text-align: center;
  line-height: 1;
  margin: 0;
  padding: 0;
}

.pres-row-images {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  min-width: 0;
  grid-column: 2;
}

.pres-image-wrap {
  position: relative;
  width: 100%;
  height: 104px;
  min-height: 104px;
}

.pres-prenda-img {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
  display: block;
  margin: 0;
}

.pres-prenda-placeholder {
  width: 84%;
  height: 70%;
  margin: 10% auto 0;
  border: 1px dashed #b5b5b5;
  background: #f2f2f2;
}

.pres-overlay.is-active {
  opacity: 1;
}

.pres-overlay img {
  display: block;
  max-width: 100%;
}

.pres-overlay--nombre {
  position: absolute;
  left: 34%;
  top: 43%;
  width: 9%;
  transform: translate(-50%, -150%);
  z-index: 3;
  opacity: 0;
  transition: opacity 0.12s ease-in-out;
}

.pres-overlay--logo {
  position: absolute;
  left: calc(72% + 15px - 30px + 10px + 3px);
  top: 44%;
  width: 16.2%;
  transform: translate(-50%, -50%);
  z-index: 3;
  opacity: 0;
  transition: opacity 0.12s ease-in-out;
}

.pres-row[data-prenda="peto"] .pres-overlay--nombre {
  left: calc(20.5% + 10px - 3px);
  top: calc(43% + 15px);
  width: 7.2%;
  transform: translate(-50%, -25%);
}

.pres-row[data-prenda="peto"] .pres-overlay--logo {
  left: calc(34% - 10px);
  top: calc(30% - 5px);
  width: 5%;
}

.pres-overlay-text {
  display: inline-block;
  color: #e00000;
  font: 700 8px / 1 var(--pres-font-main);
}

.pres-overlay-logo-fallback {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e00000;
  color: #fff;
  font: 900 9px / 1 var(--pres-font-main);
}

.pres-row-tags {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  align-items: flex-start;
  width: 100%;
  margin-left: 0;
  align-self: center;
  min-height: 0;
  min-width: 0;
}

.pres-tag-selector {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  width: 100%;
}

.pres-tag-selector input {
  position: absolute;
  inset: 0 auto 0 0;
  width: 18px;
  height: 18px;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.pres-tag-square {
  width: 18px;
  height: 18px;
  aspect-ratio: 1 / 1;
  background: #ffffff;
  border: 1.5px solid #151515;
  flex: 0 0 auto;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: visible;
}

.pres-tag-square::after {
  content: '';
}

.pres-tag-selector input:checked + .pres-tag-square::after,
.pres-row-enable input:checked + .pres-tag-square::after {
  content: '\2713';
  position: absolute;
  left: 50%;
  top: 45%;
  transform: translate(-40%, -55%) rotate(-8deg);
  color: #1a9f3e;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
  -webkit-text-stroke: 1.2px #1a9f3e;
  text-stroke: 1.2px #1a9f3e;
  paint-order: stroke fill;
}

.pres-tag-selector input:not(:checked) + .pres-tag-square,
.pres-row-enable input:not(:checked) + .pres-tag-square {
  background: #f3f3f3;
}

.pres-tag-selector input:not(:checked) + .pres-tag-square::after,
.pres-row-enable input:not(:checked) + .pres-tag-square::after {
  content: '';
}

.pres-tag-selector,
.pres-row-enable {
  overflow: visible;
}

.pres-tag-selector strong {
  font-size: 12px;
  line-height: 1.1;
  font-weight: 900;
  white-space: nowrap;
}

.pres-tag-selector--capucha strong,
.pres-tag-selector--peto strong,
.pres-tag-selector--bandera strong {
  font-size: 12px;
}

.pres-tag-selector input:disabled {
  cursor: default;
}

.pres-row.is-disabled {
  padding-top: 1px;
  padding-bottom: 1px;
}

.pres-row.is-disabled .pres-row-body,
.pres-row.is-disabled .pres-row-unit-inline {
  display: none;
}

.presupuestador-error {
  font-family: var(--pres-font-main);
  font-weight: 700;
  color: #b10000;
  font-size: 13px;
}
