@import url('https://fonts.googleapis.com/css2?family=Libre+Franklin:wght@300;400;500;700;900&display=swap');

:root {
  --bg-color: #111111;
  --text-color: #e5e5e5;
  --accent-color: #9f2214; /* Red from Zarza */
  --nav-height: 100px;
  --footer-height: 480px;
}

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

body {
  font-family: 'Libre Franklin', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  overflow-x: hidden;
  /* To enable footer reveal effect, main background is slightly different or transparent so it's handled by main wrapper */
}

a {
  text-decoration: none;
  color: inherit;
}

p {
  font-size: 18px;
  line-height: 1.6;
}

/* --- NAVIGATION --- */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 3%;
  z-index: 100;
  pointer-events: none; /* Let clicks pass to background if no links */
}

/* Gradient shadow for header text visibility */
header::before {
  content: "";
  position: absolute;
  top: 0; left: 0; width: 100%;
  height: 160px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
  z-index: -1;
  pointer-events: none;
}

header > * {
  pointer-events: auto;
}

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

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-color);
  border-radius: 50% 0 50% 50%;
}

.logo-text {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1;
}

.logo-sub {
  font-size: 10px;
  letter-spacing: 5px;
  font-weight: 300;
}

nav ul {
  display: flex;
  gap: 40px;
  list-style: none;
}

nav ul li a {
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: color 0.3s;
}

nav ul li a:hover {
  color: var(--accent-color);
}

/* --- FOOTER REVEAL EFFECT --- */
/* The footer is fixed at the bottom with a lower z-index.
   The main wrapper slides over it with a bottom margin. */
.site-wrapper {
  position: relative;
  z-index: 10;
  background-color: var(--bg-color);
  min-height: 100vh;
  margin-bottom: var(--footer-height); /* Espacio exacto para revelar el footer */
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  transition: background-color 0.5s ease;
  transform: translateZ(0); /* Contiene los hijos fixed dentro del stacking context */
}

/* The home page does NOT have a top margin or footer margin */
body.home .site-wrapper {
  margin-bottom: 0;
  background: transparent;
  box-shadow: none;
}

footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--footer-height);
  background-color: #dedede;
  color: #111111;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 60px 5% 30px 5%;
}

.footer-top-columns {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.footer-col h4 {
  font-size: 11px;
  color: #888;
  margin-bottom: 25px;
  font-weight: 500;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 15px;
  color: #111111;
}

.footer-col ul li a:hover {
  text-decoration: underline;
}

.footer-mid-logo {
  display: flex;
  justify-content: flex-start;
  margin-top: -10px;
}

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

.logo-icon-large {
  width: 140px;
  height: 140px;
  background: var(--accent-color);
  border-radius: 50% 0 50% 50%;
}

.logo-text-large {
  font-size: 100px;
  font-weight: 900;
  letter-spacing: -4px;
  line-height: 0.8;
}

.logo-sub-large {
  font-size: 42px;
  letter-spacing: 16px;
  font-weight: 300;
  color: #111;
}

.header-logo-img {
  height: 65px;
  width: auto;
}

.footer-logo-img {
  max-width: 450px;
  width: 100%;
  height: auto;
}

.footer-bottom-bar {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid #ccc;
  padding-top: 15px;
  font-size: 11px;
  color: #666;
  font-weight: 500;
  margin-top: 30px;
}

/* --- UTILITIES --- */
.container {
  padding: 0 3%;
  width: 100%;
}

.pt-nav {
  padding-top: calc(var(--nav-height) + 40px);
}

.pb-section {
  padding-bottom: 160px;
}

.fullscreen-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

.video-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Oscurecimiento general por defecto */
  background: rgba(0, 0, 0, 0.6);
  z-index: -1;
  pointer-events: none;
}

/* --- HOME PAGE --- */
.home-content {
  position: absolute;
  bottom: 8%;
  left: 0;
  z-index: 10;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 3%;
  width: 100%;
}

.home-text {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
}

.home-content h1 {
  font-size: 9.5vw;
  font-weight: 900;
  text-transform: uppercase;
  line-height: 0.9;
  letter-spacing: -2px;
  white-space: normal;
  max-width: 100%;
}

.home-content p {
  margin-top: 10px;
  letter-spacing: 1px;
  white-space: normal;
  max-width: 100%;
}

