/* ═══════════════════════════════════════════════════════════════════════════
   CONSERFIC S.A. — Shared Page Styles (Calculadora + Documentos)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Active Nav Link ──────────────────────────────────────────────────────── */
.nav-links a.active {
  color: var(--teal);
}
.nav-links a.active::after {
  width: 100%;
}

/* ── Page Hero (shared) ───────────────────────────────────────────────────── */
.page-hero {
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 0;
}
.page-hero-calc {
  min-height: 380px;
  background: linear-gradient(135deg, var(--navy-deep) 0%, var(--teal) 100%);
}
.page-hero-docs {
  min-height: 380px;
  background: linear-gradient(135deg, var(--navy-deep) 0%, var(--blue-dark) 60%, var(--navy-light) 100%);
}

.page-hero .hero-grid {
  opacity: 0.03;
  background-size: 48px 48px;
}

.page-hero-content {
  position: relative;
  z-index: 10;
  padding: 5rem 0 3rem;
}
@media (min-width: 768px) {
  .page-hero-content {
    padding: 7rem 0 4rem;
  }
}
.page-hero-content h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}
.page-hero-content .hero-sub {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.7);
  max-width: 560px;
  line-height: 1.7;
}

/* ── Navbar offset for subpages ───────────────────────────────────────────── */
.page-hero + .section {
  padding-top: 2.5rem;
}
@media (min-width: 768px) {
  .page-hero + .section {
    padding-top: 4rem;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   CALCULADORA
   ═══════════════════════════════════════════════════════════════════════════ */

.calc-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: flex-start;
}

@media (min-width: 640px) {
  .calc-layout {
    gap: 2.5rem;
  }
}

@media (min-width: 1024px) {
  .calc-layout {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── Form Panel ──────────────────────────────────────────────────────────── */
.calc-form-panel {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

@media (min-width: 640px) {
  .calc-form-panel {
    padding: 2.5rem;
  }
}

.calc-panel-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.35rem;
}
.calc-panel-sub {
  font-size: 0.9rem;
  color: var(--gray-400);
  margin-bottom: 2rem;
}

.calc-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Visual field order without changing DOM behavior */
.calc-field--amount { order: 1; }
.calc-field--frequency { order: 2; }
.calc-field--term { order: 3; }
.calc-field--rate { order: 4; }
.calc-field--exchange { order: 5; }

.calc-field-help {
  margin-top: 0.45rem;
  font-size: 0.74rem;
  color: var(--gray-300);
  line-height: 1.45;
}

.calc-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 0.5rem;
}

.calc-input-wrap {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--gray-100);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color var(--transition);
}
.calc-input-wrap:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(26, 107, 138, 0.08);
}

.calc-input-wrap input {
  flex: 1;
  border: none;
  padding: 0.8rem 1rem;
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  color: var(--gray-700);
  background: transparent;
  outline: none;
  min-width: 0;
}
.calc-input-wrap input::placeholder {
  color: var(--gray-200);
}
.calc-input-wrap input:read-only {
  cursor: default;
  background: var(--gray-50);
  color: var(--gray-500);
}

.calc-input-prefix,
.calc-input-suffix {
  padding: 0.8rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-400);
  background: var(--gray-50);
  white-space: nowrap;
}
.calc-input-prefix {
  border-right: 1px solid var(--gray-100);
}

.calc-range-wrap {
  margin-top: 0.6rem;
}
.calc-range-wrap input[type="range"] {
  width: 100%;
  accent-color: var(--teal);
  height: 6px;
  cursor: pointer;
}
.calc-range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--gray-300);
  margin-top: 0.3rem;
}

