/* =========================================
   MR Energy Services – Stylesheet
   ========================================= */

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

:root {
  --yellow: #f5c518;
  --yellow-dark: #d4a800;
  --navy: #0d1b2a;
  --navy-mid: #1a2f45;
  --navy-light: #243a52;
  --gray-bg: #f4f6f9;
  --gray-text: #5a6a7a;
  --white: #ffffff;
  --text: #1a2535;
  --radius: 10px;
  --shadow: 0 4px 20px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.16);
  --transition: 0.25s ease;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

/* ---- Top announcement banner ---- */
.lang-banner {
  background: var(--yellow);
  color: var(--navy);
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 9px 16px;
  width: 100%;
}
/* Hide when the page is in Spanish — the whole site is already Spanish */
html[lang="es"] .lang-banner { display: none; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  line-height: 1.65;
  font-size: 16px;
  overflow-x: hidden;
  width: 100%;
}

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

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

ul { list-style: none; }

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  border: 2px solid transparent;
  text-align: center;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--yellow);
  color: var(--navy);
  border-color: var(--yellow);
  box-shadow: 0 4px 18px rgba(245,197,24,0.35);
}
.btn-primary:hover {
  background: var(--yellow-dark);
  border-color: var(--yellow-dark);
  box-shadow: 0 6px 24px rgba(245,197,24,0.5);
}
.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.7);
}
.btn-outline:hover {
  background: rgba(255,255,255,0.12);
  border-color: var(--white);
}
.btn--full { width: 100%; }

/* ---- SECTION LABELS ---- */
.section { padding: 90px 0; }
.section--gray { background: var(--gray-bg); }
.section--dark { background: var(--navy); color: var(--white); }

.section-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--yellow-dark);
  margin-bottom: 10px;
}
.section-label--light { color: var(--yellow); }

.section-title {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 18px;
  color: var(--navy);
}
.section-title--light { color: var(--white); }

.section-sub {
  font-size: 1.05rem;
  color: var(--gray-text);
  max-width: 600px;
  margin-bottom: 56px;
}

/* =========================================
   HEADER
   ========================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--navy);
  box-shadow: 0 2px 16px rgba(0,0,0,0.25);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 68px;
  min-width: 0;
}
.header-inner > * { min-width: 0; flex-shrink: 1; }
.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Mobile tap-to-call header link — hidden on desktop */
.header-phone-mobile {
  display: none;
}

/* Language toggle */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50px;
  color: rgba(255,255,255,0.8);
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 5px 12px;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  white-space: nowrap;
  min-height: 36px;
}
.lang-toggle:hover {
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.4);
  color: var(--white);
}
#lang-current { color: var(--yellow); }
.lang-sep { opacity: 0.4; }
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.logo-bolt {
  font-size: 1.7rem;
  color: var(--yellow);
  line-height: 1;
}
.logo-text {
  font-size: 1.15rem;
  color: var(--white);
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.logo-text strong { color: var(--yellow); font-weight: 800; }

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav a {
  color: rgba(255,255,255,0.8);
  font-weight: 500;
  font-size: 0.92rem;
  padding: 8px 14px;
  border-radius: 6px;
  transition: color var(--transition), background var(--transition);
}
.nav a:hover { color: var(--yellow); }
.nav-cta {
  background: var(--yellow) !important;
  color: var(--navy) !important;
  font-weight: 700 !important;
  border-radius: 50px !important;
  padding: 10px 22px !important;
}
.nav-cta:hover {
  background: var(--yellow-dark) !important;
  color: var(--navy) !important;
}

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

/* =========================================
   HERO
   ========================================= */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  background:
    linear-gradient(135deg, rgba(13,27,42,0.92) 0%, rgba(13,27,42,0.75) 60%, rgba(36,58,82,0.65) 100%),
    url('pictures/1000013963.JPG') center/cover no-repeat;
  color: var(--white);
  padding: 80px 0;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(13,27,42,0.2) 0%, rgba(13,27,42,0.55) 100%);
  pointer-events: none;
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 780px;
}
.hero-badge {
  display: inline-block;
  background: var(--yellow);
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 6px 18px;
  border-radius: 50px;
  margin-bottom: 24px;
}
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 22px;
  letter-spacing: -0.02em;
}
.hero h1 br { display: block; }
.hero-sub {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.88);
  max-width: 580px;
  margin-bottom: 36px;
  line-height: 1.7;
}
.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}
.hero-trust {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.75);
}
.hero-trust span { display: flex; align-items: center; gap: 6px; }

