/*
 * Plugin: Cotação de Serviços
 * Arquivo: assets/css/cotacao.css
 * Todos os seletores usam prefixo "cot-" para evitar conflitos com o tema.
 */

/* ── RESET SCOPED ── */
.cotacao-app *,
.cotacao-app *::before,
.cotacao-app *::after {
  box-sizing: border-box;
}
.cotacao-app input[type=number] {
  -moz-appearance: textfield;
  appearance: textfield;
}
.cotacao-app input[type=number]::-webkit-outer-spin-button,
.cotacao-app input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

/* ── VARIÁVEIS ── */
.cotacao-app {
  --cot-bg: #F5F5F7;
  --cot-surface: #FFFFFF;
  --cot-surface2: #F0F0F5;
  --cot-border: #E0E0EB;
  --cot-border2: #C8C8DC;
  --cot-text: #0F0F1A;
  --cot-muted: #666680;
  --cot-muted2: #9999B0;
  --cot-accent: #E5192D;
  --cot-accent-light: #FFF0F1;
  --cot-accent-mid: #FFCED2;
  --cot-r: 14px;
  --cot-rs: 10px;
  --cot-f: 'Plus Jakarta Sans', system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  .cotacao-app {
    --cot-bg: #0C0C12;
    --cot-surface: #16161F;
    --cot-surface2: #1E1E2A;
    --cot-border: #282836;
    --cot-border2: #383850;
    --cot-text: #F0F0F8;
    --cot-muted: #9090A8;
    --cot-muted2: #5A5A72;
    --cot-accent: #FF3347;
    --cot-accent-light: #2A0A0E;
    --cot-accent-mid: #4A1018;
  }
}

/* ── LAYOUT ── */
.cotacao-app {
  max-width: 540px;
  margin: 0 auto;
  padding: 0 0 200px;
  font-family: var(--cot-f);
  font-size: 15px;
  line-height: 1.5;
  color: var(--cot-text);
  -webkit-tap-highlight-color: transparent;
}
.cotacao-app input,
.cotacao-app textarea,
.cotacao-app button,
.cotacao-app select {
  font-family: var(--cot-f);
}

/* ── HEADER ── */
.cot-header {
  padding: 24px 16px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.cot-header-logo {
  width: 40px;
  height: 40px;
  background: var(--cot-accent);
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.cot-header-logo svg {
  width: 22px;
  height: 22px;
}
.cot-header-text h2 {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.4px;
  color: var(--cot-text);
  line-height: 1.1;
  margin: 0;
}
.cot-header-text p {
  font-size: 12px;
  color: var(--cot-muted);
  margin: 2px 0 0;
}

/* ── TABS ── */
.cot-tabs-wrap {
  padding: 0 16px;
  margin-bottom: 16px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cot-tabs-wrap::-webkit-scrollbar { display: none; }
.cot-tab {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 99px;
  border: 1.5px solid var(--cot-border);
  background: var(--cot-surface);
  color: var(--cot-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: .15s;
  white-space: nowrap;
}
.cot-tab.active {
  background: var(--cot-accent);
  border-color: var(--cot-accent);
  color: #fff;
}
.cot-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  background: rgba(255,255,255,.35);
  border-radius: 99px;
  font-size: 10px;
  font-weight: 800;
  padding: 0 4px;
  margin-left: 5px;
  line-height: 1;
}
.cot-tab:not(.active) .cot-tab-badge {
  background: var(--cot-accent);
  color: #fff;
}

/* ── PANELS ── */
.cot-section-panel { display: none; animation: cotFadeUp .2s ease both; }
.cot-section-panel.active { display: block; }
@keyframes cotFadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── SECTION CARD ── */
.cot-section-card {
  margin: 0 16px 12px;
  background: var(--cot-surface);
  border: 1px solid var(--cot-border);
  border-radius: var(--cot-r);
  overflow: hidden;
}
.cot-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--cot-muted);
  padding: 14px 16px 8px;
}

/* ── CHECKBOX ROW ── */
.cot-cb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-top: 1px solid var(--cot-border);
  cursor: pointer;
  transition: background .12s;
  min-height: 56px;
  -webkit-tap-highlight-color: transparent;
}
.cot-cb-row:first-of-type { border-top: none; }
.cot-cb-row:active { background: var(--cot-surface2); }
.cot-cb-check {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border: 2px solid var(--cot-border2);
  border-radius: 7px;
  background: var(--cot-surface2);
  display: grid;
  place-items: center;
  transition: .15s;
  flex-shrink: 0;
}
.cot-cb-row input { display: none; }
.cot-cb-row.selected .cot-cb-check {
  background: var(--cot-accent);
  border-color: var(--cot-accent);
}
.cot-cb-check svg {
  width: 13px;
  height: 13px;
  stroke: #fff;
  stroke-width: 2.5;
  fill: none;
  opacity: 0;
  transform: scale(.6);
  transition: .15s;
}
.cot-cb-row.selected .cot-cb-check svg { opacity: 1; transform: scale(1); }
.cot-cb-info { flex: 1; min-width: 0; }
.cot-cb-name { font-size: 14px; font-weight: 600; color: var(--cot-text); }
.cot-cb-desc { font-size: 12px; color: var(--cot-muted); margin-top: 1px; }
.cot-cb-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--cot-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.cot-cb-row.selected .cot-cb-price { color: var(--cot-accent); }

