:root {
  /* Brand colors — PAL EMS */
  --primary: #12366B;
  --primary-hover: #0D2852;
  --secondary: #D71927;
  --secondary-hover: #B91521;

  /* Backgrounds */
  --background: #FFFFFF;
  --background-light: #F4F6F9;
  --background-blue: #EAF2FB;

  /* Text */
  --text-primary: #12366B;
  --text-body: #344054;
  --text-muted: #667085;

  /* Borders and surfaces */
  --border-color: #E4EAF1;
  --card-background: #FFFFFF;

  /* Typography */
  --font-ar: "Cairo", sans-serif;
  --font-en: "Inter", "Cairo", sans-serif;

  /* UI */
  --border-radius: 12px;
  --shadow-card: 0 4px 16px rgba(18, 54, 107, 0.08);
}

* { font-family: var(--font-ar); }
.ems-ltr, [lang="en"], input[type="tel"], input[type="email"] { font-family: var(--font-en); }

html { font-size: 14px; }
@media (max-width: 768px) { html { font-size: 13.5px; } }
@media (max-width: 480px) { html { font-size: 13px; } }
h1, h2, h3, h4, h5, h6 { font-weight: 800; }

body {
  background: var(--background);
  color: var(--text-body);
}
h1, h2, h3, h4, h5, h6 { color: var(--text-primary); }

a { text-decoration: none; }

/* ══════════ Header ══════════ */
.ems-header {
  background: var(--primary);
  box-shadow: 0 2px 12px rgba(18,54,107,.25);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 14px 0;
}
.ems-header-row {
  display: flex;
  align-items: center;
  gap: 20px;
}
.ems-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 1.05rem;
  color: var(--primary);
  white-space: nowrap;
}
.ems-logo i { color: var(--secondary); font-size: 1.3rem; }
.ems-logo img { height: 40px; width: auto; }

.ems-nav { gap: 22px; margin-right: auto; }
.ems-nav a { color: var(--primary); font-weight: 700; font-size: .92rem; transition: .2s; }
.ems-nav a:hover { color: var(--secondary); }

.ems-search {
  flex: 1;
  max-width: 420px;
  background: var(--background-light);
  border-radius: 30px;
  padding: 9px 18px;
  align-items: center;
  gap: 10px;
}
.ems-search i { color: var(--text-muted); }
.ems-search input { border: none; background: transparent; outline: none; flex: 1; font-size: .88rem; }
.ems-search-mobile { margin-top: 10px; max-width: 100%; }

