/* The application shell. Desktop: a fixed-width sidebar (on the right in Arabic, on the left in
   English: the grid follows the document direction) and a scrolling main column. Under 960px the
   sidebar becomes a drawer opened from the mobile bar; Alpine toggles .nav-open on .app. */
.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.main { display: flex; flex-direction: column; min-width: 0; }
.container { width: 100%; max-width: var(--content); margin: 0 auto; padding: var(--space-5) var(--space-5) var(--space-6); flex: 1; }

/* ---------- sidebar ---------- */
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; background: var(--brand); color: #d6e2dc; padding: var(--space-4) var(--space-3); gap: var(--space-4); }
.sidebar .brand { display: flex; align-items: center; gap: .65rem; color: #fff; padding: .25rem .5rem; }
.sidebar .brand:hover { text-decoration: none; }
.sidebar .brand img { width: 32px; height: 33px; display: block; }
.sidebar .brand .wordmark { display: flex; flex-direction: column; line-height: 1.1; font-weight: 700; font-size: 1.05rem; }
.sidebar .brand .wordmark small { font-size: .58rem; letter-spacing: .24em; color: var(--gold); font-weight: 600; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: .65rem; padding: .55rem .7rem; border-radius: var(--radius-sm); color: #d6e2dc; font-weight: 500; border-inline-start: 3px solid transparent; }
.side-nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; }
.side-nav a.active { background: rgba(255, 255, 255, .12); color: #fff; font-weight: 700; border-inline-start-color: var(--gold); }
.side-nav a .icon { flex: none; opacity: .85; }
.side-nav a .count { margin-inline-start: auto; }
.side-nav .section { margin: .6rem .7rem .2rem; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .45); }
html[dir="rtl"] .side-nav .section { letter-spacing: 0; text-transform: none; font-size: .78rem; }
.side-user { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .12); padding-top: var(--space-3); }
.side-user .who { display: flex; align-items: center; gap: .55rem; padding: .3rem .5rem; color: #fff; font-weight: 700; }
.side-user .who small { display: block; font-weight: 400; color: #b9cbc3; font-size: .78rem; }
.side-user .links { display: flex; flex-wrap: wrap; gap: .25rem; padding: .35rem .25rem 0; }
.side-user .links a, .side-user .links button { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .55rem; border-radius: var(--radius-sm); color: #d6e2dc; font: inherit; font-size: .85rem; font-weight: 500; background: transparent; border: 0; cursor: pointer; }
.side-user .links a:hover, .side-user .links button:hover { background: rgba(255, 255, 255, .1); color: #fff; text-decoration: none; }

/* ---------- mobile bar and drawer ---------- */
.mobile-bar { display: none; }
.backdrop { display: none; }
@media (max-width: 959px) {
    .app { display: block; }
    .mobile-bar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: .6rem; height: var(--mobile-bar); padding: 0 var(--space-3); background: var(--brand); color: #fff; box-shadow: 0 2px 6px rgba(18, 49, 37, .25); }
    .mobile-bar .brand { display: flex; align-items: center; gap: .5rem; color: #fff; font-weight: 700; flex: 1; min-width: 0; }
    .mobile-bar .brand img { width: 26px; height: 27px; }
    .mobile-bar .brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .mobile-bar .brand:hover { text-decoration: none; }
    .mobile-bar .menu { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; border-radius: var(--radius-sm); background: transparent; color: #fff; cursor: pointer; }
    .mobile-bar .menu:hover { background: rgba(255, 255, 255, .12); }
    .sidebar { position: fixed; top: 0; bottom: 0; inset-inline-start: 0; width: min(300px, 86vw); height: auto; z-index: 60; transition: transform .2s ease; box-shadow: none; }
    html[dir="rtl"] .sidebar { transform: translateX(100%); }
    html[dir="ltr"] .sidebar { transform: translateX(-100%); }
    .app.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
    .app.nav-open .backdrop { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(18, 49, 37, .45); }
    .sidebar .close { display: inline-flex; align-self: flex-end; align-items: center; justify-content: center; width: 36px; height: 36px; border: 0; border-radius: var(--radius-sm); background: transparent; color: #fff; cursor: pointer; margin: -.5rem -.25rem -1.25rem 0; }
    .container { padding: var(--space-4) var(--space-4) var(--space-6); }
}
@media (min-width: 960px) { .sidebar .close { display: none; } }

/* ---------- page structure ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin-bottom: var(--space-4); }
.page-head h1 { margin: 0; flex: 1 1 auto; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.page-head .sub { flex-basis: 100%; margin: -.3rem 0 0; color: var(--muted); font-size: .9rem; }
.page-head .actions { margin: 0; flex: none; }
.grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); margin-bottom: var(--space-4); }
.grid > .card { margin-bottom: 0; }
.toolbar { display: flex; gap: .6rem; align-items: end; flex-wrap: wrap; margin-bottom: var(--space-4); }
.toolbar > label { margin: 0; }
.toolbar input, .toolbar select { width: auto; min-width: 160px; margin-top: 0; }
.toolbar .grow { flex: 1 1 200px; }
.toolbar .grow input { width: 100%; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .75rem; align-items: center; }
.site-note { max-width: var(--content); width: 100%; margin: 0 auto; padding: var(--space-4) var(--space-5); text-align: center; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }
.site-note a { color: var(--brand); }
.site-note .dot { margin: 0 .35rem; color: var(--line-strong); }

/* the shop page: the tab column and, on wide screens, the summary column beside it */
.shop-layout { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1100px) {
    .shop-layout { grid-template-columns: minmax(0, 1fr) 300px; }
    .shop-layout .summary { position: sticky; top: var(--space-4); }
}

/* ---------- sign-in, password and key pages: the brand ground with one faint mark behind the card ----------
   The mark is a watermark, not a decoration: one stalk, centred and taller than the screen, at a
   fraction of its strength, painted by a pseudo-element under everything (isolation keeps its
   negative z-index inside the page); the card sits on its stem and the leaves show around it. */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1.5rem; background: var(--brand); position: relative; isolation: isolate; }
.login-page::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .07;
    background: url("../img/sonbola-mark-gold.svg") no-repeat center center / auto 150vh; }
.login-card { background: var(--card); border-radius: 14px; padding: 2rem; width: 100%; max-width: 400px; box-shadow: var(--shadow-lg); text-align: center; }
.login-card .lockup { display: flex; flex-direction: column; align-items: center; gap: .35rem; margin-bottom: 1.25rem; }
.login-card .lockup img { width: 62px; height: 63px; }
.login-card .lockup strong { font-size: 1.5rem; font-weight: 700; color: var(--brand); line-height: 1; }
.login-card .lockup small { font-size: .68rem; letter-spacing: .28em; color: var(--gold); font-weight: 600; }
.login-card h1 { font-size: 1.05rem; color: var(--muted); font-weight: 600; margin: 0 0 1.25rem; }
.login-card form { text-align: start; }
.login-card label { color: var(--text); font-weight: 600; }
.login-card .foot { display: flex; gap: .6rem; align-items: center; justify-content: center; flex-wrap: wrap; margin-top: 1rem; color: var(--muted); font-size: .85rem; }
@media (max-width: 720px) { .login-page { padding: 1rem; } .login-page::before { background-size: auto 130vh; } .login-card { padding: 1.5rem 1.25rem; } }
