/* =========================
   VARIABLES GLOBALES
   ========================= */
:root {
  --primary: #2559a4;
  --primary-dark: #1b437a;
  --accent: #f97316;
  --bg: #0b1120;
  --bg-light: #f8fafc;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-soft: #e2e8f0;
  --radius-lg: 12px;
  --radius-md: 8px;
  --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.18);
  --transition-fast: 0.2s ease;
}

/* =========================
   RESET BÁSICO
   ========================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--text-main);
  background: #ffffff;
}

p {
  line-height: 1.6;
  margin: 0 0 0.75rem;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.75rem;
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* foco accesible */
a:focus,
button:focus,
.cta-btn:focus,
.nav-link:focus,
.menu-toggle:focus,
.phone-link:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* helper accesibilidad */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* =========================
   LAYOUT PRINCIPAL
   ========================= */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
}

header > * {
  min-width: 0;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

/* =========================
   LOGO
   ========================= */
.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.logo-container img {
  display: block;
  height: 72px;
  width: auto;
}

/* =========================
   NAVEGACIÓN PRINCIPAL
   ========================= */
nav#mainNav {
  display: none;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.nav-link {
  font-size: 0.95rem;
  color: #e5e7eb;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  transition: background var(--transition-fast), color var(--transition-fast),
    transform var(--transition-fast);
  white-space: nowrap;
}

.nav-link:hover {
  background: rgba(148, 163, 184, 0.2);
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-1px);
}

.nav-link.active {
  background: #ffffff;
  color: var(--primary);
  font-weight: 600;
}

/* estado visible para móvil */
nav#mainNav.open {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #020617;
  padding: 0.75rem 1rem 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.4);
}

/* =========================
   SELECTOR DE IDIOMA
   ========================= */
.language-selector {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.language-current {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(15, 23, 42, 0.7);
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
  color: #e5e7eb;
  cursor: pointer;
  white-space: nowrap;
}

.language-chevron {
  font-size: 0.75rem;
}

.language-dropdown {
  position: absolute;
  top: 115%;
  right: 0;
  min-width: 170px;
  background: #020617;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: var(--shadow-soft);
  padding: 0.4rem;
  display: none;
}

.language-selector:hover .language-dropdown {
  display: block;
}

.language-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  color: #e5e7eb;
  font-size: 0.85rem;
}

.language-option:hover {
  background: rgba(148, 163, 184, 0.2);
  text-decoration: none;
}

.language-option.active {
  background: rgba(37, 89, 164, 0.2);
  border: 1px solid rgba(37, 89, 164, 0.6);
}

/* =========================
   BANDERAS
   ========================= */
.language-flag {
  width: 18px;
  height: 12px;
  border-radius: 2px;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}

/* España */
.language-flag.es {
  background: linear-gradient(
    to bottom,
    #aa151b 0 33%,
    #f1bf00 33% 66%,
    #aa151b 66% 100%
  );
}

/* Francia */
.language-flag.fr {
  background: linear-gradient(
    to right,
    #002395 0 33%,
    #ffffff 33% 66%,
    #ed2939 66% 100%
  );
}

/* Reino Unido simplificado */
.language-flag.en,
.language-flag.gb {
  background: #012169;
}

.language-flag.en::before,
.language-flag.en::after,
.language-flag.gb::before,
.language-flag.gb::after {
  content: "";
  position: absolute;
  background: #ffffff;
}

.language-flag.en::before,
.language-flag.gb::before {
  top: 40%;
  left: 0;
  width: 100%;
  height: 20%;
}

.language-flag.en::after,
.language-flag.gb::after {
  left: 40%;
  top: 0;
  width: 20%;
  height: 100%;
}

/* =========================
   MENÚ HAMBURGUESA
   ========================= */
.menu-toggle {
  background: transparent;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.hamburger {
  width: 20px;
  height: 2px;
  background: #e5e7eb;
  border-radius: 999px;
  position: relative;
}

.hamburger::before,
.hamburger::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  background: #e5e7eb;
  border-radius: 999px;
}

.hamburger::before {
  top: -6px;
}

.hamburger::after {
  top: 6px;
}

/* =========================
   CTA CABECERA
   ========================= */
.cta-container {
  display: none;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.phone-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: #e5e7eb;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.6);
  text-decoration: none;
  transition: background var(--transition-fast), border-color var(--transition-fast);
  white-space: nowrap;
}

.phone-link:hover {
  background: rgba(37, 89, 164, 0.7);
  border-color: rgba(37, 89, 164, 0.9);
  text-decoration: none;
}

.phone-icon {
  width: 16px;
  height: 16px;
  fill: #e5e7eb;
}

