/* ═══════════════════════════════════════════════════
   MACOPA CALCULADORA v2 — CSS
   Todos los estilos con prefijo .mc- para no colisionar
   con temas de WordPress o Elementor
═══════════════════════════════════════════════════ */
:root {
  --mc-red:   #b10023;
  --mc-red-d: #870019;
  --mc-red-l: #f5e0e4;
  --mc-amber: #ffa300;
  --mc-amb-d: #cc8200;
  --mc-dark:  #1a1a1a;
  --mc-mid:   #444;
  --mc-muted: #888;
  --mc-line:  #e0e0e0;
  --mc-bg:    #f4f4f2;
  --mc-white: #ffffff;
  --mc-r:     10px;
  --mc-r-sm:  6px;
  --mc-sh:    0 2px 16px rgba(0,0,0,.08);
  --mc-sh-lg: 0 8px 32px rgba(0,0,0,.14);
}

/* ── RESET SCOPE ── */
.mc-wrap, .mc-wrap *, .mc-wrap *::before, .mc-wrap *::after {
  box-sizing: border-box;
}
.mc-wrap {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 15px;
  color: var(--mc-dark);
  line-height: 1.55;
  max-width: 1000px;
  margin: 0 auto;
  background: var(--mc-bg);
  border-radius: var(--mc-r);
  overflow: hidden;
}
.mc-wrap input, .mc-wrap select, .mc-wrap button, .mc-wrap textarea {
  font-family: inherit;
}

/* ── HERO ───────────────────────────────────────── */
.mc-hero {
  background: linear-gradient(135deg, #8a001b 0%, #b10023 60%, #cc002a 100%);
  padding: 36px 32px 30px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.mc-hero::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  background: rgba(255,255,255,.04);
  border-radius: 50%;
}
.mc-hero::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -30px;
  width: 240px; height: 240px;
  background: rgba(255,255,255,.03);
  border-radius: 50%;
}
/* FORZAR color blanco aunque el tema lo sobreescriba */
.mc-hero .mc-hero__title,
.mc-hero h1, .mc-hero h2, .mc-hero h3 {
  color: #ffffff !important;
  font-size: 1.85rem !important;
  font-weight: 700 !important;
  letter-spacing: .02em;
  margin: 0 0 8px !important;
  padding: 0 !important;
  text-shadow: 0 1px 3px rgba(0,0,0,.2);
  position: relative;
  z-index: 1;
}
.mc-hero__sub {
  color: rgba(255,255,255,.88) !important;
  font-size: 14px !important;
  margin: 0 !important;
  position: relative;
  z-index: 1;
}

/* ── PASO 1: TIPO DE MURO ───────────────────────── */
.mc-section {
  padding: 0 24px;
  margin-bottom: 8px;
}

.mc-step-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 24px 0 14px;
  font-weight: 700;
  font-size: .95rem;
  color: var(--mc-dark);
  letter-spacing: .01em;
}
.mc-step-n {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--mc-red);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(177,0,35,.35);
}

.mc-type-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.mc-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 16px 18px;
  background: var(--mc-white);
  border: 2px solid var(--mc-line);
  border-radius: var(--mc-r);
  cursor: pointer;
  transition: all .2s;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.mc-type-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--mc-red);
  opacity: 0;
  transition: opacity .2s;
}
.mc-type-btn:hover {
  border-color: var(--mc-red);
  box-shadow: 0 4px 16px rgba(177,0,35,.15);
  transform: translateY(-1px);
}
.mc-type-btn.active {
  border-color: var(--mc-red);
  background: #fff;
  box-shadow: 0 4px 20px rgba(177,0,35,.18);
}
.mc-type-btn.active::before {
  content: '✓';
  position: absolute;
  top: 10px; right: 12px;
  width: 20px; height: 20px;
  background: var(--mc-red);
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  line-height: 20px;
  text-align: center;
}
.mc-type-icon {
  font-size: 2.2rem;
  margin-bottom: 10px;
  display: block;
}
.mc-type-name {
  font-weight: 700;
  font-size: .95rem;
  color: var(--mc-dark);
  display: block;
}
.mc-type-desc {
  font-size: .78rem;
  color: var(--mc-muted);
  display: block;
  margin-top: 4px;
}

/* ── FORM LAYOUT ────────────────────────────────── */
.mc-form-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  background: var(--mc-bg);
  padding: 0 24px 24px;
}
@media(min-width: 760px) {
  .mc-form-layout {
    grid-template-columns: 1fr 280px;
    gap: 20px;
    padding: 0 24px 24px;
  }
  .mc-sidebar { position: sticky; top: 20px; align-self: start; }
}

