/* ==========================================================================
   Portafolio - Estilos
   Header / Footer / Drawer tomados de L&H (Roca Arquitectos)
   ========================================================================== */

:root {
  --color-bg: #fdfdfd;
  --color-bg-alt: #f7f7f7;
  --color-dark: #0f0f0f;
  --color-primary: #d90429;
  --color-primary-hover: #b00321;
  --color-text: #0f0f0f;
  --color-text-muted: #666666;
  --color-white: #FFFFFF;
  --font-primary: 'Inter', sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --transition-fast: 0.2s ease;
  --transition-normal: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --shadow-sm: 0 4px 6px rgba(0,0,0,0.05);
  --shadow-md: 0 10px 30px rgba(0,0,0,0.08);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-primary);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition-fast);
}

img {
  max-width: 100%;
  display: block;
}

ul {
  list-style: none;
}

/* ==========================================================================
   HEADER (desde L&H)
   ========================================================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1.2rem 0;
  z-index: 1000;
  background: rgba(253, 253, 253, 0.97);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-img {
  height: 60px;
  width: auto;
  object-fit: contain;
}

.badge-15-years {
  border-left: 2px solid var(--color-primary);
  padding-left: 12px;
}

.badge-years {
  display: block;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--color-primary);
  line-height: 1;
  font-family: var(--font-heading);
}

.badge-text {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--color-dark);
}

.nav-links {
  display: flex;
  gap: 1.8rem;
  align-items: center;
}

.btn-contact {
  background: var(--color-primary);
  color: var(--color-white) !important;
  padding: 0.55rem 1.1rem;
  border-radius: 2px;
  font-size: 0.85rem;
  font-weight: 500;
}

.btn-contact:hover {
  background-color: var(--color-primary-hover);
}

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.mobile-menu-btn span {
  width: 24px;
  height: 2px;
  background-color: var(--color-dark);
}

@media (max-width: 992px) {
  .mobile-menu-btn { display: flex; z-index: 1002; }
  .mobile-menu-btn.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
    background-color: #fff;
  }
  .mobile-menu-btn.active span:nth-child(2) { opacity: 0; }
  .mobile-menu-btn.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
    background-color: #fff;
  }
  .nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background-color: var(--color-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: right 0.4s ease;
    z-index: 1001;
    overflow-y: auto;
    padding: 4rem 0 2rem;
  }
  .nav.active { right: 0; }
  .nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
  }
  .nav-overlay.open { display: block; }
  .nav-links {
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    padding: 0 1.5rem;
  }
  .nav-links > li { width: 100%; }
  .nav-links a {
    color: var(--color-white) !important;
    font-size: 1.1rem;
  }
  .dropdown-menu {
    position: static !important;
    display: none !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    min-width: 0 !important;
    padding: 0.4rem 0 0.2rem 0.75rem !important;
  }
  .dropdown.open > .dropdown-menu { display: block !important; }
  .dropdown-menu a {
    color: rgba(255,255,255,0.8) !important;
    padding: 0.45rem 0.75rem !important;
    font-size: 0.95rem !important;
  }
  .dropdown-menu a:hover {
    color: #d90429 !important;
    background: transparent !important;
  }
}

/* ==========================================================================
   CONTENIDO PORTAFOLIO
   ========================================================================== */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 40px;
}

.portfolio-content {
  padding-top: 120px;
  padding-bottom: 80px;
}

.portfolio-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 48px;
  margin-bottom: 48px;
}

.header-text h1 {
  font-family: var(--font-heading);
  font-size: 3.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 18px;
  color: #111;
}

.intro {
  max-width: 480px;
  font-size: 0.95rem;
  color: #666;
  font-weight: 400;
  line-height: 1.55;
}

.filters {
  display: flex;
  gap: 28px;
  flex-shrink: 0;
  padding-top: 12px;
}

.filter-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #999;
  padding: 0 0 6px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.filter-btn:hover {
  color: #333;
}

.filter-btn.active {
  color: #111;
  border-bottom-color: #111;
}

/* ==========================================================================
   PROJECTS
   ========================================================================== */
.projects {
  display: flex;
  flex-direction: column;
}

.project {
  display: flex;
  align-items: center;
  gap: 56px;
  padding: 48px 0;
  border-bottom: 1px solid #e8e8e8;
  transition: opacity 0.25s ease;
}

.project:first-child {
  border-top: 1px solid #e8e8e8;
}

.project:nth-child(even) {
  flex-direction: row-reverse;
}

.project-image {
  flex: 1 1 52%;
  overflow: hidden;
  background: #f5f5f5;
  position: relative;
}

/* Carousel */
.carousel {
  position: relative;
  width: 100%;
  height: 340px;
  overflow: hidden;
}

.carousel-images {
  position: relative;
  width: 100%;
  height: 100%;
}

.carousel-images img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.carousel-images img.active {
  opacity: 1;
  pointer-events: auto;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #111;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease, background 0.2s ease;
  z-index: 5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.carousel:hover .carousel-btn {
  opacity: 1;
}

.carousel-btn:hover {
  background: #fff;
}

.carousel-btn.prev {
  left: 14px;
}

.carousel-btn.next {
  right: 14px;
}

.carousel-btn svg {
  width: 18px;
  height: 18px;
}

/* Project info */
.project-info {
  flex: 1 1 48%;
  padding: 8px 0;
}

.project-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.project-cat {
  font-size: 0.78rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
  margin-bottom: 22px;
}

.project-services {
  list-style: none;
  margin-bottom: 28px;
}

.project-services li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 7px;
  font-size: 0.88rem;
  color: #333;
  font-weight: 400;
}

