/* Afifa Apparels Ltd — corporate stylesheet */

:root {
  --green: #1e6b3c;
  --green-dark: #14522c;
  --green-tint: #f2f7f3;
  --ink: #26312b;
  --muted: #5c6a61;
  --line: #dde5df;
  --white: #ffffff;
  --serif: "Poppins", "Segoe UI", Arial, Helvetica, sans-serif;
  --sans: "Inter", "Segoe UI", Arial, Helvetica, sans-serif;
  --shadow-sm: 0 2px 8px rgba(20, 82, 44, 0.08);
  --shadow-md: 0 10px 28px rgba(20, 82, 44, 0.16);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--white);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.22; letter-spacing: -0.015em; }

a { color: var(--green); }

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

/* Scroll-reveal (JS adds .reveal, then .visible) */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero .bg { animation: none !important; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* Header */
.topbar {
  background: var(--green-dark);
  color: #d7e5dc;
  font-size: 13px;
  padding: 6px 0;
}
.topbar .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; }
.topbar a { color: #ffffff; text-decoration: none; }
.topbar a:hover { text-decoration: underline; }

header.site {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 3px solid var(--green);
  position: sticky;
  top: 0;
  z-index: 50;
  transition: box-shadow 0.3s var(--ease);
}
header.site.scrolled { box-shadow: 0 6px 20px rgba(18, 41, 26, 0.12); }
header.site .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}
.logo { text-decoration: none; line-height: 1.1; }
.logo .name {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 0.5px;
  display: block;
}
.logo .tag {
  font-size: 11px;
  letter-spacing: 4px;
  color: var(--muted);
  text-transform: uppercase;
  display: block;
}

nav.main { display: flex; gap: 28px; align-items: center; }
nav.main a {
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  padding: 4px 0;
  position: relative;
}
nav.main a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--green);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s var(--ease);
}
nav.main a:hover, nav.main a.active { color: var(--green); }
nav.main a:hover::after, nav.main a.active::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 20px;
  color: var(--green);
  cursor: pointer;
}

/* Hero */
.hero {
  position: relative;
  color: var(--white);
  background: var(--green-dark);
  overflow: hidden;
}
.hero .bg {
  position: absolute;
  inset: 0;
  background: url("../assets/factory.jpg") center/cover no-repeat;
  animation: heroDrift 22s var(--ease) infinite alternate;
  will-change: transform;
}
@keyframes heroDrift {
  from { transform: scale(1); }
  to { transform: scale(1.09) translateX(-1.5%); }
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(13, 42, 25, 0.3) 0%, rgba(13, 42, 25, 0.55) 55%, rgba(13, 42, 25, 0.88) 100%);
  z-index: 1;
}
.hero .container { position: relative; z-index: 2; padding-top: 150px; padding-bottom: 120px; max-width: 880px; text-align: center; }
.hero.tall { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 150px); }
.hero.tall .container { padding-top: 90px; padding-bottom: 130px; }
.hero h1 { font-size: 48px; margin-bottom: 18px; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35); }
.hero p { font-size: 19px; color: #e4efe8; margin-bottom: 32px; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.4); }
.hero .btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* Hero entrance */
.hero h1, .hero p, .hero .btns {
  opacity: 0;
  transform: translateY(22px);
  animation: heroIn 0.8s var(--ease) forwards;
}
.hero p { animation-delay: 0.15s; }
.hero .btns { animation-delay: 0.3s; }
@keyframes heroIn { to { opacity: 1; transform: none; } }

.btn {
  display: inline-block;
  padding: 13px 32px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  border-radius: 999px;
  transition: background 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.btn-light { background: var(--white); color: var(--green-dark); border: 1px solid var(--white); }
.btn-light::after { content: "\00a0\2192"; display: inline-block; transition: transform 0.25s var(--ease); }
.btn-light:hover { background: #eaf3ed; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-light:hover::after { transform: translateX(4px); }
.btn-solid { background: var(--green); color: var(--white); border: 1px solid var(--green); }
.btn-solid::after { content: "\00a0\2192"; display: inline-block; transition: transform 0.25s var(--ease); }
.btn-solid:hover { background: var(--green-dark); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-solid:hover::after { transform: translateX(4px); }
.btn-ghost { background: transparent; color: var(--white); border: 1px solid rgba(255, 255, 255, 0.7); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); transform: translateY(-2px); }

/* Stats — floating card overlapping the hero */
.stats-card {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  text-align: center;
  gap: 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(18, 41, 26, 0.16);
  padding: 34px 24px 30px;
  margin-top: -64px;
  position: relative;
  z-index: 5;
}
.stats .stat-icon { width: 44px; height: 44px; margin: 0 auto 10px; color: var(--green); display: block; }
.stats .num { font-family: var(--serif); font-size: 30px; font-weight: 700; display: block; color: var(--green); font-variant-numeric: tabular-nums; }
.stats .lbl { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 1.2px; }
@media (min-width: 901px) {
  .stats-card > div { border-right: 1px solid var(--line); padding: 0 8px; }
  .stats-card > div:last-child { border-right: none; }
}

/* Product explorer (home) */
.tabs { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 28px 0 30px; }
.tab {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  padding: 9px 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.tab:hover { border-color: var(--green); color: var(--green); }
.tab.active { background: var(--green); border-color: var(--green); color: var(--white); }

.explorer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
}
.explorer-grid.fading { opacity: 0; transform: translateY(10px); }
.explorer-grid figure {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 14px 12px;
  transition: box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
}
.explorer-grid figure:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); }
.explorer-grid img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; }
.explorer-grid figcaption { font-size: 13.5px; color: var(--muted); margin-top: 10px; text-align: center; }
.explorer-desc { color: var(--muted); margin-top: 24px; }
.explorer-actions { margin-top: 20px; }

