/* ══════════ Cotizador flotante ══════════ */

/* ── Botón flotante ── */
.cot-float {
  position: fixed; right: 28px; bottom: 142px; z-index: 86;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--bg2); border: 1px solid var(--line);
  display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
  font-size: 22px; color: var(--ink); line-height: 1;
}
.cot-float:hover {
  border-color: var(--acc); transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.6), 0 0 16px rgba(242,112,29,0.15);
}
.cot-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 20px; height: 20px; border-radius: 10px;
  background: var(--fire); color: #1a0d04;
  font-size: 11px; font-weight: 800; line-height: 20px;
  text-align: center; padding: 0 5px;
}

/* ── Overlay ── */
.cot-overlay {
  position: fixed; inset: 0; z-index: 88;
  background: rgba(0,0,0,0.55); opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.cot-overlay.on { opacity: 1; pointer-events: auto; }

/* ── Panel lateral ── */
.cot-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 89;
  width: min(420px, 92vw); background: var(--bg);
  border-left: 1px solid var(--line);
  transform: translateX(100%); transition: transform 0.35s cubic-bezier(0.16,1,0.3,1);
  display: flex; flex-direction: column;
  box-shadow: -8px 0 40px rgba(0,0,0,0.4);
}
.cot-panel.on { transform: none; }

.cot-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 22px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.cot-panel-head h3 {
  font-family: var(--disp); font-weight: 800; font-size: 22px;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink);
}
.cot-close {
  background: none; border: 1px solid var(--line); color: var(--mut);
  width: 36px; height: 36px; border-radius: 8px; cursor: pointer;
  font-size: 16px; display: grid; place-items: center;
  transition: border-color 0.3s, color 0.3s;
}
.cot-close:hover { border-color: var(--acc); color: var(--ink); }

.cot-panel-body {
  flex: 1; overflow-y: auto; padding: 18px 22px 24px;
  scrollbar-width: thin; scrollbar-color: rgba(242,112,29,0.3) transparent;
}

/* ── Toggle materiales ── */
.cot-toggle {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; color: var(--mut); cursor: pointer;
  padding: 12px 16px; margin-bottom: 16px;
  background: rgba(255,255,255,0.02); border: 1px solid var(--line);
  border-radius: 8px; transition: border-color 0.3s;
}
.cot-toggle:hover { border-color: rgba(242,112,29,0.2); }
.cot-toggle input { accent-color: var(--acc); width: 16px; height: 16px; cursor: pointer; }

/* ── Section titles ── */
.cot-section-title {
  font-family: var(--disp); font-weight: 700; font-size: 13px;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--dim);
  margin: 18px 0 10px; display: flex; align-items: center; gap: 10px;
}
.cot-section-title::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}

/* ── Cart items ── */
.cot-empty { font-size: 13px; color: var(--dim); font-style: italic; margin: 8px 0; }

.cot-item {
  display: grid; grid-template-columns: 1fr auto auto; gap: 8px;
  align-items: center; padding: 10px 0;
  border-bottom: 1px solid rgba(243,239,232,0.05);
}
.cot-item-name {
  display: block; font-size: 14px; font-weight: 600; color: var(--ink);
  line-height: 1.2;
}
.cot-item-detail { display: block; font-size: 12px; color: var(--dim); margin-top: 2px; }
.cot-item-total {
  font-family: var(--disp); font-weight: 700; font-size: 16px;
  background: var(--fire); -webkit-background-clip: text;
  background-clip: text; color: transparent; white-space: nowrap;
}
.cot-item-rm {
  background: none; border: none; color: var(--dim); cursor: pointer;
  font-size: 14px; padding: 4px 6px; border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}
