/* Alfaihaa — JDCO-inspired corporate layout */

:root {
  --color-primary: #0c4a6e;
  --color-primary-dark: #083552;
  --color-accent: #c9a227;
  --color-accent-hover: #b08e1f;
  --color-bg: #f4f6f8;
  --color-surface: #ffffff;
  --color-header: #f9f7eb;
  --color-header-border: #e5e0d4;
  --color-text: #2c3e50;
  --color-muted: #5a6b7d;
  --color-border: #dde3ea;
  --color-footer: #1a2b3c;
  --font-sans: "Segoe UI", "Noto Sans Arabic", Tahoma, system-ui, sans-serif;
  --max-width: 1140px;
  --radius: 4px;
  --shadow: 0 8px 32px rgba(12, 74, 110, 0.1);
  --text-body: 1.05rem;
}

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

html {
  scroll-behavior: smooth;
  font-size: 18px;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.8;
  color: var(--color-text);
  background: var(--color-bg);
}

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

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  color: var(--color-accent-hover);
}

/* Header — warm cream to match logo artwork */
.site-header {
  background: var(--color-header);
  border-bottom: 1px solid var(--color-header-border);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 1px 8px rgba(42, 35, 22, 0.06);
  direction: ltr;
}

.header-inner {
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  padding-right: 5.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 4.75rem;
}

.brand {
  display: block;
  flex-shrink: 0;
  line-height: 0;
}

.brand-logo {
  display: block;
  object-fit: contain;
}

.brand-logo-wide {
  height: clamp(52px, 5vw, 60px);
  width: auto;
  max-width: min(400px, 62vw);
}

.brand-logo-mark {
  display: none;
  height: clamp(48px, 12vw, 54px);
  width: clamp(48px, 12vw, 54px);
}

.header-end {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 0;
}

html[lang="ar"] .header-end {
  direction: rtl;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  color: var(--color-text);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.4rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--color-primary);
  border-bottom-color: var(--color-accent);
}

.lang-switch {
  position: absolute;
  top: 50%;
  right: 1.5rem;
  transform: translateY(-50%);
  display: flex;
  gap: 0;
  direction: ltr;
  width: auto;
  min-width: 4.5rem;
  border: 1px solid var(--color-header-border);
  border-radius: var(--radius);
  overflow: hidden;
  z-index: 2;
  background: var(--color-header);
}

.lang-switch button {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.4rem 0.55rem;
  border: none;
  cursor: pointer;
  background: transparent;
  color: var(--color-muted);
  transition: background 0.15s, color 0.15s;
}

.lang-switch button.is-active {
  background: var(--color-primary);
  color: #fff;
}

.lang-switch button:not(.is-active):hover {
  background: rgba(255, 255, 255, 0.55);
  color: var(--color-primary);
}

main {
  min-height: 50vh;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Hero slider */
.hero-slider {
  position: relative;
  min-height: min(72vh, 560px);
  background: var(--color-primary-dark);
  overflow: hidden;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  padding: 3rem 1.5rem;
}

.hero-slide.is-active {
  opacity: 1;
  z-index: 1;
}

.hero-slide-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
}

.hero-slide-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(8, 53, 82, 0.55),
    rgba(8, 53, 82, 0.82)
  );
}

.hero-slide-inner {
  position: relative;
  z-index: 2;
  max-width: 820px;
}

.hero-slide h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.6rem, 4.5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.25;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}

.hero-slide p {
  margin: 0;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  opacity: 0.95;
}

.hero-dots {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  gap: 0.5rem;
  direction: ltr;
}

.hero-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: transparent;
  padding: 0;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s, background 0.2s;
}

.hero-dot.is-active,
.hero-dot:hover {
  opacity: 1;
  background: var(--color-accent);
  border-color: var(--color-accent);
}

/* Sections */
.section {
  padding: 4rem 0;
}

.section-alt {
  background: var(--color-surface);
}

.section-heading {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-heading h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  font-weight: 700;
  color: var(--color-primary);
}

.section-heading .accent-line {
  display: block;
  width: 60px;
  height: 3px;
  background: var(--color-accent);
  margin: 0.75rem auto 0;
}

.intro-block {
  max-width: 900px;
  margin: 0 auto 1rem;
  text-align: center;
  font-size: var(--text-body);
  color: var(--color-muted);
  line-height: 1.9;
}

.intro-block:last-child {
  margin-bottom: 0;
}

/* Home — prominent phone & location */
.home-contact-strip {
  padding: 3rem 0;
  background: var(--color-surface);
  border-block: 1px solid var(--color-border);
}

.home-contact-reach-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
  max-width: 720px;
  margin: 0 auto 2.5rem;
}

.home-contact-reach-card {
  text-align: center;
  padding: 1.75rem 1.25rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.home-contact-reach-card h3 {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-primary);
}

.home-contact-reach-card .email-link {
  margin-top: 0;
  white-space: nowrap;
  word-break: normal;
  font-size: clamp(0.95rem, 2.2vw, 1.2rem);
}

