/* ═══════════════════════════════════════════
   TMD B2B HOMEPAGE — "Precision Authority"
   Geometric. Institutional. Trustworthy.
   Version: 1.2 — b.tmd.com (6-issue fix)
   ═══════════════════════════════════════════ */

/* Arabic Font */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;700;800&display=swap');

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

:root {
  --navy: #1e3a5f;
  --navy-deep: #0f172a;
  --royal: #2563eb;
  --royal-light: #3b82f6;
  --cyan-accent: #22d3ee;
  --slate: #1e293b;
  --slate-mid: #334155;
  --slate-muted: #64748b;
  --border: #e2e8f0;
  --surface: #f8fafc;
  --surface-warm: #f1f5f9;
  --white: #ffffff;
  --success: #10b981;
  --font: 'Plus Jakarta Sans', -apple-system, sans-serif;
  --max-w: 1280px;
  --radius: 2px;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font);
  color: var(--slate);
  background: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ──── UTILITY ──── */
.tmd-container {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 3rem);
}

/* ──── ANIMATIONS ──── */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeSlideRight {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleReveal {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes lineGrow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(1deg); }
}

@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* stagger children */
.stagger-children .animate-on-scroll:nth-child(1) { transition-delay: 0.05s; }
.stagger-children .animate-on-scroll:nth-child(2) { transition-delay: 0.12s; }
.stagger-children .animate-on-scroll:nth-child(3) { transition-delay: 0.19s; }
.stagger-children .animate-on-scroll:nth-child(4) { transition-delay: 0.26s; }
.stagger-children .animate-on-scroll:nth-child(5) { transition-delay: 0.33s; }
.stagger-children .animate-on-scroll:nth-child(6) { transition-delay: 0.40s; }
.stagger-children .animate-on-scroll:nth-child(7) { transition-delay: 0.47s; }
.stagger-children .animate-on-scroll:nth-child(8) { transition-delay: 0.54s; }

/* ════════════════════════════════════════════
   § 0 — TOP TICKER BAR
   ════════════════════════════════════════════ */
.tmd-ticker {
  background: var(--navy-deep);
  color: var(--slate-muted);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  overflow: hidden;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.tmd-ticker__track {
  display: flex;
  width: max-content;
  animation: tickerScroll 40s linear infinite;
}

.tmd-ticker__track:hover {
  animation-play-state: paused;
}

.tmd-ticker__item {
  white-space: nowrap;
  padding-inline: 2.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tmd-ticker__dot {
  width: 4px;
  height: 4px;
  background: var(--royal);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ════════════════════════════════════════════
   § 1 — HERO
   ════════════════════════════════════════════ */
.tmd-hero {
  position: relative;
  background: linear-gradient(165deg, var(--navy) 0%, var(--navy-deep) 55%, #070d18 100%);
  padding: clamp(4rem, 10vw, 8rem) 0 clamp(5rem, 12vw, 10rem);
  overflow: hidden;
  isolation: isolate;
}

/* geometric grid overlay */
.tmd-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(37,99,235,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37,99,235,0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 70% at 70% 40%, black 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 70% 40%, black 0%, transparent 70%);
  z-index: 1;
}

/* angular accent shape */
.tmd-hero::after {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 55%;
  height: 140%;
  background: linear-gradient(135deg, rgba(37,99,235,0.08), rgba(34,211,238,0.04));
  clip-path: polygon(25% 0%, 100% 0%, 100% 100%, 0% 100%);
  z-index: 1;
}

.tmd-hero__inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}

.tmd-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(37,99,235,0.15);
  border: 1px solid rgba(37,99,235,0.3);
  color: var(--cyan-accent);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.4rem 1rem;
  margin-bottom: 1.5rem;
  animation: fadeSlideRight 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.tmd-hero__badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--cyan-accent);
  animation: pulseGlow 2s ease-in-out infinite;
}

