/* =====================================================================
   VETASUR design system — overrides on top of styles.css (v=20)
   Loaded AFTER styles.css. Public-facing redesign only.
   ===================================================================== */

:root {
  --paper: #F5F0E6;
  --paper-2: #ECE4D4;
  --field: #FDFBF4;
  --ink: #2A3438;
  --pine: #47565C;
  --wood: #8B5E3C;
  --sage: #7C8A72;
  --text-soft: #5C5A4E;
  --line: #CFC5AE;

  /* Re-map base palette so the rest of components follow the theme */
  --primary: var(--wood);
  --primary-hover: #7A5132;
  --accent: var(--wood);
  --accent-dark: var(--pine);
  --accent-light: #C9B08F;
  --gray-50: #F7F4EC;
  --gray-100: #EFE9DC;
  --gray-200: #E3DCCC;
  --gray-300: #CFC5AE;
  --gray-500: #8A857A;
  --gray-600: #6E6A60;
  --gray-700: var(--text-soft);
  --gray-800: var(--ink);
  --gray-900: #1F272B;
  --radius: 12px;
}

/* ---------- Base ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 28px; }

body {
  font-family: 'Work Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--paper);
  color: var(--ink);
}

h1, h2, h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  color: var(--ink);
  text-wrap: balance;
}

h2 {
  font-size: 1.45rem;
  margin: 1.5rem 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom-color: var(--paper-2);
}

h3 { font-size: 1.15rem; }

.eyebrow {
  display: inline-block;
  font-family: 'Work Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--wood);
}

/* ---------- Header v2 (Vetasur) ---------- */
.v2-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(245, 240, 230, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(42, 52, 56, 0.12);
}

.v2-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 136px;
  gap: 16px;
  flex-wrap: nowrap;
}

.v2-logo { cursor: pointer; display: flex; align-items: center; }
.v2-logo-img {
  height: 120px;
  width: auto;
  display: block;
}

/* ---------- Menú superior ---------- */
.v2-menu {
  display: flex;
  align-items: stretch;
  align-self: stretch;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
}

.v2-menu-item {
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-soft);
  text-decoration: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.v2-menu-item:hover { color: var(--wood); border-bottom-color: var(--wood); }

.v2-menu-login {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 10px;
  padding-left: 14px;
  border-left: 1px solid var(--paper-2);
}

.v2-header-actions { display: flex; align-items: center; gap: 12px; }

.v2-btn-outline {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-soft);
  border-radius: 0;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.v2-btn-outline:hover { background: none; color: var(--wood); border-bottom-color: var(--wood); }

.v2-user-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.v2-user-mail { color: var(--ink); font-size: 0.8rem; font-weight: 600; }
.v2-role-badge {
  font-size: 0.66rem;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--sage);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.v2-btn-ghost {
  background: none;
  border: none;
  color: var(--wood);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}
.v2-header .v2-user-info { color: var(--ink); }
.v2-header .v2-user-info button {
  background: none;
  border: none;
  color: var(--wood);
}
.v2-header .v2-user-info button:hover { color: #7A5132; }

.v2-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 4px 0;
  color: var(--text-soft);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s;
}
.v2-back:hover { color: var(--wood); }

/* ---------- Home hero ---------- */
#section-home {
  background: var(--ink);
}

#section-home::before {
  background: linear-gradient(180deg, rgba(42, 52, 56, 0.18) 0%, rgba(42, 52, 56, 0.72) 100%);
  animation: none;
}

.v2-hero {
  min-height: 76vh;
  display: flex;
  align-items: flex-end;
}

.v2-hero-copy { max-width: 700px; padding: 40px 0 72px; }

.v2-hero-copy .eyebrow { color: #E9E2D2; }

.v2-hero-copy h1 {
  font-size: clamp(2.1rem, 4.4vw, 3.4rem);
  line-height: 1.08;
  color: #fff;
  margin: 0.6rem 0 1rem;
  letter-spacing: -0.01em;
}

.v2-hero-sub {
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(0.95rem, 1.2vw, 1.05rem);
  max-width: 46rem;
  line-height: 1.6;
}

.v2-hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 1.6rem;
}

.v2-btn-hero {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.82rem 1.7rem;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: background 0.2s, border-color 0.2s;
}
.v2-btn-hero:hover { background: rgba(255, 255, 255, 0.16); }
.v2-btn-hero.v2-btn-solid { background: var(--wood); border-color: var(--wood); }
.v2-btn-hero.v2-btn-solid:hover { background: #7A5132; border-color: #7A5132; }

/* ---------- Home choice cards ---------- */
.v2-choice-section {
  background: var(--paper);
  padding: 64px 0 72px;
}

.v2-choice {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 26px;
  align-items: stretch;
}

.v2-choice-card {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: var(--ink);
  box-shadow: 0 18px 40px -18px rgba(42, 52, 56, 0.45);
  min-height: 380px;
  display: flex;
}

.v2-choice-ph {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.6s ease;
}
.v2-choice-card:hover .v2-choice-ph { transform: scale(1.04); }

.v2-choice-overlay {
  position: relative;
  z-index: 1;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 10px;
  padding: 30px;
  color: #fff;
  background: linear-gradient(180deg, rgba(42, 52, 56, 0.22) 0%, rgba(42, 52, 56, 0.82) 55%, rgba(30, 37, 40, 0.97) 100%);
}

.v2-choice-overlay .eyebrow { color: #E9E2D2; }

.v2-choice-overlay h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.7rem;
  font-weight: 600;
  margin: 0;
  color: #fff;
}

.v2-choice-overlay p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  line-height: 1.55;
  margin: 0;
}

