/* ========================================= */
/* --- FUENTES Y VARIABLES --- */
/* ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800;900&family=Roboto:wght@300;400;500;700&display=swap');

:root {
  --primary: #1A5276;
  --primary-dark: #003355;
  --primary-light: #5D8AA8;
  --secondary: #2C3E50;
  --accent: #FFD700;
  --accent-hover: #e6c200;
  --light: #f4f6f7;
  --dark: #003355;
  --grey: #95a5a6;
  --font-heading: 'Montserrat', sans-serif;
  --font-body: 'Roboto', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--secondary);
  background-color: var(--light);
  line-height: 1.6;
  overflow-x: hidden;
  max-width: 100vw;
  position: relative;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary-dark);
  font-weight: 800;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

/* ========================================= */
/* --- TOP BAR --- */
/* ========================================= */
.top-bar {
  background: var(--primary-dark);
  color: #aaa;
  font-size: 0.85rem;
  padding: 10px 0;
  border-bottom: 1px solid #333;
  width: 100%;
}

.top-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-info span { margin-right: 20px; }
.top-info i, .top-social i { color: var(--accent); margin-right: 5px; }

.top-social a {
  color: #fff;
  margin-left: 15px;
  opacity: 0.7;
}

.top-social a:hover { opacity: 1; color: var(--accent); }

/* ========================================= */
/* --- HEADER & NAV --- */
/* ========================================= */
#main-header {
  background: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 15px 0;
  transition: 0.3s;
  width: 100%;
}

.header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ========================================= */
/* ✅ LOGO - RESPONSIVE --- */
/* ========================================= */
.header-logo {
  height: auto;
  width: 20%;
  max-width: 250px;
  min-width: 150px;
  display: block;
  transition: 0.3s;
  object-fit: contain;
}

.header-logo:hover {
  transform: scale(1.02);
  opacity: 0.95;
}

/* ========================================= */
/* --- NAVEGACIÓN --- */
/* ========================================= */
.nav-links {
  display: flex;
  gap: 30px;
  align-items: center;
}

.nav-links a {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--secondary);
  position: relative;
  text-transform: uppercase;
}

.nav-links a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -5px;
  left: 0;
  background-color: var(--accent);
  transition: 0.3s;
}

.nav-links a:hover::after, .nav-links a.active::after {
  width: 100%;
}

.btn-nav {
  background: var(--accent);
  color: var(--primary-dark) !important;
  padding: 10px 25px;
  border-radius: 2px;
  font-weight: 700;
}

.btn-nav:hover {
  background: var(--accent-hover);
  color: var(--primary-dark) !important;
}
.btn-nav::after { display: none; }

/* Burger Menu */
.burger { display: none; cursor: pointer; }
.burger div { width: 25px; height: 3px; background: var(--primary-dark); margin: 5px; transition: 0.3s; }

/* ========================================= */
/* ✅ HERO INTERNO --- */
/* ========================================= */
.page-hero {
  height: 50vh;
  min-height: 400px;
  background: url('imagens/aceros-fondo-especializado.jfif') center/cover fixed;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  overflow: hidden;
  width: 100%;
}

.page-hero .overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(135deg, rgba(0, 51, 85, 0.8) 0%, rgba(26, 82, 118, 0.9) 100%);
}

.page-hero .hero-content {
  position: relative;
  z-index: 2;
  animation: fadeInUp 1s ease-out;
  padding: 0 15px;
  max-width: 100%;
}

.page-hero h1 {
  font-size: 3.5rem;
  margin-bottom: 15px;
  text-shadow: 2px 2px 10px rgba(0,0,0,0.5);
  color: #fff;
  font-weight: 900;
}

.page-hero p {
  font-size: 1.4rem;
  font-weight: 400;
  opacity: 0.95;
}

/* ========================================= */
/* ✅ GALERÍA DE PRODUCTOS --- */
/* ========================================= */
.gallery-section {
  padding: 80px 0;
  background: #fff;
  overflow: hidden;
  width: 100%;
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
  padding: 0 15px;
}

.section-header h2 {
  font-size: 2.8rem;
  color: var(--primary-dark);
  font-weight: 800;
}