/* ── CARD ───────────────────────────────────────── */
.mc-card {
  background: var(--mc-white);
  border: 1px solid var(--mc-line);
  border-radius: var(--mc-r);
  padding: 18px 20px;
  box-shadow: var(--mc-sh);
  transition: box-shadow .2s;
}
.mc-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.1); }
.mc-card--mt { margin-top: 12px; }
.mc-card-title {
  font-weight: 700;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--mc-red);
  margin-bottom: 14px;
  padding-bottom: 9px;
  border-bottom: 2px solid var(--mc-red-l);
  display: flex;
  align-items: center;
  gap: 7px;
}
.mc-card-title::before {
  content: '';
  width: 3px; height: 14px;
  background: var(--mc-red);
  border-radius: 2px;
  display: inline-block;
}

/* ── FORM GRID ──────────────────────────────────── */
.mc-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.mc-row2--mt { margin-top: 14px; }
@media(max-width: 540px) { .mc-row2 { grid-template-columns: 1fr; } }

.mc-fg { display: flex; flex-direction: column; gap: 5px; }
.mc-fg label {
  font-size: 12px;
  font-weight: 700;
  color: var(--mc-mid);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.mc-input, .mc-select {
  padding: 10px 13px;
  border: 1.5px solid var(--mc-line);
  border-radius: var(--mc-r-sm);
  background: #fafafa;
  color: var(--mc-dark);
  width: 100%;
  font-size: 14px;
  transition: border-color .15s, background .15s, box-shadow .15s;
  -webkit-appearance: none;
  appearance: none;
}
.mc-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.mc-input:focus, .mc-select:focus {
  outline: none;
  border-color: var(--mc-red);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(177,0,35,.1);
}

/* ── AVISO ──────────────────────────────────────── */
.mc-aviso {
  background: #fff8e1;
  border: 1px solid #ffc107;
  border-left: 4px solid var(--mc-amber);
  border-radius: var(--mc-r-sm);
  padding: 10px 14px;
  font-size: 12.5px;
  color: #7a4e00;
  margin-bottom: 12px;
  line-height: 1.5;
}

/* ── CALC BUTTON ────────────────────────────────── */
.mc-btn-calc {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px 20px;
  background: var(--mc-red);
  color: #fff !important;
  border: none;
  border-radius: var(--mc-r);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .15s, transform .1s, box-shadow .15s;
  box-shadow: 0 4px 14px rgba(177,0,35,.3);
  margin-top: 4px;
}
.mc-btn-calc:hover {
  background: var(--mc-red-d);
  box-shadow: 0 6px 20px rgba(177,0,35,.4);
  transform: translateY(-1px);
}
.mc-btn-calc:active { transform: scale(.99); box-shadow: none; }

.mc-btn-pdf {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 18px;
  padding: 13px 20px;
  background: var(--mc-dark);
  color: #fff !important;
  border: none;
  border-radius: var(--mc-r);
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .1s;
  box-shadow: 0 3px 10px rgba(0,0,0,.2);
}
.mc-btn-pdf:hover { background: #333; transform: translateY(-1px); }
.mc-btn-pdf:disabled { opacity: .55; cursor: wait; transform: none; }

.mc-help-text { font-size: 12.5px; color: var(--mc-muted); margin-bottom: 16px; line-height: 1.55; }
.mc-req { color: var(--mc-red); }

/* ── SIDEBAR PREVIEW ────────────────────────────── */
.mc-preview-card {
  background: var(--mc-white);
  border: 1px solid var(--mc-line);
  border-radius: var(--mc-r);
  overflow: hidden;
  box-shadow: var(--mc-sh);
  margin-top: 24px;
}
@media(min-width: 760px) { .mc-preview-card { margin-top: 0; } }

.mc-preview-hd {
  background: var(--mc-dark);
  color: #fff;
  padding: 12px 16px;
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  display: flex;
  align-items: center;
  gap: 7px;
}
.mc-preview-hd::before {
  content: '●';
  color: var(--mc-amber);
  font-size: .6rem;
}
.mc-preview-body { padding: 12px 14px; }
.mc-preview-item {
  padding: 9px 0;
  border-bottom: 1px solid var(--mc-line);
  font-size: 12.5px;
  overflow: hidden;
}
.mc-preview-item:last-child { border-bottom: none; }
.mc-preview-caps {
  float: right;
  font-weight: 800;
  color: var(--mc-red);
  font-size: .8rem;
  margin-left: 6px;
  background: var(--mc-red-l);
  padding: 2px 8px;
  border-radius: 20px;
}
.mc-preview-name { font-weight: 700; color: var(--mc-dark); font-size: .85rem; }
.mc-preview-desc { color: var(--mc-muted); font-size: 11px; margin-top: 3px; line-height: 1.45; }
.mc-preview-img-wrap { border-top: 1px solid var(--mc-line); background: var(--mc-bg); }
.mc-preview-img { width: 100%; display: block; max-height: 210px; object-fit: cover; }
.mc-preview-ph {
  width: 100%; height: 120px;
  display: flex; align-items: center; justify-content: center;
  color: var(--mc-muted); font-size: 12px;
  background: var(--mc-bg);
  gap: 6px;
}

/* ── MODAL ──────────────────────────────────────── */
.mc-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.mc-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(3px);
}
.mc-modal-box {
  position: relative;
  background: #fff;
  border-radius: var(--mc-r);
  width: 100%;
  max-width: 700px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--mc-sh-lg);
  animation: mc-modal-in .2s ease;
}
@keyframes mc-modal-in {
  from { opacity:0; transform: translateY(16px) scale(.98); }
  to   { opacity:1; transform: translateY(0) scale(1); }
}