.tmd-hero h1 {
  font-size: clamp(2.2rem, 5.5vw, 4.2rem);
  font-weight: 800;
  line-height: 1.08;
  color: var(--white);
  letter-spacing: -0.03em;
  max-width: 16ch;
  animation: fadeSlideUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

.tmd-hero h1 span {
  background: linear-gradient(135deg, var(--royal-light), var(--cyan-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tmd-hero__sub {
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  color: rgba(255,255,255,0.55);
  max-width: 48ch;
  line-height: 1.7;
  font-weight: 400;
  margin-top: 1.25rem;
  animation: fadeSlideUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.45s both;
}

.tmd-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.5rem;
  animation: fadeSlideUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.6s both;
}

.tmd-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.85rem 2rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  letter-spacing: 0.01em;
}

.tmd-btn--primary {
  background: var(--royal);
  color: var(--white);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.tmd-btn--primary:hover {
  background: var(--royal-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(37,99,235,0.35);
}

.tmd-btn--ghost {
  background: transparent;
  color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.2);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.tmd-btn--ghost:hover {
  border-color: var(--cyan-accent);
  color: var(--cyan-accent);
  background: rgba(34,211,238,0.05);
}

.tmd-btn__arrow {
  transition: transform 0.25s;
}

.tmd-btn:hover .tmd-btn__arrow {
  transform: translateX(3px);
}

/* floating geometric accent on right */
.tmd-hero__graphic {
  display: none;
}

@media (min-width: 900px) {
  .tmd-hero__inner {
    grid-template-columns: 1fr 0.6fr;
  }

  .tmd-hero__graphic {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
  }

  .tmd-hero__graphic-shape {
    width: 280px;
    height: 280px;
    border: 2px solid rgba(37,99,235,0.2);
    transform: rotate(45deg);
    position: relative;
    animation: float 6s ease-in-out infinite;
  }

  .tmd-hero__graphic-shape::before {
    content: '';
    position: absolute;
    inset: 20px;
    border: 1px solid rgba(34,211,238,0.15);
  }

  .tmd-hero__graphic-shape::after {
    content: '';
    position: absolute;
    inset: 45px;
    background: linear-gradient(135deg, rgba(37,99,235,0.1), rgba(34,211,238,0.05));
    backdrop-filter: blur(1px);
  }

  .tmd-hero__graphic-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    color: rgba(255,255,255,0.7);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    white-space: nowrap;
  }
}

/* ════════════════════════════════════════════
   § 2 — TRUST SIGNALS
   ════════════════════════════════════════════ */
.tmd-trust {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 5;
}

.tmd-trust__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
}

@media (min-width: 700px) {
  .tmd-trust__grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.tmd-trust__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 1rem;
  border-inline-end: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}

@media (min-width: 700px) {
  .tmd-trust__item {
    border-bottom: none;
  }
  .tmd-trust__item:last-child {
    border-inline-end: none;
  }
}

.tmd-trust__item:hover {
  background: var(--surface);
}

.tmd-trust__icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  color: var(--royal);
}

.tmd-trust__icon svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tmd-trust__title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--slate);
  margin-bottom: 0.25rem;
  letter-spacing: 0.01em;
}

.tmd-trust__desc {
  font-size: 0.75rem;
  color: var(--slate-muted);
  font-weight: 500;
}

/* ════════════════════════════════════════════
   § 3 — FEATURED CATEGORIES
   ════════════════════════════════════════════ */
.tmd-categories {
  padding: clamp(4rem, 8vw, 7rem) 0;
  background: var(--surface);
}

.tmd-section-header {
  margin-bottom: 3rem;
}

.tmd-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--royal);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.tmd-section-label::before {
  content: '';
  width: 24px;
  height: 2px;
  background: var(--royal);
}

.tmd-section-title {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 800;
  color: var(--slate);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.tmd-categories__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 768px) {
  .tmd-categories__grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
  }
}

.tmd-cat-card {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--navy-deep);
  cursor: pointer;
  text-decoration: none;
  display: block;
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
}

.tmd-cat-card__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.35;
  transition: opacity 0.5s, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.tmd-cat-card:hover .tmd-cat-card__bg {
  opacity: 0.55;
  transform: scale(1.08);
}

.tmd-cat-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(15,23,42,0.95) 100%);
  z-index: 1;
}

.tmd-cat-card__content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
  z-index: 2;
}

.tmd-cat-card__count {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--cyan-accent);
  margin-bottom: 0.35rem;
}