/* ── NOTE ── */
.cot-note {
  margin: 0 16px 12px;
  background: var(--cot-accent-light);
  border: 1px solid var(--cot-accent-mid);
  border-radius: var(--cot-rs);
  padding: 11px 14px;
  font-size: 13px;
  color: var(--cot-accent);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  line-height: 1.5;
}
.cot-note svg { width: 16px; height: 16px; min-width: 16px; margin-top: 1px; }

/* ── STEPPER ── */
.cot-qty-block {
  padding: 14px 16px;
  border-top: 1px solid var(--cot-border);
}
.cot-qty-block:first-child { border-top: none; }
.cot-qty-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.cot-qty-name { font-size: 14px; font-weight: 600; color: var(--cot-text); }
.cot-qty-sub { font-size: 12px; color: var(--cot-muted); margin-top: 2px; }
.cot-qty-total {
  font-size: 14px;
  font-weight: 700;
  color: var(--cot-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.cot-qty-total.has { color: var(--cot-accent); }
.cot-stepper {
  display: flex;
  align-items: center;
  background: var(--cot-surface2);
  border: 1px solid var(--cot-border);
  border-radius: var(--cot-rs);
  overflow: hidden;
  height: 48px;
}
.cot-stepper button {
  width: 52px;
  height: 48px;
  min-width: 52px;
  border: none;
  background: transparent;
  color: var(--cot-muted);
  font-size: 20px;
  cursor: pointer;
  transition: background .12s, color .12s;
  display: grid;
  place-items: center;
}
.cot-stepper button:active { background: var(--cot-accent); color: #fff; }
.cot-stepper button:disabled { opacity: .3; cursor: not-allowed; }
.cot-stepper-div { width: 1px; height: 26px; background: var(--cot-border2); flex-shrink: 0; }
.cot-stepper input {
  flex: 1;
  border: none;
  background: transparent;
  text-align: center;
  font-family: var(--cot-f);
  font-size: 19px;
  font-weight: 800;
  color: var(--cot-text);
  outline: none;
  height: 48px;
  padding: 0;
  min-width: 0;
}
.cot-stepper.active { border-color: var(--cot-accent); }
.cot-stepper.active input { color: var(--cot-accent); }

/* ── POSTS BADGE ── */
.cot-posts-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--cot-accent-light);
  border: 1px solid var(--cot-accent-mid);
  border-radius: var(--cot-rs);
  padding: 10px 14px;
  margin: 0 16px 12px;
  font-size: 13px;
  color: var(--cot-accent);
}
.cot-posts-badge.cot-hidden { display: none; }

/* ── FIELDS ── */
.cot-fields-wrap { margin: 0 16px 12px; display: grid; gap: 8px; }
.cot-field-group {
  background: var(--cot-surface);
  border: 1px solid var(--cot-border);
  border-radius: var(--cot-r);
  overflow: hidden;
}
.cot-field-row {
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  border-top: 1px solid var(--cot-border);
}
.cot-field-row:first-child { border-top: none; }
.cot-field-row label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--cot-muted);
  margin-bottom: 5px;
}
.cot-field-row input,
.cot-field-row textarea {
  background: transparent;
  border: none;
  outline: none;
  color: var(--cot-text);
  font-size: 15px;
  font-family: var(--cot-f);
  width: 100%;
  resize: vertical;
}
.cot-field-row input::placeholder,
.cot-field-row textarea::placeholder { color: var(--cot-muted2); }

