/* AUTIP Calculadora — Hereda variables de styles.css */

.calc-page { background: var(--paper); min-height: 100vh; }

.calc-hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(50px, 7vw, 90px) var(--gutter) clamp(30px, 5vw, 50px);
  text-align: center;
}
.calc-hero h1 { margin: 22px auto 28px; max-width: 900px; }
.calc-hero p {
  font-size: clamp(17px, 1.6vw, 21px);
  color: var(--ink-soft);
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.5;
}

.calc-config { max-width: var(--max); margin: 0 auto; padding: 30px var(--gutter); }

.calc-selectors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 40px;
}

.calc-selector-card {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 26px;
  transition: border-color var(--transition), background var(--transition);
  min-height: 220px;
  display: flex;
  flex-direction: column;
}
.calc-selector-card.has-selection {
  border-color: var(--ink);
  background: var(--paper);
}

.selector-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 18px;
}
.selector-num {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 28px;
  color: var(--accent);
  font-weight: 500;
}
.selector-label {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  font-weight: 500;
}

.selector-input-wrap { position: relative; }

.calc-selector-input {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 15px;
  background: var(--paper);
  color: var(--ink);
  transition: border-color var(--transition);
}
.calc-selector-input:focus { outline: none; border-color: var(--ink); }

.calc-selector-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 12px;
  max-height: 320px;
  overflow-y: auto;
  z-index: 10;
  box-shadow: 0 20px 50px -20px rgba(26,24,20,0.25);
  display: none;
}
.calc-selector-dropdown.open { display: block; }

.dropdown-item {
  padding: 12px 18px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  border-bottom: 1px solid var(--rule);
  transition: background var(--transition);
}
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item:hover { background: var(--paper-2); }

.dropdown-item .item-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
}
.dropdown-item .item-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  white-space: nowrap;
}
.dropdown-empty {
  padding: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  font-style: italic;
}

.calc-selector-selected { display: flex; flex-direction: column; gap: 10px; }

.selected-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.2;
}
.selected-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.selected-remove {
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 6px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  cursor: pointer;
  align-self: flex-start;
  margin-top: 8px;
  transition: all var(--transition);
}
.selected-remove:hover { border-color: var(--accent); color: var(--accent); }

.calc-params {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
  padding: 32px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
}

.calc-param { display: flex; flex-direction: column; gap: 16px; }

.param-label {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  font-weight: 500;
}

.km-slider-wrap { display: flex; align-items: center; gap: 20px; }

#km-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--paper-3);
  border-radius: 999px;
  outline: none;
}
#km-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid var(--paper);
  box-shadow: 0 2px 8px rgba(184,69,31,0.3);
  transition: transform var(--transition);
}
#km-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
#km-slider::-moz-range-thumb {
  width: 24px; height: 24px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid var(--paper);
  box-shadow: 0 2px 8px rgba(184,69,31,0.3);
}

.km-value {
  display: flex;
  align-items: baseline;
  gap: 8px;
  background: var(--paper);
  padding: 8px 16px;
  border-radius: 12px;
  border: 1px solid var(--rule);
}

#km-input {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  color: var(--ink);
  border: none;
  background: transparent;
  width: 90px;
  text-align: right;
  outline: none;
}
#km-input::-webkit-outer-spin-button,
#km-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
#km-input { -moz-appearance: textfield; }