.tmd-cat-card__name {
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.tmd-cat-card__arrow {
  width: 32px;
  height: 32px;
  background: var(--royal);
  display: flex;
  align-items: center;
  justify-content: center;
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
  transform: translateX(-8px);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.tmd-cat-card:hover .tmd-cat-card__arrow {
  transform: translateX(0);
  opacity: 1;
}

.tmd-cat-card__arrow svg {
  width: 14px;
  height: 14px;
  stroke: white;
  fill: none;
  stroke-width: 2;
}

/* ════════════════════════════════════════════
   § 4 — LATEST PRODUCTS
   ════════════════════════════════════════════ */
.tmd-products {
  padding: clamp(4rem, 8vw, 7rem) 0;
  background: var(--white);
}

.tmd-products__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 900px) {
  .tmd-products__grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
  }
}

.tmd-product-card {
  background: var(--white);
  border: 1px solid var(--border);
  position: relative;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  display: block;
}

.tmd-product-card:hover {
  border-color: var(--royal);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(30,58,95,0.1);
}

.tmd-product-card__img {
  aspect-ratio: 1;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.tmd-product-card__img-placeholder {
  width: 60%;
  height: 60%;
  background: linear-gradient(135deg, var(--border) 0%, var(--surface-warm) 100%);
  clip-path: polygon(10% 0, 90% 0, 100% 10%, 100% 90%, 90% 100%, 10% 100%, 0 90%, 0 10%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tmd-product-card__img-placeholder svg {
  width: 32px;
  height: 32px;
  stroke: var(--slate-muted);
  fill: none;
  stroke-width: 1;
  opacity: 0.4;
}

.tmd-product-card__badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  inset-inline-start: 0.75rem;
  background: var(--royal);
  color: var(--white);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
}

.tmd-product-card__body {
  padding: 1rem;
}

.tmd-product-card__sku {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--slate-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.tmd-product-card__name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--slate);
  line-height: 1.35;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tmd-product-card__price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.tmd-product-card__price {
  font-size: 1rem;
  font-weight: 800;
  color: var(--navy);
}

.tmd-product-card__price-currency {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--slate-muted);
}

.tmd-product-card__stock {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.tmd-product-card__stock::before {
  content: '';
  width: 5px;
  height: 5px;
  background: var(--success);
  border-radius: 50%;
}

/* Wholesale note */
.tmd-products__note {
  text-align: center;
  margin-top: 2.5rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px dashed var(--border);
  font-size: 0.8rem;
  color: var(--slate-muted);
  font-weight: 500;
}

.tmd-products__note strong {
  color: var(--royal);
}

/* ════════════════════════════════════════════
   § 5 — WHY PARTNER
   ════════════════════════════════════════════ */
.tmd-why {
  padding: clamp(4rem, 8vw, 7rem) 0;
  background: var(--surface);
  position: relative;
}

.tmd-why__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .tmd-why__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }
}

.tmd-why-card {
  background: var(--white);
  padding: 2.5rem 2rem;
  border: 1px solid var(--border);
  position: relative;
  transition: all 0.35s;
}

.tmd-why-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  inset-inline-start: 0;
  width: 3px;
  height: 0;
  background: var(--royal);
  transition: height 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.tmd-why-card:hover::before {
  height: 100%;
}

.tmd-why-card:hover {
  border-color: rgba(37,99,235,0.2);
  box-shadow: 0 8px 30px rgba(30,58,95,0.06);
}

.tmd-why-card__number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--royal);
  line-height: 1;
  margin-bottom: 1rem;
  letter-spacing: -0.04em;
}

.tmd-why-card__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--slate);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.tmd-why-card__desc {
  font-size: 0.85rem;
  color: var(--slate-muted);
  line-height: 1.7;
}

/* ════════════════════════════════════════════
   § 6 — CTA BANNER
   ════════════════════════════════════════════ */
.tmd-cta {
  position: relative;
  background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy) 60%, #1a3f6e 100%);
  padding: clamp(4rem, 8vw, 6rem) 0;
  overflow: hidden;
  text-align: center;
}

.tmd-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(37,99,235,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37,99,235,0.05) 1px, transparent 1px);
  background-size: 40px 40px;
}

.tmd-cta__inner {
  position: relative;
  z-index: 2;
}

.tmd-cta h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.6rem);
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}

.tmd-cta__sub {
  font-size: 1rem;
  color: rgba(255,255,255,0.5);
  margin-bottom: 2.5rem;
  max-width: 50ch;
  margin-inline: auto;
}

