/* ==========================================================
   MABAPU FOODS - Enterprise Shell Layer (Additive)
   Non-breaking normalization over existing theme styles.
   ========================================================== */

:root {
  --shell-content-max: 1280px;
  --shell-gutter: clamp(14px, 2.2vw, 28px);
  --shell-section-y: clamp(28px, 5vw, 64px);
  --shell-radius: 16px;
  --shell-border: 1px solid rgba(var(--royal-gold-rgb), 0.16);
}

html,
body {
  max-width: 100%;
  overflow-x: clip;
}

/* Safer media defaults */
img,
video,
canvas,
svg,
iframe {
  max-width: 100%;
}

/* Shared shell rhythm */
.mabapu-shell {
  width: min(100%, var(--shell-content-max));
  margin-inline: auto;
  padding-inline: var(--shell-gutter);
}

.mabapu-section {
  padding-block: var(--shell-section-y);
}

.mabapu-card {
  border-radius: var(--shell-radius);
  border: var(--shell-border);
  background: #fff;
  box-shadow: var(--shadow-xs);
}

/* Prevent common modal/dropdown clipping issues */
[role="dialog"],
.modal,
.dropdown-menu,
.popover {
  z-index: max(1000, var(--z-modal));
}

/* Sticky safety */
.admin-header,
.chef-header,
.navbar-royal {
  backface-visibility: hidden;
  transform: translateZ(0);
}

/* Long text safety in cards/tables */
.card,
.mabapu-card,
td,
th {
  overflow-wrap: anywhere;
  word-break: normal;
}

/* Form controls consistency without changing semantics */
input,
select,
textarea,
button {
  font: inherit;
}

/* Mobile overflow and double-scroll protections */
@media (max-width: 1024px) {
  .admin-main,
  .chef-main {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 768px) {
  body {
    overscroll-behavior-y: contain;
  }

  .container,
  .container-sm,
  .container-lg {
    padding-left: clamp(12px, 4vw, 16px);
    padding-right: clamp(12px, 4vw, 16px);
  }

  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

