.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 46px;
  padding-inline: var(--sp-5);
  padding-block: var(--sp-2);
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-400);
  line-height: 1;
  color: var(--c-white);
  background-color: var(--c-red);
  border: var(--bw) solid var(--c-maroon);
  border-radius: var(--r-wobble);
  box-shadow: var(--shadow-md);
  transition:
    transform var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease),
    background-color var(--t-fast) ease;
}

html[lang="ar"] .btn {
  font-family: var(--font-display-ar);
}

.btn:hover {
  color: var(--c-white);
  background-color: var(--c-red-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lift);
}

.btn:active {
  transform: translateY(1px);
  box-shadow: var(--shadow-sm);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: var(--shadow-sm);
}

.btn--secondary {
  color: var(--c-maroon);
  background-color: transparent;
  border-color: var(--c-maroon);
  box-shadow: var(--shadow-sm);
}

.btn--secondary:hover {
  color: var(--c-maroon);
  background-color: var(--c-wheat-soft);
}

.btn--ghost {
  color: var(--c-ink);
  background-color: transparent;
  border-color: transparent;
  box-shadow: none;
  border-radius: var(--r-md);
}

.btn--ghost:hover {
  color: var(--c-maroon);
  background-color: var(--c-wheat-soft);
}

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

.btn--lg {
  min-height: 54px;
  font-size: var(--fs-500);
  border-radius: var(--r-wobble-alt);
}

.btn--sm {
  min-height: 38px;
  padding-inline: var(--sp-3);
  font-size: var(--fs-300);
}

.btn__icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.icon {
  width: 24px;
  height: 24px;
  fill: currentColor;
  flex: none;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--c-ink);
  border-radius: var(--r-md);
  transition:
    background-color var(--t-fast) ease,
    color var(--t-fast) ease;
}

.icon-btn:hover {
  color: var(--c-maroon);
  background-color: var(--c-wheat-soft);
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: var(--c-paper);
  border: var(--bw) solid var(--c-line);
  border-radius: var(--r-wobble);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.card--interactive {
  transition:
    transform var(--t-med) var(--ease),
    box-shadow var(--t-med) var(--ease);
}

.card--interactive:hover {
  transform: translateY(-3px) rotate(-0.4deg);
  box-shadow: var(--shadow-lift);
}

.product-card {
  height: 100%;
}

.product-card__media {
  padding: var(--sp-3);
  background-color: var(--c-wheat-soft);
  border-bottom: var(--bw) solid var(--c-line);
}

.product-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: var(--sp-3) var(--sp-4) var(--sp-4);
}

.product-card__name {
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-500);
  color: var(--c-maroon);
  line-height: var(--lh-snug);
}

html[lang="ar"] .product-card__name {
  font-family: var(--font-display-ar);
}

.product-card__hint {
  font-size: var(--fs-300);
  color: var(--c-ink-soft);
}

.product-card__price {
  margin-top: var(--sp-1);
  font-size: var(--fs-500);
  font-weight: var(--fw-semibold);
  color: var(--c-ink);
}

.photo-frame {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

.photo-frame__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-frame--polaroid {
  padding: 10px 10px 42px;
  background-color: var(--c-white);
  border-radius: 3px;
  box-shadow: var(--shadow-polaroid);
  transform: rotate(-1.2deg);
}

.photo-frame--polaroid .photo-frame__caption {
  position: absolute;
  inset-inline: 0;
  bottom: 10px;
  text-align: center;
  font-family: var(--font-marker);
  font-size: var(--fs-500);
  color: var(--c-ink);
}

.photo-frame--taped {
  padding: 8px;
  background-color: var(--c-white);
  box-shadow: var(--shadow-md);
}

.photo-frame--taped::before,
.photo-frame--taped::after {
  content: "";
  position: absolute;
  top: -10px;
  width: 54px;
  height: 22px;
  background-color: rgba(234, 209, 150, 0.7);
  box-shadow: 0 1px 2px var(--c-shadow-soft);
}

.photo-frame--taped::before {
  inset-inline-start: 10px;
  transform: rotate(-8deg);
}

.photo-frame--taped::after {
  inset-inline-end: 10px;
  transform: rotate(7deg);
}

.photo-frame--torn {
  padding: 10px;
  background-color: var(--c-white);
  box-shadow: var(--shadow-md);
  clip-path: polygon(
    0 4%,
    6% 0,
    20% 3%,
    38% 0,
    55% 3%,
    72% 0,
    88% 3%,
    100% 1%,
    98% 20%,
    100% 42%,
    97% 60%,
    100% 80%,
    98% 97%,
    80% 100%,
    60% 97%,
    42% 100%,
    24% 98%,
    8% 100%,
    2% 86%,
    0 64%,
    3% 42%,
    0 22%
  );
}

.input-field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.input-field__label {
  font-family: var(--font-display);
  font-weight: var(--fw-medium);
  font-size: var(--fs-300);
  color: var(--c-maroon);
}

html[lang="ar"] .input-field__label {
  font-family: var(--font-display-ar);
}

.input,
.textarea,
.select {
  width: 100%;
  min-height: 46px;
  padding: var(--sp-2) var(--sp-3);
  font-family: var(--font-body);
  font-size: var(--fs-400);
  color: var(--c-ink);
  background-color: var(--c-white);
  border: var(--bw) solid var(--c-line);
  border-radius: var(--r-wobble);
  transition:
    border-color var(--t-fast) ease,
    box-shadow var(--t-fast) ease;
}

html[lang="ar"] .input,
html[lang="ar"] .textarea,
html[lang="ar"] .select {
  font-family: var(--font-body-ar);
}

.textarea {
  min-height: 110px;
  resize: vertical;
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--c-red);
  box-shadow: 0 0 0 3px rgba(191, 49, 49, 0.18);
}

