/* Mi Argentina — layout & theme */
:root {
  --celeste: #74acdf;
  --celeste-soft: #a8d0ef;
  --celeste-mist: #e8f4fb;
  --blanco: #fbfcfe;
  --dorado: #c9a227;
  --dorado-bright: #e8c547;
  --ink: #1a2a3a;
  --ink-soft: #3d5266;
  --shadow: rgba(26, 42, 58, 0.12);
  --font-display: "Fraunces", "Georgia", serif;
  --font-body: "Outfit", "Segoe UI", sans-serif;
  --flip-duration: 0.8s;
  --shirt-max: min(92vw, 420px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100dvh;
  overflow-x: hidden;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(ellipse 120% 80% at 50% -10%, var(--celeste-soft) 0%, transparent 55%),
    radial-gradient(ellipse 80% 50% at 100% 100%, rgba(232, 197, 71, 0.18) 0%, transparent 45%),
    linear-gradient(165deg, var(--blanco) 0%, var(--celeste-mist) 48%, #f0f7fc 100%);
  background-attachment: fixed;
}

.page {
  width: min(100% - 2rem, 1100px);
  margin-inline: auto;
  padding: 1.5rem 0 3.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.panel-intro {
  width: 100%;
  text-align: center;
}

.brand {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 4.5vw, 1.85rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--celeste);
  line-height: 1.1;
}

.title {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 4.2vw, 1.95rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
}

.subtitle {
  margin: 0;
  font-size: clamp(0.9rem, 2.4vw, 1.05rem);
  font-weight: 400;
  color: var(--ink-soft);
  line-height: 1.45;
}

.stage {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.35rem;
}

/* Remera + panel de personalización */
.design-row {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.design-row__shirt {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: var(--shirt-max);
}

/* Globito de precio — flota junto a la remera, fuera del área imprimible */
.price-badge {
  position: absolute;
  left: -2.6rem;
  top: 1.1rem;
  z-index: 5;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.05rem;
  padding: 0.6rem 0.95rem 0.55rem;
  border-radius: 1rem;
  background: linear-gradient(160deg, var(--celeste) 0%, #5f9bd2 100%);
  color: var(--blanco);
  text-align: center;
  line-height: 1.15;
  box-shadow: 0 10px 22px rgba(26, 42, 58, 0.18);
  animation: price-float 5.5s ease-in-out infinite;
  pointer-events: none;
  user-select: none;
}

/* Colita del globo */
.price-badge::after {
  content: "";
  position: absolute;
  right: 1.15rem;
  bottom: -0.42rem;
  width: 0.85rem;
  height: 0.85rem;
  background: #5f9bd2;
  border-radius: 0 0 0.2rem 0;
  transform: rotate(45deg);
}

.price-badge__label {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.92;
}

.price-badge__amount {
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.price-badge__tax {
  font-size: 0.68rem;
  font-weight: 500;
  opacity: 0.9;
}

@keyframes price-float {
  0%,
  100% {
    transform: translateY(0) rotate(-1.5deg);
  }
  50% {
    transform: translateY(-6px) rotate(1deg);
  }
}

.design-row__panel {
  width: 100%;
  max-width: 22rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.1rem;
}

.controls {
  display: flex;
  justify-content: center;
}

.btn-flip {
  appearance: none;
  border: 2px solid var(--celeste);
  background: var(--blanco);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.75rem 1.6rem;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 18px var(--shadow);
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.15s ease;
}

.btn-flip:hover {
  background: var(--celeste);
  color: #fff;
  border-color: var(--celeste);
}

.btn-flip:active {
  transform: scale(0.98);
}

.btn-flip:focus-visible {
  outline: 3px solid var(--dorado-bright);
  outline-offset: 3px;
}

/* —— Personalización (Sprint 3) —— */
.personalize-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.85rem;
  padding: 1rem 1.05rem 1.1rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(116, 172, 223, 0.28);
  box-shadow: 0 4px 18px var(--shadow);
}

.personalize-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 3vw, 1.25rem);
  font-weight: 600;
  color: var(--ink);
  text-align: left;
}

.personalize-toggles {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 1rem;
  margin: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(116, 172, 223, 0.35);
  cursor: pointer;
  user-select: none;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.toggle:hover {
  background: #fff;
  border-color: var(--celeste-soft);
  box-shadow: 0 4px 14px var(--shadow);
}

.toggle:has(input:focus-visible) {
  outline: 3px solid var(--dorado-bright);
  outline-offset: 2px;
}

.toggle input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.toggle__track {
  position: relative;
  flex-shrink: 0;
  width: 2.75rem;
  height: 1.55rem;
  border-radius: 999px;
  background: #c5d5e3;
  transition: background 0.25s ease;
}

.toggle__track::after {
  content: "";
  position: absolute;
  top: 0.18rem;
  left: 0.18rem;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(26, 42, 58, 0.25);
  transition: transform 0.25s ease;
}

.toggle input:checked + .toggle__track {
  background: var(--celeste);
}

.toggle input:checked + .toggle__track::after {
  transform: translateX(1.2rem);
}

.toggle__label {
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.3;
}

/* —— Acciones —— */
.actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.7rem;
  width: 100%;
}

.actions .btn {
  width: 100%;
  text-align: center;
}

.btn {
  appearance: none;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.8rem 1.55rem;
  border-radius: 999px;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.15s ease,
    box-shadow 0.2s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn:focus-visible {
  outline: 3px solid var(--dorado-bright);
  outline-offset: 3px;
}

.btn--primary {
  border: 2px solid var(--celeste);
  background: var(--celeste);
  color: #fff;
  box-shadow: 0 4px 18px rgba(116, 172, 223, 0.35);
}

.btn--primary:hover {
  background: #5a9ad4;
  border-color: #5a9ad4;
}

.btn--secondary {
  border: 2px solid var(--celeste);
  background: var(--blanco);
  color: var(--ink);
  box-shadow: 0 4px 18px var(--shadow);
}

.btn--secondary:hover {
  background: var(--celeste-mist);
  border-color: var(--celeste);
}

/* —— Contador (panel) —— */
.icons-counter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin: 0;
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(116, 172, 223, 0.35);
  box-shadow: 0 2px 12px var(--shadow);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  text-align: center;
  transition:
    color 0.25s ease,
    border-color 0.25s ease,
    background 0.25s ease;
}

.icons-counter::before {
  content: "✓";
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--celeste);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.icons-counter--complete {
  font-weight: 600;
  color: var(--celeste);
  border-color: var(--celeste);
  background: rgba(116, 172, 223, 0.14);
}

/* —— Galería de iconos (Sprint 2 / 3) —— */
/* Se ensancha más allá de .page para ocupar el ancho útil del sitio. */
.icons-section {
  width: min(100vw - 2rem, 1360px);
  margin-inline: auto;
  margin-left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.75rem;
}

.icons-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 3.2vw, 1.35rem);
  font-weight: 600;
  color: var(--ink);
}