.divider {
  width: 80px;
  height: 4px;
  background: var(--accent);
  margin: 15px auto;
  border-radius: 2px;
}

.section-header p {
  color: #666;
  font-size: 1.2rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  padding: 0 15px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  cursor: pointer;
  transform: translateY(0);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.gallery-item:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.gallery-card {
  position: relative;
  overflow: hidden;
  height: 380px;
}

.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gallery-item:hover .gallery-img {
  transform: scale(1.15) rotate(2deg);
}

.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0, 51, 85, 0.85) 0%, rgba(26, 82, 118, 0.95) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.4s ease;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.overlay-content {
  text-align: center;
  color: #fff;
  padding: 30px;
  transform: translateY(20px);
  transition: all 0.4s ease 0.1s;
}

.gallery-item:hover .overlay-content {
  transform: translateY(0);
}

.overlay-content i {
  font-size: 3.5rem;
  color: var(--accent);
  margin-bottom: 20px;
  display: block;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.overlay-content h3 {
  font-size: 1.6rem;
  margin-bottom: 10px;
  color: #fff;
  font-weight: 800;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.overlay-content p {
  font-size: 1rem;
  opacity: 0.95;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* ========================================= */
/* ✅ LIGHTBOX MODAL --- */
/* ========================================= */
.lightbox {
  display: none;
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  animation: fadeIn 0.3s ease;
  overflow: hidden;
}

.lightbox.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img {
  max-width: 90%;
  max-height: 80vh;
  object-fit: contain;
  border: 4px solid var(--accent);
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: zoomIn 0.4s ease;
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: var(--accent);
  color: var(--primary-dark);
  border: none;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  font-size: 2.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  z-index: 10000;
  font-weight: bold;
}

.lightbox-close {
  top: 20px;
  right: 20px;
}

.lightbox-prev {
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: var(--accent-hover);
  transform: scale(1.15);
}

.lightbox-prev:hover {
  transform: translateY(-50%) scale(1.15);
}

.lightbox-next:hover {
  transform: translateY(-50%) scale(1.15);
}

.lightbox-caption {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 51, 85, 0.95);
  color: #fff;
  padding: 25px 50px;
  border-radius: 8px;
  text-align: center;
  border: 3px solid var(--accent);
  max-width: 80%;
}

.lightbox-caption h3 {
  font-size: 2rem;
  margin-bottom: 8px;
  color: var(--accent);
  font-weight: 800;
}

.lightbox-caption p {
  font-size: 1.2rem;
  opacity: 0.95;
}

/* ========================================= */
/* ✅ CTA SECTION --- */
/* ========================================= */
.cta-gallery {
  background: url('https://images.unsplash.com/photo-1581091226825-a6a2a5aee158?ixlib=rb-1.2.1&auto=format&fit=crop&w=1950&q=80') center/cover fixed;
  position: relative;
  padding: 100px 0;
  text-align: center;
  color: #fff;
  overflow: hidden;
  width: 100%;
}

.cta-gallery .overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 51, 85, 0.85);
}

.cta-gallery .container {
  position: relative;
  z-index: 2;
  padding: 0 15px;
}

.cta-gallery h2 {
  font-size: 2.8rem;
  margin-bottom: 15px;
  color: #fff;
  font-weight: 800;
}

.cta-gallery p {
  font-size: 1.3rem;
  margin-bottom: 40px;
  opacity: 0.9;
}

.cta-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 18px 40px;
  background: var(--accent);
  color: var(--primary-dark);
  font-family: var(--font-heading);
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 50px;
  font-size: 1.1rem;
  transition: all 0.3s;
  border: 2px solid var(--accent);
}

.btn-cta i {
  font-size: 1.3rem;
}

.btn-cta:hover {
  background: transparent;
  color: var(--accent);
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(255, 215, 0, 0.3);
}

.btn-cta.btn-secondary {
  background: transparent;
  color: #fff;
  border-color: #fff;
}

.btn-cta.btn-secondary:hover {
  background: #fff;
  color: var(--primary-dark);
}

