/* Aladwaa Affiliate Campaign — shared component styles.
 * Arabic RTL. Mobile-first targets are enforced in the media queries at the end.
 */

/* ------------------------------------------------------------------ base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  direction: rtl;
}

body {
  margin: 0;
  background: var(--adw-bg);
  font-family: var(--adw-font);
  color: var(--adw-ink);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--adw-teal);
  text-decoration: none;
}

a:hover {
  color: var(--adw-cyan-dark);
}

img {
  max-width: 100%;
}

/* §9.6 — visible focus ring on everything interactive. */
:focus-visible {
  outline: 2px solid var(--adw-cyan);
  outline-offset: 2px;
  border-radius: var(--adw-r-sm);
}

.adw-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Latin strings (codes, order numbers, phone numbers) inside RTL text. */
.adw-ltr {
  direction: ltr;
  unicode-bidi: isolate;
}

[hidden] {
  display: none !important;
}

/* ---------------------------------------------------------------- layout */

.adw-page {
  max-width: 1440px;
  margin: 0 auto;
  background: var(--adw-bg);
  overflow: hidden;
}

.adw-section {
  padding: var(--adw-s9) var(--adw-pad-x);
}

.adw-wrap {
  max-width: var(--adw-maxw);
  margin: 0 auto;
}

.adw-wrap-narrow {
  max-width: 880px;
  margin: 0 auto;
}

/* ---------------------------------------------------------------- header */

.adw-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--adw-s5);
  padding: 14px var(--adw-pad-x);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--adw-hairline);
}

.adw-brand {
  display: flex;
  align-items: center;
  gap: var(--adw-s3);
}

.adw-brand img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.adw-brand-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.adw-brand-name b {
  font-size: 22px;
  font-weight: 900;
  color: var(--adw-ink);
  line-height: 1;
}

.adw-brand-name span {
  font-size: 12px;
  font-weight: 600;
  color: var(--adw-body);
  line-height: 1;
}

.adw-navlinks {
  display: flex;
  align-items: center;
  gap: 20px;
}

.adw-navlink {
  font-size: 16px;
  font-weight: 700;
  color: var(--adw-teal);
}

/* --------------------------------------------------------------- buttons */

.adw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: inherit;
  font-weight: 800;
  font-size: 17px;
  line-height: 1;
  padding: 18px 34px;
  border-radius: var(--adw-r-full);
  border: 0;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.1s ease, opacity 0.16s ease;
  /* §9.6 — 44×44 minimum tap target. */
  min-height: 52px;
}

.adw-btn:active {
  transform: scale(0.97);
}

.adw-btn[disabled],
.adw-btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.adw-btn-primary {
  background: var(--adw-cyan);
  color: #fff;
  box-shadow: var(--adw-sh-cta);
}

.adw-btn-primary:hover:not([disabled]) {
  background: var(--adw-cyan-dark);
  color: #fff;
}

.adw-btn-secondary {
  background: transparent;
  border: 2px solid var(--adw-teal);
  color: var(--adw-teal);
  font-weight: 700;
  padding: 16px 28px;
}

.adw-btn-secondary:hover:not([disabled]) {
  background: var(--adw-cyan-tint);
  color: var(--adw-teal);
}

.adw-btn-ghost {
  background: var(--adw-neutral-tint);
  color: var(--adw-teal);
}

.adw-btn-ghost:hover:not([disabled]) {
  background: var(--adw-cyan-tint);
}

.adw-btn-onteal {
  background: #fff;
  color: var(--adw-teal);
  font-weight: 900;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16);
}

.adw-btn-onteal:hover:not([disabled]) {
  background: var(--adw-cyan-tint);
  color: var(--adw-teal);
}

.adw-btn-danger {
  background: var(--adw-danger);
  color: #fff;
}

.adw-btn-block {
  width: 100%;
}

.adw-btn-lg {
  font-size: 20px;
  padding: 19px 40px;
}

.adw-btn-sm {
  font-size: 15px;
  padding: 12px 20px;
  min-height: 44px;
}

/* ------------------------------------------------------------------ pill */

.adw-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--adw-s2);
  background: var(--adw-neutral-tint);
  color: var(--adw-teal);
  font-weight: 700;
  font-size: 14px;
  padding: 8px 18px;
  border-radius: var(--adw-r-full);
}

.adw-pill-cyan {
  background: var(--adw-cyan-tint);
}