.home-contact-reach-card .phone-link {
  white-space: nowrap;
  font-size: clamp(1.2rem, 3vw, 1.55rem);
}

a[href^="tel:"],
.phone-link {
  direction: ltr;
  unicode-bidi: isolate;
}

.phone-link {
  display: block;
  font-size: clamp(1.45rem, 4vw, 2.1rem);
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
  margin-bottom: 0.35rem;
  line-height: 1.3;
}

a[href^="tel:"]:not(.phone-link) {
  display: inline-block;
}

.phone-link:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

a[href^="mailto:"],
.email-link {
  direction: ltr;
  unicode-bidi: isolate;
}

.email-link {
  display: block;
  font-size: clamp(1.05rem, 2.5vw, 1.35rem);
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  margin-top: 1rem;
  word-break: break-all;
}

.email-link:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

.phone-link-inline,
.email-link-inline {
  font-size: clamp(1.35rem, 3vw, 1.65rem);
  margin: 0;
}

.phone-link-inline {
  white-space: nowrap;
}

.email-link-inline {
  white-space: nowrap;
  word-break: normal;
}

.location-maps-block {
  max-width: 1000px;
  margin: 0 auto;
}

.location-maps-heading {
  margin: 0 0 1.25rem;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-primary);
}

.location-maps-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.location-maps-grid-page {
  max-width: 1000px;
  margin: 0 auto;
}

.location-map-card {
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.location-map-label {
  display: block;
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  background: var(--color-primary);
  text-align: center;
}

.location-map-frame {
  padding: 0.5rem;
  background: #e8edf2;
  line-height: 0;
}

.location-map-frame img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 2px;
}

.location-map-card figcaption {
  margin: 0;
  padding: 1rem 1.1rem 1.15rem;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--color-muted);
  text-align: center;
  flex: 1;
}

.location-section {
  margin-top: 2.5rem;
}

@media (max-width: 768px) {
  .location-maps-grid {
    grid-template-columns: 1fr;
  }
}

.mission-block {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.mission-block h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  color: var(--color-primary);
}

.mission-block p {
  margin: 0;
  color: var(--color-muted);
  font-size: 1.05rem;
  line-height: 1.9;
}

/* Values grid (قيمنا) */
.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.value-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.value-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(12, 74, 110, 0.14);
}

.value-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #cbd5e1;
}

.value-card-body {
  padding: 1.5rem 1.25rem 1.75rem;
}

.value-card h3 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  color: var(--color-primary);
}

.value-card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-muted);
  line-height: 1.7;
}

/* Product feature rows */
.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  margin-bottom: 4rem;
}

.feature-row:last-child {
  margin-bottom: 0;
}

.feature-row.reverse .feature-media {
  order: 2;
}

.feature-row.reverse .feature-text {
  order: 1;
}

.feature-media img {
  width: 100%;
  border-radius: var(--radius);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #cbd5e1;
  box-shadow: var(--shadow);
}

.feature-text h3 {
  margin: 0 0 0.75rem;
  font-size: 1.4rem;
  color: var(--color-primary);
}

.feature-text p {
  margin: 0 0 1rem;
  color: var(--color-muted);
}

.link-more {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
}

.link-more:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

/* Product cards home */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.75rem;
}

.card {
  background: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow);
  transition: transform 0.2s;
}

.card:hover {
  transform: translateY(-3px);
}

.card-image {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
  background: #cbd5e1;
}

.card-body {
  padding: 1.35rem;
}

.card-body h3 {
  margin: 0 0 0.5rem;
  color: var(--color-primary);
  font-size: 1.15rem;
}

.card-body p {
  margin: 0 0 0.75rem;
  color: var(--color-muted);
  font-size: 0.95rem;
}

/* CTA band */
.cta-band {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  text-align: center;
  padding: 3.5rem 1.5rem;
}

.cta-band h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
}

.cta-band p {
  margin: 0 0 1.5rem;
  opacity: 0.92;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--color-accent);
  color: #1a2b3c;
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  text-decoration: none;
  color: #1a2b3c;
}

.btn-outline-light {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.85);
  margin-inline-start: 0.5rem;
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.12);
  text-decoration: none;
  color: #fff;
}

/* Inner page banner — same type scale + similar height as home hero */
.page-banner {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  padding: 3rem 1.5rem;
  min-height: min(55vh, 480px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.page-banner .container {
  width: 100%;
  max-width: 820px;
}

.page-banner h1 {
  margin: 0;
  font-size: clamp(1.6rem, 4.5vw, 2.75rem);
  font-weight: 600;
  line-height: 1.25;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}

.page-banner p {
  margin: 0.75rem 0 0;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  opacity: 0.92;
  line-height: 1.5;
}

.section-title {
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--color-primary);
}

.section-lead {
  color: var(--color-muted);
  margin: 0 0 2rem;
  max-width: 900px;
  font-size: var(--text-body);
  line-height: 1.9;
}

.prose {
  max-width: 900px;
  margin-inline: auto;
  font-size: var(--text-body);
  line-height: 1.9;
}

.prose p {
  margin: 0 0 1rem;
  color: var(--color-muted);
}

.prose ul {
  margin: 0 0 1rem;
  padding-inline-start: 1.25rem;
  color: var(--color-muted);
}

.prose-centered {
  text-align: center;
}

.prose-centered ul {
  list-style-position: inside;
  padding-inline-start: 0;
}

.prose code {
  font-size: 0.9em;
  background: #e8edf2;
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

.product-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
  margin-bottom: 3.5rem;
  padding-bottom: 3.5rem;
  border-bottom: 1px solid var(--color-border);
}

.product-block:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.product-image-wrap img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #cbd5e1;
}