.v2-cta-note {
  font-size: 0.86rem;
  color: #E9E2D2;
  font-style: italic;
  opacity: 0.92;
}

.v2-link-arrow {
  margin-top: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  padding-bottom: 2px;
  transition: border-color 0.2s;
}
.v2-link-arrow:hover { border-color: #fff; }

/* home-model chips (dark overlay context) */
.v2-home-models {
  margin-top: 10px;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-height: 250px;
  width: 100%;
}

.v2-home-models .home-model-item {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
  border-radius: 10px;
}

/* ---------- Nav tabs (public) ---------- */
.nav-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  padding: 14px 0;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--paper-2);
}

.nav-tab {
  background: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.5rem 1.05rem;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-soft);
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.nav-tab:hover { color: var(--ink); }
.nav-tab.active {
  color: #fff;
  background: var(--pine);
  border-color: var(--pine);
}

#mainNav {
  background: rgba(245, 240, 230, 0.96);
}

/* ---------- Components ---------- */
.header {
  background: linear-gradient(135deg, var(--pine), var(--ink));
}
.header h1 { font-size: 1.9rem; }

.form-card, .result-card {
  background: var(--paper);
  border-top-color: var(--wood);
  box-shadow: 0 12px 30px -18px rgba(42, 52, 56, 0.28);
}

input, select, textarea {
  background: var(--field);
  border-color: var(--line);
}
input:focus, select:focus {
  border-color: var(--wood);
  box-shadow: 0 0 0 3px rgba(139, 94, 60, 0.16);
}

.btn {
  border-radius: 999px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.btn-primary { background: var(--wood); }
.btn-primary:hover { background: #7A5132; }
.btn-secondary {
  background: transparent;
  border: 1px solid var(--pine);
  color: var(--pine);
}
.btn-secondary:hover { background: var(--paper-2); }

table th {
  background: var(--pine);
  color: #fff;
  font-weight: 600;
}

/* Catalog */
.catalog-card {
  border-color: var(--paper-2);
  background: var(--field);
}
.catalog-card:hover {
  border-color: var(--sage);
  transform: translateY(-3px);
  box-shadow: 0 14px 28px -16px rgba(42, 52, 56, 0.32);
}
.catalog-card-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.18rem;
  color: var(--ink);
}
.catalog-card-price { color: var(--wood); }

/* Catálogo de modelos — vista horizontal (estilo Vetasur) */
#catalogGrid { display: block; }

#catalogGrid .model-row {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: stretch;
  border: 1px solid var(--paper-2);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--field);
  margin-bottom: 22px;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
#catalogGrid .model-row:hover {
  border-color: var(--sage);
  box-shadow: 0 14px 28px -16px rgba(42, 52, 56, .32);
  transform: translateY(-2px);
}
#catalogGrid .model-row:nth-child(even) { direction: rtl; }
#catalogGrid .model-row:nth-child(even) > * { direction: ltr; }

#catalogGrid .model-media {
  position: relative;
  min-height: 320px;
  overflow: hidden;
  background: var(--paper-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  font-size: 3rem;
}
#catalogGrid .model-media img { width: 100%; height: 100%; object-fit: cover; display: block; }

#catalogGrid .model-text {
  padding: 42px 46px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#catalogGrid .model-tag {
  align-self: flex-start;
  display: inline-block;
  font-size: .68rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  background: var(--paper-2);
  border: 1px solid rgba(35, 40, 31, .15);
  color: var(--pine);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 14px;
}
#catalogGrid .model-text h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.7rem, 3.2vw, 2.3rem);
  color: var(--ink);
  margin: 0 0 14px;
}
#catalogGrid .model-text p {
  color: var(--text-soft);
  font-size: .98rem;
  margin: 0 0 20px;
  max-width: 52ch;
}
#catalogGrid .model-features { list-style: none; padding: 0; margin: 0 0 22px; }
#catalogGrid .model-features li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 6px 0;
  color: var(--text-soft);
  font-size: .9rem;
}
#catalogGrid .model-features li::before { content: '—'; color: var(--wood); flex-shrink: 0; }

#catalogGrid .model-price {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--wood);
  margin-bottom: 18px;
}
#catalogGrid .model-cta {
  align-self: flex-start;
  font-size: .78rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--wood);
  border-bottom: 1px solid var(--wood);
  padding-bottom: 3px;
}
#catalogGrid .model-cta:hover { color: #7A5132; border-color: #7A5132; }

