/* ============================================================
   TEKNATON — Design System CSS (loads after Bootstrap RTL)
   Brand: Technology + Intelligence + Trust + Egyptian Heritage
   ============================================================ */

:root {
  /* Brand palette */
  --tn-green: #0F5A46;
  --tn-green-hover: #0B4838;
  --tn-emerald: #09372D;
  --tn-charcoal-deep: #0B1410;
  --tn-gold: #C79A3B;
  --tn-gold-hover: #D6B15E;
  --tn-ivory: #F5F0E5;
  --tn-charcoal: #171C1A;
  --tn-gray: #E9E8E2;
  --tn-gray-mid: #5F6B66;
  --tn-white: #FFFFFF;

  /* Semantic */
  --tn-success: #1E7A4E;
  --tn-warning: #B7791F;
  --tn-danger: #B3261E;
  --tn-info: #2563EB;

  /* Maps for Bootstrap overrides */
  --bs-primary: #0F5A46;
  --bs-primary-rgb: 15, 90, 70;
  --bs-body-color: #171C1A;
  --bs-body-bg: #FFFFFF;
  --bs-link-color: #0F5A46;
  --bs-link-hover-color: #0B4838;
  --bs-border-color: #E9E8E2;
  --bs-body-font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;

  /* Radii & shadows */
  --tn-radius-card: 14px;
  --tn-radius-btn: 10px;
  --tn-radius-input: 10px;
  --tn-shadow-rest: 0 1px 2px rgba(23, 28, 26, .06);
  --tn-shadow-hover: 0 10px 30px -12px rgba(15, 90, 70, .25);
  --tn-dark-gradient: linear-gradient(160deg, #0B1410 0%, #09372D 100%);
  --tn-hero-pattern: repeating-linear-gradient(
    120deg, rgba(214, 177, 94, .05) 0 2px, transparent 2px 46px);
}

/* ---------------- Fonts ---------------- */
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/IBMPlexSansArabic-400-arabic.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/IBMPlexSansArabic-400-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/IBMPlexSansArabic-500-arabic.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/IBMPlexSansArabic-500-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/IBMPlexSansArabic-600-arabic.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/IBMPlexSansArabic-600-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/IBMPlexSansArabic-700-arabic.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/IBMPlexSansArabic-700-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F; }

/* ---------------- Base ---------------- */
html { scroll-behavior: smooth; }
body { font-family: var(--bs-body-font-family); color: var(--tn-charcoal); font-size: 1rem; line-height: 1.75; text-align: start; background: var(--tn-white); }
body.direction-rtl { letter-spacing: 0; }

h1, .tn-h1 { font-size: clamp(1.65rem, 2.6vw, 2.25rem); font-weight: 700; line-height: 1.4; color: var(--tn-charcoal); }
h2, .tn-h2 { font-size: clamp(1.4rem, 2vw, 1.75rem); font-weight: 700; line-height: 1.45; }
h3, .tn-h3 { font-size: clamp(1.15rem, 1.5vw, 1.375rem); font-weight: 600; line-height: 1.5; }
.tn-display { font-size: clamp(2rem, 4.2vw, 2.75rem); font-weight: 700; line-height: 1.35; }
.tn-lead { font-size: 1.0625rem; color: var(--tn-gray-mid); line-height: 1.9; }
@media (min-width: 992px) { .tn-lead { font-size: 1.125rem; } }

.tn-text-gold { color: var(--tn-gold); }
.tn-text-green { color: var(--tn-green); }
a { text-underline-offset: 4px; }

/* Numbers: Latin digits, tabular for prices */
.tn-num { font-variant-numeric: tabular-nums lining-nums; direction: ltr; unicode-bidi: embed; }

/* Section rhythm */
.tn-section { padding-block: 4rem; }
@media (min-width: 992px) { .tn-section { padding-block: 5.5rem; } }
.tn-section-alt { background: var(--tn-ivory); }
.tn-section-dark { background: var(--tn-dark-gradient); color: var(--tn-ivory); }
.tn-section-dark h1, .tn-section-dark h2, .tn-section-dark h3 { color: var(--tn-white); }
.tn-section-dark .tn-lead { color: rgba(245, 240, 229, .78); }

/* Eyebrow label */
.tn-eyebrow { display: inline-flex; align-items: center; gap: .5rem; font-size: .8125rem; font-weight: 600; color: var(--tn-green); margin-bottom: .75rem; }
.tn-eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--tn-gold); border-radius: 2px; }
.tn-section-dark .tn-eyebrow { color: var(--tn-gold-hover); }