.km-unit {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.km-marks {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0 4px;
}

.period-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.period-btn {
  padding: 14px 0;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all var(--transition);
  font-weight: 500;
}
.period-btn:hover { border-color: var(--ink); }
.period-btn.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.calc-actions { text-align: center; margin-top: 10px; }
.calc-actions button:disabled { opacity: 0.4; cursor: not-allowed; }

/* RESULTADOS */
.calc-results {
  max-width: var(--max);
  margin: 0 auto;
  padding: 30px var(--gutter) 80px;
  scroll-margin-top: 100px;
}

.results-head { margin-bottom: 50px; text-align: center; }
.results-head .eyebrow { display: inline-flex; }
.results-head h2 { margin-top: 16px; font-size: clamp(32px, 5vw, 56px); }
.results-head p {
  margin-top: 20px;
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Hero numbers — el wow moment */
.cost-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 60px;
}

.cost-hero-card {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 36px;
  position: relative;
  transition: transform var(--transition), box-shadow var(--transition);
}

.cost-hero-card.is-cheapest {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.cost-hero-card.is-cheapest .cost-hero-name,
.cost-hero-card.is-cheapest .cost-hero-monthly { color: var(--paper); }
.cost-hero-card.is-cheapest .cost-hero-label,
.cost-hero-card.is-cheapest .cost-hero-period { color: var(--accent-soft); }
.cost-hero-card.is-cheapest .cost-hero-total { color: rgba(245, 241, 234, 0.85); }

.cost-hero-tag {
  position: absolute;
  top: 24px;
  right: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 500;
  color: var(--muted);
}

.cost-hero-card.is-cheapest .cost-hero-tag {
  background: var(--accent);
  color: var(--paper);
  padding: 6px 14px;
  border-radius: 999px;
}

.cost-hero-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-bottom: 14px;
}

.cost-hero-name {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 500;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 30px;
}

.cost-hero-monthly {
  font-family: var(--font-display);
  font-size: clamp(48px, 8vw, 80px);
  font-weight: 500;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.cost-hero-card.is-cheapest .cost-hero-monthly { color: var(--accent-soft); }

.cost-hero-period {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 24px;
}

.cost-hero-total {
  font-size: 14px;
  color: var(--ink-soft);
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}
.cost-hero-card.is-cheapest .cost-hero-total {
  border-top-color: rgba(245,241,234,0.18);
}

.cost-hero-total strong {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 17px;
  color: var(--ink);
}
.cost-hero-card.is-cheapest .cost-hero-total strong { color: var(--paper); }

/* Diferencia destacada */
.cost-diff-banner {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 28px 36px;
  margin-bottom: 60px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.cost-diff-icon {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 500;
  font-style: italic;
  color: var(--accent);
  line-height: 1;
  flex-shrink: 0;
}

.cost-diff-content h3 {
  font-family: var(--font-display);
  font-size: 22px;
  margin-bottom: 8px;
  color: var(--ink);
  font-weight: 500;
}

.cost-diff-content p {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.cost-diff-content strong { color: var(--accent-dark); font-weight: 500; }

/* DESGLOSE */
.breakdown-section { margin-bottom: 60px; }

.breakdown-section h3 {
  font-family: var(--font-display);
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 500;
  margin-bottom: 30px;
  text-align: center;
}

.breakdown-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.breakdown-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.breakdown-card h4 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 24px;
  color: var(--ink);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
}

.breakdown-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}

.breakdown-row:last-of-type { border-bottom: 2px solid var(--ink); }

.breakdown-icon {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14px;
  color: var(--accent);
  font-weight: 500;
  text-align: center;
}

.breakdown-label {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.3;
}

.breakdown-label small {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 2px;
}

.breakdown-value {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}

.breakdown-total {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 14px;
  align-items: center;
  padding-top: 16px;
}

.breakdown-total .breakdown-label {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
}

.breakdown-total .breakdown-value {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--accent);
}

/* INSIGHTS */
.insights-box {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 36px;
  margin-bottom: 50px;
}

.insights-box h3 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  margin-bottom: 22px;
}

.insights-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
}

.insights-list li {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.6;
  padding-left: 28px;
  position: relative;
}

.insights-list li::before {
  content: "→";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-weight: 500;
}

.insights-list strong { color: var(--ink); font-weight: 500; }

/* CTA dentro de resultados */
.results-cta {
  text-align: center;
  margin-top: 50px;
  padding: 40px;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-lg);
}

.results-cta h3 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  margin-bottom: 12px;
  color: var(--paper);
}

.results-cta p {
  color: rgba(245, 241, 234, 0.85);
  margin-bottom: 24px;
  font-size: 16px;
}

