:root {
  --brand-primary: #1B2A4A;
  --brand-white: #FFFFFF;
  --brand-light: #F8F9FA;
  --brand-info: #17A2B8;
  --brand-blue: #2F6FED;
  --brand-purple: #7C3AED;
  --brand-gradient: linear-gradient(90deg, var(--brand-blue), var(--brand-purple));
  --brand-muted: #64748B;
  --brand-border: #E7ECF3;
  --radius-lg: 1.25rem;
  --radius-md: 0.9rem;
}

html {
  font-size: 15px;
}

body {
  font-family: "IBM Plex Sans Arabic", sans-serif;
  background: var(--brand-white);
  color: #1f2937;
}

.text-primary-brand { color: var(--brand-primary) !important; }
.text-info-brand { color: var(--brand-info) !important; }
.bg-primary-brand { background-color: var(--brand-primary) !important; }
.bg-light-brand { background-color: var(--brand-light) !important; }

.btn-primary-brand {
  background: var(--brand-primary);
  color: #fff;
  border-color: var(--brand-primary);
}

.btn-outline-primary-brand {
  color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.btn-info-brand {
  background: var(--brand-info);
  border-color: var(--brand-info);
}

.cart-quantity-form { align-items: center; min-width: 116px; }
.cart-quantity-input {
  width: 44px;
  flex: 0 0 44px;
  background: #fff !important;
  font-weight: 700;
  padding-inline: .15rem;
}
.cart-quantity-button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--brand-border);
  border-radius: 7px;
  background: #f8fafc;
  color: var(--brand-primary);
  font-size: 1.1rem;
  line-height: 1;
  font-weight: 700;
}
.cart-quantity-button:hover { border-color: var(--brand-blue); color: var(--brand-blue); background: #eff6ff; }

/* Product catalog cards keep the grid calm even when source images have different ratios. */
.product-grid {
  --product-gap: 1.35rem;
  margin-inline: calc(var(--product-gap) / -2);
  row-gap: var(--product-gap);
}

.product-grid-item {
  padding-inline: calc(var(--product-gap) / 2);
}

.product-card {
  overflow: hidden;
  border: 1px solid #e4eaf2;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: #cbd8ea;
  box-shadow: 0 18px 34px rgba(15, 23, 42, .12);
}

.product-card-media {
  display: flex !important;
  align-items: center;
  justify-content: center;
  height: 250px;
  padding: 1rem;
  background: #f4f7fb;
  border-bottom: 1px solid #e8edf4;
}

.product-card-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transition: transform .25s ease;
}

.product-card:hover .product-card-image {
  transform: scale(1.035);
}

.product-card-body {
  min-height: 282px;
  padding: 1.05rem;
}

.product-card-body h2 {
  min-height: 2.8rem;
  line-height: 1.45;
}

.product-card-body form {
  margin-top: auto !important;
}

@media (max-width: 575.98px) {
  .product-card-media {
    height: 220px;
  }

  .product-card-body {
    min-height: 270px;
  }
}

.hero-section {
  background: linear-gradient(145deg, #eef2f7 0%, #ffffff 100%);
}

.glass-card,
.route-card,
.feature-box,
.sector-card,
.step-pill {
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-md);
  background: #fff;
}

.route-card, .feature-box, .sector-card {
  transition: transform .2s ease, box-shadow .2s ease;
}
.route-card:hover, .feature-box:hover, .sector-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 35px -22px rgba(15, 23, 42, .25);
}

.section-title {
  font-weight: 700;
  color: var(--brand-primary);
}

/* ===================== Modern design system ===================== */

/* Navbar */
.navbar-modern { padding-block: .85rem; }
.navbar-modern .nav-link { color: #334155; font-weight: 500; }
.navbar-modern .nav-link:hover,
.navbar-modern .nav-link.active { color: var(--brand-blue); }
.navbar-modern .navbar-nav:not(.localized-nav) { display: none; }
.navbar-modern .navbar-collapse > .d-flex:not(.localized-actions) { display: none !important; }
.localized-actions { margin-inline-start: 1rem; }

.brand-logo-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--brand-gradient);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.brand-logo-image {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  padding: .18rem;
  border: 1px solid var(--brand-border);
  border-radius: 999px;
  background: #fff;
}