/* Product marquee */
.marquee {
  overflow: hidden;
  padding: 28px 0;
  background: var(--white);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.marquee-track { display: flex; width: max-content; animation: marqueeScroll 48s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-item {
  flex: 0 0 auto;
  width: 150px;
  height: 120px;
  margin-right: 22px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}
.marquee-item img { max-width: 100%; max-height: 100%; object-fit: contain; }
@keyframes marqueeScroll { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }

/* Parallax facility band */
.parallax {
  background-image: linear-gradient(rgba(13, 42, 25, 0.74), rgba(13, 42, 25, 0.74)), url("../assets/facility/sewing-01.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  padding: 106px 0;
  color: var(--white);
  text-align: center;
}
.parallax h2 { font-size: 34px; color: var(--white); margin-bottom: 12px; }
.parallax p { color: #d7e5dc; margin-bottom: 26px; max-width: 620px; margin-left: auto; margin-right: auto; }

/* Scroll cue + progress */
.scroll-cue {
  position: absolute;
  bottom: 92px;
  left: 50%;
  z-index: 2;
  color: var(--white);
  opacity: 0.85;
  animation: cueBob 2.2s ease-in-out infinite;
}
@keyframes cueBob {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 10px); }
}
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--green);
  z-index: 300;
}

/* Sections */
section.block { padding: 72px 0; }
section.block.alt { background: var(--green-tint); }
section.block.dark {
  background: linear-gradient(140deg, var(--green-dark) 0%, #0f3d21 100%);
  color: var(--white);
}
section.block.dark h2.title { color: var(--white); }
section.block.dark .lead { color: #cfe2d6; }

.kicker {
  display: inline-block;
  background: var(--green-tint);
  border: 1px solid #d3e4d9;
  color: var(--green-dark);
  text-transform: uppercase;
  letter-spacing: 2.5px;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 16px;
  border-radius: 999px;
  margin-bottom: 16px;
}
section.block.dark .kicker, .parallax .kicker {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.28);
  color: var(--white);
}
h2.title { font-size: 34px; margin-bottom: 18px; }
.title-rule { display: none; }
.center { text-align: center; }
.center .title-rule { margin-left: auto; margin-right: auto; }
.lead { color: var(--muted); max-width: 760px; }
.center .lead { margin: 0 auto; }

/* Cards */
.grid { display: grid; gap: 24px; margin-top: 36px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  transition: box-shadow 0.3s var(--ease), transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-5px); border-color: #bcd3c4; }
.card .imgbox {
  background: var(--white);
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.card .imgbox img {
  max-height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  transition: transform 0.45s var(--ease);
}
div.card .imgbox, .explorer-grid figure { cursor: zoom-in; }
.card:hover .imgbox img { transform: scale(1.05); }
.card .body { padding: 14px 16px 16px; }
.card h3 { font-size: 17px; margin-bottom: 4px; }
.card p { font-size: 14px; color: var(--muted); }

/* Category pill nav (products page) */
.pillnav {
  position: sticky;
  top: 71px;
  z-index: 40;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.pillnav .container {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-top: 12px;
  padding-bottom: 12px;
  scrollbar-width: none;
}
.pillnav .container::-webkit-scrollbar { display: none; }
.pillnav a {
  white-space: nowrap;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 16px;
  transition: all 0.25s var(--ease);
}
.pillnav a:hover { color: var(--green); border-color: var(--green); }
.pillnav a.active { background: var(--green); border-color: var(--green); color: var(--white); }

/* Skip link + focus */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--green-dark);
  color: var(--white);
  padding: 10px 18px;
  z-index: 200;
  border-radius: 0 0 4px 0;
}
.skip-link:focus { left: 0; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

/* Facility gallery */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 34px; }
.shot {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
}
.shot:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); }
.shot a { display: block; overflow: hidden; aspect-ratio: 3 / 2; cursor: zoom-in; }
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.45s var(--ease); }
.shot:hover img { transform: scale(1.05); }
.shot figcaption { padding: 12px 14px; font-size: 13.5px; color: var(--muted); line-height: 1.45; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 24, 15, 0.93);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 64px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox img {
  max-width: 100%;
  max-height: calc(100% - 60px);
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.lightbox .lb-caption { color: #d7e5dc; font-size: 15px; margin-top: 16px; text-align: center; max-width: 720px; }
.lightbox button {
  position: absolute;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--white);
  font-size: 22px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s var(--ease);
}
.lightbox button:hover { background: rgba(255, 255, 255, 0.22); }
.lightbox .lb-close { top: 18px; right: 18px; }
.lightbox .lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 14px; top: 50%; transform: translateY(-50%); }

