/* ==========================================
   ROSCADOS Y PARTES INDUSTRIALES S.A. de C.V.
   ========================================== */

/* ── Galería slider infinito ── */
@keyframes scroll-left {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.gallery-slider-section {
  background: var(--navy);
  padding: 4rem 0;
  overflow: hidden;
}

.gallery-slider-header {
  text-align: center;
  margin-bottom: 2.5rem;
  padding: 0 1rem;
}

.gallery-slider-header h2 { color: #fff; font-size: 1.9rem; margin-bottom: .5rem; }
.gallery-slider-header .divider { background: var(--red); margin: .75rem auto; }
.gallery-slider-header p { color: rgba(255,255,255,.7); }

.gallery-slider-mask {
  -webkit-mask: linear-gradient(90deg, transparent 0%, #000 12%, #000 88%, transparent 100%);
  mask: linear-gradient(90deg, transparent 0%, #000 12%, #000 88%, transparent 100%);
  overflow: hidden;
}

.gallery-slider-track {
  display: flex;
  gap: 1.25rem;
  width: max-content;
  animation: scroll-left 28s linear infinite;
}

.gallery-slider-track:hover { animation-play-state: paused; }

.gallery-slide {
  flex-shrink: 0;
  width: 260px;
  height: 200px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
  transition: transform .3s ease, filter .3s ease;
}

.gallery-slide:hover {
  transform: scale(1.06);
  filter: brightness(1.12);
}

.gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Product card click hint ── */
.product-card { cursor: pointer; position: relative; transition: transform .2s, box-shadow .2s; }
.product-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,.15); }
.product-hint { display: block; font-size: .75rem; color: var(--red); margin-top: .4rem; font-weight: 600; opacity: 0; transition: opacity .2s; }
.product-card:hover .product-hint { opacity: 1; }

/* ── Modal de imagen ── */
.img-modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.75); z-index: 2000; align-items: center; justify-content: center; padding: 1rem; }
.img-modal.open { display: flex; }
.img-modal-content { background: #fff; border-radius: 12px; padding: 1.5rem; max-width: 640px; width: 100%; position: relative; text-align: center; }
.img-modal-content img { width: 100%; max-height: 420px; object-fit: contain; border-radius: 8px; }
.img-modal-content p { margin-top: .75rem; font-weight: 700; color: var(--navy); font-size: 1.1rem; }
.img-modal-close { position: absolute; top: .75rem; right: .75rem; background: var(--navy); color: #fff; border: none; border-radius: 50%; width: 32px; height: 32px; font-size: 1.2rem; cursor: pointer; line-height: 32px; }

:root {
  --navy:   #0d1f5c;
  --red:    #c41230;
  --white:  #ffffff;
  --light:  #f4f6fa;
  --gray:   #6c757d;
  --border: #dee2e6;
  --shadow: 0 2px 12px rgba(0,0,0,.12);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  color: #222;
  background: var(--white);
}

/* ── Nav slider (efecto píldora deslizante) ── */
.nav-links { position: relative; }
.nav-slider {
  position: absolute;
  background: var(--red);
  border-radius: 9999px;
  top: 50%;
  transform: translateY(-50%);
  height: 34px;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  transition: left .22s cubic-bezier(.4,0,.2,1), width .22s cubic-bezier(.4,0,.2,1), opacity .15s;
}
.nav-links li { position: relative; z-index: 1; }

/* ── Navbar ── */
.navbar {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.logo {
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
}

.logo-icon {
  width: 48px;
  height: 48px;
  background: var(--red);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--white);
  letter-spacing: -2px;
  line-height: 1;
}

.logo-text {
  color: var(--white);
  line-height: 1.2;
}
.logo-text strong { font-size: 1rem; display: block; }
.logo-text span   { font-size: .7rem; opacity: .85; }

.nav-links {
  display: flex;
  list-style: none;
  gap: .25rem;
}

.nav-links a {
  color: rgba(255,255,255,.88);
  text-decoration: none;
  padding: .5rem 1rem;
  border-radius: 4px;
  font-size: .92rem;
  font-weight: 500;
  transition: background .2s, color .2s;
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--red);
  color: var(--white);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: .25rem;
}
.hamburger span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: .3s;
}

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, var(--navy) 60%, #1a3a8f 100%);
  color: var(--white);
  padding: 5rem 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='20'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
}
.hero-content { position: relative; max-width: 800px; margin: 0 auto; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 800; line-height: 1.2; }
.hero h1 span { color: #e8324a; }
.hero p { margin-top: 1rem; font-size: 1.1rem; opacity: .9; }
.hero-badge {
  display: inline-block;
  background: var(--red);
  color: var(--white);
  padding: .35rem 1.1rem;
  border-radius: 20px;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  letter-spacing: .5px;
}
.hero-btns { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-top: 2rem; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.75rem;
  border-radius: 5px;
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  transition: transform .2s, box-shadow .2s;
  cursor: pointer;
  border: none;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.btn-red   { background: var(--red); color: var(--white); }
.btn-white { background: var(--white); color: var(--navy); }
.btn-outline { background: transparent; color: var(--white); border: 2px solid rgba(255,255,255,.5); }

/* ── Section shared ── */
.section { padding: 4.5rem 1.5rem; }
.section-alt { background: var(--light); }
.container { max-width: 1200px; margin: 0 auto; }

.section-header { text-align: center; margin-bottom: 3rem; }
.section-header h2 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  color: var(--navy);
  font-weight: 800;
}
.section-header p { color: var(--gray); margin-top: .5rem; font-size: 1rem; }
.divider {
  width: 60px;
  height: 4px;
  background: var(--red);
  border-radius: 2px;
  margin: .75rem auto 0;
}

/* ── Products grid ── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.25rem;
}
.product-card {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 1.75rem 1rem;
  text-align: center;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.product-card:hover {
  border-color: var(--red);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}
.product-icon { font-size: 2.2rem; margin-bottom: .75rem; }
.product-card h3 { font-size: 1rem; color: var(--navy); font-weight: 700; }

/* ── Thread tables ── */
.tables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}
.table-card {
  background: var(--white);
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.table-card-header {
  background: var(--navy);
  color: var(--white);
  padding: .9rem 1.25rem;
  font-weight: 700;
  font-size: .95rem;
  text-align: center;
  letter-spacing: .3px;
}
.table-wrapper { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .83rem;
}
th {
  background: var(--red);
  color: var(--white);
  padding: .55rem .6rem;
  text-align: center;
  font-weight: 600;
  font-size: .8rem;
}
td {
  padding: .45rem .6rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
tr:nth-child(even) td { background: #f8f9fc; }
tr:hover td { background: #eef1ff; }

/* ── Services list ── */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.service-card {
  background: var(--white);
  border-left: 5px solid var(--red);
  border-radius: 0 10px 10px 0;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.service-card h3 { color: var(--navy); font-size: 1.05rem; margin-bottom: .5rem; }
.service-card p  { color: var(--gray); font-size: .9rem; line-height: 1.6; }
.service-card ul { margin-top: .5rem; padding-left: 1.25rem; color: var(--gray); font-size: .9rem; }
.service-card ul li { margin-bottom: .25rem; }

/* ── Why us (nosotros) ── */
.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}
.value-card {
  text-align: center;
  padding: 2rem 1rem;
  border-radius: 10px;
  background: var(--white);
  box-shadow: var(--shadow);
}
.value-card .icon { font-size: 2.5rem; margin-bottom: 1rem; }
.value-card h3 { color: var(--navy); margin-bottom: .5rem; font-size: 1rem; }
.value-card p  { color: var(--gray); font-size: .88rem; line-height: 1.5; }

/* ── Contact ── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}
.contact-info h3 { color: var(--navy); font-size: 1.4rem; margin-bottom: 1.5rem; }
.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.contact-item .ci-icon {
  width: 42px;
  height: 42px;
  background: var(--red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--white);
  flex-shrink: 0;
}
.contact-item .ci-text strong { display: block; color: var(--navy); font-size: .9rem; }
.contact-item .ci-text span  { color: var(--gray); font-size: .88rem; }
.contact-item .ci-text a     { color: var(--red); text-decoration: none; }

.contact-form {
  background: var(--white);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 2rem;
}
.contact-form h3 { color: var(--navy); margin-bottom: 1.5rem; font-size: 1.2rem; }
.form-group { margin-bottom: 1.1rem; }
.form-group label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: .35rem;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: .65rem .85rem;
  border: 2px solid var(--border);
  border-radius: 6px;
  font-size: .9rem;
  font-family: inherit;
  transition: border-color .2s;
  outline: none;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { border-color: var(--navy); }
.form-group textarea { resize: vertical; min-height: 110px; }
.form-success {
  display: none;
  background: #d4edda;
  color: #155724;
  padding: 1rem;
  border-radius: 6px;
  text-align: center;
  font-weight: 600;
}

/* ── Page header (inner pages) ── */
.page-header {
  background: linear-gradient(135deg, var(--navy) 60%, #1a3a8f);
  color: var(--white);
  padding: 3.5rem 1.5rem;
  text-align: center;
}
.page-header h1 { font-size: clamp(1.6rem, 3vw, 2.5rem); font-weight: 800; }
.page-header p  { margin-top: .5rem; opacity: .85; font-size: 1rem; }
.breadcrumb { font-size: .8rem; opacity: .7; margin-bottom: .5rem; }
.breadcrumb a { color: inherit; text-decoration: none; }

/* ── Footer ── */
.footer {
  background: var(--navy);
  color: rgba(255,255,255,.8);
  padding: 3rem 1.5rem 1.5rem;
}
.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr;
  gap: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255,255,255,.15);
}
.footer h4 { color: var(--white); margin-bottom: 1rem; font-size: .95rem; }
.footer p  { font-size: .88rem; line-height: 1.7; }
.footer ul { list-style: none; }
.footer ul li { margin-bottom: .5rem; }
.footer ul a  { color: rgba(255,255,255,.75); text-decoration: none; font-size: .88rem; transition: color .2s; }
.footer ul a:hover { color: var(--white); }
.footer-bottom {
  max-width: 1200px;
  margin: 1.25rem auto 0;
  text-align: center;
  font-size: .8rem;
  opacity: .6;
}

/* ── WhatsApp floating button ── */
.whatsapp-btn {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  z-index: 9999;
  width: 60px;
  height: 60px;
  background: #25d366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37,211,102,.5);
  text-decoration: none;
  transition: transform .2s, box-shadow .2s;
  animation: wapulse 2.5s ease-in-out infinite;
}
.whatsapp-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(37,211,102,.6);
  animation: none;
}
.whatsapp-btn svg { width: 32px; height: 32px; fill: var(--white); }
.whatsapp-tooltip {
  position: absolute;
  right: calc(100% + 12px);
  background: #1a1a1a;
  color: var(--white);
  white-space: nowrap;
  font-size: .8rem;
  padding: .4rem .8rem;
  border-radius: 5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.whatsapp-tooltip::after {
  content: '';
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-left-color: #1a1a1a;
}
.whatsapp-btn:hover .whatsapp-tooltip { opacity: 1; }

@keyframes wapulse {
  0%,100% { box-shadow: 0 4px 20px rgba(37,211,102,.5); }
  50%      { box-shadow: 0 4px 32px rgba(37,211,102,.8); }
}

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

@media (max-width: 640px) {
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 70px;
    left: 0; right: 0;
    background: var(--navy);
    padding: 1rem;
    box-shadow: var(--shadow);
    gap: .25rem;
  }
  .nav-links.open { display: flex; }
  .hamburger { display: flex; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .hero { padding: 3.5rem 1.25rem; }
}
