:root {
  --teal: #1a9a98;
  --teal-dark: #137a78;
  --teal-soft: #e6f4f4;
  --ink: #505050;
  --ink-dark: #2b2b2b;
  --line: #e4e8ea;
  --bg: #f6f8f9;
  --white: #fff;
  --danger: #c0392b;
  --ok: #1e8e5a;
  --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Cairo', system-ui, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.7; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { width: min(1180px, 100% - 32px); margin-inline: auto; }

/* Header */
.topbar { background: var(--ink-dark); color: #cfd6d9; font-size: .85rem; }
.topbar .container { display: flex; justify-content: space-between; align-items: center; padding-block: 6px; gap: 12px; flex-wrap: wrap; }
.topbar a:hover { color: #fff; }
.header { background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.header .container { display: flex; align-items: center; gap: 20px; padding-block: 10px; }
.logo img { height: 46px; width: auto; }
.nav { display: flex; gap: 6px; margin-inline-start: 12px; }
.nav a { padding: 6px 14px; border-radius: 8px; font-weight: 600; }
.nav a:hover, .nav a.active { background: var(--teal-soft); color: var(--teal-dark); }
.header-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }
.search { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg); }
.search input { border: 0; background: transparent; padding: 8px 12px; font: inherit; width: 200px; outline: 0; }
.search button { border: 0; background: var(--teal); color: #fff; padding: 0 14px; cursor: pointer; font: inherit; }
.icon-btn { position: relative; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--white); font-weight: 600; cursor: pointer; font-family: inherit; font-size: 1rem; color: inherit; }
.icon-btn:hover { border-color: var(--teal); color: var(--teal-dark); }
.badge { background: var(--teal); color: #fff; border-radius: 99px; font-size: .75rem; padding: 1px 8px; margin-inline-start: 4px; }
.menu-toggle { display: none; }

/* Buttons */
.btn { display: inline-block; background: var(--teal); color: #fff; border: 0; border-radius: 10px; padding: 10px 22px; font: inherit; font-weight: 700; cursor: pointer; transition: background .15s; text-align: center; }
.btn:hover { background: var(--teal-dark); }
.btn.outline { background: transparent; color: var(--teal-dark); border: 1.5px solid var(--teal); }
.btn.outline:hover { background: var(--teal-soft); }
.btn.block { display: block; width: 100%; }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid var(--line); padding: 6px 12px; }
.btn[disabled] { background: #b9c3c6; cursor: not-allowed; }

/* Hero */
.hero { background: linear-gradient(135deg, var(--teal) 0%, #0f6f6d 100%); color: #fff; padding: 64px 0; }
.hero .container { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: center; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.3; margin-bottom: 14px; }
.hero p { font-size: 1.1rem; opacity: .92; margin-bottom: 24px; }
.hero .btn { background: #fff; color: var(--teal-dark); }
.hero .btn.outline { background: transparent; color: #fff; border-color: #fff; }
.hero-services { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hero-services div { background: rgba(255,255,255,.14); border-radius: var(--radius); padding: 16px; font-weight: 700; text-align: center; }
.hero-services small { display: block; font-weight: 400; opacity: .85; }

/* Sections */
.section { padding: 44px 0; }
.section h2 { font-size: 1.5rem; color: var(--ink-dark); margin-bottom: 20px; display: flex; justify-content: space-between; align-items: baseline; }
.section h2 a { font-size: .95rem; color: var(--teal-dark); font-weight: 600; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.cat-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 14px; text-align: center; font-weight: 700; transition: .15s; }
.cat-card:hover { border-color: var(--teal); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(26,154,152,.12); }
.cat-card .ico-wrap { width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 50%; background: var(--teal-soft); display: grid; place-items: center; font-size: 1.6rem; overflow: hidden; }
.cat-card .ico-wrap img { width: 100%; height: 100%; object-fit: cover; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: .15s; }
.card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.card .thumb { aspect-ratio: 4/3; background: var(--teal-soft); display: grid; place-items: center; font-size: 3rem; position: relative; overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .cat { font-size: .8rem; color: var(--teal-dark); font-weight: 600; }
.card h3 { font-size: 1.02rem; color: var(--ink-dark); line-height: 1.4; }
.price { font-weight: 800; color: var(--teal-dark); font-size: 1.1rem; }
.price del { color: #9aa5a8; font-weight: 400; font-size: .9rem; margin-inline-start: 6px; }
.tag { position: absolute; top: 10px; inset-inline-start: 10px; background: var(--danger); color: #fff; font-size: .75rem; padding: 2px 10px; border-radius: 99px; font-weight: 700; }
.tag.out { background: #7b8689; }
.card form { margin-top: auto; padding-top: 8px; }

/* Shop layout */
.shop { display: grid; grid-template-columns: 240px 1fr; gap: 24px; padding-block: 32px; align-items: start; }
.sidebar { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; position: sticky; top: 90px; }
.sidebar h4 { margin-bottom: 8px; color: var(--ink-dark); }
.sidebar a { display: block; padding: 7px 10px; border-radius: 8px; }
.sidebar a:hover, .sidebar a.active { background: var(--teal-soft); color: var(--teal-dark); font-weight: 700; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 10px; flex-wrap: wrap; }
select, input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], textarea { font: inherit; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--white); width: 100%; color: var(--ink-dark); }
select { width: auto; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--teal-soft); border-color: var(--teal); }
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 6px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); }
.pagination .active span, .pagination span[aria-current] { background: var(--teal); color: #fff; border-color: var(--teal); }

/* Product page */
.product { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; padding-block: 36px; }
.product .main-img { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); aspect-ratio: 1; display: grid; place-items: center; font-size: 6rem; overflow: hidden; }
.product .main-img img { width: 100%; height: 100%; object-fit: contain; }
.thumbs { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.thumbs img { width: 70px; height: 70px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; }
.product h1 { font-size: 1.8rem; color: var(--ink-dark); line-height: 1.4; }
.product .price { font-size: 1.7rem; margin-block: 12px; }
.stock-ok { color: var(--ok); font-weight: 700; } .stock-out { color: var(--danger); font-weight: 700; }
.desc { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.buy { display: flex; gap: 10px; margin-top: 18px; align-items: center; }
.buy input { width: 90px; }

/* Cart / forms */
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 10px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--ink-dark); font-size: .9rem; }
.cart-wrap { display: grid; grid-template-columns: 1fr 340px; gap: 22px; padding-block: 32px; align-items: start; }
.summary-row { display: flex; justify-content: space-between; padding: 8px 0; }
.summary-row.total { font-weight: 800; font-size: 1.2rem; color: var(--teal-dark); border-top: 1px solid var(--line); margin-top: 6px; padding-top: 14px; }
.thumb-sm { width: 56px; height: 56px; border-radius: 8px; background: var(--teal-soft); display: grid; place-items: center; overflow: hidden; }
.thumb-sm img { width: 100%; height: 100%; object-fit: cover; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
label { display: block; font-weight: 600; margin-bottom: 4px; color: var(--ink-dark); font-size: .92rem; }
.error { color: var(--danger); font-size: .85rem; margin-top: 3px; }
.auth { width: min(460px, 100% - 32px); margin: 44px auto; }
.auth h1 { margin-bottom: 18px; color: var(--ink-dark); }
.pay-opt { display: flex; gap: 12px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; margin-bottom: 10px; }
.pay-opt:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); }
.pay-opt input { width: auto; margin-top: 7px; }
.pay-opt small { display: block; color: #7b8689; font-weight: 400; }
.status { display: inline-block; padding: 2px 12px; border-radius: 99px; font-size: .82rem; font-weight: 700; background: var(--teal-soft); color: var(--teal-dark); }
.status.pending { background: #fff4d6; color: #8a6200; } .status.cancelled { background: #fde4e1; color: var(--danger); } .status.delivered { background: #dff5e9; color: var(--ok); }

.flash { padding: 12px 18px; border-radius: 10px; margin-block: 16px; font-weight: 600; }
.flash.success { background: #dff5e9; color: var(--ok); } .flash.error { background: #fde4e1; color: var(--danger); }
.empty { text-align: center; padding: 60px 0; color: #7b8689; }

/* Footer */
.footer { background: var(--ink-dark); color: #b9c3c6; margin-top: 40px; padding: 36px 0 18px; }
.footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 28px; }
.footer h4 { color: #fff; margin-bottom: 10px; }
.footer a:hover { color: #fff; }
.footer .copy { border-top: 1px solid #444; margin-top: 24px; padding-top: 14px; font-size: .85rem; text-align: center; }
.footer img.flogo { height: 44px; background: #fff; border-radius: 8px; padding: 4px 8px; margin-bottom: 10px; }

@media (max-width: 860px) {
  .hero .container, .shop, .product, .cart-wrap, .footer .cols { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .search { display: none; }
  .nav { display: none; flex-direction: column; position: absolute; top: 100%; inset-inline: 0; background: #fff; padding: 10px 16px; border-bottom: 1px solid var(--line); margin: 0; }
  .nav.open { display: flex; }
  .menu-toggle { display: inline-block; }
  .form-grid { grid-template-columns: 1fr; }
  .header .container { position: relative; }
}

/* Responsive refinements: tablets, iPad and phones */
@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
}
@media (max-width: 860px) {
  /* Categories become a swipeable row of chips instead of a tall list */
  .sidebar { display: flex; gap: 8px; overflow-x: auto; padding: 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .sidebar::-webkit-scrollbar { display: none; }
  .sidebar h4 { display: none; }
  .sidebar a { flex: none; white-space: nowrap; border: 1px solid var(--line); border-radius: 99px; padding: 8px 16px; }
  .sidebar a.active { border-color: var(--teal); }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .section { padding: 32px 0; }
  .cart-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card .body { padding: 10px; gap: 4px; }
  .card h3 { font-size: .92rem; }
  .card .cat { font-size: .74rem; }
  .price { font-size: 1rem; }
  .card .btn { padding: 10px 8px; font-size: .88rem; }
  .product h1 { font-size: 1.4rem; }
  .product .price { font-size: 1.4rem; }
  .buy { flex-wrap: wrap; }
  .panel { padding: 16px; }
  th, td { padding: 10px 6px; font-size: .92rem; }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 380px) {
  .container { width: calc(100% - 24px); }
}

/* Phones: compact two-column service cards, smaller floating WhatsApp button */
@media (max-width: 640px) {
  .feature-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .feature-grid.compact .feature { padding: 16px 10px; text-align: center; }
  .feature-grid.compact .feature > span { width: 46px; height: 46px; margin: 0 auto 10px; }
  .feature-grid.compact .feature h3 { font-size: 1rem; margin-bottom: 2px; }
  .feature-grid.compact .feature p { font-size: .85rem; color: #6a7679; }
  .section h2 { font-size: 1.25rem; }
  .floating-wa { width: 48px; height: 48px; bottom: 14px; inset-inline-start: 14px; }
  .floating-wa .ico { width: 1.4rem; height: 1.4rem; }
  body { padding-bottom: 70px; }
}

.order-wa { display: flex; width: 100%; margin-top: 10px; padding: 13px; }

/* Reviews and stars */
.stars { display: inline-flex; gap: 2px; vertical-align: middle; }
.stars > span { color: #cbd2d4; display: inline-flex; }
.stars > span.on { color: #f5a623; }
.stars > span.on .ico { fill: currentColor; }
.stars .ico { width: 17px; height: 17px; }
.rev-sum { color: var(--ink-dark); font-weight: 600; font-size: .95rem; }
.reviews h2 small { font-size: .9rem; font-weight: 600; margin-inline-start: 10px; }
.review { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; }
.review p { margin-top: 6px; }
.rev-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.rev-head time { color: #7b8689; font-size: .85rem; margin-inline-start: auto; }
.review-form { margin-top: 16px; }
.review-form textarea { width: 100%; }
.rate-input { display: inline-flex; flex-direction: row-reverse; gap: 4px; position: relative; }
.rate-input input { position: absolute; opacity: 0; pointer-events: none; }
.rate-input label { cursor: pointer; color: #cbd2d4; margin: 0; display: inline-flex; padding: 2px; }
.rate-input label .ico { width: 32px; height: 32px; }
.rate-input input:checked ~ label, .rate-input label:hover, .rate-input label:hover ~ label { color: #f5a623; }
.rate-input input:checked ~ label .ico, .rate-input label:hover .ico, .rate-input label:hover ~ label .ico { fill: currentColor; }
.rate-input input:focus-visible + label { outline: 2px solid var(--teal); border-radius: 6px; }
.muted { color: #7b8689; }

/* Order tracking */
.track { list-style: none; display: flex; gap: 6px; margin: 4px 0 18px; padding: 0; }
.track li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: .88rem; color: #7b8689; text-align: center; position: relative; }
.track li span { width: 32px; height: 32px; border-radius: 50%; background: #e3e9ea; display: grid; place-items: center; font-weight: 700; z-index: 1; }
.track li::before { content: ""; position: absolute; top: 15px; inset-inline-start: 50%; width: 100%; height: 3px; background: #e3e9ea; }
.track li:last-child::before { display: none; }
.track li.done, .track li.now { color: var(--ink-dark); font-weight: 600; }
.track li.done span, .track li.now span { background: var(--teal); color: #fff; }
.track li.done::before { background: var(--teal); }
.track .ico { width: 16px; height: 16px; }

@media (max-width: 640px) {
  .inquiry { display: grid; gap: 8px; }
  .inquiry .btn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; }
}

/* Software and project showcase: framed previews and feature cards */
.band { background: linear-gradient(180deg, #eaf6f6, #f4fafa); border-block: 1px solid #d9ecec; padding: 44px 0; margin-block: 8px 28px; }
.band h2 { font-size: 1.5rem; color: var(--ink-dark); margin-bottom: 8px; display: flex; justify-content: space-between; align-items: baseline; }
.band h2 a { font-size: .95rem; color: var(--teal-dark); font-weight: 600; }
.band-lead { color: #5b6a6d; margin-bottom: 20px; max-width: 640px; }
.work-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.sw-preview { display: block; width: calc(100% + 40px); margin: -24px -20px 16px; max-width: none; aspect-ratio: 16/10; object-fit: cover; border-radius: var(--radius) var(--radius) 0 0; }
.feature.soft { overflow: hidden; }

.work-main { min-width: 0; padding-block: 10px; }
.showcase { display: block; border-radius: 18px; overflow: hidden; box-shadow: 0 14px 40px rgba(15, 111, 109, .22); background: #0f6f6d; transition: transform .25s, box-shadow .25s; }
.showcase:hover { transform: translateY(-3px); box-shadow: 0 20px 50px rgba(15, 111, 109, .3); }
.showcase img { display: block; width: 100%; height: auto; aspect-ratio: 16/10; object-fit: cover; }
.work-lead { margin-top: 22px; font-size: 1.2rem; }
.work-desc { padding-block: 6px; max-width: none; }
.feat-section { margin-top: 34px; }
.feat-section h2 { color: var(--ink-dark); font-size: 1.35rem; margin-bottom: 14px; display: block; }
.feat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.feat { display: flex; gap: 12px; align-items: flex-start; background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; transition: border-color .2s, box-shadow .2s, transform .2s; }
.feat:hover { border-color: var(--teal); box-shadow: 0 10px 26px rgba(26, 154, 152, .14); transform: translateY(-2px); }
.feat > span { flex: none; width: 42px; height: 42px; border-radius: 12px; background: var(--teal-soft); color: var(--teal-dark); display: grid; place-items: center; }
.feat > span .ico { width: 1.35rem; height: 1.35rem; }
.feat p { margin: 0; line-height: 1.6; color: var(--ink-dark); font-weight: 600; font-size: .95rem; }
.shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.shots .showcase { border-radius: 14px; }

@media (max-width: 860px) {
  .band { padding: 30px 0; }
  .feat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .feat-grid { grid-template-columns: 1fr; }
  .shots { grid-template-columns: 1fr; }
  .showcase { border-radius: 12px; }
}
.sw-placeholder { display: grid; place-items: center; background: linear-gradient(135deg, #d6f0ee, #bae3e0 60%, #e2f5f3); color: #1a9a98; }
.sw-placeholder .ico { width: 3.6rem; height: 3.6rem; color: #1a9a98; }
.feature.soft .sector { margin-top: 2px; }
.card .thumb.sw-placeholder { background: linear-gradient(135deg, #d6f0ee, #bae3e0 60%, #e2f5f3); }
.card .thumb.sw-placeholder .ico { color: rgba(255, 255, 255, .92); opacity: 1; }

/* Project cards: one per row on phones, two on tablets (the 2-column product grid rule must not apply) */
.grid.work-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
@media (max-width: 860px) { .grid.work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid.work-grid { grid-template-columns: 1fr; } }
.project-card .body p { line-height: 1.7; }

/* Justified text for paragraphs (titles and short labels stay aligned to the start) */
.prose p, .prose li, .desc, .desc p, .work-desc p, .band-lead, .card .body p, .project-card p, .feature p,
.faq details p, .review p, .sw-cta p, .page-hero p, .panel p, .footer p, .contact-wrap p {
  text-align: justify; text-justify: inter-word; text-align-last: start; overflow-wrap: anywhere; hyphens: none;
}
.feature-grid.compact .feature p, .feat p, .track li, .empty p, .thanks p, .stats span { text-align: center; text-align-last: auto; }
.feat p { text-align: start; }
.work-lead, p.lead { text-align: justify; text-justify: inter-word; text-align-last: start; }

/* toast for ajax cart */
#toast { position: fixed; inset-inline: 0; bottom: 90px; margin-inline: auto; width: max-content; max-width: 90vw; padding: 11px 22px; border-radius: 12px; background: #0f6f6d; color: #fff; font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.25); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .25s; z-index: 99; }
#toast.show { opacity: 1; transform: none; } #toast.bad { background: #c0392b; }

/* clients */
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 14px; }
.client-chip { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.client-logo { width: 54px; height: 54px; border-radius: 14px; flex: none; display: grid; place-items: center; background: linear-gradient(135deg, #d6f0ee, #bae3e0); color: #0f6f6d; font-size: 1.4rem; font-weight: 800; overflow: hidden; }
.client-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.client-info { display: flex; flex-direction: column; min-width: 0; }
.client-info strong { font-size: 1rem; line-height: 1.4; }
.client-info small { color: var(--muted); }

/* call button (phones only) */
.floating-call { display: none; }
@media (max-width: 768px) {
  .floating-call { display: grid; place-items: center; position: fixed; bottom: 72px; inset-inline-start: 14px; width: 48px; height: 48px; border-radius: 50%; background: #0f6f6d; color: #fff; box-shadow: 0 8px 22px rgba(0,0,0,.25); z-index: 30; }
  .floating-call .ico { width: 1.4rem; height: 1.4rem; }
}