.showreel-widget {
  width: 320px;
  background-color: #111111;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease;
  flex-shrink: 0;
  margin-bottom: 20px;
  text-decoration: none;
}

.showreel-widget:hover {
  transform: scale(1.05);
}

.showreel-thumb {
  position: relative;
  width: 100%;
  height: 180px;
}

.showreel-thumb img,
.showreel-preview-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
  transition: opacity 0.3s, transform 0.5s;
}

.showreel-widget:hover .showreel-thumb img,
.showreel-widget:hover .showreel-preview-video {
  opacity: 1;
  transform: scale(1.05);
}

/* Video Popup Container & Embed */
.video-popup-container {
  width: 90%;
  max-width: 1280px;
  max-height: 90vh;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,0.8);
}

.video-popup-embed {
  width: 100%;
  aspect-ratio: 16/9;
  background-color: #000;
}

.video-popup-embed iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.hidden {
  display: none !important;
}

.showreel-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.showreel-play-icon svg {
  width: 18px;
  height: 18px;
  fill: #e5e5e5;
  margin-left: 3px; /* visual center for play icon */
}

.showreel-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background-color: #111111;
}

.showreel-info span {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  color: #e5e5e5;
  letter-spacing: 0.5px;
}

.showreel-info svg.external-icon {
  width: 16px;
  height: 16px;
  stroke: #e5e5e5;
}

/* --- PROYECTOS PAGE --- */
.proyectos-header {
  margin-bottom: 40px;
}

.proyectos-header h1 {
  font-size: 7vw;
  font-weight: 900;
  text-transform: uppercase;
  line-height: 0.9;
  margin-bottom: 80px;
}

.staggered-text {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.staggered-text .left-align {
  align-self: flex-start;
  text-align: left;
}

.staggered-text .right-align {
  align-self: flex-end;
  text-align: right;
}

.view-toggles {
  display: flex;
  gap: 10px;
  font-size: 14px;
  text-transform: uppercase;
  color: #888;
}

.view-toggles span {
  cursor: pointer;
  transition: color 0.3s;
}

.view-toggles span:hover,
.view-toggles span.active {
  color: #e5e5e5;
  font-weight: 700;
}

.view-separator {
  color: #888;
}

/* List View */
.project-list-wrapper {
  width: 100%;
}

.project-list-header {
  display: flex;
  padding: 10px 0;
  border-bottom: 1px solid #333;
  color: #888;
  font-size: 14px;
  text-transform: uppercase;
}

.col-nombre {
  flex: 2;
}
.col-cliente {
  flex: 1;
}
.col-duracion {
  width: 100px;
  text-align: right;
}

.project-item {
  display: flex;
  padding: 20px 0;
  border-bottom: 1px solid #222;
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
  position: relative;
}

.project-item:hover {
  background-color: rgba(255, 255, 255, 0.95);
  color: #111111;
  border-bottom-color: transparent;
}

.video-bg-container {
  position: fixed; /* Contenido por el transform del site-wrapper */
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: 0; /* Detrás del contenido (proyectos-content es z-index: 2) */
  pointer-events: none;
  overflow: hidden;
}

.project-list-video-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.project-list-video-bg.active {
  opacity: 1;
}

/* Specific overlay for project list background */
#hover-video-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 1;
  pointer-events: none;
}

.site-wrapper.hovering #hover-video-overlay {
  opacity: 1;
}

/* Base site wrapper styling is solid, no transparency, elements inside stack over video bg */
/* Text content should be above the video layer */
.proyectos-content {
  position: relative;
  z-index: 2;
  background-color: transparent;
}


/* Grid View */
.project-grid-wrapper {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
  gap: 30px;
  margin-top: 40px;
  overflow-x: hidden;
}

.project-grid-wrapper.active {
  display: grid;
}

.project-list-wrapper.hidden {
  display: none;
}

.project-card {
  position: relative;
  background: #111111;
  border-radius: 8px;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.3s;
}

.project-card:hover {
  transform: translateY(-5px);
}

.project-card video,
.grid-preview-video,
.project-card img {
  width: 100%;
  aspect-ratio: 16/9;
  min-height: 350px;
  object-fit: cover;
  display: block;
  transition: transform 0.5s;
}

.project-card:hover video,
.project-card:hover .grid-preview-video,
.project-card:hover img {
  transform: scale(1.05);
}

