/* ═══════════════════════════════════════════════
   COTIZADOR — Panel flotante de cotización
   Navia Comunicaciones y Servicios Ltda.
   Archivo independiente: css/cotizador.css
═══════════════════════════════════════════════ */

/* ── Botón cotizar en navbar ── */
.cot-nav-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: 7px;
  background: transparent;
  border: 1.5px solid var(--red);
  color: var(--red);
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
  margin-left: 8px;
}
.cot-nav-btn:hover {
  background: var(--red);
  color: #fff;
  box-shadow: 0 4px 14px rgba(204,0,0,0.28);
  transform: translateY(-1px);
}
.cot-nav-btn svg { flex-shrink: 0; }
.cot-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  font-family: 'Source Sans 3', sans-serif;
  line-height: 1;
  animation: badgePop .25s cubic-bezier(.22,1,.36,1);
}
.cot-badge.visible { display: flex; }
.cot-nav-btn:hover .cot-badge { background: #fff; color: var(--red); }
@keyframes badgePop {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

/* ── Overlay de fondo ── */
.cot-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.55);
  backdrop-filter: blur(6px);
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity .32s ease;
}
.cot-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* ── Panel principal (drawer lateral derecho) ── */
.cot-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 520px;
  max-width: 100vw;
  background: #fff;
  z-index: 901;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 48px rgba(0,0,0,0.18);
  transform: translateX(100%);
  transition: transform .38s cubic-bezier(.22,1,.36,1);
}
.cot-panel.open {
  transform: translateX(0);
}

/* ── Cabecera del panel ── */
.cot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 18px;
  border-bottom: 2px solid var(--red);
  background: #fff;
  flex-shrink: 0;
}
.cot-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cot-header-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.cot-header-title {
  font-family: 'Oswald', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.1;
}
.cot-header-sub {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.5px;
}
.cot-close {
  background: #f5f5f5;
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  font-size: 16px;
  transition: all .18s;
  flex-shrink: 0;
}
.cot-close:hover {
  background: var(--red);
  color: #fff;
  transform: rotate(90deg);
}

/* ── Tabs ── */
.cot-tabs {
  display: flex;
  border-bottom: 1px solid #ebebeb;
  flex-shrink: 0;
  background: #fafafa;
}
.cot-tab {
  flex: 1;
  padding: 13px 10px;
  border: none;
  background: transparent;
  font-family: 'Oswald', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all .18s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  position: relative;
  top: 1px;
}
.cot-tab.active {
  color: var(--red);
  border-bottom-color: var(--red);
  background: #fff;
}
.cot-tab:hover:not(.active) { color: var(--text); }
.cot-tab-num {
  background: var(--red);
  color: #fff;
  border-radius: 50%;
  width: 17px;
  height: 17px;
  font-size: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 800;
}

/* ── Cuerpo scrolleable ── */
.cot-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
}
.cot-body::-webkit-scrollbar { width: 4px; }
.cot-body::-webkit-scrollbar-track { background: transparent; }
.cot-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── Vistas (tabs) ── */
.cot-view { display: none; padding: 20px 24px; }
.cot-view.active { display: block; }