.adw-pill-solid {
  background: var(--adw-cyan);
  color: #fff;
  font-weight: 900;
  font-size: 15px;
  padding: 7px 16px;
}

.adw-pill-solid-teal {
  background: var(--adw-teal);
  color: #fff;
  font-weight: 900;
  font-size: 15px;
  padding: 7px 16px;
}

/* --------------------------------------------------------------- heading */

.adw-h1 {
  margin: 0 0 20px;
  font-size: 60px;
  line-height: 1.22;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.adw-h2 {
  margin: 0 0 12px;
  font-size: 44px;
  font-weight: 900;
  line-height: 1.3;
}

.adw-h3 {
  margin: 0 0 10px;
  font-size: 23px;
  font-weight: 900;
  line-height: 1.35;
}

.adw-lede {
  margin: 0 0 var(--adw-s7);
  font-size: 19px;
  color: var(--adw-body);
  max-width: 620px;
}

.adw-terms-note {
  margin-top: var(--adw-s5);
  font-size: 13px;
  font-weight: 600;
  color: var(--adw-body);
}

.adw-terms-note a {
  font-weight: 700;
  text-decoration: underline;
  color: inherit;
}

.adw-terms-note-light,
.adw-terms-note-light a {
  color: #d6eef6;
}

/* ----------------------------------------------------------------- cards */

.adw-card {
  background: var(--adw-white);
  border-radius: var(--adw-r-xl);
  box-shadow: var(--adw-sh-soft);
  padding: var(--adw-s5);
}

.adw-card-flat {
  background: var(--adw-bg);
  border-radius: var(--adw-r-xl);
  padding: 34px 30px 32px;
  position: relative;
  overflow: hidden;
}

/* ----------------------------------------------------------------- grids */

.adw-grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}

.adw-grid4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

.adw-split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}

/* ----------------------------------------------------------------- forms */

.adw-field {
  display: block;
  margin-bottom: var(--adw-s5);
}

.adw-field > label {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--adw-ink);
  margin-bottom: var(--adw-s2);
}

.adw-input {
  width: 100%;
  height: 56px;
  padding: 0 16px;
  font-family: inherit;
  font-size: 17px;
  color: var(--adw-ink);
  background: #fff;
  border: 1px solid #d8e5ec;
  border-radius: var(--adw-r-sm);
  text-align: right;
}

.adw-input::placeholder {
  color: #9aa3b8;
}

.adw-input:hover {
  border-color: var(--adw-cyan-dark);
}

.adw-input[aria-invalid="true"] {
  border-color: var(--adw-danger);
  background: var(--adw-danger-tint);
}

/* Phone/number inputs render Latin digits LTR even inside the RTL page. */
.adw-input-tel {
  direction: ltr;
  text-align: left;
  letter-spacing: 1px;
}

.adw-error {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--adw-danger);
}

.adw-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 15px;
  color: var(--adw-body);
  line-height: 1.6;
  margin-bottom: var(--adw-s5);
  cursor: pointer;
}

.adw-check input {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  accent-color: var(--adw-cyan);
  cursor: pointer;
}

/* ------------------------------------------------------------ image slots */

/* Placeholder beds for the nine photo slots in §14.5. Drop a real <img> in
   and delete the slot div — the sizing lives on the parent, not here. */
.lp-slot {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--adw-s4);
  background:
    repeating-linear-gradient(
      135deg,
      rgba(2, 95, 120, 0.04) 0 12px,
      rgba(2, 95, 120, 0.08) 12px 24px
    ),
    var(--adw-cyan-tint);
  color: var(--adw-teal);
  font-size: 14px;
  font-weight: 700;
}

/* A filled slot drops its placeholder styling entirely — the photo is the
   content now, and any stripe showing through the edges would read as a bug. */
.lp-slot.is-filled {
  background: none;
  padding: 0;
}

.lp-slot.is-filled > span {
  display: none;
}

.adw-slot-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* Transparent until the load handler adds .is-filled, so a half-decoded or
     broken image never flashes over the placeholder. */
  opacity: 0;
  transition: opacity 0.35s ease;
}

.lp-slot.is-filled .adw-slot-img {
  opacity: 1;
}

.lp-slot-dark {
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0 12px, rgba(255, 255, 255, 0.1) 12px 24px),
    #024f65;
  color: var(--adw-cyan-light);
}

/* --------------------------------------------------------------- banners */

