/* ==========================================================
   Envagreenpack – Cotizador
   (usa los colores y fuentes de styles.css)
   ========================================================== */

.cot-hero {
  background: var(--ink); color: var(--white);
  padding-block: clamp(48px, 7vw, 80px) clamp(40px, 6vw, 64px);
}
.cot-hero .eyebrow { color: var(--accent-light); }
.cot-hero h1 {
  margin: 10px 0 14px;
  font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 900; line-height: 1.05;
}
.cot-hero__lead { color: var(--on-dark); font-size: 19px; max-width: 40em; }

.cot-step { padding-block: clamp(44px, 6vw, 72px); }
.cot-step--alt { background: var(--white); border-block: 1px solid var(--line); }
.cot-step__head {
  display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 16px; row-gap: 4px;
  margin-bottom: 28px;
}
.cot-step__head h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.cot-step__head p { grid-column: 2; }
.cot-step__n {
  grid-row: span 2;
  width: 48px; height: 48px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--white);
  font-family: var(--font-display); font-weight: 800; font-size: 22px;
}

/* ---------- Paso 1: modelos rápidos ---------- */
.presets { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.preset {
  background: var(--white); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px 20px 22px;
  display: flex; flex-direction: column; gap: 6px; text-align: center;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}
.preset:hover { border-color: var(--line-strong); box-shadow: 0 14px 30px rgba(22, 33, 27, 0.08); transform: translateY(-3px); }
.preset__img { aspect-ratio: 380 / 400; max-height: 300px; margin: 0 auto 6px; width: 100%; }
.preset__img svg { width: 100%; height: 100%; display: block; }
.preset__title { font-size: 18px; font-weight: 800; }
.preset__sub { color: var(--muted); font-size: 15px; min-height: 2.6em; }
.preset__btn { align-self: center; margin-top: 8px; }

/* ---------- Paso 2: configurador ---------- */
.cfg { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.cfg__preview { flex: 1 1 380px; min-width: 0; align-self: stretch; }
.cfg__sticky { position: sticky; top: 100px; display: flex; flex-direction: column; gap: 14px; }
.cfg__canvas {
  background: var(--ground); border: 1px solid var(--line); border-radius: 16px;
  padding: 12px; aspect-ratio: 380 / 400; max-height: 520px;
}
.cfg__canvas svg { width: 100%; height: 100%; display: block; }
.cfg__canvas.is-flash { animation: cfg-flash 0.9s ease; }
@keyframes cfg-flash { 0% { box-shadow: 0 0 0 0 rgba(30, 107, 59, 0.45); } 100% { box-shadow: 0 0 0 16px rgba(30, 107, 59, 0); } }
.cfg__title { font-family: var(--font-display); font-weight: 700; font-size: 17px; line-height: 1.35; }
.cfg__specs { margin: 0; border-top: 1px solid var(--line); }
.cfg__specs div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.cfg__specs dt { color: var(--muted); }
.cfg__specs dd { margin: 0; font-weight: 600; text-align: right; }

.cfg__form { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.cgroup { margin: 0; padding: 0; border: none; display: flex; flex-direction: column; gap: 10px; }
.cgroup legend { padding: 0; margin-bottom: 10px; font-family: var(--font-display); font-weight: 800; font-size: 17px; }
.cgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.cfield { display: flex; flex-direction: column; gap: 6px; }
.cfield label { font-weight: 600; font-size: 15px; }

.stepper {
  display: flex; align-items: stretch;
  border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; background: var(--white);
}
.stepper:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(30, 107, 59, 0.15); }
.stepper button {
  flex: none; width: 44px; min-height: 46px;
  background: var(--soft); color: var(--ink); border: none; cursor: pointer;
  font-size: 20px; font-weight: 600;
}
.stepper button:hover { background: var(--line); }
.stepper input {
  flex: 1; min-width: 0; width: 100%;
  border: none; text-align: center; font-family: inherit; font-size: 17px; font-weight: 600; color: var(--ink);
  -moz-appearance: textfield;
}
.stepper input:focus { outline: none; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper__unit { align-self: center; padding-right: 10px; color: var(--muted); font-size: 14px; }

.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opt__box {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 46px; padding: 10px 16px;
  background: var(--white); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 10px;
  font-weight: 600; font-size: 15px; cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.opt__box:hover { border-color: var(--ink); }
.opt input:checked + .opt__box { background: var(--ink); border-color: var(--ink); color: var(--white); }
.opt input:focus-visible + .opt__box { outline: 3px solid var(--accent); outline-offset: 2px; }

.sw { width: 14px; height: 14px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0, 0, 0, 0.2); }
.sw--sin { background: #E9E2CF; }
.sw--lam { background: linear-gradient(135deg, #F4F6F3 30%, #FFFFFF 45%, #D3DAD2 70%); }
.sw--cond { background: #EEF0EC repeating-linear-gradient(90deg, #262626 0 1px, transparent 1px 4px); }
.sw--vent { background: #EFEADD repeating-linear-gradient(90deg, #8A8875 0 2px, transparent 2px 4px); }
.cfield.is-off { opacity: 0.45; }

/* Textos dentro del dibujo */
.bag-label { font-family: var(--font-display), sans-serif; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; fill: #1E6B3B; }
.bag-dim { font-family: var(--font-body), sans-serif; font-size: 13px; font-weight: 700; fill: #16211B; }

/* ---------- Paso 3: resumen + contacto ---------- */
.cot-send { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.cot-summary {
  flex: 1 1 300px; max-width: 400px;
  background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.cot-summary h3 { font-size: 18px; }
.cot-summary__img { aspect-ratio: 380 / 400; max-height: 220px; margin: 0 auto; width: 100%; }
.cot-summary__img svg { width: 100%; height: 100%; display: block; }
.cot-summary .cfg__title { font-size: 15px; }
.cot-summary .cfg__specs div { font-size: 14px; padding: 7px 0; }
.cot-summary__edit { font-weight: 600; font-size: 15px; }
.cot-contact { flex: 2 1 420px; min-width: 0; display: flex; flex-wrap: wrap; gap: 16px; align-content: flex-start; }

@media (max-width: 860px) {
  /* En celular el dibujo se queda fijo arriba mientras se eligen opciones */
  .cfg { gap: 20px; }
  .cfg__preview {
    position: sticky; top: var(--cot-header, 76px); z-index: 20;
    align-self: flex-start; flex-basis: 100%;
    margin-inline: -24px; padding: 8px 24px;
    background: var(--white);
    border-bottom: 1px solid var(--line);
  }
  .cfg__sticky { position: static; gap: 0; }
  .cfg__canvas { height: 210px; aspect-ratio: auto; max-height: none; padding: 4px; border: none; background: transparent; }
  .cfg__preview .cfg__title, .cfg__preview .cfg__specs { display: none; }
  .cot-summary { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .preset, .opt__box { transition: none; }
  .cfg__canvas.is-flash { animation: none; }
}

/* ==========================================================
   Hoja de especificaciones (PDF)
   ========================================================== */
.print-sheet { display: none; }

@media print {
  @page { size: letter; margin: 14mm; }
  body { background: #fff; }
  body > *:not(.print-sheet) { display: none !important; }
  .print-sheet { display: block; color: #16211B; font-family: var(--font-body), sans-serif; }
  .ps__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 12px; border-bottom: 2px solid #1E6B3B; }
  .ps__head img { height: 56px; width: auto; }
  .ps__head div { display: flex; flex-direction: column; text-align: right; }
  .ps__head strong { font-family: var(--font-display), sans-serif; font-size: 18px; }
  .ps__head span { font-size: 12px; color: #3E4A43; }
  .ps__title { font-family: var(--font-display), sans-serif; font-size: 20px; margin: 18px 0 12px; }
  .ps__grid { display: flex; gap: 20px; align-items: flex-start; }
  .ps__img { flex: 0 0 46%; border: 1px solid #DDE3DA; border-radius: 8px; padding: 6px; }
  .ps__img svg { width: 100%; height: auto; display: block; }
  .ps__specs { flex: 1; margin: 0; }
  .ps__specs div { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid #DDE3DA; font-size: 12pt; }
  .ps__specs dt { color: #3E4A43; }
  .ps__specs dd { margin: 0; font-weight: 700; text-align: right; }
  .ps__contact { margin-top: 18px; font-size: 12pt; }
  .ps__contact h2 { font-family: var(--font-display), sans-serif; font-size: 14pt; margin: 0 0 6px; }
  .ps__contact p { margin: 0 0 4px; }
  .ps__foot { margin-top: 24px; padding-top: 10px; border-top: 1px solid #DDE3DA; font-size: 10pt; color: #3E4A43; }
}