/* ========================================= */
/* --- FOOTER --- */
/* ========================================= */
footer {
  background: var(--primary-dark);
  color: #fff;
  padding-top: 80px;
  overflow: hidden;
  width: 100%;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1.5fr 1fr;
  gap: 50px;
  padding-bottom: 60px;
  border-bottom: 1px solid #333;
}

.footer-logo {
  margin-bottom: 20px;
}

.footer-logo-img {
  height: 80px;
  width: auto;
  display: block;
  transition: 0.3s;
}

.footer-logo-img:hover {
  transform: scale(1.05);
}

.footer-col p { color: #aaa; margin-bottom: 20px; font-size: 0.95rem; }

.footer-legal span {
  background: #333;
  padding: 5px 10px;
  font-size: 0.8rem;
  border-radius: 4px;
  color: #fff;
}

.footer-col h3 {
  color: #fff;
  font-size: 1.2rem;
  margin-bottom: 25px;
  position: relative;
  padding-bottom: 10px;
  font-family: var(--font-heading);
  font-weight: 700;
}

.footer-col h3::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; width: 40px; height: 3px;
  background: var(--accent);
}

.contact-list li {
  margin-bottom: 15px;
  color: #aaa;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.contact-list li i { color: var(--accent); width: 20px; flex-shrink: 0; }

.social-circle-container { display: flex; gap: 15px; }

.social-circle-container a {
  width: 45px; height: 45px;
  border-radius: 50%;
  background: #333;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.2rem;
  transition: 0.3s;
  border: 2px solid transparent;
}

.social-circle-container a:hover {
  background: var(--accent);
  color: var(--primary-dark);
  border-color: var(--accent-hover);
  transform: translateY(-5px);
}

.small-text { font-size: 0.8rem; color: #555; margin-top: 20px; }

.footer-bottom {
  text-align: center;
  padding: 20px;
  background: #002244;
  color: #aaa;
  font-size: 0.85rem;
}

/* ========================================= */
/* --- ANIMACIONES --- */
/* ========================================= */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================= */
/* ✅ RESPONSIVE - MÓVILES Y TABLETS --- */
/* ========================================= */

/* Tablets y pantallas medianas */
@media screen and (max-width: 900px) {
  .page-hero h1 { font-size: 2.5rem; }
  .page-hero p { font-size: 1.2rem; }
  
  .header-logo {
    width: 35% !important;
    max-width: 200px;
    min-width: 120px;
  }
  
  .footer-logo-img { 
    height: 70px !important; 
    margin: 0 auto 20px auto; 
  }
  
  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
  }
  .gallery-card {
    height: 340px;
  }
  .overlay-content h3 {
    font-size: 1.4rem;
  }
  .overlay-content p {
    font-size: 0.95rem;
  }
  
  .lightbox-img {
    max-width: 95%;
    max-height: 70vh;
  }
  .lightbox-caption {
    padding: 20px 40px;
    bottom: 20px;
  }
  .lightbox-caption h3 {
    font-size: 1.6rem;
  }
  .lightbox-caption p {
    font-size: 1rem;
  }
  
  .cta-gallery h2 {
    font-size: 2.2rem;
  }
  .cta-gallery p {
    font-size: 1.1rem;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
    padding: 0 15px;
  }
  .footer-col h3::after {
    left: 50%;
    transform: translateX(-50%);
  }
  .contact-list li {
    justify-content: center;
  }
  .social-circle-container {
    justify-content: center;
  }
  
  .nav-links {
    position: absolute;
    right: 0px;
    height: 92vh;
    top: 8vh;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 70%;
    max-width: 300px;
    transform: translateX(100%);
    transition: transform 0.5s ease-in;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    padding-top: 50px;
    gap: 0;
  }
  
  .nav-links li {
    opacity: 0;
    margin: 20px 0;
    width: 100%;
    text-align: center;
  }
  
  .nav-links a {
    font-size: 1.1rem;
    padding: 10px 0;
    width: 100%;
  }
  
  .burger { display: block; }
  .nav-active { transform: translateX(0%); }
  
  .burger {
    position: relative;
    z-index: 1001;
  }
  
  .burger.toggle .line1 {
    transform: rotate(-45deg) translate(-5px, 6px);
  }
  .burger.toggle .line2 { opacity: 0; }
  .burger.toggle .line3 {
    transform: rotate(45deg) translate(-5px, -6px);
  }
  
  @keyframes navLinkFade {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0px); }
  }
}

