/* ══════════════════════════════════════════════
   COTIZADOR IA - STYLES
   ══════════════════════════════════════════════ */

.cotizador-page {
  background-color: var(--bg-body);
}

.cotizador-main {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Hero Section ─── */
.ai-hero {
  background: linear-gradient(135deg, #0a1628 0%, #1e3a8a 100%);
  color: white;
  padding: calc(var(--header-offset, 130px) + 16px) 20px 60px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.ai-hero::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at top right, rgba(212,163,89,0.15) 0%, transparent 60%);
  pointer-events: none;
}

.ai-hero-inner {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.ai-title {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 15px;
  letter-spacing: -0.02em;
}

.ai-sparkle {
  color: var(--gold-accent);
  display: inline-block;
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; text-shadow: 0 0 15px rgba(212,163,89,0.4); }
  50% { opacity: 0.7; text-shadow: 0 0 5px rgba(212,163,89,0.1); }
}

.ai-subtitle {
  font-size: 1.1rem;
  color: #cbd5e1;
  line-height: 1.6;
}

/* ─── Content Wrapper ─── */
.cotizador-content {
  max-width: 1200px;
  margin: -30px auto 60px;
  width: 100%;
  padding: 0 20px;
  position: relative;
  z-index: 2;
  flex: 1;
}

/* ─── Upload Zone ─── */
.ai-upload-box {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-lg);
  padding: 60px 40px;
  text-align: center;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  cursor: pointer;
}

.ai-upload-box.dragover {
  border-color: var(--gold-accent);
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 10px 30px rgba(212,163,89,0.15);
  transform: scale(1.02);
}

.ai-upload-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  color: var(--navy-light);
  background: #f1f5f9;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.ai-upload-icon svg {
  width: 40px;
  height: 40px;
}

.ai-upload-box:hover .ai-upload-icon {
  background: var(--gold-accent);
  color: white;
  transform: translateY(-5px);
}

.upload-title {
  font-size: 1.5rem;
  color: var(--navy-dark);
  font-weight: 700;
  margin-bottom: 10px;
}

.upload-hint {
  color: #64748b;
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.upload-or {
  color: #94a3b8;
  margin-bottom: 20px;
  position: relative;
  display: inline-block;
  width: 100%;
}
.upload-or::before, .upload-or::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 30%;
  height: 1px;
  background: #cbd5e1;
}
.upload-or::before { left: 10%; }
.upload-or::after { right: 10%; }

.btn-upload {
  display: inline-block;
  padding: 12px 30px;
  font-size: 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* ─── Analyzing Zone ─── */
.ai-analyzing-box {
  background: white;
  border-radius: var(--radius-lg);
  padding: 60px 40px;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.ai-scanner-visual {
  position: relative;
  width: 100px;
  height: 120px;
  margin: 0 auto 30px;
}

.ai-doc-icon {
  width: 100px;
  height: 120px;
  color: #e2e8f0;
}

.ai-scanner-line {
  position: absolute;
  top: 0; left: -10%; right: -10%;
  height: 3px;
  background: var(--gold-accent);
  box-shadow: 0 0 10px var(--gold-accent), 0 0 20px var(--gold-accent);
  animation: scan 2s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}

@keyframes scan {
  0% { top: 0%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

.analyzing-title {
  font-size: 1.5rem;
  color: var(--navy-dark);
  font-weight: 700;
  margin-bottom: 25px;
}

.analyzing-steps {
  list-style: none;
  padding: 0;
  max-width: 400px;
  margin: 0 auto;
  text-align: left;
}

.analyzing-steps .step {
  padding: 12px 0;
  color: #94a3b8;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.3s;
}

.analyzing-steps .step::before {
  content: "";
  display: block;
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  background: transparent;
}

.analyzing-steps .step.active {
  color: var(--navy-dark);
  font-weight: 600;
}

.analyzing-steps .step.active::before {
  border-color: var(--gold-accent);
  background: var(--gold-accent);
  box-shadow: 0 0 8px rgba(212,163,89,0.5);
  animation: pulse-dot 1.5s infinite;
}

.analyzing-steps .step.done {
  color: var(--success, #10b981);
}
.analyzing-steps .step.done::before {
  border-color: var(--success, #10b981);
  background: var(--success, #10b981);
}

@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(212,163,89,0.4); }
  70% { box-shadow: 0 0 0 6px rgba(212,163,89,0); }
  100% { box-shadow: 0 0 0 0 rgba(212,163,89,0); }
}

/* ─── Results Zone ─── */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 25px;
}

.results-title {
  font-size: 1.8rem;
  color: var(--navy-dark);
  font-weight: 800;
}

.results-subtitle {
  color: #64748b;
  font-size: 0.95rem;
  margin-top: 5px;
}

.results-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 30px;
}

/* Table */
.results-table-container {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid #e2e8f0;
  overflow-x: auto;
}

.ai-quote-table {
  width: 100%;
  border-collapse: collapse;
}

.ai-quote-table th {
  background: #f8fafc;
  color: var(--navy-light);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  padding: 15px 20px;
  text-align: left;
  border-bottom: 2px solid #e2e8f0;
}

.ai-quote-table td {
  padding: 15px 20px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.ai-quote-table tbody tr:hover {
  background: #f8fafc;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-input {
  width: 60px;
  padding: 6px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  text-align: center;
  font-weight: 600;
}

.original-item {
  color: #64748b;
  font-size: 0.85rem;
  margin-top: 4px;
  font-style: italic;
}

.match-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.match-img {
  width: 40px; height: 40px;
  object-fit: contain;
  border-radius: 4px;
  background: #f1f5f9;
  padding: 2px;
}

.match-info {
  display: flex;
  flex-direction: column;
}

.match-name {
  font-weight: 600;
  color: var(--navy-dark);
  font-size: 0.95rem;
}

.match-sku {
  font-size: 0.75rem;
  color: #94a3b8;
  font-family: monospace;
}

.price-cell, .total-cell {
  font-weight: 600;
  white-space: nowrap;
}
.total-cell {
  color: var(--navy-dark);
}

/* Sidebar */
.results-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.summary-box {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid #e2e8f0;
  padding: 25px;
}

.summary-box h3 {
  font-size: 1.2rem;
  color: var(--navy-dark);
  font-weight: 700;
  margin-bottom: 20px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  color: #475569;
  font-size: 0.95rem;
}

.summary-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 15px 0;
}

.summary-total {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--navy-dark);
}

.summary-actions {
  margin-top: 25px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-confidence-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-lg);
  padding: 20px;
  color: #166534;
}

.confidence-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  margin-bottom: 8px;
}

.ai-confidence-box p {
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Responsive */
@media (max-width: 992px) {
  .results-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .ai-title { font-size: 2.2rem; }
  .cotizador-content { margin-top: 20px; }
  .results-header { flex-direction: column; align-items: flex-start; gap: 15px; }
}
