/* Al Rawnaq design — Departments page (pills + department cards) */
.depts-page { padding-bottom: 88px; background: #fff; }
.depts-page > .container { padding-top: var(--rw-hero-gap, 32px); }

/* department pills */
.depts-pills { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 40px; }
.depts-pill {
  display: inline-flex; align-items: center; padding: 12px 22px; border-radius: 999px;
  background: var(--offwhite); border: 1px solid var(--line); color: var(--navy);
  font-size: 14px; line-height: 22px; font-weight: 400; text-transform: none; letter-spacing: 0; text-decoration: none; white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.depts-pill:hover, .depts-pill.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }

/* cards */
.depts-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 991px) { .depts-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .depts-cards { grid-template-columns: 1fr; gap: 16px; } .depts-pills { flex-wrap: nowrap; overflow-x: auto; margin-bottom: 24px; scrollbar-width: none; } .depts-pill { flex: 0 0 auto; } }

.depts-box { display: flex; flex-direction: column; gap: 16px; padding: 24px; border: 0 !important; border-radius: 28px !important; background: var(--offwhite); box-shadow: none !important; }
.depts-box:nth-child(3n+1) { background: var(--yellowtint); }
.depts-box:nth-child(3n+2) { background: var(--navytint); }
.depts-box:nth-child(3n+3) { background: var(--graytint); }

.depts-box__head { display: flex; align-items: center; gap: 14px; padding: 0; border: 0; }
.depts-box__avatar { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 999px; background: var(--yellow); color: var(--navy); display: flex; align-items: center; justify-content: center; font-size: 18px; line-height: 26px; font-weight: 600; }
.depts-box:nth-child(3n+1) .depts-box__avatar { background: var(--navy); color: var(--yellow); }
.depts-box__title { margin: 0; font-size: 18px; line-height: 26px; font-weight: 600; color: var(--navy); text-transform: none; }
.depts-box__title a { color: inherit; text-decoration: none; }
.depts-box__title a:hover { text-decoration: underline; }
.depts-box__count { font-size: 14px; line-height: 22px; color: var(--waterloo); }

.depts-box__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.depts-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: #fff; text-decoration: none; color: var(--navy); transition: transform 0.15s ease; }
.depts-row:hover { transform: translateX(2px); }
[dir="rtl"] .depts-row:hover { transform: translateX(-2px); }
.depts-row__thumb { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; object-fit: cover; background: var(--graytint); }
.depts-row__thumb--ph { display: flex; align-items: center; justify-content: center; color: var(--waterloo); }
.depts-row__body { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.depts-row__title { font-size: 14px; line-height: 22px; font-weight: 600; color: var(--navy); text-transform: none; letter-spacing: 0; }
.depts-row__count { font-size: 14px; line-height: 22px; color: var(--gray); }
.depts-row__go { width: 30px; height: 30px; padding: 8px; border-radius: 999px; background: var(--navy); color: var(--yellow); flex: 0 0 30px; }

.depts-box__more { font-size: 14px; line-height: 22px; color: var(--waterloo); text-decoration: none; }
.depts-box__more:hover { color: var(--navy); text-decoration: underline; }
.depts-box__browse { margin-top: auto; display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; padding: 12px 22px; border-radius: 999px; background: var(--navy); color: #fff; font-size: 14px; line-height: 20px; font-weight: 600; text-decoration: none; text-transform: none; letter-spacing: 0.02em; }
.depts-box__browse:hover { background: #2d2e5c; }

.depts-empty__btn { display: inline-flex; background: var(--navy); color: #fff; border-radius: 999px; padding: 16px 32px; font-weight: 600; text-decoration: none; }
.depts-empty__title { color: var(--navy); text-transform: none; font-weight: 700; }

.depts-page .depts-pills { margin: 0 0 40px !important; padding: 0 !important; }
.depts-page > .container { padding-top: var(--rw-hero-gap, 32px) !important; margin-top: 0 !important; }

/* ===== Single department page: Figma "Category Card" grid ===== */
.dept-page { padding-bottom: 88px; background: #fff; }
.dept-body { padding-top: var(--rw-hero-gap, 32px) !important; margin-top: 0 !important; }
.dept-mobile-title { margin: 0 0 16px; font-size: 24px; line-height: 32px; font-weight: 700; color: var(--navy); text-transform: none; letter-spacing: 0; }
@media (min-width: 768px) { .dept-mobile-title { display: none; } }
.dept-hero__desc { margin: 12px 0 0; font-size: 16px; line-height: 26px; color: var(--gray); max-width: none; }

.dept-grid { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 24px; }
@media (max-width: 1099px) { .dept-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767px) { .dept-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 14px; } }

.dept-card { display: flex; flex-direction: column; gap: 14px; text-decoration: none; color: var(--navy); border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 0 !important; border-radius: 0 !important; }
.dept-card__media { height: 220px; border-radius: 24px; overflow: hidden; background: var(--yellowtint); display: flex; align-items: center; justify-content: center; color: var(--waterloo); }
.dept-card:nth-child(3n+2) .dept-card__media { background: var(--navytint); }
.dept-card:nth-child(3n+3) .dept-card__media { background: var(--graytint); }
.dept-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.35s ease; }
.dept-card:hover .dept-card__media img { transform: scale(1.04); }
.dept-card__placeholder svg { width: 56px; height: 56px; }
@media (max-width: 767px) { .dept-card__media { height: 150px; border-radius: 20px; } }

.dept-card__details { position: relative; display: flex; flex-direction: column; gap: 2px; padding-inline-end: 48px; min-height: 36px; justify-content: center; }
.dept-card__title { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; color: var(--navy); text-transform: none; letter-spacing: 0; }
.dept-card__count { font-size: 14px; line-height: 22px; color: var(--waterloo); }
.dept-card__details::after {
  content: ""; position: absolute; inset-inline-end: 0; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 999px; border: 1.5px solid var(--navy);
  background: url("/assets/images/figma/icon-arrow-navy.svg") center / 16px 16px no-repeat; transition: background-color 0.15s ease;
}
[dir="rtl"] .dept-card__details::after { background-image: url("/assets/images/figma/icon-arrow-navy.svg"); transform: translateY(-50%) scaleX(-1); }
.dept-card:hover .dept-card__details::after { background-color: var(--yellow); border-color: var(--yellow); }

.dept-empty__btn { display: inline-flex; background: var(--navy); color: #fff; border-radius: 999px; padding: 16px 32px; font-weight: 600; text-decoration: none; }
.dept-empty__title { color: var(--navy); text-transform: none; font-weight: 700; }

.dept-card .dept-card__details { padding: 0 48px 0 0 !important; margin: 0 !important; min-height: 40px; justify-content: center; }
[dir="rtl"] .dept-card .dept-card__details { padding: 0 0 0 48px !important; }

/* tighter department cards */
.depts-box { padding: 18px; gap: 12px; border-radius: 24px !important; }
.depts-row { padding: 8px 10px; }

.depts-box { padding: 14px; }
.depts-row { padding: 8px 10px; }

.depts-box { padding: 16px; }

/* Mobile: sticky department pills — no bottom border, vertical breathing room */
@media (max-width: 767px) {
  .depts-page .depts-pills { border-bottom: 0 !important; box-shadow: none !important; padding: 12px 0 !important; margin: 0 0 12px !important; }
}