/* Móviles pequeños */
@media screen and (max-width: 600px) {
  .page-hero {
    height: 40vh;
    min-height: 300px;
  }
  .page-hero h1 {
    font-size: 1.8rem;
    margin-bottom: 10px;
  }
  .page-hero p {
    font-size: 1rem;
  }
  
  .gallery-section, .cta-gallery {
    padding: 60px 0;
  }
  
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0 15px;
  }
  .gallery-card {
    height: 300px;
  }
  .gallery-item:hover {
    transform: translateY(-5px);
  }
  .gallery-item:hover .gallery-img {
    transform: scale(1.05);
  }
  .gallery-overlay {
    opacity: 0.3;
  }
  .gallery-item:hover .gallery-overlay {
    opacity: 1;
  }
  .overlay-content {
    padding: 25px;
  }
  .overlay-content i {
    font-size: 3rem;
  }
  .overlay-content h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
  }
  .overlay-content p {
    font-size: 0.9rem;
  }
  
  .lightbox-prev,
  .lightbox-next {
    display: none;
  }
  .lightbox-close {
    top: 10px;
    right: 10px;
    width: 45px;
    height: 45px;
    font-size: 2rem;
  }
  .lightbox-img {
    max-width: 100%;
    max-height: 60vh;
    border-width: 3px;
  }
  .lightbox-caption {
    padding: 18px 30px;
    bottom: 10px;
    width: 90%;
    max-width: 90%;
  }
  .lightbox-caption h3 {
    font-size: 1.3rem;
  }
  .lightbox-caption p {
    font-size: 0.9rem;
  }
  
  .cta-gallery h2 {
    font-size: 1.8rem;
  }
  .cta-gallery p {
    font-size: 1rem;
  }
  .btn-cta {
    padding: 15px 30px;
    font-size: 1rem;
    width: 100%;
    max-width: 300px;
  }
  
  .footer-logo-img {
    height: 60px !important;
  }
  .footer-col h3 {
    font-size: 1.1rem;
  }
  .footer-col p {
    font-size: 0.9rem;
  }
  .contact-list li {
    font-size: 0.9rem;
    justify-content: flex-start;
    flex-wrap: wrap;
    word-break: break-word;
  }
  .contact-list li i {
    width: 18px;
    font-size: 1rem;
  }
  .social-circle-container a {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  
  .container {
    padding: 0 15px;
  }
  
  .top-info span {
    margin-right: 10px;
    font-size: 0.75rem;
  }
  .top-social span {
    display: none;
  }
  
  .header-logo {
    width: 75% !important;
    max-width: 280px;
    min-width: 150px;
  }
}

/* Móviles muy pequeños */
@media screen and (max-width: 400px) {
  .page-hero h1 {
    font-size: 1.5rem;
  }
  .section-header h2 {
    font-size: 1.8rem;
  }
  .gallery-card {
    height: 260px;
  }
  .overlay-content h3 {
    font-size: 1.1rem;
  }
  .cta-gallery h2 {
    font-size: 1.5rem;
  }
  
  .header-logo {
    width: 85% !important;
    max-width: 250px;
    min-width: 140px;
  }
  
  .footer-logo-img {
    height: 55px !important;
  }
}

/* ========================================= */
/* ✅ CORRECCIONES FINALES - OVERFLOW MÓVIL */
/* ========================================= */

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  position: relative;
}

.container, 
.gallery-grid, 
.footer-grid, 
.lightbox {
  max-width: 100%;
  overflow: hidden;
}

img, video, iframe {
  max-width: 100%;
  height: auto;
  display: block;
}

.gallery-item,
.gallery-card {
  isolation: isolate;
}

.burger {
  position: relative;
  z-index: 1001;
}

.nav-links {
  max-width: 70%;
  overflow-x: hidden;
}