/* =========================
   BOTONES CTA
   ========================= */
.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.3rem;
  border-radius: 999px;
  border: none;
  background: var(--primary);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  box-shadow: 0 12px 25px rgba(37, 89, 164, 0.35);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast),
    background var(--transition-fast);
}

.cta-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(37, 89, 164, 0.45);
  text-decoration: none;
}

.cta-btn.secondary {
  background: #ffffff;
  color: var(--primary);
  border: 1px solid rgba(148, 163, 184, 0.8);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.18);
}

.cta-btn.secondary:hover {
  background: #f9fafb;
}

.cta-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* =========================
   HERO
   ========================= */
.hero {
  margin: 2rem auto 1.5rem;
  max-width: 900px;
  text-align: center;
  padding: 60px 20px 40px;
  background: linear-gradient(180deg, #f8fafc 0%, #eef6ff 100%);
  border-bottom: 1px solid #e5e7eb;
  border-radius: 18px;
}

.hero h1 {
  font-size: 2.2rem;
  line-height: 1.2;
  color: var(--text-main);
  margin-bottom: 15px;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 720px;
  margin: 0 auto;
}

/* =========================
   PARALLAX CASI FULL-WIDTH
   ========================= */
.parallax-bg {
  position: relative;
  margin: 2.5rem 0;
  width: 100vw;
  left: 50%;
  margin-left: -50vw;
  min-height: 360px;
  border-radius: 0;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-attachment: scroll;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.25);
}

.parallax-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(
      circle at top left,
      rgba(37, 89, 164, 0.55),
      transparent 55%
    ),
    linear-gradient(
      120deg,
      rgba(15, 23, 42, 0.92),
      rgba(15, 23, 42, 0.8)
    );
}

.parallax-content {
  position: relative;
  z-index: 1;
  color: #e5e7eb;
  padding: 2.4rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

/* =========================
   CONTENT GRID
   ========================= */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 20px;
}

.content-grid a {
  display: block;
  text-decoration: none;
  color: inherit;
}

.content-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 24px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
  height: 100%;
  overflow: hidden;
}

/* pequeño ajuste visual "premium" */
.content-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0.85;
}

.content-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.10);
  border-color: #3b82f6;
  cursor: pointer;
}

.content-card h2 {
  font-size: 1.25rem;
  color: var(--primary-dark);
}

.content-card h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.25rem;
  font-weight: 600;
  color: #0f172a;
}

.content-card p {
  margin: 0;
  color: #475569;
  line-height: 1.6;
  font-size: 0.95rem;
}

/* =========================
   TARJETAS CLICABLES
   ========================= */
.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.card-link:hover {
  text-decoration: none;
}

.card-link h2,
.card-link h3,
.card-link p,
.card-link li,
.card-link span {
  color: inherit;
}

/* =========================
   CATEGORY GRID / CARDS
   ========================= */
.category-grid {
  max-width: 1100px;
  margin: 40px auto 0;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.category-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 24px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
  height: 100%;
  overflow: hidden;
}

.category-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0.85;
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.10);
  border-color: #3b82f6;
  cursor: pointer;
}

.category-card h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.25rem;
  font-weight: 600;
  color: #0f172a;
}

.category-card p {
  margin: 0;
  color: #475569;
  line-height: 1.6;
  font-size: 0.95rem;
}

.category-card ul {
  margin: 14px 0 0;
  padding-left: 18px;
}

.category-card li {
  margin-bottom: 8px;
  color: #475569;
}

.category-card a {
  color: inherit;
  text-decoration: none;
}

.category-card a:hover {
  text-decoration: none;
}

/* listas */
.feature-list {
  list-style: none;
  padding-left: 0;
  margin-top: 10px;
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 8px;
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.5;
}

.check-icon {
  width: 18px;
  height: 18px;
  fill: #22c55e;
  flex-shrink: 0;
}

/* tarjeta con imagen de fondo */
.card-with-image-bg {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 260px;
  box-shadow: var(--shadow-soft);
}

.card-bg-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.05);
  transition: transform 0.6s ease;
}

.card-bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(15, 23, 42, 0.9),
    rgba(15, 23, 42, 0.65)
  );
}

.card-with-image-bg:hover .card-bg-image {
  transform: scale(1.09);
}

.card-content {
  position: relative;
  z-index: 1;
  color: #e5e7eb;
  padding: 1.75rem 1.5rem;
}

/* =========================
   FORMULARIOS (CONTACTO / BÚSQUEDA)
   ========================= */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group,
.form-group-half {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.9rem;
}

.form-group-half {
  flex: 1;
}