.cot-item-rm:hover { color: #e74c3c; background: rgba(231,76,60,0.1); }

/* ── Materiales button ── */
.cot-add-mat {
  display: block; width: 100%; padding: 10px; margin: 6px 0 10px;
  background: rgba(242,112,29,0.06); border: 1px dashed rgba(242,112,29,0.25);
  border-radius: 8px; color: var(--acc); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background 0.3s, border-color 0.3s;
  font-family: var(--body);
}
.cot-add-mat:hover { background: rgba(242,112,29,0.12); border-color: var(--acc); }

/* ── Totals ── */
.cot-totals {
  margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line);
}
.cot-total-row {
  display: flex; justify-content: space-between; padding: 5px 0;
  font-size: 14px; color: var(--mut);
}
.cot-subtotal { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 6px; font-weight: 600; }
.cot-grand {
  font-family: var(--disp); font-weight: 800; font-size: 20px; color: var(--ink);
  margin-top: 4px; padding-top: 8px; border-top: 2px solid var(--acc);
}

/* ── Generate button ── */
.cot-generate {
  width: 100%; margin-top: 18px; text-align: center;
  font-size: 16px !important; padding: 16px 24px !important;
}
.cot-generate:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* ── Materials modal ── */
.mat-modal {
  position: fixed; inset: 0; z-index: 95;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.65); opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.mat-modal.on { opacity: 1; pointer-events: auto; }

.mat-modal-inner {
  width: min(560px, 94vw); max-height: 80vh;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.mat-modal-head {
  padding: 18px 22px; border-bottom: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
}
.mat-modal-head h3 {
  font-family: var(--disp); font-weight: 700; font-size: 18px;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink); flex: 1;
}
.mat-modal-close {
  background: none; border: 1px solid var(--line); color: var(--mut);
  width: 32px; height: 32px; border-radius: 6px; cursor: pointer;
  font-size: 14px; display: grid; place-items: center;
}
#mat-search {
  width: 100%; padding: 10px 14px;
  background: rgba(243,239,232,0.04); border: 1px solid var(--line);
  border-radius: 6px; color: var(--ink); font-family: var(--body);
  font-size: 14px; outline: none; margin-top: 4px;
}
#mat-search:focus { border-color: var(--acc); }

.mat-modal-body { flex: 1; overflow-y: auto; padding: 12px 22px 22px; }

.mat-cat-head {
  padding: 10px 0; cursor: pointer; display: flex; align-items: center; gap: 10px;
  font-family: var(--disp); font-weight: 700; font-size: 15px;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--mut);
  border-bottom: 1px solid var(--line); user-select: none;
}
.mat-cat-head::before {
  content: "▸"; font-size: 12px; color: var(--acc);
  transition: transform 0.3s; display: inline-block;
}
.mat-cat-head.open::before { transform: rotate(90deg); }
.mat-cat-list { display: none; padding: 6px 0; }
.mat-cat-list.open { display: block; }

.mat-row {
  display: grid; grid-template-columns: 1fr auto; gap: 8px;
  align-items: center; padding: 8px 0;
  border-bottom: 1px solid rgba(243,239,232,0.04);
}
.mat-row-name { font-size: 13px; color: var(--ink); font-weight: 500; }
.mat-row-meta { font-size: 11px; color: var(--dim); }
.mat-row-add {
  display: flex; align-items: center; gap: 4px;
}
.mat-row-qty {
  width: 52px; padding: 5px 6px; text-align: center;
  background: rgba(243,239,232,0.04); border: 1px solid var(--line);
  border-radius: 4px; color: var(--ink); font-size: 13px; font-weight: 600;
}
.mat-row-btn {
  background: var(--fire); border: none; color: #1a0d04;
  font-weight: 700; font-size: 16px; width: 30px; height: 30px;
  border-radius: 6px; cursor: pointer; display: grid; place-items: center;
}

/* ── Tariff card add button ── */
.tar-add-btn {
  display: block; width: 100%; margin-top: 10px; padding: 8px 12px;
  background: rgba(242,112,29,0.08); border: 1px solid rgba(242,112,29,0.2);
  border-radius: 6px; color: var(--acc); font-size: 13px; font-weight: 700;
  font-family: var(--body); cursor: pointer;
  transition: background 0.3s, border-color 0.3s;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.tar-add-btn:hover { background: rgba(242,112,29,0.16); border-color: var(--acc); }

@media (max-width: 640px) {
  .cot-float { bottom: 136px; width: 50px; height: 50px; font-size: 20px; }
  .cot-panel { width: 100vw; }
}
