/* ===== Variables & Reset ===== */
:root {
  --bg-primary: #0e0d0b;
  --bg-secondary: #171613;
  --bg-card: #1e1d1a;
  --bg-elevated: #252420;
  --gold: #c9a96e;
  --gold-light: #dfc08a;
  --gold-dim: #8a7a55;
  --cream: #f0e8d8;
  --text-primary: #f5f0e6;
  --text-secondary: #a09880;
  --text-muted: #6b6355;
  --border: rgba(201, 169, 110, 0.12);
  --border-strong: rgba(201, 169, 110, 0.25);
  --font-heading: 'Playfair Display', serif;
  --font-body: 'Inter', sans-serif;
  --font-arabic: 'Cairo', sans-serif;
  --nav-height: 64px;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-primary);
  overflow-x: hidden;
  line-height: 1.6;
}

[dir="rtl"] body { font-family: var(--font-arabic); }
[dir="rtl"] .section-title,
[dir="rtl"] .section-label,
[dir="rtl"] .cat-tab,
[dir="rtl"] .ceo-name,
[dir="rtl"] .contact-card h3,
[dir="rtl"] .nav-links a,
[dir="rtl"] .hero-tagline p,
[dir="rtl"] .hero-cta,
[dir="rtl"] .product-desc { font-family: var(--font-arabic); }

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; border: none; outline: none; font-family: inherit; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ===== Navigation ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: rgba(14, 13, 11, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.nav-logo img,
.nav-butterfly {
  height: 22px;
  width: auto;
  opacity: 0.85;
  transition: opacity var(--transition);
}

.nav-logo:hover .nav-butterfly { opacity: 1; }

.nav-brand {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 2px;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  align-items: center;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: color var(--transition);
  position: relative;
  padding: 4px 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--gold);
  transition: width var(--transition);
}

.nav-links a:hover,
.nav-links a.active { color: var(--gold-light); }

.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

.lang-toggle {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--gold);
  padding: 6px 16px;
  font-size: 0.8rem;
  border-radius: 100px;
  transition: all var(--transition);
  font-family: var(--font-arabic);
  font-weight: 500;
  flex-shrink: 0;
}

[dir="rtl"] .lang-toggle { font-family: var(--font-body); }

.lang-toggle:hover {
  background: var(--gold);
  color: var(--bg-primary);
  border-color: var(--gold);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  padding: 8px;
  -webkit-tap-highlight-color: transparent;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text-primary);
  transition: all var(--transition);
  border-radius: 2px;
}

.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(4.5px, 4.5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(4.5px, -4.5px); }

/* ===== Hero Section ===== */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding-top: var(--nav-height);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(201, 169, 110, 0.08) 0%, transparent 70%),
    radial-gradient(circle at 20% 80%, rgba(201, 169, 110, 0.04) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(201, 169, 110, 0.04) 0%, transparent 50%);
}

.hero-content {
  text-align: center;
  z-index: 2;
  padding: 2rem;
  animation: heroFadeIn 1.2s ease;
  width: 100%;
  max-width: 600px;
}

.hero-logo {
  max-width: 260px;
  height: auto;
  margin: 0 auto 3rem;
  filter: brightness(0) invert(1) opacity(0.92);
  drop-shadow: 0 0 40px rgba(201, 169, 110, 0.1);
}

.hero-tagline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 3rem;
  flex-wrap: nowrap;
}

.hero-tagline p {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--text-muted);
  letter-spacing: 4px;
  text-transform: uppercase;
  white-space: nowrap;
}

[dir="rtl"] .hero-tagline p {
  font-family: var(--font-arabic);
  letter-spacing: 1px;
  font-weight: 500;
  font-size: 1.1rem;
}

.hero-line {
  display: block;
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim));
  flex-shrink: 0;
}

.hero-line:last-child {
  background: linear-gradient(90deg, var(--gold-dim), transparent);
}

[dir="rtl"] .hero-line {
  background: linear-gradient(90deg, var(--gold-dim), transparent);
}

[dir="rtl"] .hero-line:last-child {
  background: linear-gradient(90deg, transparent, var(--gold-dim));
}