.tmd-cta__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.tmd-btn--whatsapp {
  background: #25d366;
  color: var(--white);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.tmd-btn--whatsapp:hover {
  background: #20bd5a;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(37,211,102,0.3);
}

/* ════════════════════════════════════════════
   § 7 — FOOTER BRAND LINE
   ════════════════════════════════════════════ */
.tmd-footer-brand {
  background: var(--navy-deep);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 1.5rem 0;
  text-align: center;
}

.tmd-footer-brand p {
  font-size: 0.75rem;
  color: var(--slate-muted);
  font-weight: 500;
}

.tmd-footer-brand strong {
  color: rgba(255,255,255,0.4);
}

/* ════════════════════════════════════════════
   § 8 — RESPONSIVE REFINEMENTS
   ════════════════════════════════════════════ */
@media (max-width: 640px) {
  .tmd-hero h1 {
    font-size: 2rem;
  }

  .tmd-hero__actions {
    flex-direction: column;
  }

  .tmd-btn {
    justify-content: center;
    width: 100%;
  }

  .tmd-cat-card {
    aspect-ratio: 3 / 3.5;
  }

  .tmd-why-card {
    padding: 1.75rem 1.5rem;
  }
}

/* ════════════════════════════════════════════
   § 9 — ASTRA OVERRIDES
   ════════════════════════════════════════════ */

/* FIX: Logo size constraint */
.site-logo-img .custom-logo,
.ast-header-custom-item .custom-logo,
.site-branding img {
  max-width: 120px !important;
  max-height: 40px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain;
}

/* Compact header */
.ast-primary-header-bar {
  padding-top: 0.4rem !important;
  padding-bottom: 0.4rem !important;
}

/* Mobile header: smaller logo */
@media (max-width: 921px) {
  .site-logo-img .custom-logo,
  .ast-header-custom-item .custom-logo,
  .site-branding img {
    max-width: 90px !important;
    max-height: 32px !important;
  }

  /* Clean up mobile menu — target ALL Astra mobile selectors */
  .ast-mobile-header-content .main-header-menu,
  .ast-mobile-popup-content .main-header-menu {
    padding: 0.5rem 1rem !important;
    background: #ffffff !important;
  }

  .ast-mobile-header-content .main-header-menu li,
  .ast-mobile-popup-content .main-header-menu li {
    border-bottom: 1px solid #e2e8f0 !important;
    list-style: none !important;
  }

  .ast-mobile-header-content .main-header-menu li:last-child,
  .ast-mobile-popup-content .main-header-menu li:last-child {
    border-bottom: none !important;
  }

  .ast-mobile-header-content .menu-link,
  .ast-mobile-popup-content .menu-link,
  .ast-mobile-header-content .main-header-menu a,
  .ast-mobile-popup-content .main-header-menu a {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    padding: 0.85rem 0.5rem !important;
    color: #0f172a !important;
    text-decoration: none !important;
    display: block !important;
  }

  .ast-mobile-header-content .menu-link:hover,
  .ast-mobile-popup-content .menu-link:hover {
    color: #2563EB !important;
  }

  /* Force mobile menu background white */
  .ast-mobile-header-content,
  .ast-mobile-popup-inner {
    background: #ffffff !important;
  }
}

/* Override Astra default body padding on homepage */
.tmd-page .site-content > .ast-container,
.tmd-b2b-homepage .site-content > .ast-container {
  max-width: 100%;
  padding: 0;
}

.tmd-page #primary,
.tmd-b2b-homepage #primary {
  padding: 0;
  margin: 0;
}

/* Full-width entry content */
.tmd-page .entry-content,
.tmd-b2b-homepage .entry-content {
  max-width: 100%;
  padding: 0;
  margin: 0;
}

/* Remove Astra default post title on homepage */
.tmd-b2b-homepage .entry-header,
.tmd-b2b-homepage .ast-archive-description {
  display: none;
}

/* ════════════════════════════════════════════
   § 10 — ARABIC / RTL SUPPORT
   ════════════════════════════════════════════ */

/* Arabic font family */
[lang="ar"] body,
[dir="rtl"] body,
.tmd-ar {
  font-family: 'Cairo', 'Plus Jakarta Sans', -apple-system, sans-serif;
}

