@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --primary:       #7C3AED;
  --primary-dark:  #5B21B6;
  --primary-light: #EDE9FE;
  --success:       #2E7D32;
  --success-light: #E8F5E9;
  --danger:        #C62828;
  --gray-light:    #F8F9FA;
  --gray:          #9E9E9E;
  --border:        #E0E0E0;
  --text:          #2C3E50;
  --radius:        12px;
  --shadow:        0 4px 20px rgba(0,0,0,.08);
  --shadow-hover:  0 8px 30px rgba(124,58,237,.2);
}

.cot-wrap * { box-sizing: border-box; }

.cot-wrap {
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 0 40px;
  color: var(--text);
}

/* ── Hero Header ───────────────────────────────────── */
.cot-hero {
  background: linear-gradient(135deg, #5B21B6 0%, #7C3AED 40%, #C026D3 75%, #0891B2 100%);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 36px 40px 28px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.cot-hero::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 220px; height: 220px;
  background: rgba(255,255,255,.06);
  border-radius: 50%;
}
.cot-hero::after {
  content: '';
  position: absolute;
  bottom: -40px; left: 30%;
  width: 160px; height: 160px;
  background: rgba(255,255,255,.04);
  border-radius: 50%;
}
.cot-hero h1 {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.3px;
  color: #fff;
}
.cot-hero p {
  margin: 0;
  font-size: 15px;
  opacity: .85;
  color: #fff;
}

/* ── Progreso ─────────────────────────────────────── */
.cot-progress-wrap {
  background: #fff;
  padding: 20px 40px;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.cot-progress {
  display: flex;
  align-items: center;
  max-width: 480px;
  margin: 0 auto;
}
.cot-prog-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--gray);
  flex-shrink: 0;
  transition: color .3s;
}
.cot-prog-step .num {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--border);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  transition: all .3s;
  flex-shrink: 0;
}
.cot-prog-step.current .num  { background: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); }
.cot-prog-step.done    .num  { background: var(--success); }
.cot-prog-step.done    .num::after { content: '✓'; }
.cot-prog-step.done    .num span   { display: none; }
.cot-prog-step.current label { color: var(--primary); font-weight: 600; }
.cot-prog-step.done    label { color: var(--success); }
.cot-prog-line {
  flex: 1;
  height: 3px;
  background: var(--border);
  margin: 0 12px;
  border-radius: 2px;
}
.cot-prog-line.done { background: var(--success); }

/* ── Steps ────────────────────────────────────────── */
.cot-step { display: none; }
.cot-step.active { display: block; }
.cot-step-body {
  background: #fff;
  padding: 32px 40px;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow);
}

.cot-step-title {
  font-size: 19px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--text);
}
.cot-step-subtitle {
  font-size: 14px;
  color: var(--gray);
  margin: 0 0 24px;
}

/* ── Mensaje ──────────────────────────────────────── */
.cot-msg {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  display: none;
  align-items: center;
  gap: 10px;
}
.cot-msg.error   { background: #FFEBEE; border: 1px solid #EF9A9A; color: var(--danger); display: flex; }
.cot-msg.success { background: #E8F5E9; border: 1px solid #A5D6A7; color: var(--success); display: flex; }

/* ── Loading ──────────────────────────────────────── */
.cot-loading {
  text-align: center;
  padding: 50px 20px;
  color: var(--gray);
  font-size: 14px;
}
.cot-loading::before {
  content: '';
  display: block;
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 14px;
  animation: cot-spin .8s linear infinite;
}
@keyframes cot-spin { to { transform: rotate(360deg); } }

/* ── Tabs de categorías ───────────────────────────── */
.cot-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.cot-tab {
  padding: 8px 20px;
  border: 2px solid var(--border);
  border-radius: 24px;
  font-size: 13px;
  cursor: pointer;
  background: #fff;
  color: var(--text);
  transition: all .2s;
  font-weight: 500;
  font-family: inherit;
}
.cot-tab:hover  { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.cot-tab.active { border-color: var(--primary); background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(25,118,210,.3); }

/* ── Grid de servicios ────────────────────────────── */
.cot-servicios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
  min-height: 140px;
}
.cot-srv-card {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px 14px;
  transition: all .25s;
  position: relative;
  background: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.cot-srv-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.cot-srv-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: var(--shadow-hover);
}

.cot-checkmark {
  position: absolute; top: -10px; right: -10px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--success);
  color: #fff; font-size: 13px;
  display: none; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(46,125,50,.4);
}
.cot-srv-card.selected .cot-checkmark { display: flex; }

.cot-srv-card h4 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
}
.cot-srv-card p {
  margin: 0 0 14px;
  font-size: 12px;
  color: #777;
  line-height: 1.5;
  flex: 1;
}

.cot-srv-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.cot-srv-precio { font-size: 18px; font-weight: 700; color: var(--primary); }
.cot-srv-precio small { font-size: 11px; font-weight: 400; color: var(--gray); }