.form-row--two-cols {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-form label {
  font-weight: 500;
  color: #0f172a;
}

.contact-form input,
.contact-form select,
.contact-form textarea,
.catalog-search input[type="search"] {
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  padding: 0.55rem 0.7rem;
  font-size: 0.9rem;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus,
.catalog-search input[type="search"]:focus {
  border-color: #2559a4;
  box-shadow: 0 0 0 1px rgba(37, 89, 164, 0.2);
}

.contact-form textarea {
  resize: vertical;
  min-height: 120px;
}

.contact-form .submit-btn {
  align-self: flex-start;
  margin-top: 0.5rem;
}

.catalog-search {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 760px;
  margin: 20px auto 0;
}

/* =========================
   FOOTER
   ========================= */
footer {
  background: #020617;
  color: #e5e7eb;
  padding: 2.5rem 1.5rem 1.5rem;
  margin-top: 2rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto 1.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.footer-section h3 {
  font-size: 1rem;
  margin-bottom: 0.6rem;
  color: #f9fafb;
}

.footer-section p,
.footer-section a {
  font-size: 0.9rem;
  color: #cbd5f5;
  margin: 0.15rem 0;
}

.footer-section a:hover {
  color: #ffffff;
  text-decoration: none;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  border-top: 1px solid rgba(148, 163, 184, 0.4);
  padding-top: 0.8rem;
  text-align: center;
}

.footer-bottom p {
  margin: 0;
  font-size: 0.8rem;
  color: #9ca3af;
}

/* =========================
   RESPONSIVE
   ========================= */
@media (min-width: 768px) {
  header {
    padding: 0.75rem 2.5rem;
    gap: 1.25rem;
  }

  main {
    padding: 2.25rem 2.5rem 3.5rem;
  }

  nav#mainNav {
    display: flex;
  }

  nav#mainNav.open {
    position: static;
    flex-direction: row;
    background: transparent;
    padding: 0;
    border-bottom: none;
  }

  .menu-toggle {
    display: none;
  }

  .cta-container {
    display: flex;
  }

  .hero {
    margin-top: 2.5rem;
  }

  .parallax-content {
    padding: 2.8rem 2.5rem;
    text-align: left;
  }

  .parallax-content h2 {
    font-size: 2.4rem;
  }

  .footer-content {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .form-row--two-cols {
    flex-direction: row;
  }

  .catalog-search {
    flex-direction: row;
    align-items: center;
  }

  .catalog-search input[type="search"] {
    flex: 1;
  }
}

@media (min-width: 1024px) {
  .logo-container img {
    height: 96px;
  }

  .hero {
    max-width: 900px;
  }

  .hero h1 {
    font-size: 2.4rem;
  }

  .parallax-bg {
    min-height: 420px;
    background-attachment: fixed;
  }

  .card-content {
    padding: 2rem 2rem;
  }
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 1.7rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .content-grid,
  .category-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .content-card,
  .category-card {
    padding: 22px 20px;
  }
}
/* =========================
   FICHAS DE PIEZAS
   ========================= */

/* Contenedor general de galerías */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

/* Imágenes dentro de galerías */
.image-grid img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
}

/* Por si alguna ficha sigue usando content-grid con imágenes dentro */
.content-grid img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
}

/* Evita desbordes raros en tarjetas */
.content-card {
  overflow: hidden;
}

/* Mejora separación vertical en fichas */
main section {
  box-sizing: border-box;
}

/* Breadcrumb simple */
.breadcrumb,
nav[aria-label="Miga de pan"],
nav[aria-label="Breadcrumb"] {
  font-size: 0.95rem;
}

.breadcrumb a,
nav[aria-label="Miga de pan"] a,
nav[aria-label="Breadcrumb"] a {
  text-decoration: none;
}

/* Etiquetas tipo Disponible / Ref / Stock */
.badge-row {
  margin-top: 15px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.badge {
  color: white;
  padding: 6px 12px;
  border-radius: 15px;
  font-weight: 600;
  display: inline-block;
}

.badge--ok {
  background: #16a34a;
}

.badge--ref {
  background: #3b82f6;
}

.badge--alt {
  background: #f97316;
}

.badge--stock {
  background: #475569;
}

/* Espaciado más limpio para fichas */
.pieza-wrap {
  max-width: 1100px;
  margin: 40px auto;
  padding: 0 20px;
}

/* CTA final de fichas */
.pieza-cta {
  max-width: 1100px;
  margin: 40px auto;
  padding: 0 20px;
}

/* Relacionados en fichas */
.pieza-relacionados {
  max-width: 1100px;
  margin: 40px auto;
  padding: 0 20px 40px;
}

/* Responsive fino para galerías */
@media (max-width: 640px) {
  .image-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .badge-row {
    gap: 8px;
  }
}