.product-text h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.35rem, 3vw, 1.5rem);
  font-weight: 700;
  color: var(--color-primary);
}

.product-text p {
  font-size: var(--text-body);
  line-height: 1.85;
}

.product-text ul {
  margin: 0;
  padding-inline-start: 1.25rem;
  color: var(--color-muted);
  font-size: var(--text-body);
  line-height: 1.85;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.75rem;
}

.contact-card {
  background: var(--color-surface);
  padding: 1.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow);
}

.contact-card h3 {
  margin: 0 0 1rem;
  color: var(--color-primary);
  font-size: 1.15rem;
  font-weight: 700;
}

.contact-card p,
.contact-card address {
  margin: 0 0 0.75rem;
  font-style: normal;
  color: var(--color-muted);
  font-size: var(--text-body);
  line-height: 1.85;
}

.map-placeholder {
  aspect-ratio: 16 / 9;
  background: #e2e8f0;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  border: 1px dashed var(--color-border);
}

/* Footer — JDCO-style multi-column */
.site-footer {
  background: var(--color-footer);
  color: rgba(255, 255, 255, 0.88);
  padding: 3rem 1.5rem 0;
  margin-top: 0;
}

.footer-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-logo {
  display: block;
  height: 56px;
  width: 56px;
  margin-bottom: 1rem;
  border-radius: 10px;
}

.footer-brand p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.7;
  opacity: 0.85;
}

.footer-col h4 {
  margin: 0 0 1rem;
  font-size: 1rem;
  color: #fff;
  font-weight: 700;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-col li {
  margin-bottom: 0.5rem;
}

.footer-col a {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
}

.footer-col a:hover {
  color: var(--color-accent);
}

.footer-contact p {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}

.phone-link-footer {
  display: inline-block;
  font-size: inherit;
  font-weight: inherit;
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
}

.phone-link-footer:hover {
  color: var(--color-accent);
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.25rem 0 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.75;
}

.img-placeholder {
  background: linear-gradient(145deg, #b8c5d0, #94a3b8);
  min-height: 120px;
}

/* Pipe catalogue */
.catalogue-back {
  margin: 0 0 1rem;
  font-size: 0.95rem;
}

.catalogue-back a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.catalogue-back a:hover {
  color: #fff;
}

.catalogue-section {
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
}

.catalogue-diagrams {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.catalogue-figure {
  margin: 0;
  text-align: center;
}

.catalogue-figure img {
  margin: 0 auto;
  max-height: 220px;
  width: auto;
  object-fit: contain;
}

.catalogue-figure figcaption {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.catalogue-table-heading {
  margin: 0 0 1.25rem;
  font-size: 1.35rem;
  color: var(--color-primary);
  text-align: center;
}

.catalogue-table-wrap {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow);
}

.catalogue-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.catalogue-table {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  min-width: 0;
  border-collapse: collapse;
  font-size: 0.95rem;
  direction: ltr;
  text-align: center;
}

.catalogue-table th,
.catalogue-table td {
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--color-border);
}

.catalogue-table thead th {
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  line-height: 1.35;
}

.catalogue-table tbody tr:nth-child(even) {
  background: #f8fafb;
}

.catalogue-note {
  margin: 1.25rem 0 0;
  font-size: 0.9rem;
  color: var(--color-muted);
  text-align: center;
}

.product-catalogue-link {
  margin: 1.25rem 0 0;
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .feature-row,
  .feature-row.reverse .feature-media,
  .feature-row.reverse .feature-text {
    grid-template-columns: 1fr;
  }

  .feature-row.reverse .feature-media,
  .feature-row.reverse .feature-text {
    order: unset;
  }

  .product-block {
    grid-template-columns: 1fr;
  }

  .catalogue-diagrams {
    grid-template-columns: 1fr;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 768px) {
  .header-inner {
    flex-wrap: wrap;
    padding-right: 1.5rem;
    row-gap: 0.5rem;
  }

  .lang-switch {
    top: 0.85rem;
    transform: none;
  }

  .brand-logo-wide {
    display: none;
  }

  .brand-logo-mark {
    display: block;
  }

  .header-end {
    flex: 1 1 100%;
    justify-content: flex-start;
  }

  .hero-slider {
    min-height: 420px;
  }
}
