/* =========================================================
   COTIZADOR PÚBLICO · prefijo cotz-
   Usa las variables del sitio (claro / oscuro)
   ========================================================= */

.cotz-page {
  min-height: 70vh;
  background: var(--bg-soft, var(--bg));
  color: var(--text);
  font-family: inherit;
}

.cotz-container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0 72px;
}

.cotz-hero {
  margin-bottom: 26px;
  max-width: 720px;
}

.cotz-eyebrow {
  display: block;
  margin-bottom: 8px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.cotz-hero h1,
.cotz-success h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.1;
}

.cotz-hero p {
  margin: 10px 0 0;
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.55;
}

.cotz-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 22px;
  align-items: start;
}

.cotz-main {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.cotz-card,
.cotz-sum,
.cotz-success {
  border: 1px solid var(--border);
  border-radius: var(--radius, 12px);
  background: var(--surface);
}

.cotz-card {
  padding: 22px;
}

.cotz-card h2 {
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.01em;
}

.cotz-step {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: var(--accent);
  color: var(--accent-ink, #111);
  font-size: 14px;
  font-weight: 800;
}

/* buscador */
.cotz-search {
  position: relative;
}

.cotz-search i,
.cotz-search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--text-soft);
  pointer-events: none;
}

.cotz-search input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px 0 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 15px;
}

