:root {
  --color-primary: #CF713E;
  --color-secondary: #DD9E52;
  --color-dark: #110F10;

  --color-primary-dark: #AF6035;
  --color-primary-light: #E59B71;
  --color-secondary-light: #EBC89B;
  --color-surface: rgba(17, 15, 16, 0.85);
  --color-text-on-dark: #F5F0EA;
  --color-text-on-light: #110F10;

  --leo-link: #E4780D;

  --bs-primary: var(--color-primary);
  --bs-secondary: var(--color-secondary);
  --bs-dark: var(--color-dark);
  --bs-body-bg: #F8F4F0;
  --bs-body-color: var(--color-text-on-light);

  --topbar-h: 40px;
  --navbar-h: 78px;
}

/* --- Base --- */
* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  font-family: "Source Sans 3", system-ui, sans-serif;
  color: var(--color-text-on-light);
  background-color: var(--bs-body-bg);
  padding-top: calc(var(--topbar-h) + var(--navbar-h));
}

body.topbar-hidden {
  padding-top: var(--navbar-h);
}

h1,
h2,
h3,
h4,
h5,
h6,
.section__title,
.hero__title,
.brand-text {
  font-family: "Oswald", sans-serif;
  letter-spacing: 0.02em;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.section {
  padding: 4.5rem 0;
}

.section--light {
  background: #fff;
}

.section__title {
  font-size: clamp(1.9rem, 3.2vw, 2.8rem);
  margin-bottom: 0.5rem;
}

.section__subtitle {
  font-size: 1.1rem;
  color: rgba(17, 15, 16, 0.8);
  max-width: 760px;
  margin: 0 auto;
}

.text-primary {
  color: var(--color-primary) !important;
}

.btn-primary {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
}

.text-leo-link {
  color: var(--leo-link) !important;
}

.text-leo-link:hover,
.text-leo-link:focus {
  color: var(--bs-body-bg) !important;
  text-decoration: underline;
}

/* --- Navegación --- */
.navbar--fixed {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  right: 0;
  z-index: 1080;
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1090;
  background: #222;
  border-bottom: 1px solid rgba(245, 240, 234, 0.14);
  color: var(--bs-body-bg) !important;
  font-size: 0.85rem;
  transform: translateY(0);
  transition: transform 0.25s ease;
  will-change: transform;
}

.topbar__inner {
  min-height: var(--topbar-h);
  gap: 0.75rem;
}

.topbar__contact-link {
  color: var(--bs-body-bg) !important;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.topbar__contact-link:hover {
  color: var(--color-primary) !important;
}

.topbar__separator {
  color: rgba(245, 240, 234, 0.4);
}

.topbar__langs .btn {
  border-color: rgba(245, 240, 234, 0.35);
  color: var(--color-primary) !important;
  padding: 0.15rem 0.28rem;
  line-height: 1;
}

.topbar__langs .btn:hover {
  border-color: var(--color-secondary);
  background: var(--color-secondary);
  color: var(--color-dark);
}

.topbar__langs svg {
  display: block;
}

#siteNavbar.navbar--transparent {
  background: transparent;
}

#siteNavbar.navbar--solid {
  background: rgba(17, 15, 16, 0.97);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

#siteNavbar .navbar-brand {
  padding: 0.35rem 0;
  line-height: 1;
}

.logo-img {
  display: block;
  width: auto;
  height: 160px;
  max-width: 100%;
  object-fit: contain;
  transition: height 0.25s ease, max-width 0.25s ease, filter 0.25s ease;
}

#siteNavbar.navbar--transparent .logo-img {
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35));
}

#siteNavbar.navbar--solid .logo-img {
  height: 40px;
  max-width: 80%;
  filter: none;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: #fff;
  font-size: 1rem;
}

.brand-text {
  font-size: 1.2rem;
  color: #fff;
}

#siteNavbar .nav-link {
  color: #fff;
  font-weight: 600;
}

#siteNavbar .nav-link:hover,
#siteNavbar .nav-link:focus {
  color: var(--color-secondary-light);
}

/* --- Hero --- */
.hero {
  min-height: 92vh;
  display: flex;
  align-items: center;
  background: var(--color-dark);
}

.hero__bg {
  position: absolute;
  inset: 0;
  background-image: url("../img/recambios.webp");
  background-position: center;
  background-size: cover;
  filter: grayscale(100%);
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(17, 15, 16, 0.9) 0%, rgba(17, 15, 16, 0.72) 60%, rgba(207, 113, 62, 0.4) 100%);
}