/* Flip arrows for RTL */
[dir="rtl"] .tmd-btn__arrow,
.tmd-ar .tmd-btn__arrow {
  transform: scaleX(-1);
}

[dir="rtl"] .tmd-btn:hover .tmd-btn__arrow,
.tmd-ar .tmd-btn:hover .tmd-btn__arrow {
  transform: scaleX(-1) translateX(-3px);
}

[dir="rtl"] .tmd-cat-card__arrow,
.tmd-ar .tmd-cat-card__arrow {
  transform: translateX(8px) scaleX(-1);
}

[dir="rtl"] .tmd-cat-card:hover .tmd-cat-card__arrow,
.tmd-ar .tmd-cat-card:hover .tmd-cat-card__arrow {
  transform: translateX(0) scaleX(-1);
  opacity: 1;
}

/* RTL section label line */
[dir="rtl"] .tmd-section-label::before,
.tmd-ar .tmd-section-label::before {
  order: 1;
}

/* RTL why-card accent bar */
[dir="rtl"] .tmd-why-card::before,
.tmd-ar .tmd-why-card::before {
  left: auto;
  right: 0;
}

/* ════════════════════════════════════════════
   § 11 — LANGUAGE SWITCHER
   ════════════════════════════════════════════ */
.tmd-lang-switch {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 999;
  display: flex;
  gap: 0;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  font-family: var(--font);
}

.tmd-lang-switch a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  letter-spacing: 0.02em;
}

.tmd-lang-switch a.active {
  background: var(--royal);
  color: var(--white);
}

.tmd-lang-switch a:not(.active) {
  background: var(--white);
  color: var(--slate);
  border: 1px solid var(--border);
}

.tmd-lang-switch a:not(.active):hover {
  background: var(--surface);
}

/* ════════════════════════════════════════════
   § 12 — ACCESSIBILITY
   ════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .animate-on-scroll,
  .tmd-ticker__track,
  .tmd-hero__graphic-shape {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* Focus visible for keyboard navigation */
.tmd-btn:focus-visible,
.tmd-cat-card:focus-visible,
.tmd-product-card:focus-visible {
  outline: 2px solid var(--cyan-accent);
  outline-offset: 2px;
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ════════════════════════════════════════════
   § 13 — ASTRA FOOTER HIDE (Homepage)
   ════════════════════════════════════════════ */
.tmd-b2b-homepage .site-footer,
.tmd-b2b-homepage .ast-footer-copyright,
.tmd-b2b-homepage .site-below-footer-wrap,
.tmd-b2b-homepage .ast-small-footer,
.tmd-b2b-homepage .ast-footer-overlay,
.tmd-b2b-homepage footer.site-footer {
  display: none !important;
}

/* ════════════════════════════════════════════
   § 14 — B2B GUEST PRICE HIDING
   ════════════════════════════════════════════ */
.tmd-guest .tmd-product-card__price-row {
  display: none !important;
}

.tmd-product-card__login-msg {
  display: none;
  font-size: 0.78rem;
  color: var(--royal);
  font-weight: 600;
  text-align: center;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border);
}

.tmd-guest .tmd-product-card__login-msg {
  display: block;
}

/* WooCommerce-wide guest price hiding (shop, product, category pages) */
.tmd-guest .woocommerce-Price-amount,
.tmd-guest .tiered-pricing-wrapper,
.tmd-guest .tiered-pricing-block__price,
.tmd-guest .tiered-pricing-block__price-discount,
.tmd-guest .product .summary .price,
.tmd-guest .woocommerce-variation-price,
.tmd-guest .single_add_to_cart_button,
.tmd-guest form.cart .quantity {
  display: none !important;
}

/* ════════════════════════════════════════════
   § 15 — ENHANCED ARABIC / RTL
   ════════════════════════════════════════════ */

