/* ===== RESET & BASE STYLES ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #9F1822;
  --text-color: #fff;
  --bg-color: #000;
  --transition-normal: all 0.3s ease;
  --transition-slow: all 0.5s ease;
  --container-max-width: 1200px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Roboto', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  line-height: 1.6;
}

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

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

/* ===== LOADER ===== */
.loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-color);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-logo {
  width: 80px;
  animation: pulse 1.5s infinite alternate;
}

@keyframes pulse {
  0% { opacity: 0.4; transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1.05); }
}

/* ===== PAGE TRANSITIONS ===== */
.page-transition {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-color);
  z-index: 900;
  transform: translateY(100%);
  transition: transform 0.8s ease;
}

/* ===== HEADER ===== */
header {
  background-color: var(--bg-color);
  padding: 1.5rem 2rem;
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  z-index: 100;
  transition: var(--transition-normal);
}

header.scrolled {
  padding: 1rem 2rem;
  background-color: rgba(0, 0, 0, 0.95);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.header-content {
  max-width: var(--container-max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.logo {
  z-index: 101;
}

.logo img {
  max-width: 60px;
  height: auto;
  transition: var(--transition-normal);
}

.logo:hover img {
  transform: scale(1.1);
}

/* Navigation */
.navbar .nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.navbar .nav-links li a {
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
  text-transform: uppercase;
  position: relative;
  transition: var(--transition-normal);
  padding: 0.5rem 0;
}

.navbar .nav-links li a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: var(--primary-color);
  transition: var(--transition-normal);
}

.navbar .nav-links li a:hover,
.navbar .nav-links li a.active {
  color: var(--primary-color);
}

.navbar .nav-links li a:hover::after,
.navbar .nav-links li a.active::after {
  width: 100%;
}

/* Mobile Menu */
.menu-toggle {
  display: none;
  cursor: pointer;
  z-index: 101;
}

.menu-toggle .bar {
  display: block;
  width: 25px;
  height: 3px;
  margin: 5px auto;
  background-color: var(--text-color);
  transition: var(--transition-normal);
}

/* Header Divider - REMOVED */
.header-divider {
  display: none;
}

/* ===== MAIN CONTENT ===== */
main {
  flex: 1;
  width: 100%;
  padding-top: calc(1.5rem * 2 + 60px);
}

.section {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s ease, transform 1s ease;
}

.section.appear {
  opacity: 1;
  transform: translateY(0);
}

/* Back Button */
.back-button-container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 1rem 2rem;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-color);
  font-weight: 700;
  transition: var(--transition-normal);
  margin-bottom: 1rem;
}

.back-button:hover {
  color: var(--primary-color);
  transform: translateX(-5px);
}

/* Section titles */
.section-title, .page-title {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  position: relative;
  display: inline-block;
  padding-bottom: 0.5rem;
}

.section-title::after, .page-title::after {
  content: '';
  position: absolute;
  width: 50px;
  height: 3px;
  background-color: var(--primary-color);
  bottom: 0;
  left: 0;
  transition: var(--transition-normal);
}

.section-title:hover::after, .page-title:hover::after {
  width: 100px;
}

/* ===== ABOUT SECTION ===== */
.about-section {
  display: flex;
  min-height: calc(100vh - 150px);
  padding: 2rem 0;
}

.about-text {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.text-content {
  max-width: 600px;
}

.about-text h1 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  position: relative;
  display: inline-block;
  padding-bottom: 0.5rem;
}

.about-text h1::after {
  content: '';
  position: absolute;
  width: 50px;
  height: 3px;
  background-color: var(--primary-color);
  bottom: 0;
  left: 0;
  transition: var(--transition-normal);
}

.about-text:hover h1::after {
  width: 100px;
}

.about-text p {
  font-size: 1.5rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.about-image {
  flex: 1;
  overflow: hidden;
}

.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-slow);
  filter: grayscale(0.2);
}

.about-section:hover .about-image img {
  filter: grayscale(0);
  transform: scale(1.02);
}

/* ===== SECTION DIVIDERS ===== */
.section-divider {
  position: relative;
  width: 100%;
  height: 300px;
  overflow: hidden;
}

.divider-image {
  width: 100%;
  height: 100%;
}

.divider-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-slow);
  transform: scale(1.05);
}

.section-divider:hover .divider-image img {
  transform: scale(1);
}

.divider-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.7));
}

/* ===== WORK SECTION ===== */
.work-section {
  padding: 5rem 2rem;
  text-align: center;
}

.work-categories {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2rem;
  max-width: var(--container-max-width);
  margin: 0 auto;
}

.work-category {
  flex: 1;
  min-width: 300px;
  max-width: 350px;
  height: 450px;
  position: relative;
  overflow: hidden;
  border-radius: 0;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  transition: var(--transition-normal);
}

.work-category:hover {
  transform: translateY(-10px);
}

.category-image {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.category-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.category-image:hover img {
  transform: scale(1.08);
}

.category-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: var(--transition-normal);
}

.category-image:hover .category-overlay {
  opacity: 1;
}

.category-overlay h2 {
  color: var(--text-color);
  font-size: 2rem;
  margin-bottom: 1rem;
  transform: translateY(-20px);
  transition: transform 0.5s ease;
}

.category-image:hover .category-overlay h2 {
  transform: translateY(0);
}

.view-more {
  display: inline-block;
  background-color: transparent;
  color: var(--text-color);
  border: 1px solid var(--primary-color);
  padding: 0.8rem 1.5rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-normal);
  transform: translateY(20px);
  opacity: 0;
  text-transform: uppercase;
}

