/* AL-BARI Corporate Website - Global Styles */

:root {
  --bg: #ffffff;
  --surface: #f6f6f6;
  --surface-2: #eeeeee;
  --card: #ffffff;
  --text: #111111;
  --muted: #444444;
  --muted-2: #666666;
  --border: rgba(0, 0, 0, 0.12);
  --brand: #777777;
  --brand-2: #666666;
  --accent: #999999;
  --success: #777777;
  --danger: #777777;

  --shadow: 0 10px 24px rgba(0, 0, 0, 0.10);
  --radius: 14px;
  --radius-sm: 10px;
  --max: 1120px;

  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg, video { max-width: 100%; display: block; }

.container {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  padding: 0.75rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  z-index: 999;
}
.skip-link:focus { left: 1rem; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  position: relative;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.4px;
}

.brand-mark {
  width: 60px;
  height: 60px;
  padding: 8px;
  border-radius: 12px;
  background: var(--text);
  border: 0;
  object-fit: contain;
}

.brand span {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand small {
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.2px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav a {
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 650;
  font-size: 0.95rem;
}

.nav a[aria-current="page"] {
  color: var(--text);
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.10);
}

.nav a:hover {
  text-decoration: none;
  color: var(--text);
  background: rgba(0, 0, 0, 0.04);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.72rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.btn:hover {
  text-decoration: none;
  background: var(--surface-2);
  transform: translateY(-1px);
}

.btn-primary {
  border-color: rgba(0, 0, 0, 0.18);
  background: var(--surface-2);
}

.btn-primary:hover {
  background: #e2e2e2;
}

.btn-ghost {
  background: transparent;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
}

.nav-toggle svg { width: 22px; height: 22px; }

/* Hero / Sections */
main { padding-bottom: 3rem; }

.section {
  padding: 3.2rem 0;
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.section-title {
  margin: 0;
  font-size: clamp(1.35rem, 1.05rem + 1.2vw, 2.1rem);
  letter-spacing: 0.2px;
}

.section-kicker {
  margin: 0 0 0.4rem;
  color: var(--muted-2);
  font-weight: 700;
  letter-spacing: 0.25px;
  text-transform: uppercase;
  font-size: 0.82rem;
}

.lead {
  margin: 0.75rem 0 0;
  color: var(--muted);
  max-width: 70ch;
}

.grid {
  display: grid;
  gap: 1rem;
}

.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-link {
  display: block;
  text-decoration: none;
}

.card-link:hover {
  text-decoration: none;
}

.card-link:focus-visible {
  outline: 3px solid rgba(0, 0, 0, 0.18);
  outline-offset: 4px;
  border-radius: var(--radius);
}

.card-media {
  aspect-ratio: 16 / 9;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: block;
}

.card-media img,
.card-media video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--surface);
}

.card-body { padding: 1.1rem; }
.card-title {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: 0.2px;
}

.card-text { margin: 0.6rem 0 0; color: var(--muted); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.85rem;
  background: var(--surface);
}

/* Slider */
.slider {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.slider-viewport {
  position: relative;
  aspect-ratio: 16/8;
  min-height: 300px;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 450ms ease;
}

.slide.is-active {
  opacity: 1;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: right center;
  background: var(--surface);
}

.slide-overlay {
  position: absolute;
  inset: 0;
  background: transparent;
}

.slide-content {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  padding: clamp(1.2rem, 1rem + 1.5vw, 2.4rem);
  max-width: 60ch;
}

.slide-content h1 {
  margin: 0;
  font-size: clamp(1.8rem, 1.25rem + 2.4vw, 3.1rem);
  letter-spacing: 0.3px;
}

.slide-content p {
  margin: 0.8rem 0 1.2rem;
  color: var(--muted);
}

.slider-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.85rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.dots { display: inline-flex; gap: 0.45rem; }
.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.08);
  cursor: pointer;
}
.dot[aria-current="true"] {
  background: rgba(0, 0, 0, 0.28);
  border-color: rgba(0, 0, 0, 0.18);
}

/* Forms */
.form {
  display: grid;
  gap: 0.9rem;
}

.field {
  display: grid;
  gap: 0.45rem;
}

label {
  font-weight: 700;
  color: var(--muted);
  font-size: 0.95rem;
}

input, select, textarea {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  outline: none;
}

textarea { min-height: 120px; resize: vertical; }

input:focus, select:focus, textarea:focus {
  border-color: rgba(0, 0, 0, 0.35);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.06);
}

.help {
  margin: 0;
  color: var(--muted-2);
  font-size: 0.92rem;
}

.notice {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  background: var(--surface);
  color: var(--text);
  display: none;
}