/* ---------------- Buttons ---------------- */
.btn { --bs-btn-font-weight: 600; --bs-btn-border-radius: var(--tn-radius-btn); --bs-btn-padding-y: .65rem; --bs-btn-padding-x: 1.35rem; transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease; }
.btn:focus-visible { outline: 3px solid rgba(15, 90, 70, .35); outline-offset: 2px; }
.btn-primary { --bs-btn-bg: var(--tn-green); --bs-btn-border-color: var(--tn-green); --bs-btn-color: var(--tn-ivory); --bs-btn-hover-bg: var(--tn-green-hover); --bs-btn-hover-border-color: var(--tn-green-hover); --bs-btn-active-bg: var(--tn-green-hover); }
.btn-tn-gold { --bs-btn-bg: var(--tn-gold); --bs-btn-border-color: var(--tn-gold); --bs-btn-color: #17101F; --bs-btn-hover-bg: var(--tn-gold-hover); --bs-btn-hover-border-color: var(--tn-gold-hover); --bs-btn-active-bg: var(--tn-gold-hover); --bs-btn-color: var(--tn-charcoal); }
.btn-tn-outline { --bs-btn-bg: transparent; --bs-btn-border-color: var(--tn-green); --bs-btn-color: var(--tn-green); --bs-btn-hover-bg: var(--tn-green); --bs-btn-hover-color: var(--tn-ivory); }
.btn-tn-outline-light { --bs-btn-bg: transparent; --bs-btn-border-color: rgba(245,240,229,.45); --bs-btn-color: var(--tn-ivory); --bs-btn-hover-bg: rgba(245,240,229,.12); --bs-btn-hover-color: var(--tn-white); }
.btn-tn-quiet { --bs-btn-color: var(--tn-green); --bs-btn-padding-x: .25rem; gap: .4rem; display: inline-flex; align-items: center; }
.btn-tn-quiet:hover { color: var(--tn-green-hover); text-decoration: underline; }
.btn-lg { --bs-btn-padding-y: .85rem; --bs-btn-padding-x: 1.75rem; font-size: 1.0625rem; }
.btn.is-busy { pointer-events: none; opacity: .65; }
.btn .spinner-border-sm { width: 1em; height: 1em; margin-inline-start: .35rem; }

/* ---------------- Navbar ---------------- */
.tn-navbar { background: var(--tn-white); box-shadow: var(--tn-shadow-rest); position: sticky; top: 0; z-index: 1030; }
.tn-brand-text { font-weight: 700; letter-spacing: .02em; color: var(--tn-charcoal); font-size: 1.25rem; }
.tn-brand-sub { font-size: .6875rem; color: var(--tn-gold); }
.tn-navlink { color: var(--tn-charcoal); font-weight: 500; padding: .5rem .85rem; border-radius: 8px; }
.tn-navlink:hover, .tn-navlink.active { color: var(--tn-green); background: rgba(15, 90, 70, .07); }
.tn-navbar .dropdown-menu, .tn-mega { border-radius: var(--tn-radius-card); border: 1px solid var(--tn-gray); box-shadow: var(--tn-shadow-hover); }
.tn-nav-icon { color: inherit; position: relative; display: inline-flex; padding: .45rem; }
.tn-nav-icon .tn-count { position: absolute; top: -2px; inset-inline-end: -2px; background: var(--tn-gold); color: #17101F; font-size: .625rem; font-weight: 700; min-width: 1.1rem; height: 1.1rem; border-radius: 999px; display: grid; place-items: center; padding-inline: 2px; }

/* Mega menu */
.tn-mega { width: min(720px, 92vw); padding: 1.25rem; }
.tn-mega li > a { display: flex; flex-direction: column; gap: .15rem; padding: .7rem .8rem; border-radius: 10px; }
.tn-mega li > a:hover { background: var(--tn-ivory); }
.tn-mega li > a .tn-mega-title { font-weight: 600; display: flex; align-items: center; gap: .5rem; }
.tn-mega li > a .tn-mega-desc { font-size: .8125rem; color: var(--tn-gray-mid); }

/* Mobile drawer */
.tn-mobile-nav { position: fixed; inset: 0; z-index: 1055; visibility: hidden; }
.tn-mobile-nav[data-open="true"] { visibility: visible; }
.tn-mobile-nav .tn-drawer-backdrop { position: absolute; inset: 0; background: rgba(11, 20, 16, .55); opacity: 0; transition: opacity .25s ease; }
.tn-mobile-nav[data-open="true"] .tn-drawer-backdrop { opacity: 1; }
.tn-drawer { position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: min(340px, 88vw); background: var(--tn-white); transform: translateX(-101%); transition: transform .3s ease; display: flex; flex-direction: column; box-shadow: var(--tn-shadow-hover); }
[dir="rtl"] .tn-drawer { transform: translateX(101%); }
.tn-mobile-nav[data-open="true"] .tn-drawer { transform: translateX(0); }
.tn-drawer nav { overflow-y: auto; padding: 1rem 1.25rem; }
.tn-drawer a.tn-drawer-link { display: block; padding: .8rem .5rem; font-weight: 500; border-bottom: 1px solid var(--tn-gray); color: var(--tn-charcoal); text-decoration: none; }
.tn-drawer a.tn-drawer-link:hover { color: var(--tn-green); }

/* ---------------- Cards ---------------- */
.tn-card { background: var(--tn-white); border: 1px solid var(--tn-gray); border-radius: var(--tn-radius-card); padding: 1.5rem; transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease; height: 100%; }
.tn-card-hover:hover { box-shadow: var(--tn-shadow-hover); transform: translateY(-2px); border-color: rgba(15, 90, 70, .25); }
.tn-card .tn-card-icon { width: 52px; height: 52px; border-radius: 12px; background: rgba(15, 90, 70, .08); color: var(--tn-green); display: grid; place-items: center; margin-bottom: 1rem; }
.tn-card .tn-card-icon svg { width: 24px; height: 24px; }
.tn-card h3 { font-size: 1.0625rem; margin-bottom: .5rem; }
.tn-card .tn-card-body-text { font-size: .9375rem; color: var(--tn-gray-mid); }

/* Product card */
.tn-product-card { display: flex; flex-direction: column; background: var(--tn-white); border: 1px solid var(--tn-gray); border-radius: var(--tn-radius-card); overflow: hidden; transition: box-shadow .2s ease, translate .2s ease; height: 100%; position: relative; }
.tn-product-card:hover { box-shadow: var(--tn-shadow-hover); translate: 0 -2px; }
.tn-product-media { aspect-ratio: 4 / 3; background: var(--tn-ivory); display: grid; place-items: center; overflow: hidden; }
.tn-product-media img { width: 100%; height: 100%; object-fit: cover; }
.tn-product-body { padding: 1rem 1.1rem 1.15rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.tn-product-title { font-weight: 600; font-size: .9375rem; line-height: 1.6; color: var(--tn-charcoal); text-decoration: none; }
a.tn-product-title:hover { color: var(--tn-green); text-decoration: none; }
.tn-price { font-weight: 700; color: var(--tn-green); font-size: 1.0625rem; }
.tn-price-old { color: var(--tn-gray-mid); text-decoration: line-through; font-weight: 400; font-size: .8125rem; }
.tn-product-actions { margin-top: auto; display: flex; gap: .5rem; }
.tn-product-actions .btn { flex: 1; padding-block: .5rem; font-size: .875rem; }

/* Horizontal divider with gold center (brand motif) */
.tn-divider { display: flex; align-items: center; gap: 1rem; color: var(--tn-gold); }
.tn-divider::before, .tn-divider::after { content: ""; flex: 1; height: 1px; background: linear-gradient(to var(--tn-flip, left), var(--tn-gray), var(--tn-gold)); }
[dir="rtl"] .tn-divider::before, [dir="rtl"] .tn-divider::after { --tn-flip: right; }

.tn-badge-soft { display: inline-flex; align-items: center; gap: .3rem; padding: .22rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.tn-bs-success { background: rgba(30, 122, 78, .12); color: var(--tn-success); }
.tn-bs-gold { background: rgba(199, 154, 59, .14); color: #8A6516; }
.tn-bs-danger { background: rgba(179, 38, 29, .1); color: var(--tn-danger); }
.tn-bs-gray { background: var(--tn-gray); color: var(--tn-charcoal); }

/* ---------------- Forms ---------------- */
.form-label { font-weight: 600; font-size: .9375rem; margin-bottom: .35rem; }
.form-control, .form-select { border-radius: var(--tn-radius-input); border-color: var(--tn-gray); padding: .65rem .9rem; font-size: .9375rem; }
.form-control:focus, .form-select:focus { border-color: var(--tn-green); box-shadow: 0 0 0 .2rem rgba(15, 90, 70, .12); }
.invalid-feedback { display: flex; align-items: center; gap: .3rem; font-size: .8125rem; font-weight: 500; }
.was-validated .form-control:invalid, .form-control.is-invalid { background-image: none; }
.hint { font-size: .8125rem; color: var(--tn-gray-mid); margin-top: .3rem; }
.tn-consent { display: flex; gap: .6rem; align-items: flex-start; font-size: .875rem; color: var(--tn-gray-mid); }

/* ---------------- Hero ---------------- */
.tn-hero { position: relative; background: var(--tn-dark-gradient); color: var(--tn-ivory); padding-block: 5rem 5.5rem; overflow: hidden; }
.tn-hero::before { content: ""; position: absolute; inset: 0; background: var(--tn-hero-pattern); pointer-events: none; }
.tn-hero .tn-hero-glow { position: absolute; width: 520px; height: 520px; border-radius: 50%; filter: blur(90px); background: radial-gradient(circle, rgba(15, 90, 70, .55), transparent 65%); top: -160px; inset-inline-start: -120px; }
.tn-hero .tn-hero-glow.gold { background: radial-gradient(circle, rgba(199, 154, 59, .18), transparent 65%); top: auto; bottom: -220px; inset-inline-start: auto; inset-inline-end: -140px; }
.tn-hero .container { position: relative; }
.tn-hero .tn-display { color: var(--tn-white); }
.tn-hero .tn-lead { color: rgba(245, 240, 229, .82); max-width: 46ch; }

/* Trust strip */
.tn-trust { display: flex; flex-wrap: wrap; gap: 1.25rem 2.5rem; padding-top: 1.75rem; margin-top: 2rem; border-top: 1px solid rgba(245, 240, 229, .15); }
.tn-trust .tn-trust-item { display: flex; align-items: baseline; gap: .5rem; color: rgba(245, 240, 229, .85); font-size: .9375rem; }
.tn-trust .tn-trust-item strong { color: var(--tn-gold-hover); font-size: 1.35rem; font-weight: 700; }

/* Stats */
.tn-stat { text-align: center; }
.tn-stat .tn-stat-value { font-size: clamp(1.9rem, 3vw, 2.6rem); font-weight: 700; color: var(--tn-green); font-variant-numeric: tabular-nums; }
.tn-stat .tn-stat-label { color: var(--tn-gray-mid); font-size: .9375rem; }
.tn-section-dark .tn-stat .tn-stat-value { color: var(--tn-gold-hover); }
.tn-section-dark .tn-stat .tn-stat-label { color: rgba(245, 240, 229, .7); }

/* ---------------- Footer ---------------- */
.tn-footer { background: var(--tn-dark-gradient); color: rgba(245, 240, 229, .78); font-size: .9375rem; }
.tn-footer h3 { font-size: .9375rem; font-weight: 600; color: var(--tn-white); margin-bottom: 1.1rem; }
.tn-footer a { color: rgba(245, 240, 229, .78); text-decoration: none; display: inline-block; padding-block: .18rem; }
.tn-footer a:hover { color: var(--tn-gold-hover); }
.tn-footer .tn-footer-legal { border-top: 1px solid rgba(245, 240, 229, .12); }
.tn-footer .tn-brand-text { color: var(--tn-white); }
.tn-newsletter-form .form-control { background: rgba(245, 240, 229, .08); border-color: rgba(245, 240, 229, .2); color: var(--tn-white); }
.tn-newsletter-form .form-control::placeholder { color: rgba(245, 240, 229, .45); }
.tn-social a { width: 38px; height: 38px; border-radius: 10px; border: 1px solid rgba(245, 240, 229, .2); display: grid; place-items: center; }
.tn-social a:hover { background: rgba(245, 240, 229, .1); border-color: var(--tn-gold); }
.tn-social svg { width: 18px; height: 18px; }

/* Announcement bar */
.tn-announce { background: var(--tn-gold); color: #17101F; font-size: .875rem; font-weight: 500; padding-block: .45rem; text-align: center; }

/* Breadcrumb */
.tn-breadcrumb { font-size: .8125rem; color: var(--tn-gray-mid); padding-block: 1rem; }
.tn-breadcrumb a { color: var(--tn-gray-mid); text-decoration: none; }
.tn-breadcrumb a:hover { color: var(--tn-green); }
.tn-breadcrumb .sep { margin-inline: .5rem; color: var(--tn-gold); }

/* ---------------- Motion (reduced-motion safe) ---------------- */
.tn-reveal { opacity: 0; translate: 0 12px; transition: opacity .5s ease, translate .5s ease; }
.tn-reveal.is-visible { opacity: 1; translate: 0 0; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .tn-reveal { opacity: 1; translate: none; }
}

/* Skeleton */
.tn-skeleton { background: linear-gradient(90deg, var(--tn-gray) 25%, #f2f1ec 50%, var(--tn-gray) 75%); background-size: 200% 100%; animation: tn-shimmer 1.4s infinite; border-radius: 8px; }
@keyframes tn-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Utils */
.tc-13 { font-size: .85rem; }
.tn-object-cover { object-fit: cover; }
.tn-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tn-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.visually-hidden-focusable:not(:focus):not(:focus-within) { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
