/* مصنع المهيدب — أنماط مخصصة فوق Tailwind */

:root {
  --charcoal: #1c1f24;
  --charcoal-deep: #121417;
  --surface: #22262c;
  --concrete: #8b9098;
  --concrete-light: #d5d8de;
  --accent: #f15a24;
  --accent-deep: #c2410c;
  --paper: #f6f5f2;
  --success: #1f8a4c;
}

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

html {
  scroll-behavior: smooth;
}

html,
body {
  overflow-x: clip;
  max-width: 100%;
  width: 100%;
}

body {
  background: var(--paper);
  color: var(--charcoal);
  -webkit-font-smoothing: antialiased;
}

img,
video,
iframe,
svg {
  max-width: 100%;
}

h1, h2, h3, p, li, label {
  overflow-wrap: break-word;
}

.desktop-nav {
  gap: 1.1rem;
}

.site-header .lang-btn {
  min-height: 28px;
}

section .grid > *,
footer .grid > * {
  min-width: 0;
}

@media (min-width: 1536px) {
  .desktop-nav { gap: 1.5rem; }
}

::selection {
  background: var(--accent);
  color: #fff;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  top: -3rem;
  z-index: 100;
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
}

.skip-link:focus {
  top: 1rem;
}

/* Navbar */
.site-header {
  transition: background 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease, border-color 0.3s ease;
}

.site-header.is-scrolled {
  background: rgba(18, 20, 23, 0.94);
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.28);
  border-bottom-color: rgba(241, 90, 36, 0.35);
}

.desktop-nav .nav-link {
  position: relative;
  padding: 0.4rem 0;
  color: rgba(255, 255, 255, 0.82);
  transition: color 0.25s ease;
}

.desktop-nav .nav-link:hover {
  color: var(--accent);
}

.desktop-nav .nav-link.is-current {
  color: #fff;
}

.desktop-nav .nav-link.is-current::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 2.5px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(241, 90, 36, 0.65);
}

.mobile-drawer .nav-link {
  border-inline-start: 3px solid transparent;
  padding-inline-start: 0.7rem;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.mobile-drawer .nav-link.is-current {
  color: var(--accent);
  border-inline-start-color: var(--accent);
}

/* Hero */
.hero-overlay {
  background:
    linear-gradient(180deg, rgba(12, 14, 16, 0.55) 0%, rgba(12, 14, 16, 0.35) 40%, rgba(12, 14, 16, 0.82) 100%),
    linear-gradient(90deg, rgba(12, 14, 16, 0.72) 0%, rgba(12, 14, 16, 0.28) 70%, rgba(12, 14, 16, 0.45) 100%);
}

[dir="ltr"] .hero-overlay {
  background:
    linear-gradient(180deg, rgba(12, 14, 16, 0.55) 0%, rgba(12, 14, 16, 0.35) 40%, rgba(12, 14, 16, 0.82) 100%),
    linear-gradient(270deg, rgba(12, 14, 16, 0.72) 0%, rgba(12, 14, 16, 0.28) 70%, rgba(12, 14, 16, 0.45) 100%);
}

.hero-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, transparent, #000 20%, #000 80%, transparent);
}

.safety-stripe {
  background: repeating-linear-gradient(
    -45deg,
    var(--accent),
    var(--accent) 10px,
    #1c1f24 10px,
    #1c1f24 20px
  );
}

.hero-content {
  animation: heroIn 1s ease both;
}

.hero-kicker,
.hero-title,
.hero-lead,
.hero-actions,
.hero-metrics {
  animation: fadeUp 0.9s ease both;
}

.hero-kicker { animation-delay: 0.1s; }
.hero-title { animation-delay: 0.22s; }
.hero-lead { animation-delay: 0.36s; }
.hero-actions { animation-delay: 0.5s; }
.hero-metrics { animation-delay: 0.7s; }

@keyframes heroIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.reveal-left {
  transform: translateX(28px);
}

[dir="ltr"] .reveal.reveal-left {
  transform: translateX(-28px);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Cards */
.img-zoom {
  overflow: hidden;
}

.img-zoom img,
.img-zoom .zoom-target {
  transition: transform 0.7s ease;
}

.img-zoom:hover img,
.img-zoom:hover .zoom-target {
  transform: scale(1.08);
}

.product-card:hover,
.service-card:hover,
.project-card:hover,
.equip-card:hover,
.quality-card:hover {
  transform: translateY(-6px);
}

.product-card,
.service-card,
.project-card,
.equip-card,
.quality-card,
.stat-card,
.contact-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

/* Mobile menu */
.menu-backdrop {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.menu-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer {
  transform: translateX(110%);
  transition: transform 0.35s ease;
}

[dir="ltr"] .mobile-drawer {
  transform: translateX(-110%);
}

.mobile-drawer.is-open {
  transform: translateX(0);
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Lightbox + Modal */
.overlay-panel {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.overlay-panel.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.overlay-dialog {
  transform: translateY(18px) scale(0.98);
  transition: transform 0.3s ease;
}

.overlay-panel.is-open .overlay-dialog {
  transform: none;
}

body.modal-open {
  overflow: hidden;
}

/* Form */
.form-field:focus-within label {
  color: var(--accent);
}

.field-error {
  border-color: #dc2626 !important;
}

.form-success {
  animation: fadeIn 0.4s ease;
}

/* WhatsApp + back to top */
.float-wa,
.back-to-top {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
}

.float-wa {
  bottom: calc(1rem + env(safe-area-inset-bottom));
  left: calc(0.9rem + env(safe-area-inset-left));
}

.back-to-top {
  bottom: calc(1rem + env(safe-area-inset-bottom));
  right: calc(0.9rem + env(safe-area-inset-right));
}

.back-to-top {
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease, background 0.25s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

/* Language */
.lang-btn.is-active {
  background: var(--accent);
  color: #fff;
}

/* Filters */
.filter-btn.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.project-card.is-hidden {
  display: none;
}

/* Map */
.map-frame {
  filter: grayscale(0.15) contrast(1.05);
}

/* Concrete texture */
.concrete-bg {
  background-color: #ecebe7;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(0, 0, 0, 0.035) 0, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(0, 0, 0, 0.03) 0, transparent 45%);
}

/* Forms: prevent iOS zoom + overflow */
input,
select,
textarea {
  font-size: 16px;
  max-width: 100%;
}

/* Filters */
.filter-row {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

/* Kickers on small screens */
@media (max-width: 639px) {
  [class*="tracking-"] {
    letter-spacing: 0.08em;
  }

  .hero-kicker {
    max-width: 100%;
  }
}

/* Touch: no hover lift that feels broken */
@media (hover: none) {
  .product-card:hover,
  .service-card:hover,
  .project-card:hover,
  .equip-card:hover,
  .quality-card:hover {
    transform: none;
  }

  .img-zoom:hover img,
  .img-zoom:hover .zoom-target {
    transform: none;
  }
}

@media (min-width: 1280px) {
  .mobile-drawer,
  .menu-backdrop {
    display: none !important;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .reveal { opacity: 1; transform: none; }
}
