:root {
  --principal: #3337DB; /* Principal: Navbar, botons, títols */
  --secundari: #0a0c97; /* Secundari: Detalls, línies, hover */
  --red: #b90000; 
  --white: #fff; 
  --fons: #dbdbdb; /* Fons: Fons de seccions */
  --text: #191919; /* Text: Text principal */
  --accent: #99FF00; /* Accent opcional: Crides a l’acció, destacats */
  --transition: 0.3s ease;
}

/* 🌍 Estils generals */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Poppins", system-ui, sans-serif;
  color: var(--text);
  background: var(--fons);
}

/* HEADER GENERAL */
.site-header {
  background: transparent;
  position: sticky;
  top: 0;
  z-index: 50;
}

/* --- TOPBAR --- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0.4rem 1.5rem;
  border-bottom: 1px solid var(--principal);
  background-color: var(--principal);
  transition: all 0.3s ease;
}


  
/* --- BOTÓ DESPLEGABLE --- */
.toggle-topbar {
  background: none;
  border: none;
  color: var(--fons);
  font-size: 20px;
  cursor: pointer;
  display: block;
  margin: 0 auto;
  transition: transform 0.3s ease;
}

/* --- BOTÓ DESPLEGABLE --- */
.toggle-topbar:hover {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 20px;
  cursor: pointer;
  display: block;
  margin: 0 auto;
  transition: transform 0.3s ease;
}

/* Animació d'entrada */
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

  /* Quan fem click a la fletxa, mostrar-la */
  .topbar.active {
    display: flex;
    flex-direction: row; /* o column segons el disseny */
    justify-content: center; 
  }

  /* Quan està ocult */
.topbar.hide {
  height: 0;
  padding: 0;
  overflow: hidden;
  opacity: 0;
}

/* Rotació de la fletxa quan s'obre */
.toggle-topbar.rotate {
  transform: rotate(180deg);
}


/* --- BUSCADOR TOPBAR --- */
.search-box {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  background: var(--fons); /* ⚪ Fons: Fons de seccions */
  background-color: var(--white); /* Fons: Fons de seccions */
  border-radius: 15px;
  padding: 4px 10px;
  width: 260px;
  transition: all 0.3s ease;
}
.search-box img {
  width: 18px;
  height: 18px;
  margin-right: 6px;
}
.search-box input {
  border: none;
  outline: none;
  width: 100%;
  font-size: 0.9rem;
  color: var(--text);
  background: transparent;
  font-family: "Poppins", sans-serif;
}
.search-box input::placeholder {
  color: #191919;
  opacity: 0.6;
}
.search-box:hover,
.search-box:focus-within {
  box-shadow: 0 0 6px rgba(183, 64, 34, 0.4);
}

/* Animación hover/focus */
.search-box:hover,
.search-box:focus-within {
  box-shadow: 0 0 6px rgba(183, 64, 34, 0.4);
}

/* Botones de idioma */
.lang-buttons {
  display: inline-flex;
  gap: 0.5rem;
}
.lang-buttons a {
  text-decoration: none;
  color: #191919;
  background: var(--white);
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  font-size: 0.8rem;
  transition: all 0.3s;
}
.lang-buttons a:hover {
  background: var(--accent); /* accent */
  color: var(--text); /* text */
}
.lang-buttons a.active {
  background: var(--accent);
  color: var(--text);
  font-weight: 600;
}

/* NAV PRINCIPAL */
.main-nav {
  position: sticky;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  height: 80px;
  background-color: var(--text); /* Principal */
  overflow: visible; /* deixa que la imatge sobresurti si cal */
  top: 0;
  z-index: 9998; /* más alto aún para que nada lo tape */
}

/* Línia superior i inferior */
.main-nav::before,
.main-nav::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 8px;
  background-color: var(--fons); /* Fons */
  z-index: 9999; /* más alto aún para que nada lo tape */
}
.main-nav::before { top: 0; }
.main-nav::after { bottom: 0; }
.main-nav::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 4px; /* alçada de la línia */
  background-color: var(--fons); /* Fons */
  z-index: 2;
}

