/* ==========================================================
   DESIGN TOKENS
========================================================== */

:root {
  --primary: #0B2341;
  --primary-dark: #07172D;
  --primary-light: #163A68;
  --secondary: #2E7D32;
  --secondary-dark: #1E5B22;
  --secondary-light: #E8F5E9;
  --gold: #D4A017;
  --text: #1E293B;
  --text-soft: #64748B;
  --border: #E2E8F0;
  --surface: #FFFFFF;
  --surface-alt: #F8FAFC;
  --radius-sm: .5rem;
  --radius-md: .75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --shadow-sm: 0 2px 8px rgba(0,0,0,.04);
  --shadow-md: 0 10px 30px rgba(0,0,0,.08);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.12);
  --transition: .3s cubic-bezier(.4,0,.2,1);
}

/* ==========================================================
   RESET & SYSTEM FONTS (OFFLINE PREFERENCE)
========================================================== */

*,*::before,*::after { box-sizing: border-box; }

html { 
  scroll-behavior: smooth; 
}

html[lang="ar"], html[dir="rtl"] {
  font-family: 'Cairo', system-ui, sans-serif;
}

html[lang="en"], html[dir="ltr"] {
  font-family: 'Inter', system-ui, sans-serif;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background: white;
  line-height: 1.5;
}

img { display: block; max-width: 100%; }

a { text-decoration: none; color: inherit; }

button { font: inherit; cursor: pointer; }

input, textarea, select { font: inherit; }

/* ==========================================================
   SKIP LINK
========================================================== */

.skip-link {
  position: absolute;
  top: -999px;
  left: 0;
  padding: .5rem 1rem;
  background: var(--primary);
  color: white;
  z-index: 9999;
}
.skip-link:focus { top: 0; }

/* ==========================================================
   CONTAINERS
========================================================== */

.container-custom {
  width: min(1280px, calc(100% - 2rem));
  margin-inline: auto;
}

.section      { padding-block: 6rem; }
.section-sm   { padding-block: 4rem; }
.section-lg   { padding-block: 8rem; }

/* ==========================================================
   TYPOGRAPHY
========================================================== */

.heading-xl {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: -0.02em;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.heading-lg {
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.heading-md {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  line-height: 1.3;
}

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: var(--secondary);
  font-size: .875rem;
  text-transform: uppercase;
  letter-spacing: .15em;
  font-weight: 700;
}

html[lang="ar"] .section-eyebrow {
  letter-spacing: 0;
}

.text-xl {
  font-size: clamp(1.125rem, 2vw, 1.25rem);
  line-height: 1.7;
  font-weight: 400;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.text-soft { color: var(--text-soft); }

/* ==========================================================
   BUTTONS
========================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  border: none;
  border-radius: 999px;
  transition: var(--transition);
  font-weight: 700;
}

.btn-sm  { padding: .75rem 1.25rem; font-size: 0.875rem; }
.btn-md  { padding: .9rem 1.75rem; font-size: 1rem; }
.btn-lg  { padding: 1rem 2rem; font-size: 1.1rem; }

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); }

.btn-secondary { background: var(--secondary); color: white; }
.btn-secondary:hover { background: var(--secondary-dark); transform: translateY(-2px); }

.btn-outline { border: 2px solid white; color: white; }
.btn-outline:hover { background: white; color: var(--primary); }

/* ==========================================================
   HEADER
========================================================== */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  transition: var(--transition);
}

.site-header.scrolled {
  background: rgba(11,35,65,.96);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-md);
}

.nav-link { position: relative; font-weight: 600; }

.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 2px;
  background: white;
  transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after { width: 100%; }

html[dir="rtl"] .nav-link::after { left: auto; right: 0; }

/* ==========================================================
   HERO
========================================================== */

.hero {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.hero-slide {
  position: absolute;
  inset: 0;
}

.hero-slide img {
  width: 100%;
  height: 100%;
  opacity: 1;
  transition: opacity 300ms ease;
  object-fit: cover;
  animation: heroZoom 15s linear infinite;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.65), rgba(0,0,0,.55));
}

.hero-content {
  position: relative;
  z-index: 2;
  color: white;
}

@keyframes heroZoom {
  from { transform: scale(1); }
  to   { transform: scale(1.12); }
}

/* ==========================================================
   CARDS
========================================================== */

.card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.card-image {
  aspect-ratio: 16/10;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: .8s;
}

.card:hover img { transform: scale(1.08); }

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px,1fr));
  gap: 2rem;
}

/* ==========================================================
   FOOTER
========================================================== */

.footer {
  background: var(--primary);
  color: white;
}