/* ── Radio Group ─────────────────────────────────────────────────────────── */
.calc-radio-group {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.calc-radio {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.1rem;
  border: 1.5px solid var(--gray-100);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--gray-500);
  transition: all var(--transition);
}
.calc-radio:hover {
  border-color: var(--gray-200);
}
.calc-radio:has(input:checked) {
  border-color: var(--teal);
  background: rgba(26, 107, 138, 0.04);
  color: var(--teal);
}
.calc-radio input[type="radio"] {
  display: none;
}
.calc-radio-indicator {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid var(--gray-200);
  transition: all var(--transition);
  flex-shrink: 0;
  position: relative;
}
.calc-radio:has(input:checked) .calc-radio-indicator {
  border-color: var(--teal);
  background: var(--teal);
  box-shadow: inset 0 0 0 3px var(--white);
}

/* ── Submit Button ───────────────────────────────────────────────────────── */
.calc-submit {
  width: 100%;
  justify-content: center;
  padding: 1rem;
  font-size: 1rem;
  margin-top: 0.5rem;
  order: 6;
}

/* ── Results Panel ───────────────────────────────────────────────────────── */
.calc-results-panel {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  min-height: 400px;
}

.calc-results-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
  color: var(--gray-300);
}
.calc-empty-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1rem;
  opacity: 0.5;
  color: var(--gray-300);
}
.calc-empty-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}
.calc-results-empty h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gray-400);
  margin-bottom: 0.4rem;
}
.calc-results-empty p {
  font-size: 0.88rem;
  line-height: 1.6;
  max-width: 280px;
}

.calc-results-data {
  padding: 1.5rem;
}
@media (min-width: 640px) {
  .calc-results-data {
    padding: 2.5rem;
  }
}

/* ── Summary Cards ───────────────────────────────────────────────────────── */
.calc-summary-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin: 1.5rem 0;
}
@media (min-width: 480px) {
  .calc-summary-cards {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
  }
}

.calc-summary-card {
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1rem;
  text-align: center;
  border: 1px solid var(--gray-100);
}
.calc-summary-primary {
  background: linear-gradient(135deg, rgba(26, 107, 138, 0.06), rgba(200, 150, 62, 0.06));
  border-color: rgba(26, 107, 138, 0.15);
}

.calc-summary-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-400);
  margin-bottom: 0.4rem;
}
.calc-summary-value {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.1;
}
.calc-summary-primary .calc-summary-value {
  font-size: 1.5rem;
  color: var(--teal);
}
.calc-summary-freq {
  display: block;
  font-size: 0.75rem;
  color: var(--gray-400);
  margin-top: 0.15rem;
}

/* ── Progress Bar ────────────────────────────────────────────────────────── */
.calc-progress {
  margin: 1.5rem 0;
}

.calc-progress-bar {
  height: 8px;
  background: var(--gray-100);
  border-radius: 8px;
  overflow: hidden;
}
.calc-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  border-radius: 8px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.calc-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--gray-400);
  margin-top: 0.5rem;
}
.calc-progress-labels strong {
  color: var(--gray-600);
  font-weight: 600;
}

/* ── Amortization Table ──────────────────────────────────────────────────── */
.calc-amortization {
  margin: 1.5rem 0;
}
.calc-amortization summary {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--teal);
  cursor: pointer;
  padding: 0.5rem 0;
  user-select: none;
}
.calc-amortization summary:hover {
  color: var(--navy);
}

.calc-table-wrap {
  margin-top: 1rem;
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-sm);
}
.calc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.calc-table th {
  background: var(--gray-50);
  padding: 0.65rem 0.75rem;
  text-align: right;
  font-weight: 600;
  color: var(--gray-500);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  position: sticky;
  top: 0;
  border-bottom: 1px solid var(--gray-100);
}
.calc-table th:first-child { text-align: center; }
.calc-table td {
  padding: 0.55rem 0.75rem;
  text-align: right;
  color: var(--gray-600);
  border-bottom: 1px solid var(--gray-75);
}
.calc-table td:first-child {
  text-align: center;
  color: var(--gray-300);
  font-weight: 500;
}
.calc-table tr:hover td {
  background: var(--gray-50);
}