/* Fact table */
table.facts { width: 100%; border-collapse: collapse; margin-top: 28px; background: var(--white); box-shadow: var(--shadow-sm); }
table.facts th, table.facts td { text-align: left; padding: 12px 16px; border: 1px solid var(--line); font-size: 15px; }
table.facts th { background: var(--green-tint); color: var(--green-dark); width: 40%; font-weight: 600; }
table.facts tr { transition: background 0.2s var(--ease); }
table.facts tr:hover td { background: #fafcfa; }

/* Markets */
.markets { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; justify-content: center; }
.market {
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 15px;
  color: var(--ink);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}
.market:hover { border-color: var(--green); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.market .flag { margin-right: 8px; }

/* Feature list */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 36px; }
.feature {
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 3px solid var(--green);
  padding: 24px;
  border-radius: 12px;
  transition: box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
}
.feature:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); }
.feature h3 { font-size: 17px; margin-bottom: 8px; color: var(--green-dark); }
.feature p { font-size: 14.5px; color: var(--muted); }

/* CTA band */
.cta {
  background: linear-gradient(140deg, var(--green-dark) 0%, #0f3d21 100%);
  color: var(--white);
  text-align: center;
  padding: 56px 0;
}
.cta h2 { font-size: 30px; margin-bottom: 10px; }
.cta p { color: #cfe2d6; margin-bottom: 24px; }
.cta .btn-solid { background: var(--white); color: var(--green-dark); border-color: var(--white); }
.cta .btn-solid:hover { background: #eaf3ed; }

/* Contact page */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 960px;
  margin: 36px auto 0;
}
.contact-grid .contact-card { margin: 0; max-width: none; }
@media (max-width: 760px) {
  .contact-grid { grid-template-columns: 1fr; }
}
.contact-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 4px solid var(--green);
  border-radius: 6px;
  padding: 34px 38px;
  max-width: 560px;
  margin: 36px auto 0;
  box-shadow: var(--shadow-sm);
}
.contact-card h3 { font-size: 22px; color: var(--green-dark); }
.contact-card .role { color: var(--muted); margin-bottom: 20px; }
.contact-card dl { display: grid; grid-template-columns: 110px 1fr; row-gap: 12px; font-size: 16px; }
.contact-card dt { font-weight: 600; color: var(--green-dark); }
.contact-card dd a { color: var(--green); text-decoration: none; }
.contact-card dd a:hover { text-decoration: underline; }

/* Back to top */
.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--green);
  color: var(--white);
  font-size: 19px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), background 0.2s var(--ease);
  z-index: 60;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--green-dark); }

/* Footer */
footer.site { background: #12291a; color: #b9cdc0; font-size: 14px; }
footer.site .container {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 36px;
  padding-top: 48px;
  padding-bottom: 40px;
}
footer.site h4 { color: var(--white); font-family: var(--serif); font-size: 17px; margin-bottom: 14px; }
footer.site a { color: #d7e5dc; text-decoration: none; }
footer.site a:hover { text-decoration: underline; }
footer.site ul { list-style: none; }
footer.site li { margin-bottom: 8px; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding: 16px 0;
  text-align: center;
  font-size: 13px;
  color: #8fa697;
}

/* Section anchor offset for sticky header + pillnav */
.anchor-target { scroll-margin-top: 140px; }

/* Responsive */
@media (max-width: 900px) {
  .stats-card { grid-template-columns: repeat(3, 1fr); }
  .explorer-grid { grid-template-columns: repeat(2, 1fr); }
  .parallax { background-attachment: scroll; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .features { grid-template-columns: 1fr; }
  footer.site .container { grid-template-columns: 1fr; gap: 24px; }
  .hero h1 { font-size: 33px; }
  .hero .container { padding-top: 100px; padding-bottom: 84px; }
}

@media (max-width: 640px) {
  .nav-toggle { display: block; }
  nav.main {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    gap: 0;
    padding: 8px 24px 16px;
  }
  nav.main.open { display: flex; }
  nav.main a { padding: 10px 0; width: 100%; border-bottom: 1px solid var(--line); }
  nav.main a::after { display: none; }
  .stats-card { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-4, .grid.cols-3 { grid-template-columns: 1fr 1fr; }
  .gallery { grid-template-columns: 1fr; }
  .lightbox { padding: 60px 12px 24px; }
  .card .imgbox { height: 160px; }
  .topbar .container { justify-content: center; }
  .pillnav { top: 65px; }
}