.results-cta .button {
  background: var(--paper);
  color: var(--ink);
}

.results-cta .button:hover {
  background: var(--accent);
  color: var(--paper);
}

/* EJEMPLOS */
.calc-examples {
  max-width: var(--max);
  margin: 0 auto;
  padding: 50px var(--gutter) 80px;
}

.calc-examples h2 { margin: 16px 0 50px; }

.example-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.example-card {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 26px;
  cursor: pointer;
  transition: transform var(--transition), background var(--transition), border-color var(--transition);
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.example-card:hover {
  transform: translateY(-3px);
  border-color: var(--ink);
  background: var(--paper);
}

.example-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  font-weight: 500;
}

.example-card h3 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink);
  margin: 0;
}

.example-card p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

/* METODOLOGÍA */
.calc-methodology {
  background: var(--paper-2);
  padding: var(--section-pad) var(--gutter);
}

.calc-methodology > * {
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
}

.calc-methodology h2 { margin: 16px 0 24px; }

.methodology-intro {
  font-size: 18px;
  color: var(--ink-soft);
  max-width: 720px;
  margin-bottom: 60px;
  line-height: 1.5;
}

.methodology-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.method-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.method-card--note {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.method-card--note h3 { color: var(--paper); }
.method-card--note p { color: rgba(245, 241, 234, 0.85); }
.method-card--note .method-num { color: var(--accent-soft); }

.method-num {
  font-family: var(--font-display);
  font-size: 32px;
  font-style: italic;
  color: var(--accent);
  font-weight: 500;
  line-height: 1;
}

.method-card h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.2;
}

.method-card p {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.55;
}

/* CTA FINAL */
.calc-cta {
  max-width: 900px;
  margin: 0 auto;
  padding: 80px var(--gutter) 120px;
  text-align: center;
}

.calc-cta h2 { margin: 18px 0 24px; }
.calc-cta p {
  font-size: clamp(17px, 1.6vw, 21px);
  color: var(--ink-soft);
  margin-bottom: 36px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .calc-selectors { grid-template-columns: 1fr; }
  .calc-params { grid-template-columns: 1fr; gap: 32px; padding: 24px; }
  .km-slider-wrap { flex-direction: column; align-items: stretch; gap: 14px; }
  .km-value { justify-content: center; }
  .cost-hero-grid { grid-template-columns: 1fr; }
  .cost-diff-banner { flex-direction: column; text-align: center; padding: 24px; }
  .breakdown-grid { grid-template-columns: 1fr; }
  .methodology-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .cost-hero-card { padding: 24px; }
  .cost-hero-tag {
    position: static;
    margin-bottom: 18px;
    display: inline-block;
  }
  .breakdown-card { padding: 20px; }
  .breakdown-row,
  .breakdown-total {
    grid-template-columns: 24px 1fr auto;
    gap: 10px;
  }
  .breakdown-label { font-size: 13px; }
  .results-cta { padding: 28px; }
}

/* ==========================================================================
   LOGOS DE MARCA EN CALCULADORA
   ========================================================================== */

/* Dropdown items con logo */
.dropdown-item {
  display: flex !important;
  align-items: center;
  gap: 12px;
}

.dropdown-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  padding: 0;
  flex-shrink: 0;
  overflow: visible;
}
.dropdown-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.dropdown-text {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

/* Logo grande en hero card de coste */
.cost-hero-logo {
  width: 72px;
  height: 72px;
  background: transparent;
  border: none;
  padding: 0;
  margin-bottom: 16px;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cost-hero-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* En la card cheapest (fondo oscuro) el logo lleva fondo claro igual */
.cost-hero-card.is-cheapest .cost-hero-logo {
  background: transparent;
  border: none;
}

/* Logo en cabecera de breakdown */
.breakdown-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
}

.breakdown-card-head h4 {
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
}

.breakdown-card-logo {
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  padding: 0;
  flex-shrink: 0;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
}
.breakdown-card-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Eliminar el doble borde de h4 en breakdown-card */
.breakdown-card > h4 {
  display: none;
}