.hero-cta {
  display: inline-block;
  padding: 14px 36px;
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-radius: 100px;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.hero-cta:hover {
  background: var(--gold);
  color: var(--bg-primary);
}

.hero-scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  animation: bounce 2s infinite;
}

/* ===== Section Common ===== */
.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-butterfly {
  height: 22px;
  width: auto;
  opacity: 0.4;
  margin-bottom: 1rem;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.8rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 1px;
}

[dir="rtl"] .section-title {
  font-family: var(--font-arabic);
  letter-spacing: 0;
  font-weight: 700;
}

/* ===== About Section ===== */
.about {
  padding: 7rem 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 3rem;
  align-items: start;
}

.about-text {
  font-size: 0.95rem;
  line-height: 1.9;
  color: var(--text-secondary);
}

.about-text p { margin-bottom: 1.5rem; }

.about-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.about-highlight {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.about-highlight p { margin-bottom: 1rem; }
.about-highlight p:last-child { margin-bottom: 0; }

.about-join {
  color: var(--gold) !important;
  font-weight: 500;
  font-style: italic;
}

.ceo-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.ceo-name {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 1.5px;
  margin-bottom: 0.15rem;
}

.ceo-title {
  font-size: 0.8rem;
  color: var(--gold);
  font-weight: 500;
  letter-spacing: 1px;
}

/* ===== Products Section ===== */
.products {
  padding: 7rem 0;
  background: var(--bg-primary);
}

.category-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 3rem;
}

.cat-tab {
  padding: 10px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: 100px;
  transition: all var(--transition);
  letter-spacing: 0.3px;
  -webkit-tap-highlight-color: transparent;
}

.cat-tab:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.cat-tab.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--bg-primary);
}

.carousel-container {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 10px;
}

.carousel-slide {
  display: none;
  animation: fadeIn 0.4s ease;
}

.carousel-slide.active { display: block; }

.product-grid {
  display: grid;
  gap: 1.5rem;
}

.product-grid.three-col { grid-template-columns: repeat(3, 1fr); }
.product-grid.four-col { grid-template-columns: repeat(4, 1fr); }

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
  width: 100%;
}

.product-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

.product-badge {
  padding: 8px 16px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.product-badge::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 12px;
  background: url('media/butterfly_logo.png') center / contain no-repeat;
  opacity: 0.6;
  flex-shrink: 0;
}

.product-badge.blue { background: #2a4a7f; color: #a8c4f0; }
.product-badge.dark { background: #1a1a1a; color: #b0b0b0; }
.product-badge.pink { background: #7a3050; color: #f0b0c8; }
.product-badge.silver { background: #4a4a4a; color: #d0d0d0; }

.product-img-wrap {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #f5f0ea;
}

.product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product-card:hover .product-img-wrap img {
  transform: scale(1.06);
}

.product-info {
  padding: 1rem 1.2rem;
}

.product-desc {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  z-index: 10;
}

.carousel-arrow:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--bg-primary);
}

.carousel-arrow.prev { left: -55px; }
.carousel-arrow.next { right: -55px; }

[dir="rtl"] .carousel-arrow.prev { left: auto; right: -55px; }
[dir="rtl"] .carousel-arrow.next { right: auto; left: -55px; }

/* ===== Contact Section ===== */
.contact {
  padding: 7rem 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 960px;
  margin: 0 auto;
}

.contact-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  text-align: center;
  transition: all var(--transition);
}

.contact-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.contact-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(201, 169, 110, 0.1);
  color: var(--gold);
  margin-bottom: 1.5rem;
}

.contact-card h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1.2rem;
  letter-spacing: 2px;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.contact-details a {
  color: var(--text-secondary);
  font-size: 0.88rem;
  transition: color var(--transition);
  line-height: 1.8;
  word-break: break-word;
}

.contact-details a:hover { color: var(--gold-light); }

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  background: var(--bg-primary);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.footer-brand img,
.footer-butterfly { height: 16px; width: auto; opacity: 0.5; }

.footer-copy {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
  40% { transform: translateX(-50%) translateY(-8px); }
  60% { transform: translateX(-50%) translateY(-4px); }
}