.hero__caption {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.hero__title {
  font-size: clamp(2.1rem, 5vw, 4rem);
  line-height: 1.1;
  margin-bottom: 1rem;
}

.hero__subtitle {
  font-size: clamp(1.05rem, 1.9vw, 1.35rem);
  margin-bottom: 0;
  color: var(--color-text-on-dark);
}

.hero__note {
  color: var(--color-secondary-light);
  font-weight: 600;
}

/* TODO: Reemplazar con imagen real de la empresa para el hero */

/* --- Cards servicios y catálogo --- */
.card--hover {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card--hover:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 26px rgba(17, 15, 16, 0.12) !important;
}

.service-icon,
.category-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(207, 113, 62, 0.12);
  color: var(--color-primary);
  font-size: 1.4rem;
}

.service-media {
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: rgba(17, 15, 16, 0.05);
}

.service-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* --- Sobre nosotros --- */
.about-logo-wrap {
  background: #fff;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.75rem;
}

.about-logo-img {
  width: 100%;
  max-width: 360px;
  height: auto;
  display: block;
}

/* --- Marcas --- */
.brand-pill {
  background: #fff;
  border: 1px solid rgba(17, 15, 16, 0.12);
  color: rgba(17, 15, 16, 0.6);
  border-radius: 10px;
  padding: 0.8rem 0.7rem;
  font-weight: 700;
  filter: grayscale(1);
  transition: color 0.2s ease, border-color 0.2s ease, filter 0.2s ease;
}

.brand-pill:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
  filter: grayscale(0);
}

/* --- Ventajas --- */
.benefit-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid rgba(17, 15, 16, 0.08);
  padding: 1.4rem;
}

.benefit-card i {
  font-size: 1.6rem;
  color: var(--color-primary);
}

/* --- FAQ --- */
.accordion-button:not(.collapsed) {
  background-color: rgba(207, 113, 62, 0.1);
  color: var(--color-dark);
}

.accordion-button:focus {
  box-shadow: 0 0 0 0.2rem rgba(207, 113, 62, 0.25);
}

/* --- Contacto --- */
.contact-card-dark {
  background: var(--color-dark);
  color: var(--color-text-on-dark);
}

.contact-card-dark i {
  color: var(--color-secondary-light);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 0.2rem rgba(207, 113, 62, 0.22);
}

/* --- RGPD --- */
.rgpd__card {
  background: #fff;
}

/* --- Footer --- */
.footer {
  background: var(--color-dark) !important;
}

.footer .brand-mark {
  background: var(--color-secondary);
  color: var(--color-dark);
}

.footer .footer-links a {
  color: rgba(245, 240, 234, 0.82);
  text-decoration: none;
}

.footer .footer-links a:hover {
  color: var(--color-secondary-light);
}

/* --- Botón volver arriba --- */
.to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1090;
}

.to-top--visible {
  opacity: 1;
  pointer-events: auto;
}

/* --- Responsive --- */
@media (max-width: 1199.98px) {
  :root {
    --topbar-h: 36px;
    --navbar-h: 68px;
  }

  body.topbar-hidden .topbar {
    transform: translateY(-100%);
  }

  body.topbar-hidden .navbar--fixed {
    top: 0;
  }

  .logo-img {
    height: 44px;
    max-width: 220px;
  }

  #siteNavbar.navbar--solid .logo-img {
    height: 38px;
    max-width: 200px;
  }

  .navbar-collapse {
    margin-top: 0.75rem;
    background: rgba(17, 15, 16, 0.97);
    border-radius: 10px;
    padding: 1rem;
  }

  .navbar-nav .btn {
    width: 100%;
    margin-top: 0.5rem;
  }

  .topbar__contact-text,
  .topbar__separator,
  .topbar__lang-label {
    display: none;
  }
}

@media (min-width: 1200px) {
  body.topbar-hidden .topbar {
    transform: translateY(-100%);
  }

  body.topbar-hidden .navbar--fixed {
    top: 0;
  }

  body.topbar-hidden {
    padding-top: var(--navbar-h);
  }
}

@media (max-width: 575.98px) {
  .section {
    padding: 3.5rem 0;
  }

  :root {
    --topbar-h: 34px;
  }

  .logo-img {
    height: 38px;
    max-width: 190px;
  }

  #siteNavbar.navbar--solid .logo-img {
    height: 34px;
    max-width: 170px;
  }

  .topbar__inner {
    gap: 0.45rem;
  }

  .topbar__contact-link {
    gap: 0;
    padding: 0.1rem 0.25rem;
  }

  .topbar__contact-link i {
    font-size: 0.92rem;
  }

  .hero {
    min-height: 84vh;
  }

  .hero__cta .btn {
    width: 100%;
  }

  .about-logo-wrap {
    min-height: 220px;
    padding: 1.25rem;
  }
}