.language-switch {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.05rem;
  text-decoration: none;
  filter: grayscale(.35);
}

.language-switch:hover,
.language-switch.active {
  background: #eef2ff;
  filter: none;
}

.nav-icon-action {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-size: 0;
}

.nav-icon-action > :not(i) {
  display: none;
}

.nav-icon-action i {
  font-size: 1.15rem;
}

.cart-nav-button {
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 1.15rem;
}

.cart-nav-button > span:not(.cart-nav-count) {
  display: none;
}

.cart-nav-button .cart-nav-count {
  position: absolute;
  top: -5px;
  inset-inline-end: -6px;
  font-size: .78rem;
}

.navbar-nav > li:nth-child(1),
.navbar-nav > li:nth-child(2),
.navbar-nav > li > a[href="/pricing"] {
  display: none;
}

form[action*="Logout"] .btn-outline-soft {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
}

form[action*="Logout"] .btn-outline-soft::before {
  content: "\\F1C3";
  font-family: "bootstrap-icons";
  font-size: 1.15rem;
}

/* Buttons */
.btn-gradient-brand {
  background: var(--brand-gradient);
  color: #fff;
  border: none;
  border-radius: 999px;
  box-shadow: 0 12px 24px -10px rgba(59, 60, 235, .45);
  font-weight: 600;
}
.btn-gradient-brand:hover { color: #fff; filter: brightness(1.06); }

.btn-outline-soft {
  border-radius: 999px;
  border: 1px solid var(--brand-border);
  color: var(--brand-primary);
  background: #fff;
  font-weight: 600;
}
.btn-outline-soft:hover { border-color: var(--brand-blue); color: var(--brand-blue); }

.cart-nav-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}

.cart-nav-count {
  min-width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 .35rem;
  background: var(--brand-gradient);
  color: #fff;
  font-size: .78rem;
  font-weight: 800;
  line-height: 1;
}

.social-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--brand-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-primary);
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.social-icon:hover { background: var(--brand-gradient); color: #fff; border-color: transparent; }

.site-theme-banner {
  min-height: 42px;
  padding: .55rem 0;
  background: var(--brand-gradient);
  color: #fff;
  font-weight: 700;
  font-size: .92rem;
  text-align: center;
}

.site-theme-banner i {
  font-size: 1rem;
}

/* Text / headings */
.gradient-text {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem 1rem;
  border-radius: 999px;
  background: #F1EEFE;
  color: var(--brand-purple);
  font-weight: 600;
  font-size: .85rem;
}
.section-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand-purple); }

.section-heading { font-weight: 800; color: var(--brand-primary); }
.section-subtitle { max-width: 560px; }

/* Cards */
.card-soft {
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-lg);
  background: #fff;
  transition: transform .2s ease, box-shadow .2s ease;
}
.card-soft:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 35px -20px rgba(15, 23, 42, .25);
}

.category-card-image-link {
  display: block;
  width: calc(100% + 1rem);
  height: 170px;
  margin: -0.5rem -0.5rem 1rem;
  overflow: hidden;
  border-radius: 0.75rem;
  background: #f1f5fb;
}

.category-card-image {
  display: block;
  width: 100%;
  height: 100%;
  padding: .5rem;
  object-fit: contain;
  transition: transform .25s ease;
}

.category-card-image-link:hover .category-card-image {
  transform: scale(1.03);
}

.category-subcard {
  min-height: 88px;
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .75rem;
  color: var(--brand-primary);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-lg);
  background: #fff;
  transition: transform .2s ease, box-shadow .2s ease;
}

.category-subcard:hover {
  color: var(--brand-primary);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -18px rgba(15, 23, 42, .35);
}

