/* MicroSystem 26: homepage on Apple's online Store (owner 2026-10-27, option A). Values measured on apple.com/store at
   1440 and 390 px: #F5F5F7 page, #1D1D1F text, #6E6E73 soft text, 80 / 48 px title, 28 px two-tone shelf headings,
   400 × 500 white cards with 18 px corners and a 2 4 12 shadow, 20 px gaps, 56 px grey paddles. MicroSystem's fonts
   (Cairo, Inter) and blue (#2563EB) replace the reference's. */

.ms-ap { --a-page: #F5F5F7; --a-ink: #1D1D1F; --a-soft: #6E6E73; --a-line: #D2D2D7; --a-blue: #2563EB; --a-blue-ink: #1D4ED8; --a-r: 18px; --a-shadow: 2px 4px 12px rgba(0, 0, 0, .08); --a-shadow-h: 2px 4px 16px rgba(0, 0, 0, .16); --a-ease: cubic-bezier(.23, 1, .32, 1); padding-bottom: 64px; background: var(--a-page); color: var(--a-ink); font-family: var(--ms-font-ar); }
body:has(.ms-ap) { background: #F5F5F7; }
.ms-ap a { text-decoration: none; }
.ms-ap-wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 22px; }
@media (min-width: 1068px) { .ms-ap-wrap { padding-inline: 40px; } }

/* Ribbon under the bar (the reference's announcement line). */
.ms-ap-ribbon { margin: 0; padding: 18px 22px; background: #fff; text-align: center; font: 400 14px/1.6 var(--ms-font-ar); color: var(--a-ink); }
.ms-ap-ribbon a { color: var(--a-blue-ink); white-space: nowrap; }
@media (hover: hover) and (pointer: fine) { .ms-ap-ribbon a:hover { text-decoration: underline; } }

/* Title and side line. */
.ms-ap-head { display: flex; flex-direction: column; gap: 14px; padding-block: 34px 26px; }
.ms-ap-h1 { margin: 0; font: 700 48px/1.08 var(--ms-font-ar); letter-spacing: -.01em; color: var(--a-ink); }
.ms-ap-head__line { margin: 0; font: 700 22px/1.35 var(--ms-font-ar); color: var(--a-ink); text-wrap: balance; }
.ms-ap-head__links { display: flex; flex-direction: column; gap: 2px; margin: 8px 0 0; }
.ms-ap-head__links a { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; color: var(--a-blue-ink); font: 500 15px/1.4 var(--ms-font-ar); }
.ms-ap-head__links .ms-icon { flex: none; }
@media (hover: hover) and (pointer: fine) { .ms-ap-head__links a:hover span, .ms-ap-head__links a:hover { text-decoration: underline; text-underline-offset: 3px; } }
@media (min-width: 768px) {
	.ms-ap-head { flex-direction: row; justify-content: space-between; align-items: flex-end; padding-block: 70px 44px; }
	.ms-ap-h1 { font-size: 80px; line-height: 1.05; }
	.ms-ap-head__side { max-width: 340px; }
	.ms-ap-head__line { font-size: 24px; }
}

/* Pathway row: product pictures with names (the reference's product row under the title). */
.ms-ap-nav ul { display: flex; gap: 6px; margin: 0 auto; padding-block: 0 8px; list-style: none; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; }
.ms-ap-nav ul::-webkit-scrollbar { display: none; }
.ms-ap-nav li { flex: none; scroll-snap-align: start; }
.ms-ap-nav a { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 112px; padding: 8px 4px 10px; border-radius: 12px; color: var(--a-ink); }
.ms-ap-nav__img { display: grid; place-items: center; width: 100%; height: 78px; }
.ms-ap-nav__img img { max-width: 100%; max-height: 78px; width: auto; height: auto; object-fit: contain; mix-blend-mode: multiply; transform: none !important; }
.ms-ap-nav__t { font: 600 14px/1.35 var(--ms-font-ar); text-align: center; }
@media (hover: hover) and (pointer: fine) { .ms-ap-nav a:hover .ms-ap-nav__t { color: var(--a-blue-ink); } }
@media (min-width: 1068px) { .ms-ap-nav ul { justify-content: space-between; } .ms-ap-nav a { width: 128px; } }

/* Shelves. */
.ms-ap-shelf { padding-top: 40px; }
.ms-ap-h2 { margin: 0 auto 0; font: 700 24px/1.3 var(--ms-font-ar); color: var(--a-ink); text-wrap: balance; }
.ms-ap-h2__soft { color: var(--a-soft); }
@media (min-width: 768px) { .ms-ap-shelf { padding-top: 56px; } .ms-ap-h2 { font-size: 28px; line-height: 1.25; } }
.ms-ap-scroller { position: relative; }
.ms-ap-track { display: flex; gap: 20px; margin: 0; padding: 22px 22px 34px; list-style: none; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 22px; scrollbar-width: none; }
.ms-ap-track::-webkit-scrollbar { display: none; }
@media (min-width: 1068px) { .ms-ap-track { padding-inline: max(40px, calc((100% - 1200px) / 2 + 40px)); scroll-padding-inline: max(40px, calc((100% - 1200px) / 2 + 40px)); } }
.ms-ap-item { flex: none; scroll-snap-align: start; }

/* Cards: white, 18 px corners, the reference's soft shadow; a slight lift on hover. */
.ms-ap-card { position: relative; display: flex; flex-direction: column; width: 309px; height: 450px; overflow: hidden; border-radius: var(--a-r); background: #fff; box-shadow: var(--a-shadow); color: var(--a-ink); transition: transform 300ms var(--a-ease), box-shadow 300ms var(--a-ease); }
@media (min-width: 768px) { .ms-ap-card { width: 400px; height: 500px; } .ms-ap-shelf--wide .ms-ap-card { width: 480px; } }
@media (hover: hover) and (pointer: fine) { .ms-ap-card:hover { transform: scale(1.01); box-shadow: var(--a-shadow-h); } }
.ms-ap-card:focus-visible { outline: 2px solid var(--a-blue); outline-offset: 4px; }
.ms-ap-card__txt { display: flex; flex-direction: column; gap: 6px; padding: 28px 28px 0; }
.ms-ap-card__t { font: 700 24px/1.25 var(--ms-font-ar); color: var(--a-ink); }
.ms-ap-card--unit .ms-ap-card__t { font-family: var(--ms-font); direction: ltr; text-align: right; }
.ms-ap-card__p { margin: 0; font: 400 15px/1.55 var(--ms-font-ar); color: var(--a-soft); }
.ms-ap-card__price { margin-top: 4px; font: 600 17px/1.4 var(--ms-font-ar); color: var(--a-ink); }
.ms-ap-card__img { display: grid; place-items: center; flex: 1; min-height: 0; padding: 12px 28px 28px; }
.ms-ap-card__img img { width: 100%; height: 100%; max-height: 280px; object-fit: contain; transform: translate(var(--tx, 0%), var(--ty, 0%)) scale(var(--z, 1)); transition: transform 400ms var(--a-ease); }
@media (hover: hover) and (pointer: fine) { .ms-ap-card--unit:hover .ms-ap-card__img img { transform: translate(var(--tx, 0%), var(--ty, 0%)) scale(calc(var(--z, 1) * 1.03)); } }

/* Text cards: icon, title, one line, a blue link line. */
.ms-ap-card--text { padding: 28px; gap: 10px; }
.ms-ap-card--text .ms-ap-card__t { font-size: 24px; }
.ms-ap-card--text .ms-ap-card__p { font-size: 16px; }
.ms-ap-card__ico { display: inline-grid; place-items: center; width: 56px; height: 56px; margin-bottom: 8px; border-radius: 14px; background: #F5F5F7; color: var(--a-blue-ink); }
.ms-ap-card__cta { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; color: var(--a-blue-ink); font: 600 16px/1.4 var(--ms-font-ar); }
@media (hover: hover) and (pointer: fine) { .ms-ap-card--text:hover .ms-ap-card__cta { text-decoration: underline; text-underline-offset: 3px; } }
.ms-ap-shelf--wide .ms-ap-card--text .ms-ap-card__t { font-size: 28px; }
.ms-ap-shelf--small .ms-ap-card { width: 280px; height: auto; min-height: 220px; }
.ms-ap-shelf--small .ms-ap-card--text .ms-ap-card__t { font-size: 20px; }
.ms-ap-shelf--small .ms-ap-card--text .ms-ap-card__p { font-size: 15px; }
@media (min-width: 768px) { .ms-ap-shelf--small .ms-ap-card { width: 313px; min-height: 240px; } }

/* Paddles: round grey buttons at the track ends, shown on pointer devices (phones swipe). */
.ms-ap-paddle { position: absolute; top: calc(50% - 28px); z-index: 2; display: none; place-items: center; width: 56px; height: 56px; padding: 0; border: 0; border-radius: 50%; background: rgba(210, 210, 215, .64); color: rgba(0, 0, 0, .56); cursor: pointer; backdrop-filter: blur(7px); transition: opacity 200ms ease, background-color 200ms ease; }
.ms-ap-paddle--prev { inset-inline-start: 18px; }
.ms-ap-paddle--next { inset-inline-end: 18px; }
.ms-ap-paddle:focus-visible { outline: 2px solid var(--a-blue); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
	.ms-ap-paddle { display: grid; opacity: 0; }
	.ms-ap-scroller:hover .ms-ap-paddle, .ms-ap-paddle:focus-visible { opacity: 1; }
	.ms-ap-paddle:hover { background: rgba(223, 223, 227, .7); color: rgba(0, 0, 0, .64); }
	.ms-ap-scroller.is-start .ms-ap-paddle--prev, .ms-ap-scroller.is-end .ms-ap-paddle--next, .ms-ap-scroller.is-static .ms-ap-paddle { opacity: 0 !important; pointer-events: none; }
}

/* Quick links: pills (the reference's last shelf). */
.ms-ap-quick { padding-top: 48px; }
.ms-ap-quick ul { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; }
.ms-ap-quick a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border: 1px solid #86868B; border-radius: 999px; color: var(--a-ink); font: 500 15px/1 var(--ms-font-ar); transition: background-color 200ms ease, color 200ms ease; }
@media (hover: hover) and (pointer: fine) { .ms-ap-quick a:hover { background: var(--a-ink); border-color: var(--a-ink); color: #fff; } }

@media (prefers-reduced-motion: reduce) { .ms-ap *, .ms-ap *::before, .ms-ap *::after { transition: none !important; } .ms-ap-card:hover { transform: none; } }

/* Phones: the units come right after the title so a priced unit shows in the first screen; the pathway row follows. */
@media (max-width: 767px) {
	.ms-ap { display: flex; flex-direction: column; }
	.ms-ap > * { order: 3; }
	.ms-ap > .ms-ap-ribbon { order: 1; padding-block: 10px; font-size: 13px; }
	.ms-ap > .ms-ap-head { order: 1; padding-block: 14px 0; }
	.ms-ap > .ms-ap-shelf:first-of-type { order: 2; padding-top: 18px; }
	.ms-ap-head__links { flex-direction: row; flex-wrap: wrap; gap: 0 16px; margin-top: 2px; }
	.ms-ap-h1 { font-size: 40px; }
	.ms-ap-head__line { font-size: 18px; }
	.ms-ap-track { gap: 14px; padding-block: 16px 26px; }
	.ms-ap-card { width: 270px; height: 390px; }
	.ms-ap-card__txt { padding: 22px 22px 0; }
	.ms-ap-card__t { font-size: 21px; }
	.ms-ap-card--text { padding: 22px; }
	.ms-ap-card--text .ms-ap-card__t, .ms-ap-shelf--wide .ms-ap-card--text .ms-ap-card__t { font-size: 21px; }
	.ms-ap-shelf--wide .ms-ap-card { width: 290px; height: 340px; }
	.ms-ap-nav { padding-top: 26px; }
}

/* Simple buyers on phones (owner 2026-10-27): a visible search field, a last «شوف كل الأجهزة» card on unit shelves,
   and compact reason/budget cards. */
.ms-ap-search { display: none; }
@media (max-width: 1023px) {
	.ms-ap-search { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; margin-top: 12px; padding: 0 16px; border: 0; border-radius: 12px; background: #E8E8ED; color: var(--a-soft); font: 400 16px/1 var(--ms-font-ar); text-align: start; cursor: pointer; }
	.ms-ap-search:focus-visible { outline: 2px solid var(--a-blue); outline-offset: 2px; }
}
.ms-ap-card--all { justify-content: center; align-items: center; gap: 12px; padding: 28px; text-align: center; }
.ms-ap-card--all .ms-ap-card__cta { margin-top: 0; }
@media (max-width: 767px) {
	.ms-ap-shelf--small .ms-ap-card { min-height: 0; }
	.ms-ap-shelf--small .ms-ap-card__cta { margin-top: 10px; }
}

/* Phones (owner 2026-10-27): unit shelves are a two-column grid, two devices side by side, read by scrolling down;
   photo on top, then name, use line and price. «شوف كل الأجهزة» becomes one full-width row under the grid. */
@media (max-width: 767px) {
	.ms-ap-shelf--units .ms-ap-track { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; overflow: visible; scroll-snap-type: none; padding: 14px 16px 22px; }
	.ms-ap-shelf--units .ms-ap-item { display: flex; min-width: 0; }
	.ms-ap-shelf--units .ms-ap-card { flex: 1; width: auto; height: auto; min-width: 0; border-radius: 14px; }
	.ms-ap-shelf--units .ms-ap-card__img { order: -1; flex: none; aspect-ratio: 4 / 3; padding: 12px 12px 0; overflow: hidden; }
	.ms-ap-shelf--units .ms-ap-card__img img { max-height: none; }
	.ms-ap-shelf--units .ms-ap-card__txt { position: relative; z-index: 1; flex: 1; gap: 4px; padding: 10px 12px 14px; background: #fff; }
	.ms-ap-shelf--units .ms-ap-card__t { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 15px; line-height: 1.3; }
	.ms-ap-shelf--units .ms-ap-card__p { font-size: 13px; line-height: 1.45; }
	.ms-ap-shelf--units .ms-ap-card__price { margin-top: auto; padding-top: 4px; font-size: 16px; }
	.ms-ap-shelf--units .ms-ap-paddle { display: none; }
	.ms-ap-shelf--units .ms-ap-item:has(.ms-ap-card--all) { grid-column: 1 / -1; }
	.ms-ap-shelf--units .ms-ap-card--all { flex-direction: row; gap: 10px; min-height: 52px; padding: 12px 16px; }
	.ms-ap-shelf--units .ms-ap-card--all .ms-ap-card__ico svg { width: 24px; height: 24px; }
	.ms-ap-shelf--units .ms-ap-card--all .ms-ap-card__t { font-size: 16px; }
	.ms-ap-shelf--units .ms-ap-card--all .ms-ap-card__cta { display: none; }
}

/* Compact text cards (owner 2026-10-27: the help cards were too big, the link too far from the text): the link
   follows the text, a smaller icon. */
.ms-ap-shelf--small .ms-ap-card--text { min-height: 0; gap: 8px; padding: 22px 24px; }
.ms-ap-shelf--small .ms-ap-card__ico { width: 44px; height: 44px; margin-bottom: 2px; border-radius: 12px; }
.ms-ap-shelf--small .ms-ap-card__ico svg { width: 24px; height: 24px; }
.ms-ap-shelf--small .ms-ap-item { display: flex; }
.ms-ap-shelf--small .ms-ap-card__cta { margin-top: auto; padding-top: 6px; }
@media (max-width: 767px) { .ms-ap-shelf--small .ms-ap-card { width: min(280px, calc(100vw - 64px)); } }
/* Computers: the four help cards fit in one row, no card cut at the edge. */
@media (min-width: 1200px) { #ms-ap-help .ms-ap-card { width: 265px; } }
/* A unit without a photo keeps the same shape as its neighbours: a soft panel with a laptop icon. */
.ms-ap-card__img--none { color: #C7C7CC; }
.ms-ap-card__img--none .ms-icon { width: 64px; height: 64px; }
@media (max-width: 767px) { .ms-ap-shelf--units .ms-ap-card__img--none { margin: 12px 12px 0; padding: 0; border-radius: 10px; background: #F5F5F7; } .ms-ap-card__img--none .ms-icon { width: 44px; height: 44px; } }

/* Pathway row (owner 2026-10-27: the pictures were too small): bigger device pictures and names. */
.ms-ap-nav a { width: 128px; gap: 8px; }
.ms-ap-nav__img { height: 96px; }
.ms-ap-nav__img img { max-height: 96px; }
.ms-ap-nav__t { font-size: 15px; }
@media (min-width: 768px) { .ms-ap-nav a { width: 150px; } .ms-ap-nav__img { height: 112px; } .ms-ap-nav__img img { max-height: 112px; } }
/* Same device size in every picture: the photo's own fit (zoom and offset from ms26_img_fit()), clipped to its box. */
.ms-ap-nav__img { overflow: hidden; }
.ms-ap-nav .ms-ap-nav__img img { transform: translate(var(--tx, 0%), var(--ty, 0%)) scale(var(--z, 1)) !important; }
