/**
 * Self-hosted replacement for Bootstrap 5.3.2 -- implements only the class
 * names actually used across the storefront (grid, flex/spacing utilities,
 * buttons, forms, cards, badges, tables, nav, offcanvas), so none of the
 * existing page markup had to change. Not a general-purpose framework;
 * extend it rather than reaching for a CDN again if a page starts using a
 * Bootstrap class not covered here.
 *
 * The site's own design system (colours, header/nav chrome, animations)
 * lives in the inline <style> blocks in includes/header.php and stays
 * exactly as it was -- this file only replaces what Bootstrap provided.
 */

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

/* ---------- Minimal Reboot (Bootstrap's own baseline normalize) ----------
   Without this, un-reset browser defaults on button/input/textarea (their
   own font and line-height, not the page's) throw off spacing by a few px
   per element -- compounds into a visibly shorter page over many stacked
   form fields. */
body { margin: 0; }
button, input, optgroup, select, textarea { margin: 0; font-family: inherit; font-size: inherit; line-height: inherit; }
button { text-transform: none; }
button, [type="button"], [type="reset"], [type="submit"] { -webkit-appearance: button; appearance: button; }
img { vertical-align: middle; }


/* ---------- Layout: container / grid ---------- */
.container { width: 100%; max-width: 1140px; margin-left: auto; margin-right: auto; padding-left: 12px; padding-right: 12px; }

.row { display: flex; flex-wrap: wrap; --gx: 24px; margin-left: calc(var(--gx) / -2); margin-right: calc(var(--gx) / -2); }
.row > * { padding-left: calc(var(--gx) / 2); padding-right: calc(var(--gx) / 2); }
.g-2 { --gx: 8px; }
.g-3 { --gx: 16px; }
.g-4 { --gx: 24px; }

.col-4  { flex: 0 0 auto; width: 33.3333%; }
.col-6  { flex: 0 0 auto; width: 50%; }
.col-12 { flex: 0 0 auto; width: 100%; }

@media (min-width: 768px) {
  .col-md-2 { flex: 0 0 auto; width: 16.6667%; }
  .col-md-3 { flex: 0 0 auto; width: 25%; }
  .col-md-4 { flex: 0 0 auto; width: 33.3333%; }
  .col-md-5 { flex: 0 0 auto; width: 41.6667%; }
  .col-md-6 { flex: 0 0 auto; width: 50%; }
  .col-md-7 { flex: 0 0 auto; width: 58.3333%; }
  .col-md-9 { flex: 0 0 auto; width: 75%; }
  .d-md-flex { display: flex !important; }
  .mt-md-0   { margin-top: 0 !important; }
  .text-md-end { text-align: right !important; }
}
@media (min-width: 992px) {
  .col-lg-4 { flex: 0 0 auto; width: 33.3333%; }
  .col-lg-5 { flex: 0 0 auto; width: 41.6667%; }
  .col-lg-7 { flex: 0 0 auto; width: 58.3333%; }
  .col-lg-8 { flex: 0 0 auto; width: 66.6667%; }
  .d-lg-block { display: block !important; }
  .d-lg-flex  { display: flex !important; }
  .d-lg-none  { display: none !important; }
}

