/* USANA Foundation cookie consent: banner, settings modal, notices, gated embeds,
   and the cookie declaration table. Kit colors from Elementor post-2421.css:
   teal #016171, dark teal #0B4F58, green #23A455, body text #333F48.
   Everything is fixed-position or in-flow replacement, so it never shifts layout. */

#usf-consent,
#usf-consent * {
  box-sizing: border-box;
}

:root {
  --usf-teal: #016171;
  --usf-teal-dark: #0B4F58;
  --usf-green: #23A455;
  --usf-green-text: #1f7a3f; /* the kit green is 3.2:1 on white, fine for the switch track, not for 12px text */
  --usf-text: #333F48;
  --usf-muted: #4f5d66;
  --usf-border: #dde8ea;
  --usf-off: #6f8085;
  --usf-z: 2147483000;
}

#usf-consent {
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--usf-text);
  -webkit-font-smoothing: antialiased;
}

#usf-consent [hidden] {
  display: none !important;
}

#usf-consent p {
  margin: 0;
}

#usf-consent a {
  color: var(--usf-teal);
  text-decoration: underline;
  text-underline-offset: 2px;
}

#usf-consent a:hover {
  color: var(--usf-teal-dark);
}

#usf-consent :focus-visible,
.usf-embed :focus-visible {
  outline: 2px solid var(--usf-green, #23A455);
  outline-offset: 2px;
}

.usf-sr-only {
  position: absolute !important;
  top: 0; /* pinned to the corner: at its static position (after the footer) it added 1px to the page height */
  left: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Buttons: Accept all and Only necessary share one size, only the fill differs. */
.usf-btn,
.usf-btn:hover,
.usf-btn:focus {
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  min-height: 40px;
  padding: 0 1rem;
  border-radius: 8px;
  border: 1px solid var(--usf-teal);
  background: #fff;
  color: var(--usf-teal);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  transition: background-color 150ms ease-out, color 150ms ease-out, border-color 150ms ease-out;
}

.usf-btn:hover:not([disabled]) {
  background: #eef6f7;
}

.usf-btn--primary,
.usf-btn--primary:focus {
  background: var(--usf-teal);
  color: #fff;
}

/* Two classes here so this outranks .usf-btn:hover:not([disabled]) above
   (both 0,3,0; later wins). Without it a hovered primary button went pale
   with white text and its label vanished. */
.usf-btn.usf-btn--primary:hover:not([disabled]) {
  background: var(--usf-teal-dark);
  border-color: var(--usf-teal-dark);
  color: #fff;
}

.usf-btn--text,
.usf-btn--text:focus {
  border-color: transparent;
  background: transparent;
  padding: 0 0.5rem;
}

.usf-btn.usf-btn--text:hover:not([disabled]) {
  background: transparent;
  border-color: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.usf-btn--icon,
.usf-btn--icon:focus {
  min-height: 44px;
  min-width: 44px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--usf-muted);
}

.usf-btn--icon:hover {
  background: #eef6f7;
  border-color: transparent;
  color: var(--usf-teal-dark);
}

/* Banner: non-modal card, bottom left. */
.usf-banner {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: var(--usf-z);
  width: calc(100% - 32px);
  max-width: 420px;
  background: #fff;
  border: 1px solid var(--usf-border);
  border-top: 4px solid var(--usf-teal);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(11, 79, 88, 0.18);
  padding: 1.125rem 1.25rem 1.25rem;
  transform: translateY(0);
  opacity: 1;
  transition: transform 150ms ease-out, opacity 150ms ease-out;
}

.usf-banner.usf-enter {
  transform: translateY(12px);
  opacity: 0;
}

.usf-banner__title {
  margin: 0 0 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--usf-teal-dark);
}

.usf-banner__text {
  font-size: 0.875rem;
  color: var(--usf-text);
}

.usf-banner__changed {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--usf-teal-dark);
}

.usf-banner__links {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
}

.usf-banner__links a + a {
  margin-left: 0.75rem;
}

.usf-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* Accept all and Only necessary split one row equally (flex-basis 0, not auto,
   so the longer label does not earn a wider button); Customize sits on the
   next line as a text button, in the same tab order. */
.usf-banner__actions .usf-btn {
  flex: 1 1 0;
}

.usf-banner__actions .usf-btn--text {
  flex: 1 0 100%;
  justify-content: flex-start;
  padding-left: 0;
  padding-right: 0;
}

/* Settings modal: true modal with backdrop. */
.usf-modal {
  position: fixed;
  inset: 0;
  z-index: calc(var(--usf-z) + 2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.usf-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 79, 88, 0.45);
}

