/*
 * Top announcement bar (functions/top-bar.php, js/top-bar.js).
 *
 * The bar scrolls away above the fixed header. --arcaffe-top-bar-h (its full
 * height) and --arcaffe-top-bar-offset (the part still on screen) are set on
 * <html> by script; both default to 0, so without a bar every rule below
 * resolves to the theme's original values.
 *
 * The overrides repeat the selectors they replace with an `html` prefix, plus
 * !important where the original has it, so this file wins without editing the
 * legacy stylesheets.
 */

.arcaffe-top-bar {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  /* Below the header (9999 on mobile): with script the two never overlap, and
     without it the header must stay usable rather than be painted over. */
  z-index: 9998;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 52px;
  background: #000000;
  /* On desktop the header's own black link strip follows directly; the rule
     keeps the two from reading as one block. */
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-family: "Almoni", sans-serif;
  direction: rtl;
}

body.logged-in.admin-bar .arcaffe-top-bar {
  top: 32px;
}

.arcaffe-top-bar-text {
  margin: 0;
  max-width: 1230px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0;
  text-align: center;
  color: #ffffff;
  overflow-wrap: anywhere;
}

.arcaffe-top-bar-close {
  position: absolute;
  top: 50%;
  inset-inline-end: 6px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
}

.arcaffe-top-bar-close:hover {
  opacity: 0.75;
}

.arcaffe-top-bar-close:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: -4px;
}

html.arcaffe-top-bar-dismissed .arcaffe-top-bar {
  display: none;
}

/* ── offsets for the header and the elements positioned against it ── */

html body,
html body.logged-in.admin-bar {
  padding-top: calc(120px + var(--arcaffe-top-bar-h, 0px));
}

html #header {
  top: var(--arcaffe-top-bar-offset, 0px);
}

html body.logged-in.admin-bar #header {
  top: calc(32px + var(--arcaffe-top-bar-offset, 0px)) !important;
}

html #customMinicartContainer {
  top: calc(119px + var(--arcaffe-top-bar-offset, 0px));
}

html body.logged-in.admin-bar #customMinicartContainer {
  top: calc(151px + var(--arcaffe-top-bar-offset, 0px)) !important;
}

/* The mini-cart's own height caps assume the 120px header too; without these
   its totals and checkout buttons run below the viewport while the bar shows. */
html #customMinicartContainer .popup-minicart-wrapper {
  max-height: calc(100dvh - 120px - var(--arcaffe-top-bar-offset, 0px));
}

html .burger-menu,
html .burger-overlay {
  top: calc(61px + var(--arcaffe-top-bar-offset, 0px));
}

html .burger-overlay {
  height: calc(100vh - 61px - var(--arcaffe-top-bar-offset, 0px));
}

@media (max-width: 768px) {
  .arcaffe-top-bar {
    padding: 8px 48px;
  }

  .arcaffe-top-bar-text {
    font-size: 14px;
  }

  html body {
    padding-top: calc(120px + var(--arcaffe-top-bar-h, 0px)) !important;
  }

  html .minicart-content {
    height: calc(100dvh - 61px - 132px - var(--arcaffe-top-bar-offset, 0px));
  }

  html #NoProductContainer {
    top: calc(169px + var(--arcaffe-top-bar-offset, 0px));
  }
}
