/* Critical UI guardrails loaded after admin-selected theme overrides. */
:root {
  --mabapu-safe-dark: #1a1a2e;
  --mabapu-safe-deep: #0c0a09;
  --mabapu-safe-cream: #fff8f0;
  --mabapu-safe-muted-on-dark: rgba(255, 248, 240, 0.78);
  --mabapu-safe-surface: #ffffff;
  --mabapu-safe-surface-muted: #f3f4f6;
  --mabapu-safe-text: #1f2937;
  --mabapu-safe-text-muted: #4b5563;
}

.navbar-royal__link,
.navbar-royal__mobile-menu .navbar-royal__link,
.mobile-bottom-nav__item,
.footer-royal a,
.chef-sidebar__link,
.admin-sidebar__link {
  color: rgba(255, 248, 240, 0.82);
}

.navbar-royal__link:hover,
.navbar-royal__link--active,
.navbar-royal__mobile-menu .navbar-royal__link:hover,
.mobile-bottom-nav__item.active,
.footer-royal a:hover,
.chef-sidebar__link:hover,
.chef-sidebar__link.active,
.admin-sidebar__link:hover,
.admin-sidebar__link.active {
  color: var(--royal-gold, #d4a853);
}

.navbar-royal__link svg,
.navbar-royal__mobile-menu svg,
.mobile-bottom-nav__icon svg,
.footer-royal__social svg,
.alert svg,
.nav-svg {
  display: block;
  max-width: none;
  flex-shrink: 0;
}

.navbar-royal__link svg,
.navbar-royal__mobile-menu .navbar-royal__link svg {
  width: 18px;
  height: 18px;
}

.mobile-bottom-nav__icon {
  width: 24px;
  height: 24px;
}

.mobile-bottom-nav__icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
}

.nav-svg {
  width: 18px;
  height: 18px;
}

.recipe-card__badge svg,
.recipe-card__time svg,
.recipe-card__rating svg,
.recipe-card__meta-item svg {
  display: block;
  flex: 0 0 auto;
  fill: currentColor;
  stroke: none;
}

.recipe-card__badge svg,
.recipe-card__time svg,
.recipe-card__rating svg {
  width: 14px;
  height: 14px;
}

.recipe-card__meta-item svg {
  width: 13px;
  height: 13px;
}

.recipe-card__chef svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  stroke: none;
}

.chef-bento-icon svg,
.chef-bento-card svg {
  display: block;
  flex: 0 0 auto;
  max-width: 100%;
  max-height: 100%;
}

.btn svg,
a svg,
button svg,
.form-label svg,
.section-header__label svg,
.product-badge svg {
  flex-shrink: 0;
  vertical-align: -0.125em;
}

:where(a, button, .btn, .form-label, .section-header__label, .product-badge, .alert, h1, h2, h3, h4) > svg:not([width]):not([height]):not([style*="width"]) {
  width: 1em;
  height: 1em;
}