.input--error,
.textarea--error,
.select--error {
  border-color: var(--c-red);
}

.field-error {
  font-size: var(--fs-300);
  color: var(--c-red);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 2px var(--sp-2);
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-200);
  color: var(--c-maroon);
  background-color: var(--c-wheat);
  border-radius: var(--r-pill);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  min-height: 38px;
  padding-inline: var(--sp-3);
  font-weight: var(--fw-medium);
  font-size: var(--fs-300);
  color: var(--c-ink);
  background-color: var(--c-paper);
  border: var(--bw) solid var(--c-line);
  border-radius: var(--r-pill);
  transition:
    background-color var(--t-fast) ease,
    color var(--t-fast) ease;
}

.chip:hover,
.chip[aria-pressed="true"] {
  color: var(--c-white);
  background-color: var(--c-red);
  border-color: var(--c-maroon);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 3px var(--sp-3);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-200);
  border-radius: var(--r-pill);
  border: var(--bw) solid var(--c-line);
}

.status-pill--done {
  color: var(--c-green);
  background-color: var(--c-green-soft);
  border-color: var(--c-green);
}

.status-pill--current {
  color: var(--c-white);
  background-color: var(--c-red);
  border-color: var(--c-maroon);
}

.status-pill--pending {
  color: var(--c-ink-soft);
  background-color: var(--c-light);
  border-color: var(--c-ink-soft);
}

.toast-region {
  position: fixed;
  inset-block-end: var(--sp-4);
  inset-inline: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  z-index: var(--z-toast);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  color: var(--c-white);
  background-color: var(--c-maroon);
  border: var(--bw) solid var(--c-ink);
  border-radius: var(--r-wobble);
  box-shadow: var(--shadow-lift);
  pointer-events: auto;
  animation: toast-in var(--t-med) var(--ease);
}

.toast--success {
  background-color: var(--c-green);
}

.toast--error {
  background-color: var(--c-red);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.skeleton {
  background: linear-gradient(
    100deg,
    var(--c-light) 30%,
    var(--c-wheat-soft) 50%,
    var(--c-light) 70%
  );
  background-size: 200% 100%;
  border-radius: var(--r-md);
  animation: skeleton-shine 1.4s infinite linear;
}

@keyframes skeleton-shine {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

.skeleton-img {
  aspect-ratio: 1 / 1;
  width: 100%;
}

.skeleton-line {
  height: 16px;
  width: 100%;
  border-radius: var(--r-sm);
}

.skeleton-line--lg {
  height: 18px;
  width: 70%;
}

.skeleton-line--sm {
  height: 14px;
  width: 40%;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--c-wheat);
  border-top-color: var(--c-red);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.scribble-divider {
  display: block;
  width: 180px;
  max-width: 60%;
  height: 14px;
  margin-block: var(--sp-2);
  color: var(--c-red);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-7) var(--sp-4);
  text-align: center;
  color: var(--c-ink-soft);
}

.empty-state__art {
  width: 120px;
  height: 120px;
  color: var(--c-maroon);
  opacity: 0.8;
}

.swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: var(--bw) solid var(--c-line);
  background-color: var(--swatch, var(--c-light));
  cursor: pointer;
  transition: outline-color var(--t-fast) ease;
}

.swatch[aria-pressed="true"] {
  outline: 3px solid var(--c-red);
  outline-offset: 2px;
}

.swatch-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.stepper {
  display: inline-flex;
  align-items: center;
  border: var(--bw) solid var(--c-line);
  border-radius: var(--r-wobble);
  overflow: hidden;
  background-color: var(--c-white);
}

.stepper__btn {
  width: 42px;
  height: 44px;
  font-family: var(--font-display);
  font-size: var(--fs-600);
  font-weight: var(--fw-bold);
  color: var(--c-maroon);
  background-color: var(--c-wheat-soft);
}

.stepper__btn:hover {
  background-color: var(--c-wheat);
}

.stepper__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.stepper__input {
  width: 48px;
  height: 44px;
  text-align: center;
  font-weight: var(--fw-semibold);
  border: none;
  border-inline: var(--bw) solid var(--c-line);
  -moz-appearance: textfield;
}

.stepper__input::-webkit-outer-spin-button,
.stepper__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.page-loading {
  display: flex;
  justify-content: center;
  padding: var(--sp-7);
}

.page-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  text-align: center;
}