/* ── Disclaimer ──────────────────────────────────────────────────────────── */
.calc-disclaimer {
  margin: 1.5rem 0;
  padding: 1rem;
  background: rgba(200, 150, 62, 0.06);
  border: 1px solid rgba(200, 150, 62, 0.15);
  border-radius: var(--radius-sm);
}
.calc-disclaimer p {
  font-size: 0.8rem;
  color: var(--gray-500);
  line-height: 1.6;
  margin: 0;
}

/* ── WhatsApp CTA inside calculator ──────────────────────────────────────── */
.calc-cta {
  text-align: center;
  padding: 1.5rem 0 0;
  border-top: 1px solid var(--gray-75);
}
.calc-cta p {
  font-size: 0.9rem;
  color: var(--gray-400);
  margin-bottom: 0.75rem;
}
.calc-cta .btn {
  justify-content: center;
}

/* ═══════════════════════════════════════════════════════════════════════════
   DOCUMENTOS
   ═══════════════════════════════════════════════════════════════════════════ */

.docs-category {
  margin-bottom: 3.5rem;
}
.docs-category:last-child {
  margin-bottom: 0;
}

.docs-category-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.docs-category-icon {
  width: 54px; height: 54px;
  border-radius: 14px;
  background: rgba(26, 107, 138, 0.06);
  color: var(--teal);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.docs-category-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.25rem;
}
.docs-category-header p {
  font-size: 0.9rem;
  color: var(--gray-400);
}

/* ── Doc Cards ───────────────────────────────────────────────────────────── */
.docs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .docs-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.doc-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-md);
  padding: 1.75rem 1.5rem;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.doc-card:hover {
  border-color: var(--teal);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.doc-card-link {
  cursor: pointer;
}

.doc-card-icon {
  width: 2rem;
  height: 2rem;
  color: var(--teal);
}
.doc-card-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.doc-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.25rem;
}
.doc-card p {
  font-size: 0.85rem;
  color: var(--gray-400);
  line-height: 1.6;
  flex: 1;
}

.doc-card-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 50px;
  background: var(--gray-75);
  color: var(--gray-400);
  letter-spacing: 0.02em;
  align-self: flex-start;
}
.doc-card-badge-ok {
  background: rgba(37, 211, 102, 0.1);
  color: #1a8a3f;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SUCURSALES PAGE
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Hero ────────────────────────────────────────────────────────────────── */
.page-hero-sucursales {
  background: linear-gradient(135deg, var(--navy) 0%, #0d2f4a 50%, var(--navy) 100%);
}

/* ── Map ─────────────────────────────────────────────────────────────────── */
.sucursales-map-wrap {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  margin-bottom: 2rem;
}
.sucursales-map {
  width: 100%;
  height: 450px;
  background: var(--gray-75);
}
@media (max-width: 768px) {
  .sucursales-map {
    height: 300px;
  }
}

/* ── Grid de tarjetas ────────────────────────────────────────────────────── */
.sucursales-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.sucursal-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
  border: 2px solid var(--gray-100);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
}
.sucursal-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 12px 28px rgba(0,0,0,0.12);
  border-color: rgba(26, 107, 138, 0.3);
}

.sucursal-card--active {
  border-color: var(--teal);
  box-shadow: 0 8px 28px rgba(26,107,138,0.2);
  transform: translateY(-4px);
  background: linear-gradient(135deg, #f0f9fc 0%, #fff 100%);
}
.sucursal-card--active h3 {
  color: var(--teal);
}

.sucursal-card-selector {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.3rem 0.6rem;
  border-radius: 50px;
  background: rgba(26, 107, 138, 0.1);
  color: var(--teal);
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.2s ease;
  letter-spacing: 0.02em;
}

.sucursal-card:hover .sucursal-card-selector {
  opacity: 1;
  transform: scale(1);
}

.sucursal-card--active .sucursal-card-selector {
  background: var(--teal);
  color: #fff;
  opacity: 1;
  transform: scale(1);
}

/* ── Toast Notification ──────────────────────────────────────────────────── */
.sucursales-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(150px);
  background: var(--teal);
  color: #fff;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(26, 107, 138, 0.3);
  font-size: 0.95rem;
  font-weight: 500;
  z-index: 999;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 90vw;
}