/* ---------- Display / flex ---------- */
.d-none  { display: none !important; }
.d-block { display: block !important; }
.d-flex  { display: flex !important; }
.flex-wrap { flex-wrap: wrap !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-center  { justify-content: center !important; }
.align-items-center { align-items: center !important; }
.align-items-start  { align-items: flex-start !important; }
.gap-0 { gap: 0 !important; }
.gap-1 { gap: .25rem !important; }
.gap-2 { gap: .5rem !important; }
.gap-3 { gap: 1rem !important; }

/* ---------- Spacing ---------- */
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: .25rem !important; }
.mb-2 { margin-bottom: .5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-1 { margin-top: .25rem !important; }
.mt-2 { margin-top: .5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.my-3 { margin-top: 1rem !important; margin-bottom: 1rem !important; }
.me-1 { margin-right: .25rem !important; }
.me-2 { margin-right: .5rem !important; }
.ms-2 { margin-left: .5rem !important; }
.ms-auto { margin-left: auto !important; }
.p-0  { padding: 0 !important; }
.p-1  { padding: .25rem !important; }
.p-4  { padding: 1.5rem !important; }
.pt-3 { padding-top: 1rem !important; }
.px-3 { padding-left: 1rem !important; padding-right: 1rem !important; }
.px-4 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
.py-2 { padding-top: .5rem !important; padding-bottom: .5rem !important; }
.py-4 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
.py-5 { padding-top: 3rem !important; padding-bottom: 3rem !important; }

/* ---------- Sizing ---------- */
.w-100 { width: 100% !important; }

/* ---------- Typography ---------- */
.text-center { text-align: center !important; }
.text-muted  { color: #6c757d !important; }
.text-danger { color: #dc3545 !important; }
.text-success{ color: #198754 !important; }
.text-decoration-none { text-decoration: none !important; }
.fw-bold   { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-600    { font-weight: 600 !important; }
.fw-normal { font-weight: 400 !important; }
.visually-hidden {
  position: absolute !important; width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important; overflow: hidden !important;
  clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important;
}

/* ---------- Colour / border ---------- */
.bg-white     { background-color: #fff !important; }
.bg-secondary { background-color: #6c757d !important; }
.bg-success   { background-color: #198754 !important; }
.border-0     { border: 0 !important; }
.rounded-3    { border-radius: .5rem !important; }
.shadow-sm    { box-shadow: 0 .125rem .25rem rgba(0,0,0,.075) !important; }
.opacity-25   { opacity: .25 !important; }
.opacity-50   { opacity: .5 !important; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; font-weight: 400; line-height: 1.5; text-align: center;
  vertical-align: middle; cursor: pointer; user-select: none;
  background-color: transparent; border: 1px solid transparent;
  padding: .375rem .75rem; font-size: 1rem; border-radius: .375rem;
  transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
  text-decoration: none;
}
.btn:disabled, .btn.disabled { opacity: .65; pointer-events: none; }
.btn-sm { padding: .25rem .5rem; font-size: .875rem; border-radius: .25rem; }
.btn-primary   { color: #fff; background-color: #0d6efd; border-color: #0d6efd; }
.btn-success   { color: #fff; background-color: #198754; border-color: #198754; }
.btn-link      { color: #0d6efd; text-decoration: underline; background: none; border-color: transparent; }
.btn-outline-secondary { color: #6c757d; border-color: #6c757d; }
.btn-outline-secondary:hover { color: #fff; background-color: #6c757d; }
.btn-outline-danger { color: #dc3545; border-color: #dc3545; }
.btn-outline-danger:hover { color: #fff; background-color: #dc3545; }
.btn-close {
  box-sizing: content-box; width: 1em; height: 1em; padding: .25em;
  background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
  border: 0; border-radius: .375rem; opacity: .5; cursor: pointer;
}
.btn-close:hover { opacity: .75; }
.btn-close-white { filter: invert(1) grayscale(100%) brightness(200%); }

/* ---------- Forms ---------- */
.form-control, .form-select {
  display: block; width: 100%; padding: .375rem .75rem; font-size: 1rem;
  font-weight: 400; line-height: 1.5; color: #212529; background-color: #fff;
  border: 1px solid #ced4da; border-radius: .375rem;
  transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}
.form-control:focus, .form-select:focus {
  border-color: #86b7fe; outline: 0; box-shadow: 0 0 0 .25rem rgba(13,110,253,.25);
}
.form-control-sm, .form-select-sm { padding: .25rem .5rem; font-size: .875rem; border-radius: .25rem; }
.form-label { margin-bottom: .5rem; display: inline-block; }
.form-check { display: block; min-height: 1.5rem; padding-left: 1.5em; margin-bottom: .125rem; }
.form-check-input {
  width: 1em; height: 1em; margin-left: -1.5em; vertical-align: top;
  background-color: #fff; border: 1px solid rgba(0,0,0,.25); appearance: none; border-radius: .25em;
}
.form-check-input:checked { background-color: #0d6efd; border-color: #0d6efd; }
.form-check-label { margin-left: .25em; }
.input-group { position: relative; display: flex; flex-wrap: wrap; align-items: stretch; width: 100%; }
.input-group > .form-control, .input-group > .form-select { position: relative; flex: 1 1 auto; width: 1%; min-width: 0; }
.input-group-text {
  display: flex; align-items: center; padding: .375rem .75rem; font-size: 1rem;
  color: #212529; background-color: #e9ecef; border: 1px solid #ced4da; border-radius: .375rem;
}
.input-group-sm > .form-control, .input-group-sm > .input-group-text { padding: .25rem .5rem; font-size: .875rem; }

/* ---------- Cards / badges / tables / alerts ---------- */
.card { position: relative; display: flex; flex-direction: column; min-width: 0; background-color: #fff; border: 1px solid rgba(0,0,0,.125); border-radius: .375rem; }
.card-body { flex: 1 1 auto; padding: 1rem; }

.badge { display: inline-block; padding: .35em .65em; font-size: .75em; font-weight: 700; line-height: 1; color: #fff; text-align: center; white-space: nowrap; vertical-align: baseline; border-radius: .375rem; background-color: #6c757d; }

.table { width: 100%; margin-bottom: 1rem; vertical-align: top; border-color: #dee2e6; border-collapse: collapse; }
.table > :not(caption) > * > * { padding: .5rem .5rem; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: inherit; }
.table-sm > :not(caption) > * > * { padding: .25rem .25rem; }

.alert { position: relative; padding: 1rem; margin-bottom: 1rem; border: 1px solid transparent; border-radius: .375rem; }
.alert-danger  { color: #842029; background-color: #f8d7da; border-color: #f5c2c7; }
.alert-success { color: #0f5132; background-color: #d1e7dd; border-color: #badbcc; }

/* ---------- Nav ---------- */
.nav { display: flex; flex-wrap: wrap; padding-left: 0; margin-bottom: 0; list-style: none; }
.nav-item { }
.nav-link { display: block; padding: .5rem 1rem; text-decoration: none; }
.nav-fill .nav-item { flex: 1 1 auto; text-align: center; }
.nav-pills .nav-link { border-radius: .375rem; }
.nav-pills .nav-link.active { color: #fff; background-color: #0d6efd; }

/* ---------- Pagination ---------- */
.pagination { display: flex; padding-left: 0; list-style: none; gap: .25rem; }
.pagination-sm .page-link { padding: .25rem .5rem; font-size: .875rem; }
.page-link { position: relative; display: block; padding: .375rem .75rem; color: #0d6efd; text-decoration: none; background-color: #fff; border: 1px solid #dee2e6; border-radius: .375rem; }
.page-item.active .page-link { color: #fff; background-color: #0d6efd; border-color: #0d6efd; }

/* ---------- Offcanvas (mobile nav) ----------
   Same visual behaviour as Bootstrap's offcanvas (fixed panel that slides
   in from the left) but driven by a plain .show class toggled from jQuery
   in header.php, not data-bs-toggle. */
.offcanvas {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 1045;
  display: flex; flex-direction: column; max-width: 100%; width: 400px;
  background-color: #fff; box-shadow: 0 0 0 rgba(0,0,0,0);
  transform: translateX(-100%); transition: transform .3s ease-in-out;
  visibility: hidden;
}
.offcanvas-start { left: 0; }
.offcanvas.show { transform: translateX(0); visibility: visible; box-shadow: .5rem 0 1rem rgba(0,0,0,.25); }
.offcanvas-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem; }
.offcanvas-body { flex-grow: 1; padding: 1rem; overflow-y: auto; }
.offcanvas-backdrop {
  position: fixed; inset: 0; z-index: 1040; background-color: rgba(0,0,0,.5);
  opacity: 0; visibility: hidden; transition: opacity .15s linear;
}
.offcanvas-backdrop.show { opacity: 1; visibility: visible; }