.category-image:hover .view-more {
  transform: translateY(0);
  opacity: 1;
}

.view-more:hover {
  background-color: var(--primary-color);
  color: var(--text-color);
}

/* ===== CONNECT SECTION ===== */
.connect-section {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 5rem 2rem;
}

.connect-section h1 {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  position: relative;
  display: inline-block;
  padding-bottom: 0.5rem;
}

.connect-section h1::after {
  content: '';
  position: absolute;
  width: 50px;
  height: 3px;
  background-color: var(--primary-color);
  bottom: 0;
  left: 0;
  transition: var(--transition-normal);
}

.connect-section:hover h1::after {
  width: 100px;
}

.connect-container {
  display: flex;
  gap: 3rem;
  align-items: flex-start;
}

.contact-form {
  flex: 1;
}

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

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

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.8rem;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--text-color);
  font-family: 'Montserrat', sans-serif;
  transition: var(--transition-normal);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  background-color: rgba(255, 255, 255, 0.15);
}

.form-group textarea {
  min-height: 150px;
  resize: vertical;
}

.submit-btn {
  background-color: transparent;
  color: var(--text-color);
  border: 2px solid var(--primary-color);
  padding: 0.8rem 2rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-normal);
  text-transform: uppercase;
}

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

.connect-info {
  flex: 1;
  padding-top: 2rem;
}

.info-item {
  margin-bottom: 2rem;
}

.info-item h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

.info-item p {
  font-size: 1rem;
  line-height: 1.6;
}

.social-links {
  margin-top: 3rem;
}

.social-links h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.social-icons {
  display: flex;
  gap: 1.5rem;
}

.social-icons a {
  font-size: 1.8rem;
  transition: var(--transition-normal);
}

.social-icons a:hover {
  color: var(--primary-color);
  transform: translateY(-5px);
}

/* Form message on submission */
.form-message {
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 4px;
  display: none;
}

.form-message.success {
  background-color: rgba(39, 174, 96, 0.2);
  border: 1px solid #27ae60;
  color: #27ae60;
}

.form-message.error {
  background-color: rgba(231, 76, 60, 0.2);
  border: 1px solid #e74c3c;
  color: #e74c3c;
}

/* ===== FOOTER ===== */
footer {
  background-color: var(--primary-color);
  padding: 4rem 1rem;
  width: 100%;
}

.footer-content {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.footer-quote p {
  font-family: 'Roboto', sans-serif;
  font-weight: 900;
  color: #fff;
  font-size: 1.5rem;
  line-height: 1.1;
  text-transform: lowercase;
  letter-spacing: -1px;
  margin-bottom: 2rem;
}

.footer-logo img {
  width: 80px;
  height: auto;
  display: block;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: auto;
  filter: none;
  transition: var(--transition-normal);
}

.footer-logo:hover img {
  transform: scale(1.1);
}

/* ===== LIGHTBOX BASE STYLES ===== */
.lightbox {
  display: none;
  position: fixed;
  z-index: 10000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.lightbox.active {
  display: flex;
  opacity: 1;
}

.lightbox-content {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
}

.lightbox-vignette {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle at center,
    transparent 40%,
    rgba(0, 0, 0, 0.7) 100%
  );
  pointer-events: none;
  z-index: 10;
}

.close-lightbox {
  position: absolute;
  top: 20px;
  right: 25px;
  color: #fff;
  font-size: 35px;
  font-weight: bold;
  cursor: pointer;
  z-index: 1001;
  transition: var(--transition-normal);
}

.close-lightbox:hover {
  color: var(--primary-color);
}

.lightbox-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #fff;
  font-size: 3rem;
  cursor: pointer;
  z-index: 1001;
  transition: var(--transition-normal);
  padding: 1rem;
}

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

/* ===== RESPONSIVE STYLES ===== */
@media (max-width: 992px) {
  .about-section {
    flex-direction: column-reverse;
  }
  
  .about-text {
    padding: 2rem;
  }
  
  .about-image {
    height: 50vh;
  }
  
  .connect-container {
    flex-direction: column;
  }
  
  .connect-info {
    padding-top: 0;
  }
}

@media (max-width: 768px) {
  .header-content {
    padding: 1rem;
  }
  
  .menu-toggle {
    display: block;
  }
  
  .menu-toggle.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  
  .menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
  }
  
  .menu-toggle.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
  
  .navbar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: 0.5s;
    z-index: 99;
    text-align: center;
  }
  
  .navbar.active {
    left: 0;
  }
  
  .navbar .nav-links {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    width: 100%;
    padding: 0;
  }
  
  .navbar .nav-links li {
    width: 100%;
    text-align: center;
  }
  
  .navbar .nav-links li a {
    font-size: 1.5rem;
    display: inline-block;
    padding: 0.5rem 0;
  }
  
  .about-text p {
    font-size: 1.2rem;
  }
  
  .about-image {
    height: 40vh;
  }
  
  footer {
    padding: 3rem 1rem;
  }
}

/* --- FIX MOBILE UX: Tarjetas siempre visibles --- */
@media (max-width: 992px) {
  .category-overlay {
    opacity: 1 !important; /* Siempre visible */
    background: rgba(0, 0, 0, 0.4); /* Un poco más suave para que se vea la foto */
  }
  
  .category-overlay .view-more {
    opacity: 1 !important;
    transform: translateY(0) !important;
    background-color: rgba(0, 0, 0, 0.6); /* Fondo semi-transparente para leer mejor */
    border-color: #fff;
    margin-top: 10px;
  }
  
  /* Hacemos el botón más grande en móvil para facilitar el dedo */
  .category-overlay .view-more {
    padding: 1rem 2rem; 
  }
}