* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Roboto', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
  color: #7A7A7A;
  background: #FFFFFF;
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }

.container { width: min(1100px, 92%); margin-inline: auto; }
.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } }

.site-header { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,0.9); backdrop-filter: saturate(180%) blur(8px); border-bottom: 1px solid #e2e8f0; }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: .6rem 0; }
.logo { width: 120px; height: auto; border-radius: 12px; }
@media (min-width: 1024px) { .logo { width: 160px; } }
@media (max-width: 480px) { .logo { width: 90px; } }

.menu-toggle { background: transparent; border: 0; padding: .3rem; border-radius: .5rem; color: #094BA2; display: inline-flex; align-items: center; justify-content: center; }
.menu-toggle:focus { outline: 2px solid #6EC1E4; outline-offset: 2px; }

.nav { display: flex; gap: 1rem; align-items: center; }
.nav-link { font-family: 'Montserrat', sans-serif; font-weight: 500; font-size: 16px; color: #094BA2; text-decoration: none; padding: .4rem .7rem; border-radius: .5rem; }
.nav-link:hover { color: #009846; background: #F1F5F9; }

/* Quick contact (hidden by default, shown in mobile) */
.nav-quick-contact { display: none; }
.nav-quick-contact-card { display: none; }
.nqc-actions { display: none; }
.qc-btn { display: inline-flex; align-items: center; gap: .45rem; text-decoration: none; font-weight: 700; border-radius: .6rem; padding: .6rem .8rem; border: 2px solid transparent; transition: .15s ease-in-out; }
.qc-btn svg { display: inline-block; }
.qc-btn.call { background: #61CE70; color: #fff; border-color: #61CE70; }
.qc-btn.call:hover { background: #53b960; border-color: #53b960; }
.qc-btn.email { background: #6EC1E4; color: #fff; border-color: #6EC1E4; }
.qc-btn.email:hover { background: #56b7df; border-color: #56b7df; }
.qc-btn.maps { background: #F1F5F9; color: #094BA2; border-color: #cbd5e1; }
.qc-btn.maps:hover { background: #E6F7FB; border-color: #61CE70; color: #094BA2; }

@media (max-width: 899px) {
  .header-inner { gap: .5rem; }
  .nav { position: absolute; left: 0; right: 0; top: 100%; background: #FFFFFF; border-bottom: 1px solid #e2e8f0; border-top: 1px solid #e2e8f0; box-shadow: 0 8px 20px rgba(15,23,42,.06); display: none; flex-direction: column; padding: .5rem; z-index: 20; }
  .nav a { padding: .7rem 1rem; }
  .site-header.open .nav { display: flex; }

  /* Quick contact visible only in mobile */
  .nav-quick-contact { display: grid; gap: .6rem; padding: .6rem; border-top: 1px dashed #e2e8f0; }
  .nav-quick-contact-card { display: block; border: 1px solid #e2e8f0; background: #F9F9F9; border-radius: .6rem; padding: .6rem .75rem; }
  .nav-quick-contact-card .nqc-title { margin: 0; font-weight: 700; color: #54595F; font-size: .95rem; }
  .nav-quick-contact-card .nqc-phone { margin: .15rem 0 0; font-size: 1rem; color: #094BA2; font-weight: 700; }
  .nqc-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
}

@media (min-width: 900px) {
  .menu-toggle { display: none; }
  .nav { display: flex; position: static; box-shadow: none; border: 0; padding: 0; flex-direction: row; }
}

.hero { display: grid; place-items: center; text-align: center; min-height: 60vh; }
.hero-bg { position: relative; background: #094BA2 url('images/hero/engranajes-hero-jgomez.jpg') center/cover no-repeat; }
.hero-overlay { width: 100%; height: 100%; padding: clamp(3rem, 8vw, 6rem) 0; background: rgba(0,0,0,0.6); color: #FFFFFF; display: grid; align-content: center; gap: 1rem; }
.hero-top { font-family: 'Roboto', sans-serif; font-weight: 700; font-size: 14px; margin: 0; opacity: .9; }
.hero-title { font-family: 'Roboto', sans-serif; font-weight: 700; font-size: clamp(2.2rem, 6vw, 3.25rem); letter-spacing: -0.02em; margin: 0; color: #FFFFFF; }
.hero-sub { font-family: 'Roboto Slab', serif; font-weight: 300; font-size: 18px; margin: 0 auto; max-width: 900px; color: #FFFFFF; opacity: .95; }

.cta { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; margin-top: .5rem; }
.btn { appearance: none; border: 2px solid #6EC1E4; color: #094BA2; background: #FFFFFF; padding: .7rem 1.1rem; border-radius: .6rem; font-weight: 700; text-decoration: none; cursor: pointer; transition: .15s ease-in-out; }
.btn:hover { background: #E6F7FB; border-color: #61CE70; color: #094BA2; }
.btn.primary { background: #6EC1E4; color: #FFFFFF; border-color: #6EC1E4; }
.btn.primary:hover { background: #61CE70; border-color: #61CE70; }

h1, h2, h3 { font-family: 'Roboto Slab', serif; color: #54595F; }
.section { padding: 4rem 0; }
.section-title { margin: 0 0 .25rem; font-size: clamp(1.6rem, 3.5vw, 2rem); }
.section-sub { margin: 0 0 1.25rem; color: #7A7A7A; font-weight: 300; }

.cards-3 .card h3 { margin: .2rem 0 .4rem; font-size: 1.1rem; }
.card { border: 1px solid #e2e8f0; border-radius: 12px; padding: 1rem; background: #FFFFFF; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.card p { margin: 0; color: #475569; }

.about { margin-top: 1.25rem; max-width: 85ch; margin-inline: auto; text-align: center; }
.about p { margin: 0 0 .8rem; }

.about-grid { display: grid; gap: 1.25rem; align-items: center; margin-top: 1.5rem; }
@media (min-width: 900px) { .about-grid { grid-template-columns: 1.2fr .8fr; gap: 2rem; } }
.about-text { text-align: left; margin-inline: 0; }
.about-media img { width: 100%; height: auto; border-radius: 12px; box-shadow: 0 6px 18px rgba(0,0,0,0.08); }

.section-spacious { padding: 4rem 0; }

.clients { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem 1rem; }
@media (min-width: 700px) { .clients { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.clients li { padding: .5rem .75rem; border: 1px solid #e2e8f0; border-radius: .6rem; color: #54595F; background: #F9F9F9; }
.quote { margin: 1rem 0 0; color: #54595F; font-style: italic; }

.contact { padding: 4rem 0; }
.contact-grid { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .contact-grid { grid-template-columns: 1fr 1fr; } }
.contact-form { display: grid; gap: .8rem; max-width: 640px; }
.contact-form input, .contact-form textarea { width: 100%; padding: .8rem 1rem; border: 1px solid #cbd5e1; border-radius: .6rem; font: inherit; color: inherit; background: #fff; }
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: #6EC1E4; box-shadow: 0 0 0 3px rgba(110,193,228,.25); }
.checkbox { display: flex; gap: .5rem; align-items: center; font-size: .95rem; }

/* Contact form enhanced styles */
.form-label { display: grid; gap: .35rem; font-weight: 500; color: #54595F; }
.form-control { width: 100%; padding: .8rem 1rem; border: 1px solid #cbd5e1; border-radius: .6rem; font: inherit; color: inherit; background: #fff; transition: border-color .15s ease, box-shadow .15s ease; }
.form-control:focus { outline: none; border-color: #6EC1E4; box-shadow: 0 0 0 3px rgba(110,193,228,.25); }
.form-control.has-error { border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,.15); }
.error-text { color: #ef4444; margin-top: -.2rem; margin-bottom: .4rem; display: block; }
.alert { border: 1px solid #e2e8f0; border-left-width: 4px; border-radius: .6rem; padding: .8rem 1rem; background: #FFFFFF; box-shadow: 0 1px 2px rgba(15,23,42,.04); margin-bottom: .8rem; }
.alert.success { border-left-color: #61CE70; }
.alert.error { border-left-color: #ef4444; }

/* Contact form layout helpers */
.form-card { border: 1px solid #e2e8f0; border-radius: 12px; padding: 1rem; background: #FFFFFF; box-shadow: 0 6px 18px rgba(0,0,0,0.05); }
.contact-form.two-col { grid-template-columns: 1fr; }
@media (min-width: 900px) { .contact-form.two-col { grid-template-columns: 1fr 1fr; column-gap: 1rem; } }
.span-2 { grid-column: 1 / -1; }
.contact-form.two-col .checkbox { align-items: flex-start; }

.map-embed iframe { width: 100%; height: 420px; border: 0; border-radius: 12px; box-shadow: 0 6px 18px rgba(0,0,0,0.08); }

.site-footer { border-top: 1px solid #e2e8f0; padding: 1.25rem 0; background: #F9F9F9; color: #334155; }
.site-footer p { margin: 0; text-align: center; }
.site-footer .social { margin-top: .6rem; display: flex; gap: .6rem; justify-content: center; }
.site-footer .social a { color: #094BA2; }
.site-footer .social a:hover { color: #009846; }
.legal-links { margin-top: .4rem; font-size: .95rem; }
.legal-links a { color: #094BA2; text-decoration: none; }
.legal-links a:hover { color: #009846; text-decoration: underline; }

/* Products: filters */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin: .75rem 0 1rem; }
.filter-btn { appearance: none; background: #F1F5F9; color: #094BA2; border: 1px solid #cbd5e1; padding: .45rem .8rem; border-radius: .6rem; font-weight: 700; cursor: pointer; transition: .15s ease-in-out; }
.filter-btn:hover { background: #E6F7FB; border-color: #61CE70; }
.filter-btn.active { background: #6EC1E4; color: #fff; border-color: #6EC1E4; }

/* Products: gallery items */
.products-grid { align-items: stretch; }
.gallery-item { position: relative; overflow: hidden; text-decoration: none; padding: 0; }
.gallery-item img { width: 100%; height: 220px; object-fit: cover; border-radius: 10px; transition: transform .35s ease; }
.gallery-item:hover img { transform: scale(1.04); }
.gallery-item .badge { position: absolute; inset: auto auto .6rem .6rem; background: rgba(9,75,162,.9); color: #fff; padding: .25rem .5rem; border-radius: .5rem; font-size: .8rem; font-weight: 700; box-shadow: 0 2px 6px rgba(2,6,23,.25); }

/* Lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(2,6,23,.7); display: none; align-items: center; justify-content: center; padding: 1rem; z-index: 50; }
.lightbox.open { display: flex; }
.lightbox-content { max-width: min(1000px, 92vw); background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 20px 40px rgba(2,6,23,.35); }
.lightbox-content img { width: 100%; height: auto; display: block; }
.lightbox-content figcaption { padding: 1rem 1rem 1.1rem; }
.lightbox-content h3 { margin: 0 0 .35rem; font-size: 1.25rem; color: #54595F; }
.lightbox-content p { margin: 0; color: #475569; }
.lightbox-close { position: absolute; top: .8rem; right: .8rem; background: #F1F5F9; color: #094BA2; border: 1px solid #cbd5e1; width: 40px; height: 40px; border-radius: 999px; font-size: 1.1rem; line-height: 1; cursor: pointer; display: grid; place-items: center; box-shadow: 0 8px 18px rgba(2,6,23,.2); }
.lightbox-close:hover { background: #E6F7FB; border-color: #61CE70; }

/* Pagination */
.pagination { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; }
.page-btn { appearance: none; background: #F1F5F9; color: #094BA2; border: 1px solid #cbd5e1; padding: .4rem .7rem; border-radius: .6rem; font-weight: 700; cursor: pointer; transition: .15s ease-in-out; }
.page-btn:hover { background: #E6F7FB; border-color: #61CE70; }
.page-btn.active { background: #6EC1E4; color: #fff; border-color: #6EC1E4; }
/* Lightbox prev/next */
.lightbox-prev, .lightbox-next { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(241,245,249,.9); color: #094BA2; border: 1px solid #cbd5e1; width: 44px; height: 44px; border-radius: 999px; font-size: 1.2rem; line-height: 1; cursor: pointer; display: grid; place-items: center; box-shadow: 0 8px 18px rgba(2,6,23,.2); }
.lightbox-prev { left: .8rem; }
.lightbox-next { right: .8rem; }
.lightbox-prev:hover, .lightbox-next:hover { background: #E6F7FB; border-color: #61CE70; }

/* Ofertas */
.offer-card { display: grid; gap: .6rem; }
.offer-card .offer-media { width: 100%; height: 200px; object-fit: cover; border-radius: 10px; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.offer-card .offer-media.placeholder { background: #F1F5F9; border: 1px dashed #cbd5e1; height: 200px; border-radius: 10px; }
.offer-card h3 { margin: .2rem 0 .2rem; font-size: 1.1rem; }
.offer-card p { margin: 0 0 .3rem; }

/* Floating contact FAB */
.fab-container { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: grid; gap: .5rem; justify-items: end; }
.fab-main { width: 56px; height: 56px; border-radius: 999px; border: 2px solid #6EC1E4; background: #6EC1E4; color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 10px 22px rgba(2,6,23,.25); transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease; }
.fab-main:hover { background: #61CE70; border-color: #61CE70; box-shadow: 0 14px 26px rgba(2,6,23,.3); }
.fab-icon { font-size: 24px; line-height: 1; }
.fab-menu { display: grid; gap: .4rem; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .18s ease, transform .18s ease; }
.fab-container.open .fab-menu { opacity: 1; pointer-events: auto; transform: translateY(0); }
.fab-item { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; font-weight: 700; border-radius: 999px; padding: .5rem .8rem; border: 1px solid #cbd5e1; background: #FFFFFF; color: #094BA2; box-shadow: 0 6px 16px rgba(2,6,23,.18); transition: transform .15s ease, background .15s ease, border-color .15s ease; }
.fab-item:hover { transform: translateY(-2px); background: #E6F7FB; border-color: #61CE70; }
.fab-item .fi { width: 22px; height: 22px; display: grid; place-items: center; line-height: 1; }
.fab-item.call { background: #61CE70; border-color: #61CE70; color: #fff; }
.fab-item.call:hover { background: #53b960; border-color: #53b960; }
.fab-item.wa { background: #25D366; border-color: #25D366; color: #fff; }
.fab-item.wa:hover { background: #1ebe59; border-color: #1ebe59; }
.fab-item.contact { background: #6EC1E4; border-color: #6EC1E4; color: #fff; }
.fab-item.contact:hover { background: #56b7df; border-color: #56b7df; }
@media (min-width: 900px) { .fab-container { right: 22px; bottom: 22px; } }

/* Pagination */
.pagination { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; }
.page-btn { appearance: none; background: #F1F5F9; color: #094BA2; border: 1px solid #cbd5e1; padding: .4rem .7rem; border-radius: .6rem; font-weight: 700; cursor: pointer; transition: .15s ease-in-out; }
.page-btn:hover { background: #E6F7FB; border-color: #61CE70; }
.page-btn.active { background: #6EC1E4; color: #fff; border-color: #6EC1E4; }
.page-btn:disabled { opacity: .5; cursor: not-allowed; }

/* Lightbox prev/next */
.lightbox-prev, .lightbox-next { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(241,245,249,.9); color: #094BA2; border: 1px solid #cbd5e1; width: 44px; height: 44px; border-radius: 999px; font-size: 1.2rem; line-height: 1; cursor: pointer; display: grid; place-items: center; box-shadow: 0 8px 18px rgba(2,6,23,.2); }
.lightbox-prev { left: .8rem; }
.lightbox-next { right: .8rem; }
.lightbox-prev:hover, .lightbox-next:hover { background: #E6F7FB; border-color: #61CE70; }
