/* Majesty: sizes + add to cart. ACSS tokens first. */
.atc { display: flex; flex-direction: column; gap: var(--space-s); }
.atc__sizes { display: flex; gap: var(--space-xs); margin: 0; padding: 0; border: 0; min-inline-size: 0; }
.atc__legend { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.atc__size { position: relative; flex: 1 1 0; min-inline-size: 0; display: flex; flex-direction: column; align-items: center; padding: var(--space-xs) 4px; border: 1.5px solid var(--mj-border-input); border-radius: var(--radius-m); background: var(--mj-bg-surface); cursor: pointer; text-align: center; transition: background-color .15s ease, border-color .15s ease; }
.atc__size-input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.atc__size-name { font-size: var(--text-s); font-weight: 600; line-height: 1.4; color: var(--text-dark); }
.atc__size-price { font-size: var(--text-xs); line-height: 1.6; color: var(--text-dark-muted); }
.atc__size:has(.atc__size-input:checked) { background: var(--base); border-color: var(--base); }
.atc__size:has(.atc__size-input:checked) .atc__size-name { color: var(--text-light); }
.atc__size:has(.atc__size-input:checked) .atc__size-price { color: var(--text-light-muted); }
.atc__size:has(.atc__size-input:focus-visible) { outline: 3px solid var(--focus-color); outline-offset: 2px; }
.atc__size--soldout { opacity: .45; cursor: not-allowed; }
.atc__size--soldout .atc__size-input { cursor: not-allowed; }
.atc__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-s); padding-block-start: 4px; }
.atc__price { margin: 0; font-size: var(--mj-price-l); font-weight: 800; line-height: 1.2; color: var(--text-dark); white-space: nowrap; }
.atc__btn, .atc__choose { flex: 0 0 auto; white-space: nowrap; }
.atc__price { flex: 1 0 auto; }
/* when price and button cannot share a line, the button takes its own full-width line */
.atc { container: atc / inline-size; }
@container atc (max-width: 270px) { .atc__btn, .atc__choose { flex-basis: 100%; } }
.atc__btn[aria-busy="true"] { opacity: .7; cursor: progress; }
.atc__btn:disabled { opacity: .4; cursor: not-allowed; }
.atc--inverse .atc__price { color: var(--text-light); }

/* Toast */
.atc-toast { position: fixed; z-index: 1000; inset-inline: var(--space-m); inset-block-end: calc(72px + var(--space-m) + env(safe-area-inset-bottom)); max-inline-size: 420px; margin-inline: auto; display: flex; align-items: center; gap: var(--space-s); padding: 14px var(--space-m); border-radius: var(--radius-l); background: var(--base); color: var(--text-light); box-shadow: var(--mj-shadow-overlay); opacity: 0; translate: 0 12px; pointer-events: none; transition: opacity .2s ease, translate .2s ease; }
.atc-toast.is-visible { opacity: 1; translate: 0 0; pointer-events: auto; }
.atc-toast__icon { flex-shrink: 0; display: grid; place-items: center; inline-size: 32px; block-size: 32px; border-radius: var(--radius-circle); background: var(--success); color: var(--white); }
.atc-toast--error .atc-toast__icon { background: var(--danger); }
.atc-toast__icon svg { inline-size: 18px; block-size: 18px; }
.atc-toast__text { flex: 1 1 auto; display: flex; flex-direction: column; min-inline-size: 0; }
.atc-toast__title { font-size: var(--text-m); font-weight: 600; line-height: 1.4; }
.atc-toast__sub { font-size: var(--text-xs); line-height: 1.6; color: var(--text-light-muted); }
.atc-toast__action { flex-shrink: 0; font-size: var(--text-m); font-weight: 600; color: var(--mj-text-on-inverse-accent); text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 1200px) { .atc-toast { inset-block-end: var(--space-l); } }
@media (prefers-reduced-motion: reduce) { .atc-toast, .atc__size { transition: none; } }

/* Row layout (Figma product row 25:158): compact button with cart icon, Price/M */
.atc--row .atc__price { font-size: var(--text-m); font-weight: 700; line-height: 1.3; }
.atc--row .atc__btn, .atc--row .atc__choose { display: inline-flex; align-items: center; gap: var(--space-xs); padding: var(--space-xs) var(--space-m); font-size: var(--text-s); font-weight: 600; }
.atc__btn-icon { inline-size: 18px; block-size: 18px; }

/* Products with required choices (e.g. offers "اختار 2"): the card links to the product page instead of adding. */
.atc__choose { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