.usf-modal__card {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(11, 79, 88, 0.28);
  padding: 1.25rem 1.5rem 1.5rem;
}

.usf-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.usf-modal__title {
  margin: 0.25rem 0 0;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--usf-teal-dark);
  outline: none;
}

.usf-modal__title:focus-visible {
  outline: 2px solid var(--usf-green);
  outline-offset: 4px;
}

.usf-modal__intro {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--usf-muted);
}

.usf-modal__rows {
  margin-top: 1rem;
  border-top: 1px solid var(--usf-border);
}

.usf-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--usf-border);
}

.usf-row__text {
  flex: 1 1 auto;
  min-width: 0;
}

.usf-row__title {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--usf-teal-dark);
}

.usf-row__desc {
  margin-top: 0.125rem;
  font-size: 0.8125rem;
  color: var(--usf-muted);
}

.usf-row__link {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.8125rem;
}

.usf-row__control {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  padding-top: 0.125rem;
}

.usf-row__always {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--usf-green-text);
  white-space: nowrap;
}

/* Switch: 44 x 24, green on, grey off. The 44px tap target comes from padding. */
.usf-switch,
.usf-switch:hover,
.usf-switch:focus {
  font: inherit;
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  margin: 10px 0;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: var(--usf-off);
  cursor: pointer;
  transition: background-color 150ms ease-out;
}

.usf-switch::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 150ms ease-out;
}

.usf-switch[aria-checked="true"],
.usf-switch[aria-checked="true"]:hover,
.usf-switch[aria-checked="true"]:focus {
  background: var(--usf-green);
}

.usf-switch[aria-checked="true"]::before {
  transform: translateX(20px);
}

.usf-switch[disabled] {
  cursor: default;
  opacity: 0.7;
}

.usf-modal__record {
  margin-top: 1rem;
  padding: 0.875rem 1rem;
  border-radius: 8px;
  background: #f1f6f7;
}

.usf-modal__record-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--usf-teal-dark);
}

.usf-modal__record-text {
  margin-top: 0.25rem;
  font-size: 0.8125rem;
  color: var(--usf-text);
}

.usf-modal__record-note {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--usf-muted);
}

.usf-modal__record .usf-btn {
  margin-top: 0.625rem;
  min-height: 36px;
  font-size: 0.8125rem;
}

.usf-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.usf-modal__actions .usf-btn {
  flex: 1 1 0;
}

/* Privacy signal notice and the withdraw toast: one line, bottom, dismissible. */
.usf-notice,
.usf-toast {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: calc(var(--usf-z) + 1);
  width: calc(100% - 32px);
  max-width: 560px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #fff;
  border: 1px solid var(--usf-border);
  border-left: 4px solid var(--usf-teal);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(11, 79, 88, 0.18);
  padding: 0.5rem 0.5rem 0.5rem 1rem;
  font-size: 0.875rem;
}

.usf-notice p,
.usf-toast p {
  flex: 1 1 auto;
}

.usf-toast .usf-btn {
  min-height: 36px;
  font-size: 0.8125rem;
  flex: 0 0 auto;
}

/* Gated embeds: the container keeps the original aspect ratio so the iframe
   drops in with zero layout shift. The load button is the only way in. */
.usf-embed {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  border-radius: 4px;
  background: #0B4F58;
  color: #fff;
  font-family: inherit;
}

.usf-embed,
.usf-embed * {
  box-sizing: border-box;
}

.usf-embed[data-usf-src]:not(.usf-embed--bar) {
  min-height: 180px;
}

/* Inside a WordPress embed figure the wrapper already draws the 16:9 box with
   ::before and absolutely positions the iframe; the placeholder must do the same
   or it stacks below an empty box. Mirrors block-library style.min.css. */
.wp-embed-responsive .wp-has-aspect-ratio .usf-embed[data-usf-src] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-width: none !important;
  aspect-ratio: auto !important;
}

.usf-embed__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.55);
  pointer-events: none;
}

.usf-embed__stack {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem;
  text-align: center;
}

.usf-embed .usf-embed__load,
.usf-embed .usf-embed__load:focus {
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  min-height: 44px;
  padding: 0 1.25rem;
  border-radius: 999px;
  border: 0;
  background: #fff;
  color: #016171;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: transform 150ms ease-out, background-color 150ms ease-out;
}

.usf-embed .usf-embed__load:hover {
  background: #eef6f7;
  color: #016171;
  transform: translateY(-1px);
}

