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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #222;
  line-height: 1.6;
  background-color: #f5f5f5;
}

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

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

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  background: rgba(140, 0, 0, 0.95);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.navbar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.6rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
  font-weight: 600;
}

.nav-brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
  list-style: none;
}

.nav-links a {
  color: #ffeaea;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}

.nav-links a:hover {
  background: #fff;
  color: #900000;
  transform: translateY(-1px);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 999px;
}

@media (max-width: 768px) {
  .nav-links {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    flex-direction: column;
    background: rgba(140, 0, 0, 0.98);
    padding: 0.75rem 1.25rem 1rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease-out;
  }

  .nav-links.open {
    max-height: 260px;
  }

  .nav-toggle {
    display: flex;
  }
}

/* Hero */

.hero {
  margin-top: 64px;
  min-height: 75vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: linear-gradient(to bottom, rgba(0,0,0,0.55), rgba(0,0,0,0.75)), url("img/portada_hero.png");
  background-size: cover;
  background-position: center;
  color: #fff;
  text-align: center;
  padding: 3rem 1.5rem;
}

.hero-content {
  max-width: 800px;
  animation: fadeInUp 0.9s ease-out both;
}

.hero-logo {
  width: 140px;
  margin: 0 auto 1rem;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin-bottom: 0.75rem;
  letter-spacing: 1px;
}

.hero h2 {
  font-size: clamp(1.1rem, 2.2vw, 1.35rem);
  font-weight: 400;
  margin-bottom: 1.25rem;
  color: #ffe3e3;
}

.hero p {
  font-size: 0.98rem;
  margin-bottom: 1.5rem;
  color: #ffefef;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease, color 0.2s ease;
}

.btn-primary {
  background: #ffffff;
  color: #900000;
  box-shadow: 0 10px 25px rgba(0,0,0,0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(0,0,0,0.45);
}

.btn-outline {
  background: transparent;
  border: 1px solid #ffe3e3;
  color: #ffe3e3;
}

.btn-outline:hover {
  background: #ffe3e3;
  color: #900000;
}

/* Sections */

section {
  padding: 3.5rem 1.5rem;
}

.section-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.section-title {
  font-size: 1.6rem;
  color: #900000;
  margin-bottom: 0.5rem;
  text-align: center;
  letter-spacing: 0.5px;
}

.section-subtitle {
  text-align: center;
  margin-bottom: 2rem;
  color: #666;
  font-size: 0.95rem;
}

/* Services */

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
}

.card {
  background: #fff;
  border-radius: 18px;
  padding: 1.3rem 1.25rem 1.4rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
  border: 1px solid rgba(255,255,255,0.8);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border 0.18s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(0,0,0,0.14);
  border-color: rgba(144,0,0,0.15);
}

.card h3 {
  font-size: 1.05rem;
  color: #900000;
  margin-bottom: 0.45rem;
}

.card p {
  font-size: 0.9rem;
  color: #555;
}

/* Projects */

.projects-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 900px) {
  .projects-layout {
    grid-template-columns: 1fr;
  }
}

.projects-hero {
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0,0,0,0.18);
}

.projects-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.projects-list {
  display: grid;
  gap: 0.8rem;
}

.projects-item {
  background: #fff;
  border-radius: 14px;
  padding: 0.85rem 1rem;
  border-left: 4px solid #900000;
  box-shadow: 0 5px 15px rgba(0,0,0,0.06);
}

.projects-item h3 {
  font-size: 0.98rem;
  color: #900000;
  margin-bottom: 0.25rem;
}

.projects-item p {
  font-size: 0.88rem;
  color: #555;
}

/* Gallery */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.75rem;
}

.gallery-item {
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: #ddd;
}

.gallery-item img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.gallery-item::after {
  content: "Ver más";
  position: absolute;
  inset: auto 0 0 0;
  padding: 0.35rem 0.75rem;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  color: #fff;
  font-size: 0.75rem;
  text-align: right;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.gallery-item:hover img {
  transform: scale(1.04);
}

.gallery-item:hover::after {
  opacity: 1;
  transform: translateY(0);
}

/* Lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.lightbox.open {
  display: flex;
}

.lightbox-img {
  max-width: 90%;
  max-height: 85%;
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.7);
}

.lightbox-close {
  position: fixed;
  top: 16px;
  right: 16px;
  font-size: 2rem;
  color: #fff;
  cursor: pointer;
}

/* Machinery */

.machinery-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1.75rem;
}

@media (max-width: 900px) {
  .machinery-grid {
    grid-template-columns: 1fr;
  }
}

.machinery-text ul {
  padding-left: 1.2rem;
  font-size: 0.92rem;
  color: #444;
}

.machinery-text li {
  margin-bottom: 0.35rem;
}

.machinery-photo {
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(0,0,0,0.16);
}

/* About */

.about {
  background: radial-gradient(circle at top left, #ffe5e5, #f5f5f5 40%, #ffffff);
}

.about-content {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 2rem;
  align-items: center;
}

@media (max-width: 900px) {
  .about-content {
    grid-template-columns: 1fr;
  }
}

.about-highlight {
  background: #fff;
  border-radius: 18px;
  padding: 1.4rem 1.5rem;
  box-shadow: 0 10px 26px rgba(0,0,0,0.1);
  border-left: 4px solid #900000;
  font-size: 0.95rem;
  color: #444;
}

.about-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.badge {
  font-size: 0.78rem;
  background: #900000;
  color: #fff;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.about-stat {
  background: rgba(255,255,255,0.9);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  box-shadow: 0 8px 22px rgba(0,0,0,0.08);
}

.about-stat strong {
  display: block;
  font-size: 1.2rem;
  color: #900000;
}

/* Contact */

.contact {
  background: #111;
  color: #fff;
}

.contact-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 2rem;
}

@media (max-width: 900px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

.contact-info h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.contact-info p,
.contact-info li {
  font-size: 0.9rem;
  color: #eee;
}

.contact-info ul {
  list-style: none;
  margin-top: 0.4rem;
}

.contact-info li + li {
  margin-top: 0.25rem;
}

.contact-info a {
  color: #ffd6d6;
}

.contact-form {
  background: #181818;
  border-radius: 18px;
  padding: 1.3rem 1.3rem 1.5rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

label {
  font-size: 0.8rem;
  color: #bbb;
  display: block;
  margin-bottom: 0.25rem;
}

input, textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #333;
  background: #101010;
  color: #f5f5f5;
  padding: 0.6rem 0.7rem;
  font-size: 0.88rem;
  outline: none;
  transition: border 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input:focus,
textarea:focus {
  border-color: #ffb3b3;
  box-shadow: 0 0 0 1px #ffb3b3;
  background: #151515;
}

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

/* Social / embeds */

.social-embed {
  margin-top: 1rem;
  font-size: 0.85rem;
}

.social-embed iframe {
  border: none;
  width: 100%;
  max-width: 340px;
  height: 260px;
}

/* Footer */

footer {
  background: #080808;
  color: #aaa;
  font-size: 0.78rem;
  padding: 0.9rem 1.5rem 1.1rem;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
}

footer a {
  color: #ffd6d6;
}

/* WhatsApp floating */

.whatsapp-float {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
}

.whatsapp-float a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  font-size: 1.6rem;
  box-shadow: 0 12px 30px rgba(0,0,0,0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.whatsapp-float a:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 16px 36px rgba(0,0,0,0.6);
}

/* Animations */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