.project-card-info {
  display: flex;
  justify-content: space-between;
  padding: 15px;
  font-size: 14px;
  color: #e5e5e5;
  background-color: #1a1a1a;
  position: relative;
  z-index: 10;
}

/* --- NOSOTROS PAGE --- */
.nosotros-hero {
  margin-bottom: 60px;
}

.nosotros-hero h1 {
  font-size: 10vw;
  font-weight: 900;
  text-transform: uppercase;
  line-height: 0.9;
}

.nosotros-intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid #333;
}

.nosotros-intro p {
  max-width: 600px;
  color: #ccc;
}

.btn-primary {
  background-color: var(--accent-color);
  color: #e5e5e5;
  padding: 15px 30px;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 4px;
  transition: background 0.3s;
}

.btn-primary:hover {
  background-color: #b71c1c;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 40px;
}

.service-card {
  background-color: #222222;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.service-card img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  object-position: center;
  margin: 0;
  padding: 0;
  background-color: transparent;
  border-radius: 0;
}

.service-card-content {
  padding: 80px 30px 40px 30px;
}

.service-card-content h3 {
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 25px;
  line-height: 1.2;
  letter-spacing: -0.5px;
  text-transform: uppercase;
}

.service-card-content p {
  color: #aaa;
}

.nosotros-footer-msg {
  margin-top: 100px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.nosotros-footer-msg h2 {
  font-size: 4vw;
  font-weight: 900;
  line-height: 1.1;
  max-width: 800px;
}

.nosotros-footer-msg h2 span.highlight {
  color: var(--accent-color);
}

.nosotros-footer-msg p {
  max-width: 800px;
  color: #888;
}

/* --- CONTACT SIDEBAR --- */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

.contact-sidebar {
  position: fixed;
  top: 0;
  right: -500px; /* Hidden by default */
  width: 100%;
  max-width: 500px; /* Same max width as per spec */
  height: 100vh;
  background-color: #e5e5e5;
  color: #111111;
  z-index: 1000;
  box-shadow: -5px 0 25px rgba(0,0,0,0.5);
  transition: right 0.4s cubic-bezier(0.8, 0, 0.2, 1);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.contact-sidebar.active {
  right: 0;
}

.contact-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 40px;
  border-bottom: 1px solid #eaeaea;
}

.contact-sidebar-header h2 {
  font-size: 24px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -1px;
}

.close-sidebar {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  color: #111111;
  transition: transform 0.3s;
}

.close-sidebar:hover {
  transform: scale(1.1);
}

.contact-sidebar-content {
  padding: 40px;
  flex: 1;
}

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

.contact-form label {
  display: block;
  font-size: 13px;
  color: #444;
  margin-bottom: 8px;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 15px;
  border: 1px solid #dcdcdc;
  border-radius: 4px;
  font-family: inherit;
  font-size: 15px;
  color: #111111;
  background-color: #e5e5e5;
  transition: border-color 0.3s;
  outline: none;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  border-color: #111111;
}

.contact-form textarea {
  resize: vertical;
  min-height: 120px;
}

.custom-select-wrapper {
  position: relative;
}

.custom-select-wrapper select {
  appearance: none;
  -moz-appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23111111' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 10px;
  cursor: pointer;
}

.contact-form .btn-submit {
  width: 100%;
  padding: 18px;
  background-color: #111111;
  color: #e5e5e5;
  border: none;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.3s;
  border-radius: 4px;
  margin-top: 10px;
}

.contact-form .btn-submit:hover {
  background-color: #222222;
}

.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 10px;
  margin-bottom: 20px !important;
}

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  cursor: pointer;
}

.checkbox-group label {
  font-size: 13px;
  color: #666;
  margin-bottom: 0;
  cursor: pointer;
}

.checkbox-group label a {
  color: var(--accent-color);
  text-decoration: underline;
}

.form-footer-note {
  font-size: 12px;
  color: #888;
  text-align: center;
  margin-top: 15px;
  font-style: italic;
}

/* --- VIDEO POPUP --- */
.video-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.95);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.video-popup-overlay.active {
  opacity: 1;
  visibility: visible;
}

.video-popup-player {
  width: 90%;
  max-width: 1280px;
  max-height: 90vh;
  background-color: #111111;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.8);
  outline: none;
}