.card,
.card-glass,
.mabapu-card,
.recipe-card,
.product-card,
.orders-mobile-detail-card {
  color: var(--royal-dark, #1a1a2e);
}

.section-dark,
.marketplace-showcase,
.auth-page,
.dash-hero,
.dash-hero-sm,
.coins-hero,
.coins-hero-mob,
.subs-active-card,
.subs-active-card-mob,
.card-royal {
  color: var(--mabapu-safe-cream) !important;
}

.section-dark :where(h1, h2, h3, h4, .section-title, .section-header__title),
.marketplace-showcase :where(h1, h2, h3, h4, .section-title, .section-header__title),
.dash-hero :where(h1, h2, h3, h4),
.dash-hero-sm :where(h1, h2, h3, h4),
.coins-hero :where(h1, h2, h3, h4),
.coins-hero-mob :where(h1, h2, h3, h4),
.subs-active-card :where(h1, h2, h3, h4),
.subs-active-card-mob :where(h1, h2, h3, h4),
.card-royal :where(h1, h2, h3, h4) {
  color: var(--mabapu-safe-cream) !important;
}

.section-dark p,
.marketplace-showcase p,
.dash-hero-sub,
.dash-hero-sub-sm,
.coins-hero-value,
.coins-hero-value-mob,
.coins-hero-rate {
  color: var(--mabapu-safe-muted-on-dark) !important;
}

.auth-page {
  background: linear-gradient(135deg, var(--royal-dark, #1a1a2e), var(--royal-deep, #0f172a), var(--royal-navy, #111827));
}

.auth-card {
  color: var(--mabapu-safe-cream) !important;
}

.auth-card :where(h1, h2, h3, .auth-card__logo) {
  color: var(--royal-gold, #d4a853) !important;
}

.auth-card :where(p, .auth-description, .form-hint, .auth-footer-text),
.auth-card__logo p {
  color: var(--mabapu-safe-muted-on-dark) !important;
}

.auth-card .form-label {
  color: rgba(255, 248, 240, 0.86) !important;
}

.auth-card .form-control,
.auth-card input,
.auth-card select,
.auth-card textarea {
  color: var(--mabapu-safe-cream) !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(var(--royal-gold-rgb, 212, 168, 83), 0.28) !important;
}

.auth-card .form-control::placeholder,
.auth-card input::placeholder,
.auth-card textarea::placeholder {
  color: rgba(255, 248, 240, 0.52) !important;
}

.auth-card .google-btn {
  color: var(--mabapu-safe-dark) !important;
  background: var(--mabapu-safe-surface) !important;
  border-color: #d1d5db !important;
}

.checkout-page-main,
.checkout-page-main .card,
.checkout-page-main .card-glass,
.checkout-summary,
.cart-item {
  color: var(--mabapu-safe-text) !important;
}

.checkout-page-main :where(h1, h2, h3, h4, label, strong),
.checkout-summary :where(span, strong),
.cart-item :where(a, span, strong) {
  color: inherit;
}

.checkout-page-main .card,
.checkout-page-main .card-glass,
.checkout-summary {
  background-color: var(--mabapu-safe-surface);
}

.text-dark,
.checkout-page-main .text-dark,
.marketplace-grid .text-dark {
  color: var(--mabapu-safe-dark) !important;
}

.form-control,
.royal-input,
input,
select,
textarea {
  color: var(--royal-dark, #1a1a2e);
  background-color: #ffffff;
}

.form-control::placeholder,
.royal-input::placeholder,
input::placeholder,
textarea::placeholder {
  color: #6b7280;
  opacity: 1;
}

.navbar-royal__mobile-menu .form-control,
.navbar-royal__mobile-menu input,
.admin-sidebar,
.chef-sidebar,
.navbar-royal,
.footer-royal,
.mobile-bottom-nav {
  color: var(--royal-cream, #fff8f0);
}

.mobile-menu-header span {
  color: var(--royal-gold, #d4a853) !important;
}

.navbar-royal__hamburger {
  background: rgba(255, 248, 240, 0.1) !important;
  border-color: rgba(var(--royal-gold-rgb, 212, 168, 83), 0.45) !important;
  color: var(--mabapu-safe-cream) !important;
  flex-direction: column !important;
  gap: 5px !important;
}

.navbar-royal__hamburger span {
  display: block !important;
  width: 22px !important;
  min-width: 22px !important;
  height: 2px !important;
  min-height: 2px !important;
  border-radius: 999px !important;
  background: var(--mabapu-safe-cream) !important;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
  margin: 0 !important;
}

.navbar-royal__hamburger:hover,
.navbar-royal__hamburger:focus-visible {
  background: rgba(var(--royal-gold-rgb, 212, 168, 83), 0.18) !important;
  border-color: var(--royal-gold, #d4a853) !important;
  outline: 2px solid rgba(var(--royal-gold-rgb, 212, 168, 83), 0.45);
  outline-offset: 2px;
}

.navbar-royal__mobile-menu {
  background: var(--royal-dark, #1a1a2e) !important;
  color: var(--mabapu-safe-cream) !important;
}

.navbar-royal__mobile-menu .navbar-royal__link {
  color: rgba(255, 248, 240, 0.9) !important;
  border-bottom-color: rgba(255, 248, 240, 0.1) !important;
}

.navbar-royal__mobile-menu .navbar-royal__link svg {
  color: currentColor !important;
}

.navbar-royal__mobile-menu .navbar-royal__link:hover,
.navbar-royal__mobile-menu .navbar-royal__link[aria-current="page"] {
  color: var(--royal-gold, #d4a853) !important;
  background: rgba(var(--royal-gold-rgb, 212, 168, 83), 0.12) !important;
}

.mobile-menu-close {
  color: var(--mabapu-safe-cream) !important;
  background: rgba(255, 248, 240, 0.08) !important;
  border: 1px solid rgba(var(--royal-gold-rgb, 212, 168, 83), 0.28) !important;
  border-radius: 10px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mobile-menu-close:hover,
.mobile-menu-close:focus-visible {
  color: var(--royal-gold, #d4a853) !important;
  border-color: var(--royal-gold, #d4a853) !important;
}

.btn-primary,
a.btn-primary,
button.btn-primary {
  background: linear-gradient(135deg, var(--royal-saffron, #ff6b35), var(--royal-saffron-dark, var(--royal-saffron, #ff6b35))) !important;
  border-color: var(--royal-saffron, #ff6b35) !important;
  color: #ffffff !important;
}

.btn-primary:hover,
a.btn-primary:hover,
button.btn-primary:hover {
  color: #ffffff !important;
}

.btn-gold,
a.btn-gold,
button.btn-gold {
  color: var(--mabapu-safe-dark) !important;
}

.footer-royal {
  background: var(--royal-midnight, #0d1117) !important;
  color: rgba(255, 248, 240, 0.72) !important;
}

.footer-royal__brand span,
.footer-royal h3,
.footer-royal h4 {
  color: var(--royal-gold, #d4a853) !important;
}

.footer-royal__brand p,
.footer-royal .newsletter-desc,
.footer-royal__bottom,
.footer-royal__bottom p {
  color: rgba(255, 248, 240, 0.68) !important;
}

.footer-royal a {
  color: rgba(255, 248, 240, 0.84) !important;
}

.footer-royal a:hover {
  color: var(--royal-gold, #d4a853) !important;
}

.footer-royal__newsletter input {
  color: var(--mabapu-safe-cream) !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

.skip-link {
  background: var(--mabapu-safe-surface) !important;
  color: var(--mabapu-safe-dark) !important;
  border: 2px solid var(--royal-gold, #d4a853);
}