.mc-modal-hd {
  background: var(--mc-dark);
  color: #fff;
  padding: 16px 20px;
  border-radius: var(--mc-r) var(--mc-r) 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.mc-modal-hd h3 {
  font-size: .95rem !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin: 0 !important;
  padding: 0 !important;
  color: #fff !important;
}
.mc-modal-actions { display: flex; align-items: center; gap: 8px; }

.mc-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* Meta info strip */
.mc-modal-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.mc-meta-chip {
  background: var(--mc-bg);
  border-radius: var(--mc-r-sm);
  padding: 10px 14px;
  border-left: 3px solid var(--mc-red);
}
.mc-meta-chip .mc-mc-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--mc-muted);
  font-weight: 700;
  margin-bottom: 2px;
}
.mc-meta-chip .mc-mc-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--mc-dark);
}

.mc-modal-table-wrap {
  border-radius: var(--mc-r-sm);
  border: 1px solid var(--mc-line);
  overflow: hidden;
}
table.mc-results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.mc-results-table thead tr {
  background: var(--mc-red);
}
table.mc-results-table thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #fff;
  font-weight: 700;
}
table.mc-results-table thead th:nth-child(2),
table.mc-results-table thead th:nth-child(3) { text-align: right; }
table.mc-results-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--mc-line);
  font-size: 13px;
}
table.mc-results-table td:nth-child(2),
table.mc-results-table td:nth-child(3) { text-align: right; white-space: nowrap; }
table.mc-results-table tbody tr:nth-child(even) { background: #fafafa; }
table.mc-results-table tbody tr:last-child td { border-bottom: none; }
table.mc-results-table .mc-qty {
  font-weight: 800;
  color: var(--mc-red);
  font-size: .95rem;
}
table.mc-results-table .mc-sub td {
  background: var(--mc-dark) !important;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}
table.mc-results-table .mc-sub .mc-qty { color: var(--mc-amber); }

.mc-modal-notes {
  margin-top: 16px;
  padding: 12px 16px;
  background: #fffbf0;
  border-left: 3px solid var(--mc-amber);
  border-radius: 0 var(--mc-r-sm) var(--mc-r-sm) 0;
  font-size: 12px;
  color: var(--mc-muted);
  line-height: 1.65;
}
.mc-modal-notes strong { color: var(--mc-mid); }

.mc-modal-ft {
  padding: 14px 20px;
  border-top: 1px solid var(--mc-line);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-shrink: 0;
  background: #fafafa;
  border-radius: 0 0 var(--mc-r) var(--mc-r);
}
.mc-btn-secondary {
  padding: 9px 20px;
  background: transparent;
  color: var(--mc-mid);
  border: 1.5px solid var(--mc-line);
  border-radius: var(--mc-r-sm);
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.mc-btn-secondary:hover { background: var(--mc-bg); }
.mc-btn-download {
  padding: 9px 22px;
  background: var(--mc-red);
  color: #fff !important;
  border: none;
  border-radius: var(--mc-r-sm);
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.mc-btn-download:hover { background: var(--mc-red-d); }
.mc-btn-print {
  padding: 8px 16px;
  background: var(--mc-amber);
  color: #1a1a1a !important;
  border: none;
  border-radius: var(--mc-r-sm);
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.mc-btn-print:hover { background: var(--mc-amb-d); }
.mc-modal-close {
  background: rgba(255,255,255,.1);
  border: none;
  color: rgba(255,255,255,.8);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 5px 9px;
  border-radius: 5px;
  transition: background .15s, color .15s;
  line-height: 1;
}
.mc-modal-close:hover { background: rgba(255,255,255,.2); color: #fff; }

/* ── PASO 5 ──────────────────────────────────────── */
#mc_paso5 .mc-card {
  border-top: 3px solid var(--mc-amber);
}

/* ── SEPARADOR ──────────────────────────────────── */
.mc-divider {
  border: none;
  border-top: 1px dashed var(--mc-line);
  margin: 4px 0;
}

/* ── RESPONSIVE ─────────────────────────────────── */
@media(max-width: 500px) {
  .mc-type-btns { grid-template-columns: 1fr; }
  .mc-hero .mc-hero__title, .mc-hero h1, .mc-hero h2 { font-size: 1.4rem !important; }
  .mc-section { padding: 0 14px; }
  .mc-form-layout { padding: 0 14px 20px; }
}

/* ── PRINT ──────────────────────────────────────── */
@media print {
  .mc-wrap, .mc-hero, .mc-section,
  .mc-sidebar, .mc-modal-hd .mc-modal-actions,
  .mc-modal-ft, #mc_paso5 { display: none !important; }
  .mc-modal { position: static; display: block !important; }
  .mc-modal-backdrop { display: none !important; }
  .mc-modal-box { box-shadow: none; max-height: none; border-radius: 0; }
  .mc-modal-hd { border-radius: 0; }
  body { background: white !important; }
}

/* Aviso técnico dentro del modal de resultados (v1.7) */
#macopa-calculadora ~ .mc-modal .mc-modal-aviso,
.mc-modal .mc-modal-aviso {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 3px solid #f59e0b;
  color: #78350f;
  border-radius: 0 6px 6px 0;
  padding: 11px 14px;
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 14px;
}

/* Tres categorías en el paso 1 (v1.8) */
#macopa-calculadora .mc-type-btns--3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 720px) {
  #macopa-calculadora .mc-type-btns--3 { grid-template-columns: 1fr; }
}

/* ── Desglose del cálculo (v1.10) ── */
.mc-dg-wrap { margin: 14px 0 4px; }
.mc-dg-toggle {
  background: none; border: none; cursor: pointer; padding: 6px 0;
  font-size: 13px; font-weight: 600; color: #b10023;
  display: inline-flex; align-items: center; gap: 6px; font-family: inherit;
}
.mc-dg-toggle:hover { text-decoration: underline; }
.mc-dg-arrow { font-size: 10px; transition: transform .15s; }
.mc-dg {
  margin-top: 10px; background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 7px; padding: 14px;
}
.mc-dg-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.mc-dg-block h4 {
  margin: 0 0 7px; font-size: 11px; text-transform: uppercase;
  letter-spacing: .05em; color: #94a3b8; font-weight: 700;
}
.mc-dg-list { list-style: none; margin: 0; padding: 0; }
.mc-dg-list li {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 4px 0; border-bottom: 1px solid #eef2f7; font-size: 12.5px; color: #475569;
}
.mc-dg-list li:last-child { border-bottom: none; }
.mc-dg-list b { color: #1e293b; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.mc-dg-tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.mc-dg-tbl th {
  text-align: left; padding: 7px 8px; background: #eef2f7; color: #64748b;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700;
}
.mc-dg-tbl td { padding: 7px 8px; border-bottom: 1px solid #eef2f7; color: #475569; vertical-align: top; }
.mc-dg-tbl tr:last-child td { border-bottom: none; }
.mc-dg-f { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; color: #64748b; }
.mc-dg-r { text-align: right; white-space: nowrap; }
.mc-dg-r b { color: #b10023; font-size: 13px; }
@media (max-width: 640px) {
  .mc-dg-cols { grid-template-columns: 1fr; }
  .mc-dg-tbl th:nth-child(3), .mc-dg-tbl td:nth-child(3) { display: none; }
}

/* Aclaración corta bajo un campo (v1.16) */
#macopa-calculadora .mc-hint-inline {
  display: block;
  font-size: 11.5px;
  color: #94a3b8;
  margin-top: 5px;
  line-height: 1.45;
}