.scroll-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Responsive: Large Tablet / Small Desktop ===== */
@media (max-width: 1100px) {
  .carousel-arrow.prev { left: 4px; }
  .carousel-arrow.next { right: 4px; }
  [dir="rtl"] .carousel-arrow.prev { right: 4px; left: auto; }
  [dir="rtl"] .carousel-arrow.next { left: 4px; right: auto; }

  .carousel-arrow {
    background: rgba(30, 29, 26, 0.9);
    backdrop-filter: blur(8px);
  }
}

/* ===== Responsive: Tablet Portrait ===== */
@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .product-grid.four-col { grid-template-columns: repeat(2, 1fr); }

  .section-title { font-size: 2.4rem; }

  .contact-card { padding: 2rem 1.5rem; }
}

/* ===== Responsive: Mobile ===== */
@media (max-width: 768px) {
  :root { --nav-height: 56px; }

  .hamburger { display: flex; }

  .nav-inner { padding: 0 1.2rem; }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(14, 13, 11, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    gap: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open { max-height: 300px; }

  .nav-links li { width: 100%; text-align: center; }

  .nav-links a {
    display: block;
    padding: 16px 2rem;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
  }

  .nav-links a::after { display: none; }

  .section-title { font-size: 2rem; }

  .about, .products, .contact { padding: 4.5rem 0; }

  .container { padding: 0 1.5rem; }

  .hero-logo { max-width: 220px; }

  .hero-tagline { gap: 0.8rem; }

  .hero-tagline p {
    font-size: 0.85rem;
    letter-spacing: 2px;
  }

  .hero-line { width: 30px; }

  .hero-cta {
    padding: 12px 28px;
    font-size: 0.8rem;
  }

  .category-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    padding: 0 0 0.8rem 0;
    gap: 0.4rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .category-tabs::-webkit-scrollbar { display: none; }

  .cat-tab {
    padding: 9px 16px;
    font-size: 0.78rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .product-grid.three-col { grid-template-columns: repeat(2, 1fr); }

  .carousel-container { padding: 0; }
  .carousel-arrow { display: none; }

  .product-card:hover { transform: none; }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    max-width: 400px;
  }

  .contact-card { padding: 2rem 1.5rem; }

  .footer-inner {
    flex-direction: column;
    gap: 0.8rem;
    text-align: center;
  }

  .section-header { margin-bottom: 2.5rem; }
}

/* ===== Responsive: Small Mobile ===== */
@media (max-width: 480px) {
  .container { padding: 0 1rem; }

  .section-title { font-size: 1.7rem; }
  .section-label { font-size: 0.68rem; letter-spacing: 2px; }

  .hero-logo { max-width: 170px; margin-bottom: 2rem; }

  .hero-tagline p {
    font-size: 0.72rem;
    letter-spacing: 1.5px;
  }

  .hero-line { width: 20px; }
  .hero-tagline { gap: 0.5rem; margin-bottom: 2rem; }

  .hero-cta {
    padding: 11px 24px;
    font-size: 0.75rem;
    letter-spacing: 1.5px;
  }

  .about-text { font-size: 0.9rem; line-height: 1.8; }
  .about-highlight { padding: 1.5rem; font-size: 0.85rem; }
  .ceo-card { padding: 1.2rem 1.5rem; }

  .product-grid.three-col,
  .product-grid.four-col {
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
  }

  .product-info { padding: 0.8rem; }
  .product-desc { font-size: 0.75rem; }
  .product-badge { font-size: 0.65rem; padding: 6px 10px; gap: 4px; }
  .product-badge::before { width: 11px; height: 9px; }
}

/* ===== Responsive: Very Small Mobile ===== */
@media (max-width: 360px) {
  .hero-line { display: none; }

  .hero-tagline p {
    white-space: normal;
    text-align: center;
  }

  .nav-brand { font-size: 0.95rem; }

  .product-grid.three-col,
  .product-grid.four-col {
    grid-template-columns: 1fr;
    max-width: 280px;
    margin: 0 auto;
  }
}

/* ===== iOS safe areas ===== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .footer { padding-bottom: calc(1.5rem + env(safe-area-inset-bottom)); }
  .navbar { padding-top: env(safe-area-inset-top); }
}