.notice.is-visible { display: block; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer-inner {
  padding: 2rem 0;
  display: grid;
  gap: 1rem;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 1rem;
}

.footer-top h3 {
  margin: 0;
  font-size: 1.05rem;
}

.footer-top p { margin: 0.6rem 0 0; color: var(--muted); }

.footer-links {
  display: grid;
  gap: 0.45rem;
  align-content: start;
}

.footer-links.footer-links-center {
  justify-items: center;
  text-align: center;
}

.footer-links a { color: var(--muted); font-weight: 650; }
.footer-links a:hover { color: var(--text); text-decoration: none; }

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 650;
}

.social-links a:hover {
  color: var(--text);
  text-decoration: none;
  background: rgba(0, 0, 0, 0.04);
}

.social-links svg {
  width: 18px;
  height: 18px;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted-2);
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  font-size: 0.92rem;
}

.footer-bottom.footer-bottom-center {
  justify-content: center;
  text-align: center;
}

/* Utility */
.pill-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.65rem; align-items: center; }

.mini {
  color: var(--muted-2);
  font-size: 0.92rem;
}

.hr {
  height: 1px;
  background: var(--border);
  margin: 1rem 0;
}

/* Long-form content (product description pages) */
.prose {
  max-width: 80ch;
}

.prose h2,
.prose h3 {
  margin: 0;
}

.prose p {
  margin: 0.85rem 0 0;
  color: var(--muted);
}

.prose ul {
  margin: 0.85rem 0 0;
  padding-left: 1.25rem;
  color: var(--muted);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  background: var(--card);
}

.table th,
.table td {
  padding: 0.8rem;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  vertical-align: top;
  color: var(--muted);
}

.table th {
  background: var(--surface);
  color: var(--text);
  font-weight: 750;
}

.table tr:last-child td { border-bottom: 0; }
.table th:last-child,
.table td:last-child { border-right: 0; }

/* Page-specific alignment: Apply page */
.center-page {
}

.center-page .section-header > div {
  width: 100%;
  text-align: center;
}

.center-page .grid {
  justify-items: center;
}

.center-page .card {
  width: min(920px, 100%);
}

.center-page .card-body {
  text-align: left;
}

.center-page .card-title {
  text-align: center;
}

.center-page .lead {
  margin-left: auto;
  margin-right: auto;
}

.center-page .form {
  width: min(560px, 100%);
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

.center-page .field {
  justify-items: stretch;
}

.center-page .field label {
  justify-self: start;
}

.center-page .actions {
  justify-content: center;
}

/* Responsive */
@media (max-width: 900px) {
  .grid.two { grid-template-columns: 1fr; }
  .grid.three { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; }

  .section { padding: 2.6rem 0; }
  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .section-header > div { width: 100%; }

  .footer-links.footer-links-center {
    justify-items: start;
    text-align: left;
  }
}

@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute;
    top: calc(100% + 0.6rem);
    right: 0;
    left: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow);
    max-height: calc(100vh - 120px);
    overflow: auto;
    overscroll-behavior: contain;
  }
  .nav.is-open { display: flex; }
  .nav a {
    border-radius: 12px;
    padding: 0.8rem 0.9rem;
  }

  .slider-viewport {
    aspect-ratio: 1 / 1;
    min-height: 260px;
  }

  .slide img {
    object-position: center;
  }

  .slide-content {
    max-width: none;
    padding: 1.05rem;
  }

  .slider .slide-content .actions {
    display: none;
  }
}

@media (max-width: 520px) {
  .section { padding: 2.1rem 0; }

  .brand { gap: 0.6rem; }
  .brand-mark {
    width: 48px;
    height: 48px;
    padding: 6px;
    border-radius: 12px;
  }
  .brand small { font-size: 0.85rem; }

  .card-body { padding: 0.95rem; }

  .actions {
    flex-direction: column;
    align-items: stretch;
  }
  .actions .btn { width: 100%; }

  .footer-bottom {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
  }

  .table th,
  .table td {
    padding: 0.65rem;
    font-size: 0.92rem;
  }

  .slider-controls { display: none; }

  .slider-controls {
    flex-wrap: wrap;
    justify-content: center;
  }

  .slider-controls .btn {
    flex: 1 1 140px;
  }

  .dots {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 720px) {
  .table { min-width: 520px; }
}

@media (max-width: 640px) {
  .table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
  }

  .table {
    min-width: 0;
    background: transparent;
  }

  .table thead { display: none; }
  .table,
  .table tbody,
  .table tr,
  .table th,
  .table td {
    display: block;
    width: 100%;
  }

  .table tr {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card);
    box-shadow: var(--shadow);
    overflow: hidden;
  }

  .table tbody {
    display: grid;
    gap: 0.85rem;
  }

  .table td {
    border-right: 0;
    padding: 0.75rem 0.9rem;
    color: var(--muted);
  }

  .table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.2rem;
    font-weight: 750;
    color: var(--text);
  }

  .table td:first-child {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.7rem 0.9rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-weight: 800;
  }

  .table td:first-child::before {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 750;
    margin-bottom: 0;
  }

  .table tr:last-child td { border-bottom: 1px solid var(--border); }
  .table td:last-child { border-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .slide, .btn { transition: none !important; }
}