.sucursales-toast--show {
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 640px) {
  .sucursales-toast {
    bottom: 1.5rem;
    padding: 0.9rem 1.2rem;
    font-size: 0.9rem;
  }
}

.sucursal-card--principal {
  border: 2px solid var(--gold);
  background: linear-gradient(135deg, #fffef8 0%, #fff 100%);
}
.sucursal-card--principal h3 {
  color: var(--navy);
}

.sucursal-card-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold-dark);
  background: rgba(217,155,38,0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  align-self: flex-start;
  letter-spacing: 0.02em;
}

.sucursal-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gray-700);
  margin: 0;
}

.sucursal-card-dir {
  font-size: 0.9rem;
  color: var(--gray-400);
  line-height: 1.55;
  margin: 0;
  flex: 1;
}

.sucursal-card-contacto {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--gray-500);
}

.sucursal-card-btn {
  align-self: flex-start;
  margin-top: 0.25rem;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sucursales-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Calculator Reference Tables ──────────────────────────────────────────── */
.calc-tables-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-100);
}

.calc-tables-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: 1.5px solid var(--gray-100);
  border-radius: 50px;
  padding: 0.6rem 1.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--teal);
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 1rem;
}
.calc-tables-toggle:hover {
  background: rgba(10,78,155,0.04);
  border-color: var(--teal);
}

.calc-tables-container {
  animation: tablesSlideDown 0.3s ease;
}
@keyframes tablesSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.calc-tables-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.calc-table-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.2rem 1.25rem;
  width: 100%;
}
.calc-table-card--plazo { order: 1; }
.calc-table-card--tasa { order: 2; }
.calc-table-card--comision { order: 3; }
.calc-table-card h4 {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
  text-align: center;
}

/* Reference tables */
.ref-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  table-layout: auto;
}
.ref-table thead th {
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid var(--gray-100);
  text-align: left;
  vertical-align: top;
  word-break: break-word;
}
.ref-table thead th:last-child {
  text-align: right;
}
.ref-table tbody td {
  padding: 0.5rem 0.55rem;
  border-bottom: 1px solid rgba(0,0,0,0.03);
  color: var(--gray-500);
  transition: all var(--transition);
  vertical-align: top;
  word-break: break-word;
}
.ref-table tbody td:last-child {
  text-align: right;
  font-weight: 600;
}
.ref-table tbody tr:last-child td {
  border-bottom: none;
}

/* Rate hint & table note */
.calc-rate-hint {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--gray-300);
  text-transform: none;
  letter-spacing: 0;
}
.calc-table-note {
  font-size: 0.68rem;
  color: var(--gold);
  text-align: center;
  margin-top: -0.3rem;
  margin-bottom: 0.5rem;
  font-style: italic;
}

/* Highlighted row */
.ref-table tbody tr.table-row--active {
  background: linear-gradient(90deg, rgba(10,78,155,0.08), rgba(26,107,138,0.05));
  border-radius: var(--radius-sm);
}
.ref-table tbody tr.table-row--active td {
  color: var(--teal);
  font-weight: 700;
}
.ref-table tbody tr.table-row--active td:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.ref-table tbody tr.table-row--active td:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Note row */
.ref-table tbody tr.table-row--note td {
  color: var(--gray-300);
  font-size: 0.72rem;
  font-style: italic;
  text-align: center;
}

/* Commission info in results */
.calc-commission-info {
  background: rgba(217,155,38,0.08);
  border: 1px solid rgba(217,155,38,0.15);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--gray-600);
}
.calc-commission-info strong {
  color: var(--gold);
}

.calc-condition-msg {
  background: rgba(10,78,155,0.06);
  border: 1px solid rgba(10,78,155,0.12);
  color: var(--gray-600);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem;
  margin: 0 0 1rem;
  font-size: 0.83rem;
  line-height: 1.5;
}
.calc-condition-msg strong {
  color: var(--teal);
}