.usf-embed[data-usf-provider="youtube"] .usf-embed__load::before,
.usf-embed[data-usf-provider="facebook"][data-usf-src] .usf-embed__load::before {
  content: "\25B6";
  font-size: 0.75em;
}

.usf-embed__note {
  display: block;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: #fff;
  max-width: 36rem;
}

.usf-embed .usf-embed__note a,
.usf-embed .usf-embed__note a:hover,
.usf-embed .usf-embed__note a:focus {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.usf-embed__remember {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: #fff;
  cursor: pointer;
}

.usf-embed__remember input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: #23A455;
}

/* Script-driven providers (Instagram, Facebook SDK) get a compact bar, not a video frame. */
.usf-embed--bar {
  aspect-ratio: auto !important;
  max-width: none !important;
  margin: 0 0 1rem;
  padding: 1rem;
}

.usf-embed--bar .usf-embed__stack {
  position: static;
  padding: 0;
}

.usf-embed--loaded > iframe,
.usf-embed--loaded > .usf-embed__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.usf-embed--loaded .usf-embed__poster,
.usf-embed--loaded .usf-embed__stack {
  display: none;
}

/* Cookie declaration table: zebra rows, stacks to cards under 640px. */
.usf-cookie-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0 1.5rem;
  font-size: 0.9375rem;
  line-height: 1.45;
}

.usf-cookie-table caption {
  text-align: left;
  font-weight: 600;
  padding: 0 0 0.5rem;
  color: #0B4F58;
}

.usf-cookie-table th,
.usf-cookie-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #dde8ea;
}

.usf-cookie-table thead th {
  background: #f1f6f7;
  color: #0B4F58;
  font-weight: 600;
  border-bottom: 2px solid #016171;
}

.usf-cookie-table tbody tr:nth-child(even) {
  background: #f7fafb;
}

.usf-cookie-table td:first-child {
  font-weight: 600;
  word-break: break-word;
}

/* "Used on" and the provenance note sit under the purpose as their own lines. */
.usf-cookie-table__pages,
.usf-cookie-table__note {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875em;
  color: #4f5d66;
}

.usf-cookie-table td small {
  color: #4f5d66;
}

/* Phones: bottom sheet, stacked full-width buttons, stacked table cards. */
@media (max-width: 639px) {
  .usf-banner {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    border-radius: 12px 12px 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    padding: 1.125rem 1rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
  }

  .usf-banner__actions {
    flex-direction: column;
  }

  .usf-banner__actions .usf-btn,
  .usf-modal__actions .usf-btn {
    width: 100%;
    min-height: 44px;
  }

  .usf-modal {
    padding: 0;
    align-items: flex-end;
  }

  .usf-modal__card {
    max-width: none;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    border-radius: 12px 12px 0 0;
    padding: 1rem 1rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
  }

  .usf-modal__actions {
    flex-direction: column;
  }

  .usf-notice,
  .usf-toast {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    border-radius: 10px 10px 0 0;
    border-right: 0;
    border-bottom: 0;
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
    flex-wrap: wrap;
  }

  /* The table itself must become a block too: a display:table box grows to
     its content's max-content width (measured: 521px on a 390px phone) and
     widens the layout viewport, so the whole page gets a horizontal scroll. */
  .usf-cookie-table,
  .usf-cookie-table tbody {
    display: block;
    width: 100%;
    max-width: 100%;
  }

  .usf-cookie-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .usf-cookie-table tr {
    display: block;
    border: 1px solid #dde8ea;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    padding: 0.25rem 0;
  }

  .usf-cookie-table td {
    display: flex;
    gap: 0.75rem;
    border-bottom: 0;
    padding: 0.375rem 0.75rem;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .usf-cookie-table td > * {
    min-width: 0;
  }

  .usf-cookie-table td::before {
    content: attr(data-label);
    flex: 0 0 5.5rem;
    font-weight: 600;
    color: #0B4F58;
  }

  .usf-cookie-table td:first-child {
    font-weight: 600;
  }
}

/* Scroll lock while the modal is open. consent.js sets the padding to the
   scrollbar width so the page does not jump sideways. */
html.usf-lock,
html.usf-lock body {
  overflow: hidden !important;
}

@media (prefers-reduced-motion: reduce) {
  #usf-consent *,
  .usf-embed * {
    transition: none !important;
    animation: none !important;
  }

  .usf-banner.usf-enter {
    transform: none;
    opacity: 1;
  }
}

@media print {
  #usf-consent,
  .usf-embed__load,
  .usf-embed__note,
  .usf-embed__remember {
    display: none !important;
  }
}