.adw-banner {
  display: flex;
  align-items: flex-start;
  gap: var(--adw-s3);
  padding: 16px 20px;
  border-radius: var(--adw-r-md);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.7;
  margin-bottom: var(--adw-s5);
}

.adw-banner-info {
  background: var(--adw-cyan-tint);
  color: var(--adw-teal);
}

.adw-banner-neutral {
  background: var(--adw-neutral-tint);
  color: var(--adw-teal);
}

.adw-banner-error {
  background: var(--adw-danger-tint);
  color: var(--adw-danger);
}

/* ---------------------------------------------------------- progress bar */

.adw-progress {
  height: 12px;
  border-radius: var(--adw-r-full);
  background: var(--adw-track);
  overflow: hidden;
  position: relative;
}

.adw-progress > i {
  position: absolute;
  inset: 0 0 0 auto;
  border-radius: var(--adw-r-full);
  background: var(--adw-grad-progress);
  overflow: hidden;
  display: block;
  transition: width 0.5s ease;
}

.adw-progress > i::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  animation: adwShine 2.4s linear infinite;
}

/* ---------------------------------------------------------------- tables */

.adw-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.adw-table th {
  text-align: right;
  font-weight: 800;
  color: var(--adw-body);
  font-size: 14px;
  padding: 12px 14px;
  border-bottom: 2px solid var(--adw-hairline);
  white-space: nowrap;
}

.adw-table td {
  padding: 14px;
  border-bottom: 1px solid var(--adw-hairline);
  color: var(--adw-ink);
}

.adw-table tr:last-child td {
  border-bottom: 0;
}

.adw-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ---------------------------------------------------------------- status */

.adw-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: var(--adw-r-full);
  background: var(--adw-neutral-tint);
  color: var(--adw-teal);
  white-space: nowrap;
}

.adw-status-live {
  background: var(--adw-cyan-tint);
  color: var(--adw-cyan-dark);
}

.adw-status-done {
  background: var(--adw-teal);
  color: #fff;
}

.adw-status-bad {
  background: var(--adw-danger-tint);
  color: var(--adw-danger);
}

/* ---------------------------------------------------------------- dialog */

.adw-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(20, 20, 58, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.adw-dialog {
  background: #fff;
  border-radius: var(--adw-r-lg);
  padding: var(--adw-s6);
  max-width: 460px;
  width: 100%;
  box-shadow: var(--adw-sh-raised);
  max-height: 90vh;
  overflow-y: auto;
}

.adw-dialog h2 {
  margin: 0 0 10px;
  font-size: 26px;
  font-weight: 900;
  line-height: 1.35;
}

.adw-dialog-actions {
  display: flex;
  gap: var(--adw-s3);
  margin-top: var(--adw-s5);
  flex-wrap: wrap;
}

/* ----------------------------------------------------------------- toast */

.adw-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: var(--adw-ink);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  padding: 14px 26px;
  border-radius: var(--adw-r-full);
  box-shadow: var(--adw-sh-raised);
  max-width: calc(100vw - 40px);
  text-align: center;
}

/* -------------------------------------------------------------- skeleton */

.adw-skel {
  background: linear-gradient(90deg, #eef4f8, #e2ecf2, #eef4f8);
  background-size: 200% 100%;
  animation: adwSkel 1.3s linear infinite;
  border-radius: var(--adw-r-sm);
  height: 16px;
}

/* ------------------------------------------------------------ animations */

@keyframes adwFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-14px);
  }
}

@keyframes adwPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(0, 192, 243, 0.45);
  }
  70% {
    box-shadow: 0 0 0 18px rgba(0, 192, 243, 0);
  }
}

@keyframes adwShine {
  0% {
    transform: translateX(120%);
  }
  100% {
    transform: translateX(-320%);
  }
}

@keyframes adwSkel {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ------------------------------------------------------- responsive §9.5 */

@media (max-width: 1080px) {
  .adw-grid4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .adw-split {
    grid-template-columns: 1fr;
  }
  .adw-h1 {
    font-size: 48px;
  }
}

@media (max-width: 780px) {
  .adw-grid3,
  .adw-grid4 {
    grid-template-columns: 1fr;
  }
  .adw-section {
    padding: var(--adw-s8) var(--adw-pad-x);
  }
  .adw-h1 {
    font-size: 40px;
  }
  .adw-h2 {
    font-size: 32px;
  }
  .adw-navlink {
    display: none;
  }
  .adw-btn-block-mobile {
    width: 100%;
  }
}