/* ── FOOTER ── */
.cot-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: #000000;
  border-top: 1px solid rgba(255,255,255,.10);
  z-index: 100;
}
.cot-footer-pills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.cot-pill {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--cot-rs);
  padding: 8px 10px;
  text-align: center;
}
.cot-pill-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: rgba(255,255,255,.55);
  margin-bottom: 2px;
}
.cot-pill-val {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
}
.cot-footer-cta { display: flex; align-items: center; gap: 12px; }
.cot-total-wrap { flex: 1; }
.cot-total-lbl {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: rgba(255,255,255,.55);
}
.cot-total-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--cot-accent);
  line-height: 1.1;
  margin-top: 1px;
}
/* ── BOTÃO WHATSAPP — animado e interativo ── */
@keyframes cot-wa-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(229,25,45,.60); }
  60%  { box-shadow: 0 0 0 10px rgba(229,25,45,0); }
  100% { box-shadow: 0 0 0 0 rgba(229,25,45,0); }
}
@keyframes cot-wa-shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}
.cot-btn-wa {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 0 20px;
  background: linear-gradient(90deg, #E5192D 0%, #ff3347 50%, #E5192D 100%);
  background-size: 200% auto;
  border: none;
  border-radius: var(--cot-rs);
  color: #fff;
  font-family: var(--cot-f);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  animation: cot-wa-pulse 2s ease-out infinite, cot-wa-shimmer 3s linear infinite;
  transition: transform .15s, opacity .15s, filter .15s;
  position: relative;
  overflow: hidden;
}
.cot-btn-wa::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.18) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform .45s ease;
}
.cot-btn-wa:hover {
  filter: brightness(1.10);
  transform: translateY(-1px);
}
.cot-btn-wa:hover::after {
  transform: translateX(100%);
}
.cot-btn-wa:active {
  transform: scale(.97) translateY(0);
  filter: brightness(.95);
  animation-play-state: paused;
}
.cot-btn-wa svg { width: 20px; height: 20px; flex-shrink: 0; }
.cot-btn-pdf {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  min-width: 52px;
  background: rgba(255,255,255,.10);
  border: 1.5px solid rgba(255,255,255,.20);
  border-radius: var(--cot-rs);
  color: rgba(255,255,255,.75);
  cursor: pointer;
  flex-shrink: 0;
  transition: transform .12s, background .12s, border-color .12s, color .12s;
}
.cot-btn-pdf:hover {
  background: rgba(229,25,45,.20);
  border-color: rgba(229,25,45,.50);
  color: #ff3347;
}
.cot-btn-pdf:active {
  transform: scale(.95);
  background: rgba(229,25,45,.30);
  border-color: var(--cot-accent);
}
.cot-btn-pdf svg { width: 22px; height: 22px; }

/* ── TOAST ── */
.cot-toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(-60px);
  background: var(--cot-text);
  color: var(--cot-bg, #F5F5F7);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 99px;
  z-index: 200;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), opacity .25s;
  opacity: 0;
  white-space: nowrap;
}
.cot-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ── NAV DOTS ── */
.cot-nav-wrap {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-bottom: 12px;
}
.cot-nav-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cot-border2);
  transition: .2s;
  cursor: pointer;
}
.cot-nav-dot.active {
  background: var(--cot-accent);
  width: 18px;
  border-radius: 99px;
}

/* ── DRAFT BADGE ── */
.cot-draft-badge {
  display: none;
  align-items: center;
  gap: 6px;
  margin: 0 16px 10px;
  padding: 8px 12px;
  background: var(--cot-surface2);
  border: 1px solid var(--cot-border);
  border-radius: var(--cot-rs);
  font-size: 12px;
  color: var(--cot-muted);
}
.cot-draft-badge svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; flex-shrink: 0; }
.cot-draft-badge span { flex: 1; }
.cot-draft-badge button {
  border: none;
  background: transparent;
  color: var(--cot-accent);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  font-family: var(--cot-f);
}
.cot-draft-badge.visible { display: flex; }