/* ── Estado vacío ── */
.cot-empty {
  text-align: center;
  padding: 60px 20px;
}
.cot-empty-icon {
  font-size: 48px;
  margin-bottom: 14px;
  opacity: .4;
}
.cot-empty-title {
  font-family: 'Oswald', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.cot-empty-sub {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

/* ── Lista de productos ── */
.cot-product-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cot-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  padding: 12px;
  transition: border-color .18s, box-shadow .18s;
  animation: itemIn .28s cubic-bezier(.22,1,.36,1);
}
.cot-item:hover {
  border-color: rgba(204,0,0,0.25);
  box-shadow: 0 3px 12px rgba(204,0,0,0.07);
}
@keyframes itemIn {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: none; }
}
.cot-item-img {
  width: 60px;
  height: 60px;
  border-radius: 7px;
  background: #f8f8f8;
  border: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.cot-item-img img {
  max-width: 50px;
  max-height: 50px;
  object-fit: contain;
}
.cot-item-info {
  flex: 1;
  min-width: 0;
}
.cot-item-model {
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--red);
  font-weight: 700;
  margin-bottom: 1px;
}
.cot-item-name {
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cot-item-type {
  font-size: 10px;
  color: var(--muted);
}
.cot-item-controls {
  display: flex;
  align-items: center;
  gap: 0;
  background: #f5f5f5;
  border-radius: 7px;
  overflow: hidden;
  flex-shrink: 0;
}
.cot-qty-btn {
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
  line-height: 1;
}
.cot-qty-btn:hover { background: var(--red); color: #fff; }
.cot-qty-val {
  min-width: 30px;
  text-align: center;
  font-family: 'Oswald', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.cot-item-del {
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: #ccc;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all .18s;
  flex-shrink: 0;
  font-size: 14px;
}
.cot-item-del:hover { background: #fff0f0; color: var(--red); }

/* ── Resumen ── */
.cot-summary-bar {
  margin-top: 16px;
  padding: 14px 16px;
  background: #fafafa;
  border: 1px solid #ebebeb;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cot-summary-label {
  font-size: 12px;
  color: var(--muted);
  font-family: 'Oswald', sans-serif;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.cot-summary-val {
  font-family: 'Oswald', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.cot-summary-val span { color: var(--red); }

/* ── Botón siguiente ── */
.cot-next-btn {
  width: 100%;
  margin-top: 14px;
  padding: 13px;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  border: none;
  cursor: pointer;
  font-family: 'Oswald', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.cot-next-btn:hover {
  background: #a80000;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(204,0,0,0.28);
}
.cot-next-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── Formulario de datos ── */
.cot-form-section-title {
  font-family: 'Oswald', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid #ebebeb;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cot-form-section-title svg { color: var(--red); }

/* Resumen de productos en tab formulario */
.cot-form-products-summary {
  background: #fafafa;
  border: 1px solid #ebebeb;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 20px;
}
.cot-form-prod-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 12px;
}
.cot-form-prod-row:last-child { border-bottom: none; padding-bottom: 0; }
.cot-form-prod-name {
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}
.cot-form-prod-qty {
  font-family: 'Oswald', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--red);
  white-space: nowrap;
  margin-left: 12px;
  flex-shrink: 0;
}

/* Inputs del formulario */
.cot-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 13px;
}
.cot-field label {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-family: 'Oswald', sans-serif;
  display: flex;
  align-items: center;
  gap: 5px;
}
.cot-field label .req { color: var(--red); }
.cot-field input,
.cot-field textarea,
.cot-field select {
  padding: 10px 13px;
  border-radius: 7px;
  border: 1.5px solid var(--border);
  background: #fafafa;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 14px;
  color: var(--text);
  transition: border-color .18s, box-shadow .18s, background .18s;
  outline: none;
  width: 100%;
}
.cot-field input:focus,
.cot-field textarea:focus,
.cot-field select:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(204,0,0,0.08);
  background: #fff;
}
.cot-field input.error,
.cot-field textarea.error {
  border-color: #e53e3e;
  box-shadow: 0 0 0 3px rgba(229,62,62,0.08);
}
.cot-field textarea {
  resize: vertical;
  min-height: 80px;
}
.cot-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ── Botón enviar ── */
.cot-submit-btn {
  width: 100%;
  margin-top: 6px;
  padding: 15px;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  border: none;
  cursor: pointer;
  font-family: 'Oswald', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
}
.cot-submit-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 60%);
  pointer-events: none;
}
.cot-submit-btn:hover {
  background: #a80000;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(204,0,0,0.32);
}
.cot-submit-btn:active { transform: none; }

/* ── Mensaje de éxito ── */
.cot-success {
  display: none;
  text-align: center;
  padding: 48px 24px;
  animation: itemIn .4s cubic-bezier(.22,1,.36,1);
}
.cot-success.show { display: block; }
.cot-success-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #cc0000, #a80000);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 8px 28px rgba(204,0,0,0.28);
}
.cot-success-title {
  font-family: 'Oswald', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  text-transform: uppercase;
}
.cot-success-sub {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 320px;
  margin: 0 auto 28px;
}
.cot-success-reset {
  padding: 11px 28px;
  border-radius: 7px;
  background: transparent;
  border: 1.5px solid var(--red);
  color: var(--red);
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .2s;
}
.cot-success-reset:hover {
  background: var(--red);
  color: #fff;
}

/* ── Toast de confirmación ── */
.cot-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #111;
  color: #fff;
  padding: 11px 20px;
  border-radius: 50px;
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,0.22);
}
.cot-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.cot-toast-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4caf50;
  flex-shrink: 0;
}

/* ── Divider ── */
.cot-divider {
  height: 1px;
  background: #ebebeb;
  margin: 18px 0;
}

/* ── Nota legal ── */
.cot-legal {
  font-size: 10px;
  color: #bbb;
  text-align: center;
  line-height: 1.5;
  margin-top: 10px;
}

/* ── Responsive ── */
@media (max-width: 560px) {
  .cot-panel { width: 100vw; }
  .cot-field-row { grid-template-columns: 1fr; }
}