/* En desktop, 8 columnas fijas → 24 símbolos visibles = 3 filas parejas. */
.icons-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  width: 100%;
}

@media (min-width: 640px) {
  .icons-gallery {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .icons-gallery {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }
}

.icon-btn {
  appearance: none;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  padding: 0.9rem 0.5rem 0.75rem;
  margin: 0;
  min-height: 8.5rem;
  border: 2px solid transparent;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  font-family: var(--font-body);
  color: var(--ink-soft);
  transition:
    border-color 0.25s ease,
    background 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease,
    color 0.25s ease;
}

.icon-btn__check {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: var(--celeste);
  box-shadow: 0 0 0 2px #fff;
  color: #fff;
  opacity: 0;
  transform: scale(0.6);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
  pointer-events: none;
}

.icon-btn__check::after {
  content: "";
  position: absolute;
  left: 0.37rem;
  top: 0.25rem;
  width: 0.28rem;
  height: 0.5rem;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.icon-btn img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  object-position: center;
  display: block;
  pointer-events: none;
  transform: scale(var(--icon-scale, 1));
  transform-origin: center center;
  transition: transform 0.25s ease;
}

.icon-btn__label {
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.25;
  text-align: center;
  text-transform: capitalize;
  max-width: 100%;
  height: calc(1.25em * 2);
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: manual;
}

.icon-btn:hover {
  background: #fff;
  border-color: var(--celeste-soft);
}

.icon-btn:active {
  transform: scale(0.97);
}

.icon-btn:focus-visible {
  outline: 3px solid var(--dorado-bright);
  outline-offset: 2px;
}

.icon-btn.is-selected {
  border-color: var(--celeste);
  background: rgba(116, 172, 223, 0.16);
  box-shadow:
    0 0 0 1px rgba(116, 172, 223, 0.4),
    0 6px 16px rgba(116, 172, 223, 0.28);
  color: var(--ink);
  transform: scale(1.03);
}

.icon-btn.is-selected .icon-btn__check {
  opacity: 1;
  transform: scale(1);
}

.icon-btn.is-selected .icon-btn__label {
  font-weight: 600;
  color: var(--ink);
}

.icon-btn.is-selected:active {
  transform: scale(1.01);
}

.icons-error {
  margin: 0;
  color: #8b3a3a;
  font-size: 0.95rem;
}

/* Desktop: remera izquierda | sidebar derecha */
@media (min-width: 768px) {
  .page {
    padding-top: 2rem;
  }

  .design-row {
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 2rem 3rem;
  }

  .design-row__shirt {
    flex: 0 1 auto;
    width: auto;
  }

  .design-row__panel {
    flex: 0 1 22rem;
    padding-top: 0.35rem;
  }

  .panel-intro {
    text-align: left;
  }
}

@media (max-width: 480px) {
  .page {
    width: min(100% - 1.25rem, 960px);
    padding-top: 1.15rem;
    gap: 0.75rem;
  }

  .icons-gallery {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .icon-btn {
    min-height: 6.4rem;
    padding: 0.6rem 0.35rem 0.5rem;
  }

  .icon-btn img {
    width: 50px;
    height: 50px;
  }

  .price-badge {
    left: 0.15rem;
    top: 0.75rem;
    padding: 0.5rem 0.8rem 0.45rem;
  }

  .price-badge__amount {
    font-size: 1.12rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn-flip,
  .btn,
  .toggle,
  .toggle__track,
  .toggle__track::after,
  .icon-btn,
  .icon-btn__check,
  .icon-btn img {
    transition: none;
  }

  .price-badge {
    animation: none;
    transform: none;
  }
}