.footer a {
  color: rgba(255,255,255,.7);
  transition: var(--transition);
}

.footer a:hover { color: white; }

/* ==========================================================
   ANIMATIONS
========================================================== */

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: .8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: .8s ease;
}

.fade-left.visible { opacity: 1; transform: none; }

.fade-right {
  opacity: 0;
  transform: translateX(50px);
  transition: .8s ease;
}

.fade-right.visible { opacity: 1; transform: none; }

/* ==========================================================
   RTL SETTINGS
========================================================= */

html[dir="rtl"] body {
  font-family: 'Cairo', system-ui, -apple-system, sans-serif;
}

html[dir="rtl"] .nav-link {
  letter-spacing: 0;
}

html[dir="rtl"] .drawer-panel {
  animation-name: slideDrawerRTL;
}

html[dir="rtl"] .drawer-backdrop {
  justify-content: flex-start;
}

html[dir="rtl"] .back-to-top {
  right: auto;
  left: 20px;
}

/* ==========================================================
   FORMS
========================================================== */

input, textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1rem;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
}

/* ==========================================================
   MOBILE DRAWER
========================================================== */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 200;
  display: flex;
  justify-content: flex-end;
}

.drawer-panel {
  width: 320px;
  max-width: 90vw;
  background: white;
  height: 100%;
  padding: 2rem;
  animation: slideDrawer .3s ease;
}

.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 3rem;
}

.drawer-nav a {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.drawer-close {
  border: none;
  background: none;
  font-size: 2rem;
}

@keyframes slideDrawer {
  from { transform: translateX(100%); }
  to   { transform: none; }
}

@keyframes slideDrawerRTL {
  from { transform: translateX(-100%); }
  to   { transform: none; }
}

/* ==========================================================
   UTILITIES
========================================================== */

.bg-primary   { background: var(--primary); }
.bg-secondary { background: var(--secondary); }

.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 50px;
  height: 50px;
  border: none;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  cursor: pointer;
  z-index: 90;
  display: none;
  font-size: 1.25rem;
}

.stat-number {
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
}

/* ==========================================================
   PAGE TRANSITION
========================================================== */

.page-enter {
  animation: pageEnter .35s ease;
}

@keyframes pageEnter {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* ==========================================================
   HERO DOTS
========================================================== */

.hero-dots {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 20;
}

.hero-dot {
  width: 12px;
  height: 12px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,.4);
  cursor: pointer;
  transition: .3s;
}

.hero-dot.active {
  background: white;
  transform: scale(1.3);
}

/* ==========================================================
   SPECS TABLE
========================================================== */

.specs-table {
  margin-top: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.specs-table-header {
  display: grid;
  grid-template-columns: 1fr 2fr;
  background: var(--surface-alt);
  font-weight: 700;
}

.specs-table-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  border-top: 1px solid var(--border);
}

.specs-table-header > div,
.specs-table-row > div {
  padding: 1rem;
}

/* ==========================================================
   RESPONSIVE OVERRIDES
========================================================== */

@media (max-width: 1024px) {
  .section { padding-block: 4rem; }
}

@media (max-width: 640px) {
  .section { padding-block: 3rem; }
}

/* ==========================================================
   MOBILE OPTIMIZATION PHASE 1
========================================================== */

@media (max-width: 768px) {

  .container-custom{
    width: calc(100% - 1.5rem);
  }

  .heading-xl{
    font-size: 2rem;
    line-height: 1.25;
  }

  .heading-lg{
    font-size: 1.75rem;
  }

  .heading-md{
    font-size: 1.3rem;
  }

  .text-xl{
    font-size: 1rem;
    line-height: 1.6;
  }

  .btn-lg{
    width:100%;
    min-height:52px;
  }


  .hero{
    min-height:75vh;
  }

  .hero-content{
    padding-top:90px;
    padding-bottom:40px;
  }

   .card-image{
    aspect-ratio:1/1;
  }
   .stat-number{
    font-size:2rem;
  }

   .footer{
    text-align:center;
  }

  .footer .grid{
    gap:2rem;
  }

  .specs-table-header{
    display:none;
  }

  .specs-table-row{
    display:block;
    padding:.75rem;
  }

  .specs-table-row > div{
    padding:.35rem 0;
  }

    .gallery-thumb{
    width:90px;
    height:90px;
    flex-shrink:0;
  }
    .drawer-panel{
    width:85vw;
  }

}

@media (hover:none){

  .card:hover{
    transform:none;
  }

  .btn-primary:hover,
  .btn-secondary:hover,
  .btn-outline:hover{
    transform:none;
  }

}