.ems-header-actions { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.ems-account-btn {
  background: var(--background-light); color: var(--primary); border: none;
  border-radius: 20px; padding: 8px 16px; font-weight: 700; font-size: .85rem;
  display: inline-flex; align-items: center;
}
.ems-account-btn:hover { background: var(--secondary); color: #fff; }
.ems-cart-btn, .ems-burger {
  position: relative;
  border: none;
  background: var(--background-light);
  width: 42px; height: 42px;
  border-radius: 50%;
  color: var(--primary);
  font-size: 1.05rem;
  display: flex; align-items: center; justify-content: center;
  transition: .2s;
}
.ems-cart-btn:hover, .ems-burger:hover { background: var(--secondary); color: #fff; }
.ems-cart-badge {
  position: absolute; top: -4px; left: -4px;
  background: var(--secondary); color: #fff;
  font-size: .65rem; font-weight: 800;
  min-width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

.ems-mobile-link { color: var(--primary); font-weight: 700; padding: 10px 0; border-bottom: 1px solid var(--border-color); }

/* ══════════ Cart Offcanvas ══════════ */
.ems-cart-offcanvas { width: 380px; }
.ems-cart-empty { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.ems-cart-empty i { font-size: 2rem; margin-bottom: 10px; display: block; }
.ems-cart-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-color); align-items: center; }
.ems-cart-item-info { flex: 1; min-width: 0; }
.ems-cart-item-name { font-weight: 700; font-size: .85rem; color: var(--primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ems-cart-item-price { font-size: .78rem; color: var(--text-muted); }
.ems-qty-ctrl { display: flex; align-items: center; gap: 6px; }
.ems-qty-ctrl button {
  width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--border-color);
  background: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.ems-cart-item-remove { color: #cbd5e1; border: none; background: none; font-size: .85rem; }
.ems-cart-item-remove:hover { color: var(--secondary); }
.ems-cart-footer { border-top: 1px solid var(--border-color); padding-top: 16px; margin-top: 10px; }
.ems-cart-total-row { display: flex; justify-content: space-between; font-weight: 800; margin-bottom: 12px; font-size: 1.05rem; }

.ems-btn-primary {
  background: var(--secondary); color: #fff; border: none;
  font-weight: 700; border-radius: 10px; padding: 9px 18px;
}
.ems-btn-primary:hover { background: var(--secondary-hover); color: #fff; }

/* ══════════ Hero ══════════ */
.ems-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: #fff;
  padding: 50px 0;
  overflow: hidden;
  position: relative;
}
.ems-hero h1 { font-size: 2rem; font-weight: 800; margin-bottom: 16px; }
.ems-hero p { font-size: 1rem; opacity: .85; margin-bottom: 26px; max-width: 480px; }
.ems-hero .ems-btn-primary { padding: 10px 26px; font-size: .95rem; }
.ems-hero-icon {
  font-size: 8rem; color: rgba(192,57,43,.25); position: absolute; left: 30px; top: 50%; transform: translateY(-50%);
}
@media (max-width: 991px) { .ems-hero-icon { display: none; } .ems-hero h1 { font-size: 1.5rem; } }

/* ══════════ Sections ══════════ */
.ems-section { padding-top: 36px; padding-bottom: 36px; }
.ems-section-title { font-weight: 800; font-size: 1.2rem; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.ems-section-title i { color: var(--secondary); }

/* ══════════ Categories ══════════ */
.ems-cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 991px) { .ems-cat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 575px) { .ems-cat-grid { grid-template-columns: repeat(2, 1fr); } }
.ems-cat-card {
  background: var(--card-background); border-radius: 16px; padding: 20px 12px;
  text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,.05);
  transition: .2s; color: var(--primary);
}
.ems-cat-card:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(0,0,0,.1); color: var(--secondary); }
.ems-cat-card .ems-cat-icon { font-size: 1.6rem; margin-bottom: 10px; }
.ems-cat-card .ems-cat-name { font-weight: 700; font-size: .88rem; }

/* ══════════ Product Grid ══════════ */
.ems-prod-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 991px) { .ems-prod-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 575px) { .ems-prod-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } }

.ems-prod-card {
  background: var(--card-background); border-radius: 16px; overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,.05); transition: .2s; display: flex; flex-direction: column; position: relative;
}
.ems-prod-card:hover { transform: translateY(-4px); box-shadow: 0 10px 26px rgba(0,0,0,.1); }
.ems-prod-img { aspect-ratio: 1/1; background: var(--background-light); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ems-prod-img img { width: 100%; height: 100%; object-fit: cover; }
.ems-prod-img i { font-size: 2rem; color: #cbd5e1; }
.ems-prod-body { padding: 14px; flex: 1; display: flex; flex-direction: column; }
.ems-prod-name { font-weight: 700; font-size: .9rem; color: var(--primary); margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.ems-prod-price-row { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.ems-prod-price { font-weight: 800; font-size: 1rem; color: var(--secondary); }
.ems-prod-compare { font-size: .8rem; color: var(--text-muted); text-decoration: line-through; }
.ems-prod-add { margin-top: auto; }

.ems-badge { position: absolute; top: 10px; right: 10px; font-size: .68rem; font-weight: 800; padding: 4px 10px; border-radius: 20px; color: #fff; z-index: 2; }
.ems-badge-new { background: #1e8449; }
.ems-badge-hot { background: #e67e22; }
.ems-badge-sale { background: var(--secondary); }
.ems-badge-low { background: #7d3c98; }

/* ══════════ Product Detail ══════════ */
.ems-pd-gallery-main { aspect-ratio: 1/1; background: var(--card-background); border-radius: 16px; display: flex; align-items: center; justify-content: center; overflow: hidden; margin-bottom: 12px; }
.ems-pd-gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.ems-pd-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.ems-pd-thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 2px solid transparent; cursor: pointer; }
.ems-pd-thumbs img.active { border-color: var(--secondary); }
.ems-pd-title { font-weight: 800; font-size: 1.25rem; margin-bottom: 10px; }
.ems-pd-price { font-size: 1.5rem; font-weight: 800; color: var(--secondary); }
.ems-pd-meta-table td { padding: 6px 0; font-size: .88rem; }
.ems-pd-meta-table td:first-child { color: var(--text-muted); font-weight: 700; width: 140px; }

/* ══════════ Filters / Sidebar ══════════ */
.ems-filter-box { background: var(--card-background); border-radius: 14px; padding: 18px; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.ems-filter-box h6 { font-weight: 800; margin-bottom: 12px; }

/* ══════════ Checkout ══════════ */
.ems-checkout-summary { background: var(--card-background); border-radius: 14px; padding: 20px; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.ems-summary-row { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: .92rem; }
.ems-summary-total { font-weight: 800; font-size: 1.1rem; border-top: 1px solid var(--border-color); padding-top: 12px; margin-top: 4px; }

/* ══════════ Footer ══════════ */
.ems-footer { background: var(--primary); color: #cbd5e1; margin-top: 40px; font-size: .88rem; }
.ems-footer a { color: #cbd5e1; transition: .15s; }
.ems-footer a:hover { color: #fff; }

.ft-features { background: #fff; border-top: 1px solid var(--border-color); }
.ft-features .container { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding-top: 20px; padding-bottom: 20px; }
.ft-feat { display: flex; align-items: center; gap: 12px; }
.ft-feat > i { flex-shrink: 0; width: 42px; height: 42px; border-radius: 12px; background: #fdecee; color: var(--secondary);
  display: flex; align-items: center; justify-content: center; font-size: 1.05rem; }
.ft-feat strong { display: block; color: var(--primary); font-size: .85rem; }
.ft-feat span { display: block; color: var(--text-muted); font-size: .75rem; }

.ft-main { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 32px; padding-top: 36px; padding-bottom: 28px; }
.ft-logo { display: inline-flex; align-items: center; gap: 10px; color: #fff !important; font-weight: 800; font-size: 1.05rem; margin-bottom: 10px; }
.ft-logo i { color: var(--secondary); font-size: 1.3rem; }
.ft-logo img { height: 36px; }
.ft-brand p { color: var(--text-muted); font-size: .82rem; line-height: 1.8; margin-bottom: 14px; max-width: 320px; }
.ems-social { display: flex; gap: 8px; }
.ems-social a { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.08); color: #fff; display: flex; align-items: center; justify-content: center; font-size: .9rem; }
.ems-social a:hover { background: var(--secondary); }

.ft-head { display: flex; align-items: center; justify-content: space-between; width: 100%; background: none; border: none; padding: 0;
  color: #fff; font-weight: 800; font-size: .92rem; margin-bottom: 12px; text-align: right; pointer-events: none; }
.ft-head i { display: none; font-size: .7rem; transition: transform .2s; }
.ft-col ul { list-style: none; padding: 0; margin: 0; }
.ft-col li { margin-bottom: 8px; }
.ft-col li a, .ft-plain { display: inline-flex; align-items: center; gap: 8px; font-size: .84rem; color: #cbd5e1; }
.ft-contact i { color: var(--secondary); width: 16px; text-align: center; }

.ft-bottom { border-top: 1px solid rgba(255,255,255,.08); }
.ft-bottom .container { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 14px; padding-bottom: 14px; font-size: .76rem; color: #8193a8; }
.ft-pay i { color: var(--text-muted); margin-left: 4px; }

@media (max-width: 991px) {
  .ft-main { grid-template-columns: 1fr 1fr; gap: 24px; }
  .ft-brand { grid-column: 1 / -1; }
}
@media (max-width: 767px) {
  .ems-footer { margin-top: 24px; }
  .ft-features .container { grid-template-columns: 1fr 1fr; gap: 12px; padding-top: 14px; padding-bottom: 14px; }
  .ft-feat { gap: 8px; }
  .ft-feat > i { width: 34px; height: 34px; font-size: .9rem; border-radius: 10px; }
  .ft-feat strong { font-size: .76rem; }
  .ft-feat span { display: none; }

  .ft-main { display: block; padding-top: 20px; padding-bottom: 8px; }
  .ft-brand { text-align: center; padding-bottom: 16px; }
  .ft-brand p { margin: 0 auto 12px; font-size: .78rem; }
  .ems-social { justify-content: center; }
  .ft-col { border-top: 1px solid rgba(255,255,255,.08); }
  .ft-head { pointer-events: auto; margin: 0; padding: 13px 0; }
  .ft-head i { display: inline-block; }
  .ft-head[aria-expanded="true"] i { transform: rotate(180deg); }
  .ft-col ul { padding-bottom: 10px; }
  .ft-contact ul { display: flex; flex-wrap: wrap; gap: 4px 16px; }
  .ft-contact .ft-head-static { padding-bottom: 8px; }
  .ft-bottom .container { justify-content: center; text-align: center; }
  .ft-pay { display: none; }
}

/* numbers / prices always LTR-safe */
.ems-ltr { direction: ltr; unicode-bidi: isolate; }

/* ══════════ Product Page ══════════ */
.pd-page { padding-top: 20px; }
.pd-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .8rem; color: var(--text-muted); margin-bottom: 18px; }
.pd-crumbs a { color: var(--text-muted); }
.pd-crumbs a:hover { color: var(--secondary); }
.pd-crumbs i { font-size: .6rem; }
.pd-crumbs span { color: var(--primary); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }

.pd-gallery { position: sticky; top: 90px; }
.pd-main { position: relative; aspect-ratio: 1/1; background: #fff; border-radius: 18px; border: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pd-placeholder { font-size: 4.5rem; color: var(--border-color); }
.pd-sale-tag { position: absolute; top: 14px; right: 14px; z-index: 2; background: var(--secondary); color: #fff;
  font-weight: 800; font-size: .8rem; padding: 4px 12px; border-radius: 20px; direction: ltr; }
.pd-thumbs { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; padding-bottom: 4px; }
.pd-thumb { flex: 0 0 72px; height: 72px; padding: 0; border: 2px solid var(--border-color); border-radius: 12px; background: #fff; overflow: hidden; cursor: pointer; transition: .15s; }
.pd-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pd-thumb.active, .pd-thumb:hover { border-color: var(--secondary); }

.pd-info { background: #fff; border-radius: 18px; border: 1px solid var(--border-color); padding: 24px; }
.pd-cat { display: inline-block; font-size: .78rem; font-weight: 700; color: var(--secondary); background: #fdecee;
  padding: 4px 12px; border-radius: 20px; margin-bottom: 10px; }
.pd-title { font-size: 1.45rem; font-weight: 800; line-height: 1.5; margin-bottom: 2px; color: var(--primary); }
.pd-title-en { font-size: .85rem; color: var(--text-muted); margin-bottom: 10px; text-align: right; }
.pd-meta-line { display: flex; flex-wrap: wrap; gap: 16px; font-size: .8rem; color: var(--text-muted); margin-bottom: 16px; }
.pd-meta-line i { color: #cbd5e1; margin-left: 4px; }

.pd-price-box { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; padding: 14px 0; border-top: 1px dashed var(--border-color); border-bottom: 1px dashed var(--border-color); margin-bottom: 14px; }
.pd-price { font-size: 1.9rem; font-weight: 800; color: var(--secondary); line-height: 1; }
.pd-price small { font-size: 1rem; }
.pd-compare { font-size: 1rem; color: var(--text-muted); text-decoration: line-through; }
.pd-save { font-size: .78rem; font-weight: 700; color: #1e8449; background: #e8f5e9; padding: 3px 10px; border-radius: 20px; }

.pd-stock { margin-bottom: 18px; }
.pd-pill { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 700; padding: 6px 14px; border-radius: 20px; }
.pd-pill-in  { background: #e8f5e9; color: #1e8449; }
.pd-pill-low { background: #fff7e6; color: #b45309; }
.pd-pill-out { background: #fdecea; color: var(--secondary); }

.pd-buy { display: flex; gap: 10px; margin-bottom: 10px; }
.pd-qty { display: flex; align-items: center; border: 1.5px solid var(--border-color); border-radius: 12px; overflow: hidden; flex-shrink: 0; }
.pd-qty button { width: 40px; height: 46px; border: none; background: var(--background-light); font-size: 1.1rem; font-weight: 700; color: var(--primary); }
.pd-qty button:hover { background: var(--border-color); }
.pd-qty input { width: 50px; height: 46px; border: none; text-align: center; font-weight: 700; -moz-appearance: textfield; }
.pd-qty input::-webkit-outer-spin-button, .pd-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pd-add { flex: 1; height: 46px; font-size: .95rem; }
.pd-wa { display: flex; align-items: center; justify-content: center; height: 44px; border-radius: 12px; border: 1.5px solid #25d366;
  color: #128c4b; font-weight: 700; font-size: .9rem; margin-bottom: 18px; transition: .15s; }
.pd-wa:hover { background: #25d366; color: #fff; }

.pd-trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.pd-trust div { background: var(--background-light); border-radius: 12px; padding: 12px 6px; text-align: center; font-size: .75rem; font-weight: 700; color: var(--text-body); }
.pd-trust i { display: block; font-size: 1.15rem; color: var(--secondary); margin-bottom: 6px; }

.pd-delivery { border: 1px solid var(--border-color); border-radius: 12px; overflow: hidden; }
.pd-delivery-head { background: var(--background-light); padding: 9px 14px; font-weight: 800; font-size: .85rem; }
.pd-delivery-head i { color: var(--secondary); margin-left: 6px; }
.pd-delivery-head { display: block; margin: 0; }
.pd-delivery-pick { padding: 10px 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pd-delivery-pick select { max-width: 200px; }
.pd-delivery-cost { font-size: .88rem; color: var(--primary); }
.pd-delivery-cost i { color: var(--secondary); margin-left: 4px; }
.pd-delivery-free { padding: 8px 14px; font-size: .78rem; color: #1e8449; background: #f0faf3; border-top: 1px solid var(--border-color); }

.pd-tabs-wrap { margin-top: 32px; background: #fff; border-radius: 18px; border: 1px solid var(--border-color); overflow: hidden; }
.pd-tabs { list-style: none; display: flex; gap: 4px; padding: 0 16px; margin: 0; border-bottom: 1px solid var(--border-color); }
.pd-tabs button { background: none; border: none; padding: 14px 16px; font-weight: 700; font-size: .9rem; color: var(--text-muted); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.pd-tabs button.active { color: var(--primary); border-bottom-color: var(--secondary); }
.pd-tab-body { padding: 22px 24px; }
.pd-desc { white-space: pre-line; line-height: 1.9; color: var(--text-body); font-size: .92rem; }
.pd-specs { width: 100%; max-width: 640px; font-size: .88rem; }
.pd-specs tr:nth-child(odd) { background: var(--background-light); }
.pd-specs th { width: 170px; padding: 10px 14px; color: var(--text-muted); font-weight: 700; }
.pd-specs td { padding: 10px 14px; color: var(--primary); font-weight: 600; }

.pd-sticky { position: fixed; bottom: 0; left: 0; right: 0; z-index: 1030; background: #fff; box-shadow: 0 -4px 16px rgba(0,0,0,.08);
  display: flex; align-items: center; gap: 12px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
.pd-sticky-price { font-weight: 800; font-size: 1.15rem; color: var(--secondary); }
.pd-sticky .btn { flex: 1; }
@media (max-width: 991px) {
  .pd-gallery { position: static; }
  .pd-page { padding-bottom: 80px; }
  .pd-info { padding: 18px; }
  .pd-title { font-size: 1.25rem; }
  .pd-price { font-size: 1.6rem; }
}

/* ══════════ Product Gallery Slider ══════════ */
.pd-main { cursor: zoom-in; user-select: none; }
.pd-track { display: flex; width: 100%; height: 100%; transition: transform .35s ease; }
.pd-slide { flex: 0 0 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.pd-slide img { width: 100%; height: 100%; object-fit: contain; padding: 18px; }
.pd-main:hover .pd-slide img { transform: none; }
.pd-nav, .pd-zoom-hint { position: absolute; z-index: 3; border: none; background: rgba(255,255,255,.92);
  box-shadow: 0 2px 10px rgba(0,0,0,.12); color: var(--primary); display: flex; align-items: center; justify-content: center; transition: .2s; }
.pd-nav { top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 50%; opacity: 0; }
.pd-nav-prev { right: 12px; }
.pd-nav-next { left: 12px; }
.pd-main:hover .pd-nav { opacity: 1; }
.pd-nav:hover, .pd-zoom-hint:hover { background: var(--secondary); color: #fff; }
.pd-zoom-hint { bottom: 12px; left: 12px; width: 36px; height: 36px; border-radius: 10px; font-size: .9rem; }
.pd-counter { position: absolute; bottom: 14px; right: 14px; z-index: 3; background: rgba(44,62,80,.75); color: #fff;
  font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.pd-thumbs { scroll-snap-type: x mandatory; scrollbar-width: thin; }
.pd-thumb { scroll-snap-align: center; opacity: .65; }
.pd-thumb.active, .pd-thumb:hover { opacity: 1; }
@media (hover: none) { .pd-nav { opacity: 1; width: 34px; height: 34px; } }

/* ══════════ Lightbox ══════════ */
.row > .lb { padding: 0; margin: 0; width: auto; }
.lb { position: fixed; inset: 0; z-index: 2000; background: rgba(12,17,24,.96); display: none; flex-direction: column; }
.lb.open { display: flex; animation: lbIn .2s ease; }
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }
.lb-top { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; color: #fff; position: relative; z-index: 3; }
.lb-count { font-size: .85rem; font-weight: 700; opacity: .85; }
.lb-tools { display: flex; gap: 8px; }
.lb-tools button, .lb-nav { border: none; background: rgba(255,255,255,.12); color: #fff; display: flex; align-items: center; justify-content: center; transition: .15s; }
.lb-tools button { width: 40px; height: 40px; border-radius: 10px; font-size: 1rem; }
.lb-tools button:hover, .lb-nav:hover { background: var(--secondary); }
.lb-stage { flex: 1; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; touch-action: none; cursor: zoom-in; }
.lb-stage.zoomed { cursor: grab; }
.lb-stage.zoomed:active { cursor: grabbing; }
.lb-stage img { max-width: 92vw; max-height: calc(100vh - 170px); object-fit: contain; transform-origin: center center; will-change: transform; user-select: none; -webkit-user-drag: none; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 46px; height: 46px; border-radius: 50%; font-size: 1.1rem; }
.lb-prev { right: 16px; }
.lb-next { left: 16px; }
.lb-thumbs { display: flex; justify-content: center; gap: 8px; padding: 10px 16px 6px; overflow-x: auto; position: relative; z-index: 3; }
.lb-thumb { flex: 0 0 56px; height: 56px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: #222; opacity: .5; transition: .15s; }
.lb-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lb-thumb.active, .lb-thumb:hover { opacity: 1; border-color: var(--secondary); }
.lb-hint { text-align: center; color: rgba(255,255,255,.45); font-size: .72rem; padding: 4px 16px calc(10px + env(safe-area-inset-bottom)); }
@media (max-width: 768px) {
  .lb-nav { width: 38px; height: 38px; }
  .lb-stage img { max-width: 100vw; max-height: calc(100vh - 160px); }
  .lb-hint { display: none; }
}
@media (max-width: 991px) { body:has(.pd-sticky) .ft-bottom { padding-bottom: 64px; } }


/* ══════════ PAL EMS theme overrides ══════════ */
.ems-logo, .ems-logo span { color: #fff; }
.ems-logo i { color: #fff; background: var(--secondary); width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem; }
.ems-nav a { color: rgba(255,255,255,.85); }
.ems-nav a:hover { color: #fff; }
.ems-search { background: #fff; }
.ems-search i { color: var(--text-muted); }
.ems-cart-btn, .ems-burger { background: rgba(255,255,255,.12); color: #fff; }
.ems-cart-btn:hover, .ems-burger:hover { background: var(--secondary); color: #fff; }
.ems-cart-badge { box-shadow: 0 0 0 2px var(--primary); }
.ems-account-btn { background: rgba(255,255,255,.12); color: #fff; }
.ems-account-btn:hover, .ems-account-btn.show { background: #fff; color: var(--primary); }

.ems-hero { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%); }
.ems-hero-icon { color: rgba(255,255,255,.08); }

.ems-section.bg-white { background: var(--background-light) !important; }
.ems-cat-card, .ems-prod-card, .ems-filter-box, .ems-checkout-summary, .pd-info, .pd-tabs-wrap, .pd-main {
  border: 1px solid var(--border-color); box-shadow: var(--shadow-card); border-radius: var(--border-radius);
}
.ems-cat-card:hover { color: var(--primary); border-color: var(--background-blue); background: var(--background-blue); }
.ems-prod-card:hover { box-shadow: 0 10px 28px rgba(18,54,107,.14); }
.ems-prod-name { color: var(--text-primary); }
.ems-btn-primary { background: var(--secondary); border-radius: 10px; }
.ems-btn-primary:hover { background: var(--secondary-hover); }
.ems-section-title i { color: var(--secondary); }

.pd-cat { color: var(--primary); background: var(--background-blue); }
.pd-trust div { background: var(--background-blue); color: var(--primary); }
.pd-delivery-head, .pd-specs tr:nth-child(odd) { background: var(--background-light); }
.ft-feat > i { background: var(--background-blue); color: var(--primary); }
.ft-features { border-top: 1px solid var(--border-color); }

.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 .2rem rgba(18,54,107,.12); }
a { color: var(--primary); }
.page-link { color: var(--primary); }
.page-item.active .page-link { background: var(--primary); border-color: var(--primary); }

/* Hero: خلفية حمراء، نص أبيض، زر أزرق */
.ems-hero { background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-hover) 100%); color: #fff; }
.ems-hero h1, .ems-hero p { color: #fff; }
.ems-hero .ems-btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 18px rgba(18,54,107,.35); }
.ems-hero .ems-btn-primary:hover { background: var(--primary-hover); color: #fff; }
.ems-hero-icon { color: rgba(255,255,255,.12); }

/* ══════════ Hero Slider ══════════ */
.hs { position: relative; overflow: hidden; background: var(--primary); color: #fff; isolation: isolate; }
.hs-viewport { position: relative; height: clamp(360px, 46vw, 520px); }
.hs-slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .8s ease, visibility 0s linear .8s; display: flex; align-items: center; }
.hs-slide.is-active { opacity: 1; visibility: visible; transition: opacity .8s ease, visibility 0s; z-index: 1; }

/* خلفيات الألوان */
.hs-red  { background: radial-gradient(120% 140% at 85% 10%, #EC3340 0%, var(--secondary) 45%, #9E0F1A 100%); }
.hs-blue { background: radial-gradient(120% 140% at 85% 10%, #1E4F96 0%, var(--primary) 50%, #0A2148 100%); }
.hs-dark { background: radial-gradient(120% 140% at 85% 10%, #1B2C47 0%, #0E1A2E 55%, #070D18 100%); }

/* زخارف للشرائح بدون صور */
.hs-art { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.hs-art::before { content: ""; position: absolute; inset: 0; opacity: .07;
  background-image: radial-gradient(#fff 1.2px, transparent 1.2px); background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(to left, #000 0%, transparent 70%); mask-image: linear-gradient(to left, #000 0%, transparent 70%); }
.hs-glow { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .45; }
.hs-glow-1 { width: 420px; height: 420px; left: -80px; top: -120px; background: rgba(255,255,255,.18); }
.hs-glow-2 { width: 360px; height: 360px; left: 22%; bottom: -200px; background: rgba(0,0,0,.25); }
.hs-blue .hs-glow-1 { background: rgba(215,25,39,.35); }
.hs-dark .hs-glow-1 { background: rgba(215,25,39,.30); }
.hs-ecg { position: absolute; left: 0; right: 0; bottom: 18%; width: 100%; height: 90px; opacity: .22; }
.hs-ecg path { fill: none; stroke: #fff; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round;
  stroke-dasharray: 2400; stroke-dashoffset: 2400; }
.hs-slide.is-active .hs-ecg path { animation: hsEcg 2.6s ease-out .3s forwards; }
@keyframes hsEcg { to { stroke-dashoffset: 0; } }
.hs-bigicon { position: absolute; left: 7%; top: 50%; font-size: clamp(7rem, 17vw, 15rem); color: rgba(255,255,255,.1);
  transform: translateY(-50%) rotate(-6deg) scale(.92); transition: transform 6s ease-out; }
.hs-slide.is-active .hs-bigicon { transform: translateY(-50%) rotate(-6deg) scale(1.04); }

/* شرائح بصور */
.hs-media { position: absolute; inset: 0; }
.hs-media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); transition: transform 7s ease-out; }
.hs-slide.is-active .hs-media img { transform: scale(1); }
.hs-overlay { position: absolute; inset: 0; }
.hs-red .hs-overlay  { background: linear-gradient(to left, var(--secondary) 15%, rgba(215,25,39,.35)); }
.hs-blue .hs-overlay { background: linear-gradient(to left, var(--primary) 15%, rgba(18,54,107,.35)); }
.hs-dark .hs-overlay { background: linear-gradient(to left, #0B1424 15%, rgba(11,20,36,.3)); }
.hs-slide.has-img { background: #0B1424; }

/* المحتوى */
.hs-content { position: relative; z-index: 2; width: 100%; }
.hs-text { max-width: 620px; }
.hs-align-center .hs-text { margin: 0 auto; text-align: center; }
.hs-align-center .hs-btns { justify-content: center; }
.hs-badge { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28);
  backdrop-filter: blur(6px); color: #fff; font-size: .8rem; font-weight: 700; padding: 6px 14px; border-radius: 30px; margin-bottom: 16px; }
.hs-title { color: #fff !important; font-size: clamp(1.7rem, 3.6vw, 2.9rem); font-weight: 800; line-height: 1.35; margin-bottom: 14px; white-space: pre-line; text-wrap: balance; }
.hs-sub { color: rgba(255,255,255,.88); font-size: clamp(.92rem, 1.4vw, 1.08rem); line-height: 1.8; margin-bottom: 26px; max-width: 520px; }
.hs-align-center .hs-sub { margin-left: auto; margin-right: auto; }
.hs-btns { display: flex; flex-wrap: wrap; gap: 12px; }
.hs-btn { display: inline-flex; align-items: center; gap: 10px; padding: 12px 26px; border-radius: 12px; font-weight: 700; font-size: .95rem; transition: .2s; }
.hs-btn i { font-size: .8rem; transition: transform .2s; }
.hs-btn:hover i { transform: translateX(-4px); }
.hs-btn-main { background: var(--primary); color: #fff !important; box-shadow: 0 8px 22px rgba(10,33,72,.35); }
.hs-btn-main:hover { background: var(--primary-hover); transform: translateY(-2px); }
.hs-blue .hs-btn-main, .hs-dark .hs-btn-main { background: var(--secondary); box-shadow: 0 8px 22px rgba(158,15,26,.35); }
.hs-blue .hs-btn-main:hover, .hs-dark .hs-btn-main:hover { background: var(--secondary-hover); }
.hs-btn-ghost { color: #fff !important; border: 1.5px solid rgba(255,255,255,.55); background: rgba(255,255,255,.06); }
.hs-btn-ghost:hover { background: #fff; color: var(--primary) !important; border-color: #fff; }

/* دخول متتابع للنص */
.hs-anim { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.hs-slide.is-active .hs-anim { opacity: 1; transform: none; transition-delay: calc(.25s + var(--d) * .12s); }

/* أسهم ونقاط */
.hs-arrow { position: absolute; top: 50%; z-index: 3; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.12); backdrop-filter: blur(6px); color: #fff;
  display: flex; align-items: center; justify-content: center; opacity: 0; transition: .25s; }
.hs-prev { right: 22px; }
.hs-next { left: 22px; }
.hs:hover .hs-arrow, .hs-arrow:focus-visible { opacity: 1; }
.hs-arrow:hover { background: #fff; color: var(--primary); }
.hs-dots { position: absolute; bottom: 22px; left: 0; right: 0; z-index: 3; display: flex; justify-content: center; gap: 8px; }
.hs-dot { width: 34px; height: 4px; padding: 0; border: none; border-radius: 4px; background: rgba(255,255,255,.35); overflow: hidden; position: relative; transition: width .3s; }
.hs-dot span { position: absolute; inset: 0; background: #fff; transform-origin: right; transform: scaleX(0); }
.hs-dot.is-active { width: 54px; }
.hs-dot.is-active span { animation: hsProgress var(--hs-interval, 6000ms) linear forwards; }
.hs.is-paused .hs-dot.is-active span, .hs.is-reduced .hs-dot.is-active span { animation-play-state: paused; }
.hs.is-reduced .hs-dot.is-active span { transform: scaleX(1); animation: none; }
@keyframes hsProgress { to { transform: scaleX(1); } }

@media (max-width: 767px) {
  .hs-viewport { height: 440px; }
  .hs-slide { align-items: flex-end; padding-bottom: 64px; }
  .hs-text { max-width: 100%; }
  .hs-bigicon { left: auto; right: -8%; top: 26%; font-size: 9rem; }
  .hs-media img { object-position: center; }
  .hs-red .hs-overlay, .hs-blue .hs-overlay, .hs-dark .hs-overlay { background: linear-gradient(to top, rgba(7,13,24,.85) 30%, rgba(7,13,24,.15)); }
  .hs-btn { padding: 11px 20px; font-size: .9rem; }
  .hs-arrow { display: none; }
  .hs-dots { bottom: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .hs-slide, .hs-anim, .hs-media img, .hs-bigicon { transition: none !important; }
  .hs-ecg path { animation: none !important; stroke-dashoffset: 0; }
}

/* Hero slider — تحسينات الموبايل */
@media (max-width: 767px) {
  .hs-viewport { height: 460px; }
  .hs-slide { padding-bottom: 58px; }
  .hs-ecg { top: 18%; bottom: auto; height: 60px; opacity: .18; }
  .hs-bigicon { right: auto; left: -6%; top: 6%; transform: rotate(-6deg); font-size: 8.5rem; color: rgba(255,255,255,.08); }
  .hs-slide.is-active .hs-bigicon { transform: rotate(-6deg) scale(1.04); }
  .hs-badge { margin-bottom: 12px; font-size: .75rem; padding: 5px 12px; }
  .hs-title { font-size: 1.65rem; margin-bottom: 10px; }
  .hs-sub { font-size: .9rem; margin-bottom: 20px; line-height: 1.7; }
  .hs-btns { gap: 10px; }
  .hs-btn { flex: 1 1 auto; justify-content: center; }
}