@media (max-width: 860px) {
  #catalogGrid .model-row { grid-template-columns: 1fr; direction: ltr !important; }
  #catalogGrid .model-media { min-height: 220px; }
  #catalogGrid .model-text { padding: 30px 24px; }
}

/* Login modal */
.login-modal {
  background: var(--paper);
  border-top: 4px solid var(--wood);
}

/* ---------- Páginas editoriales (overlay) ---------- */
.v2-page {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: var(--paper);
  overflow-y: auto;
}

.v2-page-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 14px 24px;
  background: rgba(245, 240, 230, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--paper-2);
}

.v2-page-close {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s;
}
.v2-page-close:hover { background: var(--wood); }

.v2-page-body {
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 0 40px;
}

.v2-page-body h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.9rem, 3.4vw, 2.7rem);
  line-height: 1.12;
  color: var(--ink);
  margin: 0.5rem 0 1.8rem;
}

.v2-page-body p {
  color: var(--gray-600);
  font-size: 1.02rem;
  line-height: 1.85;
  margin: 0 0 1.1rem;
}

.v2-page-body .eyebrow { color: var(--wood); }
.v2-page-sign { font-style: italic; color: var(--wood); }
.v2-page-note { font-size: 0.85rem; color: var(--gray-500); }

.v2-page-steps {
  margin: 1.5rem 0;
  padding: 0;
  list-style: none;
  counter-reset: v2step;
}
.v2-page-steps li {
  counter-increment: v2step;
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--paper-2);
  color: var(--gray-600);
  line-height: 1.6;
}
.v2-page-steps li::before {
  content: counter(v2step, decimal-leading-zero);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--wood);
  min-width: 34px;
}

.v2-page-contact strong { color: var(--ink); }

.v2-page-foot {
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 28px 72px;
}

.v2-link-inline { color: var(--ink); }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .v2-choice { grid-template-columns: 1fr; }
  .v2-hero { min-height: 62vh; }
  .v2-hero-copy { padding-bottom: 52px; }
  .v2-choice-section { padding: 40px 0 48px; }
}

@media (max-width: 980px) {
  .v2-nav { flex-wrap: wrap; padding: 8px 0; }
  .v2-menu { order: 3; width: 100%; padding: 4px 0 8px; justify-content: center; align-self: auto; }
  .v2-menu-login { margin-left: 0; padding-left: 10px; }
}

@media (max-width: 600px) {
  .v2-logo-img { height: 88px; }
  .v2-btn-outline { padding: 6px 8px; font-size: 0.7rem; }
  .v2-choice-card { min-height: 340px; }
}

/* ---------- Tus planos ---------- */
.plans-badge {
  display: inline-block;
  background: var(--paper-2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.plan-status-badge {
  display: inline-block;
  background: var(--paper-2);
  color: var(--pine);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.plan-status-badge.is-review {
  background: var(--sage);
  color: var(--field);
  border-color: var(--sage);
}

.plan-status-badge.is-quoted {
  background: var(--wood);
  color: var(--field);
  border-color: var(--wood);
}

/* ---------- Footer ---------- */
.footer {
  background: var(--paper-2);
  text-align: left;
  padding: 64px 0 36px;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.footer-logo { height: 110px; width: auto; margin-bottom: 16px; }

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 48px;
}

.footer-grid h4 {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 16px;
  color: var(--pine);
}

.footer-grid p,
.footer-grid a {
  display: block;
  color: var(--text-soft);
  font-size: 0.9rem;
  margin-bottom: 8px;
  cursor: pointer;
}

.footer-grid a:hover { color: var(--wood); }

.footer-bottom {
  border-top: 1px solid rgba(35, 40, 31, 0.15);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--text-soft);
}

@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-logo { height: 96px; }
}

/* --- Formulario de contacto (cara pública) --- */
.v2-contact-form {
  max-width: 520px;
  margin-top: 28px;
}

.hp-field {
  position: absolute !important;
  left: -9999px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.v2-contact-form .form-group {
  margin-bottom: 16px;
}

.v2-contact-form label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 6px;
}

.v2-contact-form input[type="text"],
.v2-contact-form input[type="tel"],
.v2-contact-form input[type="email"] {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.95rem;
}

.v2-contact-form input[type="text"]:focus,
.v2-contact-form input[type="tel"]:focus,
.v2-contact-form input[type="email"]:focus {
  outline: none;
  border-color: var(--wood);
}

.v2-contact-call {
  display: flex !important;
  align-items: center;
  gap: 10px;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: 0.9rem !important;
  color: var(--ink) !important;
  margin: 8px 0 20px;
  cursor: pointer;
}

.v2-contact-call input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--wood);
}

.v2-contact-msg {
  margin-top: 14px;
  font-size: 0.9rem;
  font-weight: 600;
}

.v2-contact-msg.is-error { color: #b91c1c; }
.v2-contact-msg.is-ok { color: var(--accent); }