.close-video-popup {
  position: absolute;
  top: 30px;
  right: 40px;
  background: none;
  border: none;
  color: #e5e5e5;
  font-size: 40px;
  cursor: pointer;
  z-index: 2010;
  transition: transform 0.3s;
}

.close-video-popup:hover {
  transform: scale(1.1);
}

/* --- MOBILE MENU --- */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 32px;
  height: 22px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1010;
  pointer-events: auto;
}

.mobile-menu-toggle span {
  width: 100%;
  height: 2px;
  background-color: #e5e5e5;
  transition: all 0.3s;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: translateY(10px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: translateY(-10px) rotate(-45deg);
}

@media (max-width: 900px) {
  .mobile-menu-toggle {
    display: flex;
  }
  #mainNav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    max-width: 300px;
    height: 100vh;
    background-color: #0c0c0c;
    padding-top: 120px;
    transition: right 0.4s ease;
    box-shadow: -5px 0 20px rgba(0,0,0,0.5);
    z-index: 1000;
    pointer-events: auto;
  }
  #mainNav.active {
    right: 0;
  }
  #mainNav ul {
    flex-direction: column;
    align-items: center;
    gap: 40px;
  }
  #mainNav ul li a {
    font-size: 20px;
    font-weight: 700;
  }
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .nosotros-intro {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }
  .nosotros-footer-msg {
    flex-direction: column;
    align-items: flex-start;
    gap: 25px;
  }
  .nosotros-footer-msg h2 {
    font-size: 8vw;
    line-height: 1.1;
  }
  .footer-top-columns {
    flex-wrap: wrap;
    gap: 30px;
  }
}

@media (max-width: 600px) {
  :root {
    --footer-height: 800px;
  }
  .services-grid {
    grid-template-columns: 1fr;
  }
  nav ul {
    gap: 15px;
  }
  .project-item .col-cliente, .project-list-header .col-cliente {
    display: none;
  }
  .contact-sidebar {
    max-width: 100%;
    right: -100%;
  }
  .contact-sidebar-header, .contact-sidebar-content {
    padding: 25px 20px;
  }
  .footer-top-columns {
    flex-direction: column;
    gap: 40px;
  }
  /* Grid view: single column on mobile */
  .project-grid-wrapper {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  .project-card video,
  .grid-preview-video,
  .project-card img {
    aspect-ratio: 16/9;
    width: 100%;
  }
  .proyectos-header h1 {
    font-size: 12vw;
  }
}

@media (max-width: 900px) {
  .home-content {
    flex-direction: column-reverse;
    align-items: flex-start;
  }
  .showreel-widget {
    margin-bottom: 30px;
    width: 250px;
  }
  .showreel-thumb {
    height: 140px;
  }
  .home-content h1 {
    font-size: 16vw; /* Fuerza a dos renglones pero manteniendo estilo grande */
    line-height: 1;
    margin-bottom: 5px;
  }
  .home-content p {
    font-size: 16px; /* Mejor escala para mobile sin desbordar */
  }
}



/* --- CONTACT FORM 7 INTEGRATION --- */
.wpcf7-form .form-group {
    margin-bottom: 25px;
}

.wpcf7-form label {
    display: block;
    font-size: 13px;
    color: #444;
    margin-bottom: 8px;
}

.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form select,
.wpcf7-form textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #dcdcdc;
    border-radius: 4px;
    font-family: inherit;
    font-size: 15px;
    color: #111111;
    background-color: #e5e5e5;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.wpcf7-form input:focus,
.wpcf7-form select:focus,
.wpcf7-form textarea:focus {
    border-color: #111111;
}

.wpcf7-form .btn-submit {
    width: 100%;
    padding: 18px;
    background-color: #111111;
    color: #e5e5e5;
    border: none;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 4px;
    margin-top: 10px;
    transition: background-color 0.3s;
}

.wpcf7-form .btn-submit:hover {
    background-color: #222222;
}

/* Fix for CF7 wrapper spans */
.wpcf7-form-control-wrap {
    display: block;
    width: 100%;
}

.wpcf7-list-item {
    margin: 0;
}

.wpcf7-form .checkbox-group label {
    display: inline;
    color: #666;
    cursor: pointer;
}

.wpcf7-form .checkbox-group a {
    color: var(--accent-color);
    text-decoration: underline;
}