/* Imatge sota la línia */
.nav-bg {
  width: 100%;
  height: 33px; /* altura original del SVG */
  margin-top: -4px;
  z-index: 0;
  background-image: url('images/fondo-nav.svg'); /* tu SVG */
  background-repeat: repeat-x; /* repetir horizontalmente */
  background-size: auto 100%;   /* mantener proporción, altura completa */
  background-position: top;    /* alinearlo arriba */
}



/* Enlaces */
.nav-left ul,
.nav-right ul {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}
.nav-left a,
.nav-right a {
  text-decoration: none;
  color: var(--fons);
  position: relative;
  font-size: 0.95rem;
  letter-spacing: 0.3px;
  transition: color var(--transition);
}
.nav-left a::after {
  content: "";
  position: absolute;
  width: 0%;
  height: 1px;
  bottom: -4px;
  left: 0;
  background: var(--accent);
  transition: width var(--transition);
}
.nav-left a:hover,
.nav-right a:hover {
  color: var(--accent);
}
.nav-left a:hover::after {
  width: 100%;
}

/* --- ICONOS DE CUENTA Y CARRITO --- */
.nav-right a {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border: none;
  border-radius: 12px;
  width: 40px;
  height: 40px;
  transition: all 0.3s ease;
}
.nav-right a:hover {
  background: var(--accent);
}
.nav-right img.icon {
  width: 20px;
  height: 20px;
  transition: filter 0.3s ease;
}

/* LOGO NAVBAR */
.brand {
  color: black;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%); /* només un transform */
  height: 100%;
  align-items: center;
  z-index: 20; /* per assegurar que estigui per sobre de tot */
}
.brand img.logo {
  height: 100%;
  width: auto;
  border-radius: 8px;
  transition: transform 0.3s ease;
  object-fit: contain;
}
.brand img.logo:hover {
  transform: scale(1.05);
}

/* MEGA MENU */
.nav-item {
  position: relative;
}
.mega {
  display: none;
  position: absolute;
  top: calc(100% + 4px); /* deja 4px de espacio debajo del nav */
  left: 0;
  width: max-content;
  min-width: 800px;
  background: var(--fons);
  border: 1px solid var(--accent);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
  padding: 2rem;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  z-index: 9999; /* por encima del hero */
}

.nav-item:hover .mega,
.nav-item:focus-within .mega {
  display: grid;
}

.mega h4 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}
.mega a {
  text-decoration: none;
  color: var(--text);
  font-size: 0.9rem;
  display: block;
  margin-bottom: 0.4rem;
}
.mega a:hover {
  color: var(--accent);
}

.cta {
  display: inline-block;
  background: var(--accent);
  color: var(--accent);
  padding: 0.4rem 0.8rem;
  text-decoration: none;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  transition: background var(--transition);
}
.cta:hover {
  background: var(--text);
}

/* ICONOS DERECHA */
.nav-right a {
  font-size: 1.1rem;
}

/* HAMBURGUESA */
.hamburger {
  display: none;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--fons);
}

/* HERO PARALLAX */
.hero {
  margin-top: -70px; /* alçada del nav */
  display: flex;
  width: 100%;
  height: 100vh;
  position: relative;
}

/* ===== PANEL BASE ===== */
.panel {
  flex: 1;
  height: 100%;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  transition: flex 1s ease, clip-path 1s cubic-bezier(0.77,0,0.175,1);
}

.panel.izquierda {
  background-image: url('images/portfoli.jpg');
  /*background: var(--secundari);*/
}

.panel.derecha {
  background-image: url('images/move.jpg');
  /*background: #040568;*/
}

/* ===== TEXTO INICIAL ===== */
.overlay {
  position: absolute;
  text-align: center;
  z-index: 2;
  color: var(--fons);
  transition: opacity 0.5s ease;
}

.overlay h1 {
  font-size: 3rem;
}

/* ===== CONTENIDO EXPANDIDO ===== */
.content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 3rem;
  background: rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  justify-content: center;  /* centrado vertical */
  align-items: flex-start;  /* alineado a la izquierda */
  color: var(--white);
  overflow-y: auto;
  opacity: 0;
  transition: opacity 0.8s ease;
  z-index: 10;
  text-align: left;          /* texto alineado a la izquierda */
}