/* =========================================
   SERVICES
   ========================================= */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.service-card {
  background: var(--white);
  border: 1px solid #e5eaf0;
  border-radius: var(--radius);
  padding: 36px 30px;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}
.service-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}
.service-card--featured {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
  position: relative;
  overflow: hidden;
}
.service-card--featured::before {
  content: 'Most Popular';
  position: absolute;
  top: 18px;
  right: -24px;
  background: var(--yellow);
  color: var(--navy);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 36px;
  transform: rotate(35deg);
}
.service-card--featured li { color: rgba(255,255,255,0.85); }
.service-icon {
  font-size: 2.4rem;
  margin-bottom: 16px;
  line-height: 1;
}
.service-card h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 18px;
}
.service-card ul { display: flex; flex-direction: column; gap: 10px; }
.service-card li {
  font-size: 0.92rem;
  color: var(--gray-text);
  padding-left: 18px;
  position: relative;
}
.service-card li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--yellow-dark);
  font-weight: 700;
}
.service-card--featured li::before { color: var(--yellow); }

/* =========================================
   WHY US
   ========================================= */
.why-us {
  background: var(--navy);
  padding: 70px 0;
}
.why-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}
.why-item {
  text-align: center;
  color: var(--white);
}
.why-icon {
  font-size: 2.2rem;
  margin-bottom: 14px;
  line-height: 1;
}
.why-item h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--yellow);
  margin-bottom: 10px;
}
.why-item p {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.7);
  line-height: 1.6;
}

/* =========================================
   ABOUT
   ========================================= */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: center;
}
.about-text p {
  color: var(--gray-text);
  margin-bottom: 18px;
  font-size: 1rem;
}
.about-stats {
  display: flex;
  gap: 36px;
  margin: 36px 0 36px;
  padding: 28px 0;
  border-top: 1px solid #e5eaf0;
  border-bottom: 1px solid #e5eaf0;
}
.stat { display: flex; flex-direction: column; }
.stat-num {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
}
.stat-label {
  font-size: 0.82rem;
  color: var(--gray-text);
  margin-top: 4px;
}
.about-image {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  height: 500px;
}
.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* =========================================
   GALLERY
   ========================================= */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4/3;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.gallery-item:hover img { transform: scale(1.06); }
.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(13,27,42,0.9) 0%, transparent 100%);
  color: var(--white);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 24px 14px 12px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}
.gallery-item:hover .gallery-caption { transform: translateY(0); }

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.92);
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox.active { display: flex; }
.lightbox img {
  max-width: 90vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 12px 60px rgba(0,0,0,0.5);
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: var(--white);
  font-size: 2.4rem;
  cursor: pointer;
  line-height: 1;
  opacity: 0.8;
  transition: opacity var(--transition);
}
.lightbox-close:hover { opacity: 1; }

/* =========================================
   SERVICE AREAS
   ========================================= */
.areas-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-bottom: 28px;
}
.area-card {
  background: var(--gray-bg);
  border-radius: var(--radius);
  padding: 36px 32px;
  border-left: 4px solid var(--yellow);
}
.area-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 20px;
}
.area-card ul {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.area-card li {
  font-size: 0.9rem;
  color: var(--gray-text);
  padding-left: 14px;
  position: relative;
}
.area-card li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--yellow-dark);
  font-weight: 700;
}
.areas-note {
  text-align: center;
  color: var(--gray-text);
  font-size: 0.95rem;
}
.areas-note a {
  color: var(--yellow-dark);
  font-weight: 600;
  text-decoration: underline;
}

/* =========================================
   CONTACT
   ========================================= */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: start;
}
.contact-grid--solo {
  grid-template-columns: 1fr;
  max-width: 640px;
  margin: 0 auto;
}
.contact-grid--solo .contact-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.contact-intro {
  color: rgba(255,255,255,0.75);
  margin-bottom: 36px;
  font-size: 1rem;
}
.contact-details { display: flex; flex-direction: column; gap: 22px; }
.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  color: var(--white);
  text-decoration: none;
  transition: color var(--transition);
}
a.contact-item:hover { color: var(--yellow); }
.contact-icon {
  font-size: 1.5rem;
  line-height: 1;
  margin-top: 2px;
  flex-shrink: 0;
}
.contact-item div { display: flex; flex-direction: column; gap: 2px; }
.contact-item strong { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--yellow); }
.contact-item span { font-size: 0.95rem; color: rgba(255,255,255,0.85); }