.project-services li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 6px;
  height: 6px;
  background: var(--color-primary);
  border-radius: 50%;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-primary);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: gap 0.2s ease;
}

.project-link:hover {
  gap: 10px;
}

.project-link svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* ==========================================================================
   FOOTER (desde L&H)
   ========================================================================== */
.footer {
  background: var(--color-dark);
  color: rgba(255,255,255,0.7);
  padding: 3.5rem 0 1.5rem;
}

.footer-inner {
  width: 90%;
  max-width: 1100px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2.5rem;
}

.footer h3,
.footer h4 {
  color: var(--color-white);
  margin-bottom: 0.9rem;
  font-family: var(--font-heading);
}

.footer-tagline {
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.95rem;
}

.footer ul {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

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

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
}

/* ==========================================================================
   DRAWER DE CONTACTO (desde L&H)
   ========================================================================== */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.5);
  z-index: 1999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
}

.drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: -450px;
  width: 100%;
  max-width: 420px;
  height: 100vh;
  background: #fff;
  z-index: 2000;
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
  transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.drawer.open {
  right: 0;
}

.drawer-header {
  padding: 1.4rem 1.5rem;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-header h3 {
  margin: 0;
  font-size: 1.15rem;
  font-family: var(--font-heading);
}

.drawer-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: #666;
  line-height: 1;
}

.drawer-content {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.drawer-content > p {
  margin-bottom: 1.5rem;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.form-group {
  margin-bottom: 1.15rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.88rem;
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: var(--font-primary);
  font-size: 0.95rem;
}

.form-group textarea {
  resize: vertical;
}

.btn-primary {
  display: inline-block;
  padding: 0.95rem 2.2rem;
  background-color: var(--color-primary);
  color: var(--color-white) !important;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 3px;
  border: none;
  cursor: pointer;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
  transform: translateY(-2px);
}

.btn-block {
  display: block;
  width: 100%;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
  .container {
    padding: 0 24px;
  }

  .portfolio-content {
    padding-top: 110px;
    padding-bottom: 60px;
  }

  .portfolio-header {
    flex-direction: column;
    gap: 28px;
  }

  .header-text h1 {
    font-size: 2.4rem;
  }

  .filters {
    padding-top: 0;
    flex-wrap: wrap;
    gap: 20px;
  }

  .project,
  .project:nth-child(even) {
    flex-direction: column;
    gap: 28px;
    padding: 36px 0;
  }

  .project-image { width: 100%; flex: none; }
  .carousel { height: 280px; width: 100%; }

  .project-title {
    font-size: 1.5rem;
  }

  .carousel-btn {
    opacity: 0.85;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 480px) {
  .header-container {
    padding: 0 1rem;
  }

  .logo-img {
    height: 48px;
  }

  .header-text h1 {
    font-size: 2rem;
  }

  .intro {
    font-size: 0.9rem;
  }

  .carousel { height: 240px; width: 100%; }

  .carousel-btn {
    width: 34px;
    height: 34px;
  }

  .carousel-btn svg {
    width: 16px;
    height: 16px;
  }
}


/* --- Menús Desplegables (igual que Index) --- */
.dropdown {
    position: relative;
}
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    min-width: 220px;
    border-radius: 4px;
    z-index: 1001;
    border: 1px solid #eee;
}
.dropdown:hover .dropdown-menu {
    display: block;
    animation: fadeIn 0.2s ease-in-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.dropdown-menu li { padding: 0; }
.dropdown-menu a {
    display: block;
    padding: 0.75rem 1.4rem;
    color: #0f0f0f;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}
.dropdown-menu a:hover {
    background-color: #f7f7f7;
    color: #d90429;
    padding-left: 1.6rem;
}
.nav-link-standard {
    font-size: 0.95rem;
    font-weight: 500;
    color: #0f0f0f;
    position: relative;
}
.nav-link-standard::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #d90429;
    transition: width 0.3s ease;
}
.nav-link-standard:hover::after {
    width: 100%;
}
.logo-img {
    height: 70px !important;
    width: auto;
    object-fit: contain;
}
.header {
    padding: 1.1rem 0 !important;
}
.header-container {
    max-width: 1400px;
}
.nav-links {
    gap: 1.8rem !important;
}

/* Language Switcher ES | EN */
.lang-switcher { display: flex; align-items: center; gap: 6px; margin-left: 0.5rem; }
.lang-btn {
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.5px;
  color: var(--color-dark, #0f0f0f); padding: 4px 8px; border-radius: 3px;
  transition: color 0.2s ease, background 0.2s ease; text-decoration: none;
}
.lang-btn:hover { color: var(--color-primary, #d90429); }
.lang-btn.active { color: var(--color-primary, #d90429); background: rgba(217, 4, 41, 0.08); }
.lang-divider { color: #ccc; font-size: 0.75rem; user-select: none; }
@media (max-width: 992px) {
  .lang-switcher { margin-left: 0; margin-top: 0.5rem; justify-content: flex-start; }
  .nav-links .lang-btn { color: rgba(255,255,255,0.85) !important; font-size: 1rem; }
  .nav-links .lang-btn.active { color: #fff !important; background: rgba(217, 4, 41, 0.35); }
  .nav-links .lang-divider { color: rgba(255,255,255,0.4); }
}