.cotz-search input:focus,
.cotz-field input:focus,
.cotz-field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.cotz-results {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.cotz-results > .cotz-muted {
  grid-column: 1 / -1;
}

.cotz-prod {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.cotz-prod__img,
.cotz-item__img {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--surface-soft, var(--bg-soft));
  color: var(--text-soft);
}

.cotz-prod__img img,
.cotz-item__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cotz-prod__info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.cotz-prod__info strong,
.cotz-item__info strong {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.cotz-prod__info span,
.cotz-item__info span {
  color: var(--text-soft);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cotz-prod__info b {
  font-size: 14px;
}

.cotz-prod .cotz-btn {
  grid-column: 1 / -1;
}

/* botones */
.cotz-btn {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease, background 120ms ease;
}

.cotz-btn svg,
.cotz-btn i {
  width: 16px;
  height: 16px;
}

.cotz-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.cotz-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.cotz-btn--primary {
  min-height: 48px;
  background: var(--accent);
  color: var(--accent-ink, #111);
  font-size: 15px;
}

.cotz-btn--soft {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

.cotz-btn--soft:hover:not(:disabled) {
  border-color: var(--accent);
}

.cotz-btn--ghost {
  border-color: var(--border);
  background: transparent;
  color: var(--text);
}

.cotz-btn--block {
  width: 100%;
}

/* lista de ítems */
.cotz-listhead {
  margin: 22px 0 10px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.cotz-listhead h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}

.cotz-items {
  display: flex;
  flex-direction: column;
}

.cotz-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto 104px 34px;
  gap: 12px;
  align-items: center;
}

.cotz-item:last-child {
  border-bottom: 0;
}

.cotz-item__info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cotz-item__sub {
  text-align: right;
  font-size: 14px;
}

.cotz-item__del {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.cotz-item__del:hover {
  background: color-mix(in srgb, #d92d20 12%, transparent);
  color: #d92d20;
}

.cotz-item__del svg {
  width: 17px;
  height: 17px;
}

.cotz-qty {
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 9px;
  display: grid;
  grid-template-columns: 30px 1fr 30px;
  overflow: hidden;
  background: var(--bg);
}

.cotz-qty button {
  border: 0;
  background: transparent;
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.cotz-qty button:hover {
  background: var(--surface-soft, var(--bg-soft));
}

.cotz-qty svg {
  width: 14px;
  height: 14px;
}

.cotz-qty input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: center;
  font: inherit;
  font-weight: 700;
  -moz-appearance: textfield;
}

.cotz-qty input::-webkit-outer-spin-button,
.cotz-qty input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.cotz-empty {
  padding: 26px 12px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  text-align: center;
  color: var(--text-soft);
}

.cotz-empty svg {
  width: 28px;
  height: 28px;
}

.cotz-empty p,
.cotz-muted {
  margin: 8px 0 0;
  color: var(--text-soft);
  font-size: 14px;
}

/* formulario */
.cotz-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.cotz-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.cotz-field--full {
  margin-top: 14px;
}

.cotz-field > span {
  font-size: 13px;
  font-weight: 700;
}

.cotz-field em {
  color: #d92d20;
  font-style: normal;
}

.cotz-field input,
.cotz-field textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 15px;
}

.cotz-field textarea {
  resize: vertical;
}

.cotz-field.is-invalid input {
  border-color: #d92d20;
}

.cotz-field__error {
  min-height: 0;
  color: #d92d20;
  font-size: 12px;
  font-weight: 600;
}

.cotz-field__error:empty {
  display: none;
}

/* resumen */
.cotz-side {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cotz-sum {
  padding: 20px;
}

.cotz-sum h3 {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 800;
}

.cotz-sum dl {
  margin: 0;
}

.cotz-sum dl > div {
  padding: 7px 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}

.cotz-sum dt {
  color: var(--text-soft);
}

.cotz-sum dd {
  margin: 0;
  font-weight: 700;
}

.cotz-sum__promo dd {
  color: #15803d;
}

.cotz-sum__total {
  margin-top: 6px;
  padding-top: 12px !important;
  border-top: 1px solid var(--border);
}

.cotz-sum__total dt {
  color: var(--text);
  font-weight: 700;
}

.cotz-sum__total dd {
  font-size: 22px;
  letter-spacing: -.02em;
}

.cotz-note {
  margin: 12px 0 0;
  display: flex;
  gap: 8px;
  color: var(--text-soft);
  font-size: 12.5px;
  line-height: 1.45;
}

.cotz-note svg {
  flex: none;
  width: 15px;
  height: 15px;
  margin-top: 1px;
}

.cotz-sum .cotz-btn {
  margin-top: 16px;
}

.cotz-alert {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, #d92d20 45%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, #d92d20 10%, var(--surface));
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.cotz-alert[hidden] {
  display: none;
}

/* éxito */
.cotz-success {
  max-width: 560px;
  margin: 24px auto 0;
  padding: 36px 28px;
  text-align: center;
}

.cotz-success__icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--accent-ink, #111);
}

.cotz-success__icon svg {
  width: 30px;
  height: 30px;
}

.cotz-success__num {
  margin: 14px 0;
  display: inline-block;
  padding: 8px 18px;
  border: 1px dashed var(--border);
  border-radius: 999px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .04em;
}

.cotz-success__data {
  margin: 0 0 16px;
  display: flex;
  justify-content: center;
  gap: 36px;
  flex-wrap: wrap;
}

.cotz-success__data dt {
  color: var(--text-soft);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.cotz-success__data dd {
  margin: 2px 0 0;
  font-size: 22px;
  font-weight: 800;
}

.cotz-success__mail {
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
}

.cotz-success__mail svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.cotz-success__avisos {
  margin: 0 0 16px;
  padding: 10px 14px 10px 30px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 22%, var(--surface));
  text-align: left;
  font-size: 13px;
}

.cotz-success__actions {
  margin: 18px 0;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cotz-spin {
  animation: cotz-spin 900ms linear infinite;
}

@keyframes cotz-spin {
  to { transform: rotate(360deg); }
}

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .cotz-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .cotz-side {
    position: static;
  }
}

@media (max-width: 640px) {
  .cotz-container {
    padding: 28px 0 56px;
  }

  .cotz-card {
    padding: 16px;
  }

  .cotz-results,
  .cotz-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .cotz-item {
    grid-template-columns: 52px minmax(0, 1fr) auto;
    grid-template-areas:
      "img info del"
      "qty qty sub";
    align-items: center;
    row-gap: 10px;
  }

  .cotz-item__img { grid-area: img; }
  .cotz-item__info { grid-area: info; }
  .cotz-item__del { grid-area: del; }
  .cotz-item .cotz-qty { grid-area: qty; max-width: 130px; }
  .cotz-item__sub { grid-area: sub; }

  .cotz-success {
    padding: 28px 16px;
  }
}
