/*
 * Dogma Escuela de Negocios - Pasarela de pagos
 * Mismo lenguaje visual que dogma.com.pe: fondo blanco, tipografia Open Sans ligera,
 * azul corporativo (#004b9a), rojo de accion (#dd3333) y botones rectos.
 * Autocontenido: no depende de main.css, bootstrap ni mdbootstrap.
 */
:root {
  --dg-blue: #004b9a;
  --dg-blue-dark: #003670;
  --dg-red: #dd3333;
  --dg-red-dark: #bf2626;
  --dg-ink: #404041;
  --dg-muted: #89969a;
  --dg-line: #d9d9d9;
  --dg-soft: #f6f7f7;
  --dg-ok: #2e9d57;
  --dg-warn: #c98a00;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.dg {
  background: #fff;
  color: var(--dg-ink);
  font-family: "Open Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.55;
  margin: 0;
}
.dg a { color: var(--dg-blue); text-decoration: none; }
.dg a:hover { color: var(--dg-blue-dark); text-decoration: underline; }
.dg img { max-width: 100%; }
.dg h1, .dg h2, .dg h3, .dg h4 { font-weight: 300; line-height: 1.2; margin: 0; }

/* ---------- Estructura ---------- */
.dg-wrap { margin: 0 auto; max-width: 1140px; padding: 0 20px; }
.dg-header { border-bottom: 1px solid #ececec; }
.dg-header__in { align-items: center; display: flex; gap: 1rem; justify-content: space-between; min-height: 84px; }
.dg-logo img { display: block; height: 58px; width: auto; }
.dg-secure { align-items: center; color: var(--dg-muted); display: inline-flex; font-size: 13px; gap: .45rem; }
.dg-secure svg { color: var(--dg-ok); }
.dg-nav { align-items: center; display: flex; gap: 1.6rem; }
.dg-nav a { color: var(--dg-muted); font-size: 14px; }
.dg-nav a:hover { color: var(--dg-blue); text-decoration: none; }
.dg-nav .dg-pill { border: 1px solid var(--dg-blue); color: var(--dg-blue); padding: .55rem 1.1rem; }
.dg-nav .dg-pill:hover { background: var(--dg-blue); color: #fff; }

.dg-main { min-height: 60vh; padding: 34px 0 70px; }
.dg-crumbs { color: var(--dg-muted); font-size: 14px; margin-bottom: .4rem; }
.dg-kicker { color: var(--dg-red); font-size: 1.35rem; font-weight: 300; margin-bottom: .2rem; }
.dg-title { color: #6f7a7e; font-size: 2.1rem; font-weight: 300; letter-spacing: .01em; margin-bottom: 1.6rem; text-transform: uppercase; }

.dg-footer { background: var(--dg-soft); border-top: 1px solid #e6e9ea; color: var(--dg-muted); font-size: 13px; padding: 26px 0; }
.dg-footer__in { align-items: center; display: flex; flex-wrap: wrap; gap: .8rem 2rem; justify-content: space-between; }
.dg-footer a { color: var(--dg-muted); }

/* ---------- Pasos ---------- */
.dg-steps { display: flex; gap: 0; list-style: none; margin: 0 0 2rem; padding: 0; }
.dg-steps li { align-items: center; color: #b6bfc2; display: flex; flex: 1 1 0; font-size: 13px; gap: .6rem; letter-spacing: .03em; padding: .8rem 0; position: relative; text-transform: uppercase; }
.dg-steps li::after { background: var(--dg-line); content: ""; flex: 1; height: 1px; margin: 0 .8rem; }
.dg-steps li:last-child { flex: 0 0 auto; }
.dg-steps li:last-child::after { display: none; }
.dg-steps .n { align-items: center; border: 1px solid currentColor; border-radius: 50%; display: inline-flex; flex: 0 0 auto; font-size: 12px; font-weight: 700; height: 26px; justify-content: center; width: 26px; }
.dg-steps li.is-done { color: var(--dg-ok); }
.dg-steps li.is-done .n { background: var(--dg-ok); border-color: var(--dg-ok); color: #fff; }
.dg-steps li.is-on { color: var(--dg-red); font-weight: 700; }
.dg-steps li.is-on .n { background: var(--dg-red); border-color: var(--dg-red); color: #fff; }

/* ---------- Rejilla ---------- */
.dg-grid { align-items: start; display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr) 360px; }
.dg-grid--even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.dg-row { display: grid; gap: 14px 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dg-row .full { grid-column: 1 / -1; }

/* ---------- Tarjetas ---------- */
.dg-card { background: #fff; border: 1px solid #e3e6e7; margin-bottom: 22px; }
.dg-card__h { align-items: center; border-bottom: 1px solid #eef0f1; display: flex; gap: .7rem; justify-content: space-between; padding: 14px 22px; }
.dg-card__h h2 { color: #5d686c; font-size: 1.05rem; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
.dg-card__h .num { align-items: center; background: var(--dg-blue); border-radius: 50%; color: #fff; display: inline-flex; font-size: 12px; font-weight: 700; height: 24px; justify-content: center; margin-right: .6rem; width: 24px; }
.dg-card__b { padding: 22px; }
.dg-card--sum { background: var(--dg-soft); border-color: #e6e9ea; position: sticky; top: 16px; }
.dg-card--sum .dg-card__h { border-color: #e1e5e6; }

/* ---------- Formularios ---------- */
.dg-field { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.dg-field label { color: #6f7a7e; font-size: 12.5px; font-weight: 600; letter-spacing: .02em; }
.dg-field label .req { color: var(--dg-red); }
.dg input[type=text], .dg input[type=email], .dg input[type=tel], .dg input[type=number], .dg select, .dg textarea {
  appearance: none;
  background: #fff;
  border: 1px solid var(--dg-line);
  border-radius: 2px;
  color: var(--dg-ink);
  font: inherit;
  font-size: 14.5px;
  min-height: 44px;
  padding: .6rem .8rem;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
.dg select {
  background-image: linear-gradient(45deg, transparent 50%, #89969a 50%), linear-gradient(135deg, #89969a 50%, transparent 50%);
  background-position: calc(100% - 18px) 19px, calc(100% - 13px) 19px;
  background-repeat: no-repeat;
  background-size: 5px 5px;
  padding-right: 2rem;
}
.dg textarea { min-height: 84px; resize: vertical; }
.dg input:focus, .dg select:focus, .dg textarea:focus { border-color: var(--dg-blue); box-shadow: 0 0 0 3px rgba(0, 75, 154, .12); outline: 0; }
.dg input::placeholder, .dg textarea::placeholder { color: #a8b1b4; }
.dg .is-invalid { border-color: var(--dg-red) !important; }
.dg-err { color: var(--dg-red); display: none; font-size: 12px; }
.dg-field.has-error .dg-err { display: block; }
.dg-field.has-error input, .dg-field.has-error select { border-color: var(--dg-red); }
.dg-hint { color: var(--dg-muted); font-size: 12px; }
.dg-check { align-items: flex-start; cursor: pointer; display: flex; font-size: 14px; gap: .6rem; }
.dg-check input { accent-color: var(--dg-blue); flex: 0 0 auto; height: 18px; margin-top: .2rem; width: 18px; }
.dg-sub { color: #6f7a7e; font-size: 12.5px; font-weight: 700; letter-spacing: .05em; margin: 1.4rem 0 .8rem; text-transform: uppercase; }
.dg-link { background: none; border: 0; color: var(--dg-blue); cursor: pointer; font: inherit; font-size: 13px; padding: 0; }
.dg-link:hover { text-decoration: underline; }

/* ---------- Botones ---------- */
.dg-btn {
  align-items: center;
  background: var(--dg-red);
  border: 1px solid var(--dg-red);
  border-radius: 2px;
  color: #fff !important;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  gap: .55rem;
  justify-content: center;
  letter-spacing: .02em;
  min-height: 46px;
  padding: .7rem 1.5rem;
  text-decoration: none !important;
  transition: background .15s, border-color .15s;
}
.dg-btn:hover { background: var(--dg-red-dark); border-color: var(--dg-red-dark); }
.dg-btn[disabled], .dg-btn.is-disabled { background: #d9d9d9; border-color: #d9d9d9; cursor: not-allowed; }
.dg-btn--line { background: #fff; color: var(--dg-red) !important; }
.dg-btn--line:hover { background: #fdf0f0; }
.dg-btn--blue { background: var(--dg-blue); border-color: var(--dg-blue); }
.dg-btn--blue:hover { background: var(--dg-blue-dark); border-color: var(--dg-blue-dark); }
.dg-btn--block { display: flex; width: 100%; }
.dg-btn--lg { font-size: 15px; min-height: 52px; }

/* ---------- Carrito ---------- */
.dg-cart { list-style: none; margin: 0; padding: 0; }
.dg-cart__item { align-items: center; border-bottom: 1px solid #eef0f1; display: grid; gap: 14px; grid-template-columns: 76px minmax(0, 1fr) auto auto 34px; padding: 16px 0; }
.dg-cart__item:last-child { border-bottom: 0; }
.dg-cart__img { background: var(--dg-soft); height: 76px; overflow: hidden; width: 76px; }
.dg-cart__img img { display: block; height: 100%; object-fit: cover; width: 100%; }
.dg-cart__name { color: var(--dg-ink); display: block; font-size: 14px; font-weight: 600; line-height: 1.35; }
.dg-cart__unit { color: var(--dg-muted); font-size: 12.5px; margin-top: .2rem; }
.dg-cart__sub { font-size: 15px; font-weight: 700; min-width: 86px; text-align: right; }
.dg-cart__del { background: none; border: 0; color: #b6bfc2; cursor: pointer; height: 34px; padding: 0; width: 34px; }
.dg-cart__del:hover { color: var(--dg-red); }
.dg-empty { color: var(--dg-muted); padding: 34px 10px; text-align: center; }
.dg-empty svg { color: #cfd6d8; display: block; margin: 0 auto .8rem; }

.dg-qty { align-items: stretch; border: 1px solid var(--dg-line); display: inline-flex; height: 40px; }
.dg-qty button { background: #fff; border: 0; color: #6f7a7e; cursor: pointer; font-size: 18px; line-height: 1; width: 34px; }
.dg-qty button:hover { background: var(--dg-soft); color: var(--dg-red); }
.dg-qty input { border: 0 !important; border-left: 1px solid var(--dg-line) !important; border-right: 1px solid var(--dg-line) !important; box-shadow: none !important; min-height: 0 !important; padding: 0 !important; text-align: center; width: 48px !important; }

/* ---------- Resumen ---------- */
.dg-totals { list-style: none; margin: 0; padding: 0; }
.dg-totals li { align-items: baseline; border-bottom: 1px dashed #dfe3e4; color: #6f7a7e; display: flex; font-size: 14px; gap: 1rem; justify-content: space-between; padding: .65rem 0; }
.dg-totals li span { color: var(--dg-ink); font-weight: 600; text-align: right; }
.dg-totals li.total { border-bottom: 0; color: var(--dg-ink); font-size: 15px; font-weight: 700; padding-top: 1rem; text-transform: uppercase; }
.dg-totals li.total span { color: var(--dg-red); font-size: 1.6rem; font-weight: 700; }
.dg-brands { align-items: center; display: flex; gap: .6rem; margin: .4rem 0 1rem; }
.dg-brands img { border: 1px solid #e6e9ea; border-radius: 2px; display: block; max-width: 100%; }
.dg-note { align-items: flex-start; color: var(--dg-muted); display: flex; font-size: 12.5px; gap: .55rem; margin-top: 1rem; }
.dg-note svg { color: var(--dg-ok); flex: 0 0 auto; margin-top: .15rem; }

/* ---------- Producto ---------- */
.dg-product { align-items: start; display: grid; gap: 50px; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.dg-product__img { background: #fff; border: 1px solid #eef0f1; padding: 14px; }
.dg-product__img img { display: block; margin: 0 auto; max-height: 460px; object-fit: contain; width: 100%; }
.dg-brand { color: var(--dg-red); font-size: 1.1rem; font-weight: 300; }
.dg-product h1 { color: #6f7a7e; font-size: 2rem; margin: .2rem 0 .9rem; text-transform: uppercase; }
.dg-price { color: var(--dg-blue); font-size: 2rem; font-weight: 300; margin-bottom: 1rem; }
.dg-desc { color: #7b8589; font-size: 14.5px; margin-bottom: 1.4rem; max-height: 220px; overflow: auto; text-align: justify; }
.dg-opts { display: grid; gap: 14px; margin-bottom: 1.2rem; }
.dg-sess { border: 1px solid #eef0f1; margin-bottom: 1.2rem; padding: .6rem 1rem; }
.dg-sess .col-md-12 { align-items: flex-start; display: flex; font-size: 14px; gap: .6rem; padding: .35rem 0; }
.dg-sess input[type=checkbox] { accent-color: var(--dg-blue); flex: 0 0 auto; height: 17px; margin-top: .25rem; width: 17px !important; }
.dg-actions { display: flex; flex-wrap: wrap; gap: .8rem; }
.dg-added { align-items: center; background: #eef8f1; border: 1px solid #cfe9d8; color: #226b3e; display: none; font-size: 14px; gap: .6rem; padding: .8rem 1rem; }
.dg-added a { font-weight: 700; margin-left: auto; }

/* ---------- Pago ---------- */
.dg-dl { margin: 0; padding: 0; }
.dg-dl > div { align-items: baseline; border-bottom: 1px dashed #dfe3e4; display: flex; gap: 1rem; justify-content: space-between; padding: .7rem 0; }
.dg-dl dt { color: var(--dg-muted); font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.dg-dl dd { font-size: 14.5px; font-weight: 600; margin: 0; text-align: right; }
.dg-dl .big dd { color: var(--dg-red); font-size: 1.5rem; font-weight: 700; }
.dg-payform .niu { background: #fff; border: 1px solid var(--dg-line); border-radius: 2px; height: 46px; overflow: hidden; padding: 0 .6rem; position: relative; }
/* Los campos de Niubiz se insertan como iframes con altura propia: se fijan a la altura del campo */
.dg-payform .niu > *, .dg-payform .niu iframe, .dg-payform .niu > div { height: 44px !important; max-height: 44px !important; min-height: 0 !important; width: 100% !important; border: 0 !important; margin: 0 !important; padding: 0 !important; }
.dg-payform .niu iframe { display: block; }
.dg-payform .niu:focus-within { border-color: var(--dg-blue); box-shadow: 0 0 0 3px rgba(0, 75, 154, .12); }
.dg-loading { color: var(--dg-muted); display: none; font-size: 13px; }
.dg-alert { background: #fdf0f0; border: 1px solid #f3c9c9; color: #a82222; display: none; font-size: 13.5px; margin-bottom: 1rem; padding: .8rem 1rem; }
.dg-overlay { align-items: center; background: rgba(255, 255, 255, .92); display: none; flex-direction: column; gap: 1rem; inset: 0; justify-content: center; position: fixed; z-index: 9999; }
.dg-overlay p { color: var(--dg-ink); font-size: 14px; font-weight: 600; margin: 0; }
.dg-spin { animation: dgspin .8s linear infinite; border: 3px solid #e3e6e7; border-radius: 50%; border-top-color: var(--dg-red); height: 44px; width: 44px; }
@keyframes dgspin { to { transform: rotate(360deg); } }

/* ---------- Resultado ---------- */
.dg-result { margin: 0 auto; max-width: 620px; text-align: center; }
.dg-result__ico { align-items: center; border-radius: 50%; display: inline-flex; height: 76px; justify-content: center; margin-bottom: 1rem; width: 76px; }
.dg-result--ok .dg-result__ico { background: #e7f5ec; color: var(--dg-ok); }
.dg-result--bad .dg-result__ico { background: #fdecec; color: var(--dg-red); }
.dg-result h2 { color: #5d686c; font-size: 1.9rem; margin-bottom: .4rem; }
.dg-result .dg-card__h h2 { color: #5d686c; font-size: 1.05rem; font-weight: 600; margin: 0; }
.dg-result p.lead { color: var(--dg-muted); margin: 0 0 1.4rem; }
.dg-result .dg-card { text-align: left; }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .dg-grid, .dg-grid--even, .dg-product { grid-template-columns: 1fr; }
  .dg-card--sum { position: static; }
  .dg-product { gap: 24px; }
}
@media (max-width: 575.98px) {
  .dg-header__in { flex-wrap: wrap; padding: 10px 0; }
  .dg-nav { display: none; }
  .dg-row { grid-template-columns: 1fr; }
  .dg-title { font-size: 1.6rem; }
  .dg-steps li span.t { display: none; }
  .dg-cart__item { grid-template-columns: 64px minmax(0, 1fr) 34px; }
  .dg-cart__img { height: 64px; width: 64px; }
  .dg-cart__qty, .dg-cart__sub { grid-column: 2 / 3; }
  .dg-cart__sub { text-align: left; }
  .dg-cart__del { grid-column: 3; grid-row: 1; }
  .dg-card__b { padding: 16px; }
}
@media print {
  .dg-header, .dg-footer, .dg-steps, .dg-actions, .no-print { display: none !important; }
}