/* Mostrar el contenido del panel cuando el panel está activo */
.panel.active .content {
  opacity: 1;
  display: flex; /* era 'display: 100%' (inválido) */
  flex-direction: column;
  justify-content: center; /* opcional: centra verticalmente */
  align-items: flex-start;  /* opcional: contenido alineado a la izquierda */
}

/* ===== BOTÓN CERRAR ===== */
.content button.close {
  position: absolute;
  bottom: 1.5rem; /* 🔽 en lugar de top */
  right: 1.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(20px); /* Animación hacia arriba al aparecer */
  transition: opacity 0.5s ease, transform 0.5s ease;
  z-index: 20;
}

.panel.active .content button.close {
  opacity: 1;
  transform: translateY(0);
}

.content button.close svg {
  width: 40px;
  height: 40px;
  stroke: var(--fons);
  transition: transform 0.3s ease;
  stroke-width: 2;
}

.content button.close:hover svg {
  transform: rotate(90deg);
  stroke: var(--accent);
}


/* ===== TEXTO DENTRO DEL PANEL ===== */
.content h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.content h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.content p {
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.content button.go {
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  background: var(--principal);
  color: var(--white);
  transition: 0.3s;
}

.content button.go:hover {
  background: var(--accent);
  color: var(--text);
}

/* ===== ESTADOS ACTIVADOS ===== */
.panel.active {
  flex: 2;
  z-index: 10;
}

.panel.active .overlay {
  opacity: 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 950px) {
  .hero {
    flex-direction: column;
  }

  .panel {
    height: 50vh;
  }

  .overlay {
    text-align: center !important;
  }

  .content h1,
  .content h2,
  .content p {
    text-align: center;
  }
}

/* CONTENIDO PRINCIPAL */
main {
  background-color: var(--fons);
  color: var(--text);
}

.main-content {
  padding: 3rem 2rem;
  max-width: 900px;
  margin: 0 auto;
  font-size: 1rem;
  line-height: 1.6;
}

/* BOTTOM NAV MÓVIL */
.bottom-nav {
  display: none;
}

/* Normaliza solo los SVG o imágenes dentro del menú móvil */
.bottom-nav .icon {
  width: 24px;          /* tamaño fijo */
  height: 24px;
  object-fit: contain;  /* asegura que no se deforme */
  flex-shrink: 0;       /* evita que se comprima */
  display: block;
}

/* 📱 Ajustos mòbil */

/* MENÚ MÓVIL */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 60;
}

.mobile-sheet {
  width: 100%;
  height: 100%;
  background: var(--fons);
  padding: 1.5rem;
  animation: slideIn 0.3s ease forwards;
}

.mobile-sheet button {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  float: right;
  cursor: pointer;
}

.mobile-sheet ul {
  list-style: none;
  margin-top: 2rem;
}

.mobile-sheet li {
  margin-bottom: 1rem;
}

.mobile-sheet a {
  text-decoration: none;
  color: #111;
  font-size: 1.05rem;
}

@keyframes slideIn {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

@media (max-width: 950px) {
  /* TOPBAR */
  .topbar {
    display: none;
  }

  .main-nav {
    height: 60px; /* nav més baix */
    padding: 0.5rem 1rem;
  }

    .nav-right {
    display: none;
  }
    .nav-left {
    display: none;
  }
    .nav-right ul {
    gap: 1rem;
  }

  .brand {
    top: 65%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  .brand img {
    height: 44px;
  }
  .brand img.logo {
    height: 65%; /* una mica més gran dins del nav més petit */
  }

  /* Invertir color en hover o en móvil */
  .hamburger {
    color: var(--fons);
    display: block;
  }
  
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--fons);
    border-top: 1px solid var(--fons);
    z-index: 100;
    justify-content: space-around;
    padding: 0.5rem 0;
    box-shadow: 0 -2px 6px rgba(0,0,0,0.1);
  }

  .bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text);
    font-size: 0.9rem;
    transition: color 0.2s;
  }

  .bottom-nav a span {
    font-size: 0.7rem;
    margin-top: 2px;
  }

  .bottom-nav a:hover {
    color: var(--accent);
  }
}

.go {
  display: inline-block;
  background-color: var(--accent);
  color: var(--text);
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.3s;
}