/* ── CONFETTI ── */
.cot-confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 400;
}

/* ── ADMIN ── */
.cot-admin-toggle {
  position: fixed;
  bottom: calc(180px + env(safe-area-inset-bottom));
  right: 16px;
  width: 36px;
  height: 36px;
  background: var(--cot-surface2);
  border: 1px solid var(--cot-border);
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 90;
  opacity: .5;
  transition: opacity .2s;
}
.cot-admin-toggle:hover,
.cot-admin-toggle:active { opacity: 1; }
.cot-admin-toggle svg { width: 16px; height: 16px; }
.cot-admin-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 350;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.cot-admin-overlay.open { opacity: 1; pointer-events: all; }
.cot-admin-sheet {
  width: 100%;
  max-width: 400px;
  background: var(--cot-surface);
  border-radius: var(--cot-r);
  overflow: hidden;
  transform: scale(.95);
  transition: transform .2s cubic-bezier(.34,1.2,.64,1);
}
.cot-admin-overlay.open .cot-admin-sheet { transform: scale(1); }
.cot-admin-head {
  padding: 16px;
  border-bottom: 1px solid var(--cot-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cot-admin-head h3 { font-size: 16px; font-weight: 800; margin: 0; color: var(--cot-text); }
.cot-modal-close {
  border: none;
  background: transparent;
  font-size: 24px;
  color: var(--cot-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0;
}
.cot-admin-body {
  padding: 16px;
  display: grid;
  gap: 12px;
  max-height: 70vh;
  overflow-y: auto;
}
.cot-admin-pw-wrap { display: grid; gap: 8px; }
.cot-admin-pw-wrap label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--cot-muted);
}
.cot-admin-pw-wrap.cot-hidden { display: none; }
.cot-admin-pw-wrap input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--cot-border2);
  border-radius: var(--cot-rs);
  background: var(--cot-surface2);
  color: var(--cot-text);
  font-size: 15px;
  font-family: var(--cot-f);
  outline: none;
}
.cot-admin-pw-wrap input:focus { border-color: var(--cot-accent); }
.cot-admin-login-btn {
  height: 44px;
  background: var(--cot-accent);
  border: none;
  border-radius: var(--cot-rs);
  color: #fff;
  font-family: var(--cot-f);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.cot-admin-pw-error { font-size: 12px; color: var(--cot-accent); display: none; }
.cot-admin-pw-error.visible { display: block; }
.cot-admin-prices { display: none; gap: 10px; flex-direction: column; }
.cot-admin-prices.visible { display: flex; }
.cot-admin-price-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--cot-surface2);
  border: 1px solid var(--cot-border);
  border-radius: var(--cot-rs);
}
.cot-admin-price-row label { flex: 1; font-size: 13px; font-weight: 600; color: var(--cot-text); }
.cot-admin-price-row input {
  width: 90px;
  padding: 6px 10px;
  text-align: right;
  border: 1.5px solid var(--cot-border2);
  border-radius: 8px;
  background: var(--cot-surface);
  color: var(--cot-text);
  font-size: 14px;
  font-weight: 700;
  font-family: var(--cot-f);
  outline: none;
}
.cot-admin-price-row input:focus { border-color: var(--cot-accent); }
.cot-admin-save-btn {
  height: 44px;
  background: var(--cot-accent);
  border: none;
  border-radius: var(--cot-rs);
  color: #fff;
  font-family: var(--cot-f);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.cot-admin-reset-btn {
  height: 40px;
  background: transparent;
  border: 1px solid var(--cot-border2);
  border-radius: var(--cot-rs);
  color: var(--cot-muted);
  font-family: var(--cot-f);
  font-size: 13px;
  cursor: pointer;
}
.cot-admin-section-sep {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--cot-muted);
  padding: 4px 0 0;
  border-top: 1px solid var(--cot-border);
}