/* Explicit Arabic font for all TMD elements */
.tmd-ar,
.tmd-ar .tmd-ticker__item,
.tmd-ar .tmd-hero__badge,
.tmd-ar .tmd-hero h1,
.tmd-ar .tmd-hero__sub,
.tmd-ar .tmd-section-label,
.tmd-ar .tmd-section-title,
.tmd-ar .tmd-trust__title,
.tmd-ar .tmd-trust__desc,
.tmd-ar .tmd-cat-card__name,
.tmd-ar .tmd-cat-card__count,
.tmd-ar .tmd-product-card__name,
.tmd-ar .tmd-product-card__stock,
.tmd-ar .tmd-products__note,
.tmd-ar .tmd-why-card__title,
.tmd-ar .tmd-why-card__desc,
.tmd-ar .tmd-cta h2,
.tmd-ar .tmd-cta__sub,
.tmd-ar .tmd-btn,
.tmd-ar .tmd-footer-brand p,
.tmd-ar .tmd-product-card__login-msg {
  font-family: 'Cairo', 'Plus Jakarta Sans', -apple-system, sans-serif !important;
}

/* RTL text alignment overrides */
.tmd-ar .tmd-hero__content {
  text-align: right;
}

.tmd-ar .tmd-section-header {
  text-align: right;
}

.tmd-ar .tmd-why-card {
  text-align: right;
}

.tmd-ar .tmd-products__note {
  direction: rtl;
  text-align: center;
}

.tmd-ar .tmd-footer-brand p {
  direction: rtl;
}

.tmd-ar .tmd-hero h1 {
  max-width: none;
}

/* ════════════════════════════════════════════
   § 16 — SVG PLACEHOLDER VISIBILITY
   ════════════════════════════════════════════ */
.tmd-product-card__img-placeholder {
  display: flex !important;
  visibility: visible !important;
}

.tmd-product-card__img-placeholder svg {
  display: block !important;
  visibility: visible !important;
  width: 36px;
  height: 36px;
  opacity: 0.45;
}

.tmd-cat-card__bg[style] {
  display: block !important;
  visibility: visible !important;
}

/* ════════════════════════════════════════════
   § 17 — FLOATING WHATSAPP BUTTON
   ════════════════════════════════════════════ */
.tmd-whatsapp-float {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: #25D366;
  border-radius: 50%;
  color: #fff;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
}

.tmd-whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(37, 211, 102, 0.5);
  color: #fff;
}

.tmd-whatsapp-float svg {
  width: 28px;
  height: 28px;
}

/* Pulse animation for attention */
.tmd-whatsapp-float::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #25D366;
  z-index: -1;
  animation: tmd-wa-pulse 2s ease-in-out infinite;
}

@keyframes tmd-wa-pulse {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.3); opacity: 0; }
}

/* RTL: move to left side but avoid lang switcher */
.tmd-ar .tmd-whatsapp-float {
  right: auto;
  left: 1.5rem;
}

/* Move language switcher up when in RTL (WhatsApp takes bottom-left) */
.tmd-ar .tmd-lang-switch {
  bottom: 5rem;
}

/* Mobile: stack vertically to avoid overlap */
@media (max-width: 768px) {
  .tmd-whatsapp-float {
    bottom: 1rem;
    right: 1rem;
    width: 50px;
    height: 50px;
  }
  .tmd-whatsapp-float svg {
    width: 24px;
    height: 24px;
  }
  .tmd-lang-switch {
    bottom: 4.5rem !important;
    left: 1rem;
  }
}

/* ════════════════════════════════════════════
   § 18 — INNER PAGES (Contact Us, About Us)
   ════════════════════════════════════════════ */

/* Content wrapper for inner pages */
.tmd-page-content {
  max-width: var(--max-w, 1280px);
  margin-inline: auto;
}

/* Astra overrides for inner pages */
.tmd-b2b-inner .site-content > .ast-container {
  max-width: 100%;
  padding: 0;
}

.tmd-b2b-inner #primary {
  padding: 0;
  margin: 0;
}

.tmd-b2b-inner .entry-content {
  max-width: 100%;
  padding: 0;
  margin: 0;
}

/* Hide Astra post title on inner pages (we use our own h1) */
.tmd-b2b-inner .entry-header,
.tmd-b2b-inner .ast-archive-description {
  display: none;
}

/* Hide language switcher on inner pages (no bilingual content yet) */
.tmd-b2b-inner .tmd-lang-switch {
  display: none;
}

/* Hide Astra footer on all TMD pages */
.tmd-page .site-footer {
  display: none !important;
}

/* Contact card hover effects */
.tmd-page-content a[style*="border-radius:12px"]:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.tmd-page-content a[style*="border-radius:12px"]:active {
  transform: translateY(0);
}