.category-subcard img {
  width: 72px;
  height: 64px;
  flex: 0 0 72px;
  object-fit: cover;
  border-radius: .6rem;
}

.category-subcard-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.category-subcard-content small {
  color: var(--brand-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-subcard > i {
  margin-inline-start: auto;
}

.all-products-card {
  min-height: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  color: #fff;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-purple));
  box-shadow: 0 18px 32px -20px rgba(15, 23, 42, .55);
  transition: transform .2s ease, box-shadow .2s ease;
}
.all-products-card:hover { color: #fff; transform: translateY(-3px); box-shadow: 0 22px 38px -20px rgba(15, 23, 42, .65); }
.all-products-icon { width: 68px; height: 68px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 68px; border-radius: 18px; color: var(--brand-primary); background: #fff; font-size: 2rem; }
.all-products-content { min-width: 0; display: flex; flex-direction: column; gap: .35rem; }
.all-products-content strong { font-size: 1.1rem; }
.all-products-content small { color: rgba(255, 255, 255, .82); }
.all-products-arrow { margin-inline-start: auto; font-size: 1.25rem; }

.product-detail-main-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: .75rem;
  background: #eef2fa;
}

.product-detail-main-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: zoom-in;
}

.product-detail-thumb {
  width: 92px;
  height: 70px;
  object-fit: cover;
  cursor: pointer;
  border: 1px solid var(--brand-border);
  border-radius: .5rem;
}

.product-details-page { background: #f8fafc; }
.product-breadcrumb { display: flex; flex-wrap: wrap; gap: .5rem; color: #64748b; font-size: .85rem; }
.product-breadcrumb a { color: var(--brand-primary); text-decoration: none; }
.product-detail-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; }
.btn-icon-soft { width: 42px; height: 42px; padding: 0; border: 1px solid #dbe3ee; border-radius: 50%; color: #475569; background: #fff; }
.btn-icon-soft:hover { color: var(--brand-primary); border-color: var(--brand-primary); }
.product-detail-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(310px, .75fr); gap: 1.5rem; align-items: start; direction: rtl; }
.product-gallery-card, .product-purchase-card, .product-description-panel, .product-specs-panel { background: #fff; border: 1px solid #e3eaf3; border-radius: 16px; box-shadow: 0 12px 32px -26px rgba(15,23,42,.45); }
.product-gallery-card { padding: 1rem; }
.product-gallery-stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 530px; border-radius: 12px; background: #f1f5fb; overflow: hidden; }
.product-gallery-label { position: absolute; top: 1rem; right: 1rem; z-index: 1; padding: .35rem .7rem; border-radius: 999px; background: #fff; color: #64748b; font-size: .75rem; }
.product-gallery-image-button { width: 100%; height: 100%; min-height: 530px; border: 0; background: transparent; padding: 2.25rem; cursor: zoom-in; }
.product-gallery-image-button img { width: 100%; height: 100%; max-height: 480px; object-fit: contain; }
.product-gallery-thumbs { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; }
.product-gallery-thumb { width: 76px; height: 76px; padding: .25rem; border: 1px solid #dbe3ee; border-radius: 10px; background: #fff; }
.product-gallery-thumb.is-active { border: 2px solid var(--brand-primary); }
.product-gallery-thumb img { width: 100%; height: 100%; object-fit: contain; border-radius: 6px; }
.product-purchase-card { padding: 1.5rem; position: sticky; top: 1rem; direction: rtl; }
.product-stock-badge { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .65rem; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.product-stock-badge.is-available { color: #087443; background: #e8f8ef; }
.product-stock-badge.is-unavailable { color: #9f1239; background: #ffe4e6; }
.product-current-price { display: block; color: #e11d48; font-size: 2rem; letter-spacing: 0; }
.product-old-price { color: #64748b; text-decoration: line-through; }
.product-quantity-control { display: flex; align-items: center; border: 1px solid #dbe3ee; border-radius: 9px; overflow: hidden; }
.product-quantity-control .btn { width: 46px; height: 44px; border: 0; border-radius: 0; color: var(--brand-primary); background: #f8fafc; }
.product-quantity-control .form-control { height: 44px; border: 0; box-shadow: none; background: #fff; }
.product-service-points { border-top: 1px solid #e5eaf1; padding-top: 1rem; display: grid; gap: .85rem; }
.product-service-points > div { display: flex; gap: .75rem; align-items: center; }
.product-service-points i { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; color: var(--brand-primary); background: #edf4ff; font-size: 1.1rem; }
.product-service-points span { display: flex; flex-direction: column; gap: .1rem; }
.product-service-points small { color: #64748b; }
.product-detail-content { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; direction: rtl; }
.product-description-panel, .product-specs-panel { padding: 1.5rem; }
.product-description-panel h2, .product-specs-panel h2 { font-size: 1.1rem; margin: 0 0 1rem; }
.product-description-panel p { color: #475569; line-height: 2; margin: 0; white-space: pre-line; }
.product-specs-grid { display: grid; gap: .25rem; }
.product-spec-row { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid #edf1f6; }
.product-spec-row span { color: #64748b; }
.product-image-modal-img { max-width: 94vw; max-height: 88vh; object-fit: contain; border-radius: 14px; background: #fff; }
.pricing-card-image { display: block; height: 150px; border-radius: 12px; overflow: hidden; background: #f1f5fb; }
.pricing-card-image img { width: 100%; height: 100%; object-fit: contain; }
.pricing-card-image-placeholder { display: flex; align-items: center; justify-content: center; color: var(--brand-primary); font-size: 2.5rem; text-decoration: none; }
.pricing-details-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .8fr); gap: 1.5rem; direction: rtl; align-items: start; }
.pricing-details-gallery, .pricing-details-summary, .pricing-details-panel { background: #fff; border: 1px solid #e3eaf3; border-radius: 16px; box-shadow: 0 12px 32px -26px rgba(15,23,42,.45); }
.pricing-details-gallery { padding: 1rem; }
.pricing-details-stage { min-height: 520px; display: flex; align-items: center; justify-content: center; border-radius: 12px; background: #f1f5fb; }
.pricing-details-stage img { width: 100%; height: 500px; object-fit: contain; }
.pricing-details-stage i { color: var(--brand-primary); font-size: 5rem; }
.pricing-details-thumbs { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; }
.pricing-details-thumb { width: 78px; height: 70px; padding: .25rem; border: 1px solid #dbe3ee; border-radius: 10px; background: #fff; }
.pricing-details-thumb.is-active { border: 2px solid var(--brand-primary); }
.pricing-details-thumb img { width: 100%; height: 100%; object-fit: contain; }
.pricing-details-summary { padding: 2rem; position: sticky; top: 1rem; }
.pricing-details-price { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; }
.pricing-details-price strong { width: 100%; color: var(--brand-primary); font-size: 2rem; }
.pricing-audience-panel { display: flex; flex-direction: column; gap: .35rem; padding: 1rem; border-radius: 10px; background: #f8fafc; }
.pricing-audience-panel span { color: #64748b; }
.pricing-details-sections { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; direction: rtl; }
.pricing-details-panel { padding: 1.5rem; }
.pricing-details-panel h2 { font-size: 1.15rem; margin: 0 0 1rem; }
.pricing-details-panel ul { display: grid; gap: .75rem; padding: 0; margin: 0; list-style: none; }
.pricing-details-panel li { display: flex; gap: .55rem; align-items: start; color: #475569; }
.pricing-details-panel li i { color: #16a34a; margin-top: .2rem; }
.pricing-spec-list { display: grid; gap: .25rem; }
.pricing-spec-list div { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid #edf1f6; }
.pricing-spec-list span { color: #64748b; }
@media (max-width: 991.98px) { .pricing-details-layout, .pricing-details-sections { grid-template-columns: 1fr; } .pricing-details-summary { position: static; } }
@media (max-width: 575.98px) { .pricing-details-stage, .pricing-details-stage img { min-height: 320px; height: 320px; } .pricing-details-summary { padding: 1rem; } }
@media (max-width: 991.98px) {
  .product-detail-layout, .product-detail-content { grid-template-columns: 1fr; }
  .product-purchase-card { position: static; }
  .product-gallery-stage, .product-gallery-image-button { min-height: 420px; }
}
@media (max-width: 575.98px) {
  .product-detail-heading { align-items: start; flex-direction: column; }
  .product-gallery-stage, .product-gallery-image-button { min-height: 300px; }
  .product-gallery-image-button { padding: 1.5rem; }
  .product-purchase-card { padding: 1rem; }
}

/* Icon chips */
.icon-chip {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}
.icon-chip-blue   { background: #E7F0FE; color: #2563EB; }
.icon-chip-purple { background: #F1E9FD; color: #7C3AED; }
.icon-chip-green  { background: #E4F8EC; color: #16A34A; }
.icon-chip-pink   { background: #FCE7F3; color: #DB2777; }
.icon-chip-orange { background: #FDECE0; color: #EA580C; }
.icon-chip-teal   { background: #E0F4F8; color: #0891B2; }

/* Hero device mockup */
.hero-section-v2 {
  background: linear-gradient(160deg, #F5F7FF 0%, #ffffff 55%);
  overflow: hidden;
}

.hero-mockup {
  position: relative;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(55px);
  opacity: .45;
  z-index: 0;
}
.hero-blob-1 { width: 220px; height: 220px; background: var(--brand-blue); top: 5%; inset-inline-start: 8%; }
.hero-blob-2 { width: 190px; height: 190px; background: var(--brand-purple); bottom: 5%; inset-inline-end: 5%; }

.device-stack {
  position: relative;
  width: 280px;
  height: 220px;
  z-index: 1;
}

.mockup-frame {
  position: absolute;
  background: #fff;
  border-radius: 1.1rem;
  border: 1px solid var(--brand-border);
  box-shadow: 0 25px 50px -25px rgba(15, 23, 42, .35);
  display: flex;
  align-items: center;
  justify-content: center;
}
.mockup-desktop {
  width: 220px; height: 150px;
  font-size: 2.75rem; color: var(--brand-blue);
  top: 0; inset-inline-start: 30px;
}
.mockup-tablet {
  width: 100px; height: 140px;
  font-size: 1.9rem; color: var(--brand-purple);
  bottom: -20px; inset-inline-start: 0;
}
.mockup-phone {
  width: 64px; height: 118px;
  font-size: 1.4rem; color: #16A34A;
  bottom: -30px; inset-inline-end: 10px;
}

/* Smart entry */
.smart-entry-section {
  background:
    linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}

.smart-entry-shell {
  display: grid;
  grid-template-columns: minmax(280px, .95fr) minmax(0, 1.35fr);
  gap: 1rem;
  align-items: stretch;
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 60px -42px rgba(15, 23, 42, .45);
  padding: 1rem;
}

.smart-entry-intro {
  min-height: 100%;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid var(--brand-border);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.smart-entry-intro h2 {
  max-width: 520px;
}

.smart-entry-intro p {
  line-height: 1.8;
}

.smart-entry-proof {
  display: grid;
  gap: .55rem;
  margin-top: 1.25rem;
  color: var(--brand-primary);
  font-size: .92rem;
  font-weight: 600;
}

.smart-entry-proof span {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}

.smart-entry-proof i {
  color: #16a34a;
}

.smart-entry-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}

.smart-entry-action {
  min-height: 132px;
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  background: #fff;
  color: var(--brand-primary);
  text-decoration: none;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 28px;
  align-items: center;
  gap: .85rem;
  padding: 1rem;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.smart-entry-action:hover {
  color: var(--brand-primary);
  transform: translateY(-3px);
  border-color: #bfdbfe;
  box-shadow: 0 18px 40px -28px rgba(15, 23, 42, .5);
}

.smart-entry-action-primary {
  background: #f5f8ff;
  border-color: #dbeafe;
}

.smart-entry-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: var(--brand-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.smart-entry-action-primary .smart-entry-icon {
  background: var(--brand-gradient);
}

.smart-entry-action strong,
.smart-entry-action small {
  display: block;
}

.smart-entry-action strong {
  font-size: 1rem;
  margin-bottom: .35rem;
}

.smart-entry-action small {
  color: var(--brand-muted);
  line-height: 1.65;
}

.smart-entry-arrow {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #eff6ff;
  color: var(--brand-blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Process steps */
.step-pill-v2 {
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-md);
  background: #fff;
  text-align: center;
}
.step-number {
  width: 40px; height: 40px; margin-inline: auto;
  border-radius: 50%;
  background: var(--brand-gradient);
  color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* CTA band */
.cta-band {
  background: var(--brand-gradient);
  border-radius: 1.5rem;
}

/* Footer */
.footer-modern { background: var(--brand-light); border-top: 1px solid var(--brand-border); }
.footer-modern h6 { font-weight: 700; color: var(--brand-primary); margin-bottom: 1rem; }
.footer-modern .footer-link { color: #64748B; text-decoration: none; }
.footer-modern .footer-link:hover { color: var(--brand-blue); }

/* Systems store */
.systems-store-page { background: #f8fafc; }

.systems-store-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.systems-store-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.systems-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.system-showcase-card {
  display: grid;
  grid-template-rows: minmax(190px, 1fr) auto;
  min-height: 360px;
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  background: #fff;
  text-align: start;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 14px 30px rgba(15, 23, 42, .06);
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.system-showcase-card:hover,
.system-showcase-card.active {
  border-color: var(--brand-blue);
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(37, 99, 235, .13);
}

.system-showcase-image {
  display: block;
  background: #eef6ff;
  border-bottom: 1px solid #dbeafe;
  overflow: hidden;
}

.system-showcase-image img {
  width: 100%;
  height: 100%;
  min-height: 190px;
  object-fit: cover;
  display: block;
}

.system-showcase-card.missing-cover .system-showcase-image {
  display: grid;
  place-items: center;
}

.system-showcase-card.missing-cover .system-showcase-image::after {
  content: "صورة النظام";
  color: var(--brand-muted);
  font-weight: 800;
}

.system-showcase-card.missing-cover .system-showcase-image img { display: none; }

.system-showcase-body {
  display: grid;
  gap: .45rem;
  padding: 1rem;
}

.system-showcase-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eff6ff;
  color: var(--brand-blue);
  font-size: 1.35rem;
}

.system-showcase-body strong {
  color: var(--brand-primary);
  font-size: 1.18rem;
}

.system-showcase-body small {
  color: var(--brand-muted);
  line-height: 1.65;
}

[dir="rtl"] .systems-store-layout { grid-template-columns: minmax(0, 1fr) 300px; }
[dir="rtl"] .systems-sidebar { grid-column: 2; }
[dir="rtl"] .systems-catalog { grid-column: 1; grid-row: 1; }

.systems-sidebar {
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 110px);
  overflow: hidden;
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  background: #fff;
}

.systems-sidebar-head {
  height: 52px;
  padding: 0 .9rem;
  border-bottom: 1px solid var(--brand-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 800;
  color: var(--brand-primary);
}

.systems-sidebar-list {
  max-height: calc(100vh - 164px);
  overflow-y: auto;
  padding: .45rem;
}

.system-nav-item {
  width: 100%;
  min-height: 58px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem .65rem;
  text-align: start;
}

.system-nav-item i {
  color: var(--brand-blue);
  font-size: 1.2rem;
}

.system-nav-item strong,
.system-nav-item small { display: block; }

.system-nav-item small {
  color: var(--brand-muted);
  font-size: .76rem;
  margin-top: .15rem;
}

.system-nav-item:hover,
.system-nav-item.active {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.systems-catalog { display: grid; gap: 1rem; }

.catalog-image-button {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
}

.erp-vision-panel,
.system-detail-stage {
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .05);
}

.erp-vision-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr);
  gap: 1.2rem;
  padding: 1.2rem;
}

.erp-vision-panel h2 {
  color: var(--brand-primary);
  font-weight: 800;
  margin: .65rem 0 .55rem;
}

.erp-vision-panel p {
  color: var(--brand-muted);
  margin: 0;
  line-height: 1.8;
}

.erp-vision-grid { display: grid; gap: .65rem; }

.erp-vision-grid div {
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  padding: .85rem;
  background: #f8fafc;
}

.erp-vision-grid strong,
.erp-vision-grid span { display: block; }

.erp-vision-grid strong { color: var(--brand-primary); margin-bottom: .25rem; }
.erp-vision-grid span { color: var(--brand-muted); font-size: .9rem; }
.system-detail-stage { overflow: hidden; }

.system-catalog-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 34%);
  gap: .85rem;
  overflow-x: auto;
  padding: 1rem;
  scroll-snap-type: x mandatory;
  background: linear-gradient(180deg, #eef6ff, #fff);
}

.catalog-frame {
  scroll-snap-align: start;
  min-height: 250px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.catalog-image-wrap {
  aspect-ratio: 16 / 9;
  background: #eff6ff;
  border-bottom: 1px solid #dbeafe;
}

.catalog-image-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.catalog-frame-missing-image .catalog-image-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.catalog-frame-missing-image .catalog-image-wrap::after {
  content: "أضف صورة الكتالوج هنا";
  color: var(--brand-muted);
  font-weight: 700;
}

.catalog-frame-missing-image .catalog-image-wrap img {
  display: none;
}

.catalog-frame-body { padding: .85rem; }
.catalog-frame-body strong { color: var(--brand-primary); font-size: 1.05rem; }
.catalog-frame-body p { color: var(--brand-muted); margin: .35rem 0 0; }

.system-detail-content {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(320px, 1.1fr);
  gap: 1rem;
  padding: 1rem;
}

.system-detail-summary {
  border-inline-end: 1px solid var(--brand-border);
  padding-inline-end: 1rem;
}

.system-detail-summary i {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eff6ff;
  color: var(--brand-blue);
  font-size: 1.35rem;
}

.system-detail-summary h2 { color: var(--brand-primary); font-weight: 850; }
.system-detail-summary p { color: var(--brand-muted); line-height: 1.75; }

.system-problem {
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  padding: .75rem;
  background: #f8fafc;
}

.system-info-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: .85rem;
}

.system-info-columns section {
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  padding: .95rem;
  background: #fff;
}

.system-info-columns h3 {
  color: var(--brand-primary);
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: .65rem;
}

.system-info-columns ul {
  margin: 0;
  padding-inline-start: 1.2rem;
  color: var(--brand-muted);
}

.system-info-columns li + li { margin-top: .4rem; }

@media (max-width: 991.98px) {
  .systems-store-header,
  .systems-card-grid,
  .systems-store-layout,
  [dir="rtl"] .systems-store-layout,
  .smart-entry-shell,
  .erp-vision-panel,
  .system-detail-content,
  .system-info-columns {
    grid-template-columns: 1fr;
  }

  .smart-entry-actions {
    grid-template-columns: 1fr;
  }

  .systems-store-header { align-items: flex-start; }
  [dir="rtl"] .systems-sidebar,
  [dir="rtl"] .systems-catalog {
    grid-column: auto;
    grid-row: auto;
  }

  .systems-sidebar {
    position: static;
    max-height: none;
  }

  .systems-sidebar-list { max-height: 320px; }

  .system-detail-summary {
    border-inline-end: 0;
    border-bottom: 1px solid var(--brand-border);
    padding-inline-end: 0;
    padding-bottom: 1rem;
  }
}

/* AI chat widget */
.ai-chat-widget {
  position: fixed;
  inset-inline-end: 1rem;
  bottom: 1rem;
  z-index: 1040;
}

.ai-chat-toggle,
.ai-chat-send,
.ai-chat-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
}

.ai-chat-toggle {
  min-width: 148px;
  height: 52px;
  border-radius: 999px;
  background: var(--brand-gradient);
  color: #fff;
  box-shadow: 0 16px 30px -16px rgba(31, 41, 55, .55);
  font-size: .95rem;
  font-weight: 700;
  gap: .45rem;
  padding: 0 1rem;
}

.ai-chat-panel {
  width: min(360px, calc(100vw - 2rem));
  height: min(520px, calc(100vh - 6rem));
  margin-bottom: .75rem;
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 60px -28px rgba(15, 23, 42, .45);
  overflow: hidden;
}

.ai-chat-header {
  min-height: 64px;
  padding: .85rem 1rem;
  background: var(--brand-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.ai-chat-title { font-weight: 700; }
.ai-chat-status { font-size: .82rem; opacity: .78; }

.ai-chat-icon-button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fff;
}

.ai-chat-messages {
  height: calc(100% - 176px);
  overflow-y: auto;
  padding: 1rem;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: .65rem;
}

.ai-chat-actions {
  min-height: 48px;
  padding: .5rem .75rem;
  border-top: 1px solid var(--brand-border);
  background: #fff;
}

.ai-chat-handoff {
  width: 100%;
  min-height: 32px;
  border: 1px solid var(--brand-border);
  border-radius: 999px;
  background: #fff;
  color: var(--brand-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  font-weight: 600;
  font-size: .86rem;
}

.ai-chat-handoff:hover {
  border-color: var(--brand-blue);
  color: var(--brand-blue);
}

.ai-chat-message {
  max-width: 86%;
  padding: .65rem .8rem;
  border-radius: 8px;
  line-height: 1.55;
  font-size: .92rem;
  overflow-wrap: anywhere;
}

.ai-chat-message-assistant {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--brand-border);
}

.ai-chat-message-support {
  align-self: flex-start;
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  color: #064e3b;
}

.ai-chat-message-user {
  align-self: flex-end;
  background: var(--brand-blue);
  color: #fff;
}

.ai-chat-feedback {
  width: 100%;
  padding: .7rem;
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  background: #fff;
}

.ai-chat-feedback-title {
  font-weight: 700;
  font-size: .9rem;
  margin-bottom: .45rem;
}

.ai-chat-feedback-stars {
  display: flex;
  gap: .35rem;
  margin-bottom: .5rem;
}

.ai-chat-feedback-stars button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--brand-border);
  background: #f8fafc;
  color: var(--brand-text);
  font-weight: 700;
}

.ai-chat-feedback-stars button.is-selected {
  border-color: #f59e0b;
  background: #fef3c7;
  color: #92400e;
}

.ai-chat-feedback-comment {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  padding: .5rem;
  font-size: .86rem;
}

.ai-chat-feedback-submit {
  margin-top: .5rem;
  width: 100%;
  height: 34px;
  border-radius: 8px;
  background: var(--brand-primary);
  color: #fff;
  font-weight: 700;
}

.ai-chat-feedback-submit:disabled {
  opacity: .55;
}

.ai-chat-feedback-thanks {
  color: #047857;
  font-weight: 700;
}

.ai-chat-form {
  height: 64px;
  padding: .75rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  border-top: 1px solid var(--brand-border);
  background: #fff;
}

.ai-chat-input {
  min-width: 0;
  flex: 1;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--brand-border);
  padding: 0 .9rem;
}

.ai-chat-input:focus {
  outline: 0;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 .15rem rgba(47, 111, 237, .12);
}

.ai-chat-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #fff;
  background: var(--brand-primary);
  flex-shrink: 0;
}

.ai-chat-send:disabled,
.ai-chat-input:disabled {
  opacity: .65;
}

@media (max-width: 575.98px) {
  .ai-chat-widget {
    inset-inline: .75rem;
    bottom: .75rem;
  }

  .ai-chat-panel {
    width: 100%;
    height: min(480px, calc(100vh - 5rem));
  }
}

@media print {
  .ai-chat-widget {
    display: none !important;
  }
}