.cot-srv-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 22px; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(25,118,210,.3);
}
.cot-srv-btn:hover { background: var(--primary-dark); transform: scale(1.1); }
.cot-srv-card.selected .cot-srv-btn { background: var(--success); box-shadow: 0 4px 10px rgba(46,125,50,.3); }

/* ── Badge carrito ────────────────────────────────── */
.cot-badge {
  background: #fff;
  color: var(--primary);
  border-radius: 50%;
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  margin-left: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}

/* ── Tabla carrito ────────────────────────────────── */
.cot-tabla { width: 100%; border-collapse: collapse; margin-bottom: 20px; border-radius: 10px; overflow: hidden; }
.cot-tabla th,
.cot-tabla td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
.cot-tabla thead tr { background: linear-gradient(135deg, #5B21B6, #7C3AED, #C026D3); }
.cot-tabla th  { color: #fff; font-weight: 600; font-size: 13px; }
.cot-tabla tbody tr:hover { background: var(--gray-light); }
.cot-tabla .col-num   { text-align: center; }
.cot-tabla .col-right { text-align: right; font-weight: 600; }
.cot-tabla input[type="number"] {
  width: 64px; padding: 5px 8px;
  border: 2px solid var(--border);
  border-radius: 8px; font-size: 14px; text-align: center;
  transition: border-color .2s;
}
.cot-tabla input[type="number"]:focus { outline: none; border-color: var(--primary); }

.cot-total-box {
  text-align: right;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--primary-light);
  border-radius: 10px;
  border: 1px solid rgba(25,118,210,.2);
}
.cot-total-box span { font-size: 20px; font-weight: 700; color: var(--primary); }

/* ── Formulario ───────────────────────────────────── */
.cot-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 8px; }
@media (max-width: 560px) { .cot-form-grid { grid-template-columns: 1fr; } }

.cot-field { display: flex; flex-direction: column; gap: 6px; }
.cot-field.full { grid-column: 1 / -1; }
.cot-field label { font-size: 13px; font-weight: 600; color: #555; display: flex; align-items: center; gap: 5px; }
.cot-field label .req { color: var(--primary); font-size: 16px; line-height: 1; }
.cot-field input,
.cot-field textarea {
  padding: 11px 14px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  transition: all .2s;
  background: var(--gray-light);
  color: var(--text);
}
.cot-field input:focus,
.cot-field textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px var(--primary-light);
}
.cot-field textarea { height: 110px; resize: vertical; }

/* ── Botones ──────────────────────────────────────── */
.cot-btn-group { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.btn-primary {
  background: linear-gradient(135deg, #5B21B6, #7C3AED, #C026D3);
  color: #fff;
  border: none; padding: 13px 30px;
  border-radius: 10px; font-size: 15px;
  cursor: pointer; font-weight: 600;
  font-family: inherit;
  transition: all .2s;
  box-shadow: 0 4px 14px rgba(124,58,237,.35);
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary:hover     { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(124,58,237,.5); }
.btn-primary:disabled  { background: var(--gray); cursor: not-allowed; box-shadow: none; transform: none; }
.btn-secondary {
  background: #fff;
  color: var(--text);
  border: 2px solid var(--border);
  padding: 13px 24px;
  border-radius: 10px; font-size: 15px;
  cursor: pointer; font-family: inherit;
  transition: all .2s;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

/* ── Modal de confirmación ────────────────────────── */
.cot-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  padding: 20px;
  backdrop-filter: blur(3px);
}
.cot-modal {
  background: #fff;
  border-radius: 16px;
  padding: 36px 32px 28px;
  max-width: 420px; width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  text-align: center;
  animation: cot-modal-in .25s ease;
}
@keyframes cot-modal-in { from { opacity:0; transform: scale(.95); } to { opacity:1; transform: scale(1); } }
.cot-modal .icon { font-size: 48px; display: block; margin-bottom: 14px; }
.cot-modal h4 { margin: 0 0 10px; font-size: 20px; color: var(--text); }
.cot-modal p  { margin: 0 0 26px; font-size: 14px; color: #666; line-height: 1.6; }
.cot-modal .cot-btn-group { justify-content: center; margin-top: 0; }

/* ── Pantalla éxito ───────────────────────────────── */
.cot-exito { text-align: center; padding: 48px 20px 32px; }
.cot-exito-icon {
  width: 80px; height: 80px;
  background: var(--success-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px;
  margin: 0 auto 20px;
  box-shadow: 0 0 0 10px #E8F5E9;
}
.cot-exito h2  { color: var(--success); font-size: 26px; margin: 0 0 12px; }
.cot-exito p   { color: #666; margin: 0 0 6px; font-size: 15px; line-height: 1.6; max-width: 400px; margin-inline: auto; }
.cot-exito .total {
  font-size: 22px; font-weight: 700; color: var(--primary);
  margin: 24px 0 8px;
  background: var(--primary-light);
  padding: 14px 28px;
  border-radius: 12px;
  display: inline-block;
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 600px) {
  .cot-hero { padding: 28px 20px 22px; }
  .cot-progress-wrap { padding: 16px 20px; }
  .cot-step-body { padding: 24px 16px; }
  .cot-hero h1 { font-size: 20px; }
}