.contact-form {
  background: var(--white);
  border-radius: var(--radius);
  padding: 40px 36px;
  box-shadow: var(--shadow-lg);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}
.form-group label {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #dde3ec;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.95rem;
  color: var(--text);
  background: #fafbfd;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  appearance: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--yellow-dark);
  box-shadow: 0 0 0 3px rgba(212,168,0,0.18);
  background: var(--white);
}
.form-group input.field-error,
.form-group select.field-error,
.form-group textarea.field-error {
  border-color: #e05252;
  box-shadow: 0 0 0 3px rgba(224,82,82,0.15);
}
.form-group textarea { resize: vertical; min-height: 100px; }
.form-note {
  font-size: 0.78rem;
  color: var(--gray-text);
  margin-top: 12px;
  text-align: center;
}
.form-success {
  display: none;
  background: #d4edda;
  color: #155724;
  border-radius: 8px;
  padding: 14px 20px;
  margin-top: 14px;
  font-weight: 600;
  text-align: center;
}
.form-success.visible { display: block; }

/* =========================================
   FOOTER
   ========================================= */
.site-footer {
  background: var(--navy-mid);
  color: rgba(255,255,255,0.65);
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  padding: 64px 24px 48px;
}
.footer-brand .logo { margin-bottom: 14px; }
.logo--light .logo-text { color: var(--white); }
.footer-brand p { font-size: 0.88rem; line-height: 1.7; }

.footer-links,
.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-links strong,
.footer-contact strong {
  color: var(--white);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}
.footer-links a,
.footer-contact a,
.footer-contact span {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.6);
  transition: color var(--transition);
}
.footer-links a:hover,
.footer-contact a:hover { color: var(--yellow); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 18px 24px;
}
.footer-bottom p {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.4);
  text-align: center;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 960px) {
  .services-grid { grid-template-columns: 1fr; max-width: 540px; margin: 0 auto; }
  .why-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .about-image { height: 340px; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; gap: 48px; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  /* Show tap-to-call phone in header on mobile */
  .header-phone-mobile {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--yellow);
    color: var(--navy);
    font-weight: 700;
    font-size: 0.82rem;
    padding: 8px 12px;
    border-radius: 50px;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 1;
    min-width: 0;
    transition: background var(--transition), transform var(--transition);
    min-height: 44px;
  }
  .header-phone-mobile:active {
    background: var(--yellow-dark);
    transform: scale(0.97);
  }
  .header-phone-icon { font-size: 1rem; flex-shrink: 0; }
  /* On very small screens hide the number, keep icon only */
  .header-phone-num { display: inline; }

  .nav { display: none; flex-direction: column; align-items: flex-start; gap: 0; }
  .nav.open {
    display: flex;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--navy);
    padding: 16px 24px 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    z-index: 99;
  }
  .nav.open a {
    padding: 14px 0;
    width: 100%;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    min-height: 48px;
    display: flex;
    align-items: center;
  }
  .nav-cta { margin-top: 12px; text-align: center; border-radius: 8px !important; justify-content: center; }
  .hamburger { display: flex; }
  .hero { min-height: 100svh; }
  .hero h1 br { display: none; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; text-align: center; }
  .hero-trust { flex-direction: column; gap: 10px; }
  .why-grid { grid-template-columns: 1fr; }
  .areas-grid { grid-template-columns: 1fr; }
  .area-card ul { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .form-row { grid-template-columns: 1fr; }
  .contact-form { padding: 28px 20px; }
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
  .section { padding: 64px 0; }
  /* Ensure touch targets are at least 44px */
  .btn { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; }
  .form-group input,
  .form-group select,
  .form-group textarea { min-height: 48px; font-size: 16px; /* prevents iOS zoom */ }
}

@media (max-width: 440px) {
  .gallery-grid { grid-template-columns: 1fr; }
  /* Very small phones: hide phone number text, keep icon only */
  .header-phone-num { display: none; }
  .header-phone-mobile { padding: 8px 10px; }
  /* Contact details single column on small phones */
  .contact-grid--solo .contact-details { grid-template-columns: 1fr; }
}
