/* Organic Oasis: sticky header + product buy bar (v6) */

/* 992px and wider: header hides on scroll down, comes back on scroll up.
   Under 992px it is left alone: Shoptet already does this for the mobile and tablet header. */
@media (min-width: 992px) {
  body:not(.ordering-process) #header {
    position: sticky;
    top: 0;
    z-index: 900;
    transition: transform .25s ease, height .3s ease-out;
  }
  body.oo-hdr-hide:not(.ordering-process) #header {
    transform: translateY(-100%);
  }
}

/* Product buy bar: black like the header, so it reads as part of the UI and not as page text */
.oo-buybar {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 901;
  background: #000;
  color: #fff;
  font-family: inherit;
  visibility: hidden;
  transition: transform .25s ease, visibility 0s linear .25s;
}
.oo-buybar__inner {
  display: flex;
  align-items: center;
  gap: 16px;
}
.oo-buybar__inner::before,
.oo-buybar__inner::after { display: none !important; }
.oo-buybar__thumb {
  width: 44px;
  height: 44px;
  padding: 2px;
  background: #fff;
  object-fit: contain;
  flex: 0 0 auto;
}
.oo-buybar__name {
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  max-width: 320px;
}
.oo-buybar__tabs {
  display: flex;
  gap: 20px;
  margin-left: 12px;
}
.oo-buybar__tabs a {
  color: #bdbdbd;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}
.oo-buybar__tabs a:hover { color: #fff; text-decoration: underline; }
.oo-buybar__price {
  margin-left: auto;
  display: flex;
  align-items: baseline;
  gap: 10px;
  white-space: nowrap;
}
.oo-buybar__was { font-size: 14px; color: #9e9e9e; }
.oo-buybar__was s { margin-right: 6px; }
.oo-buybar__now { font-size: 22px; font-weight: 500; color: #fff; }
.oo-buybar__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 26px;
  border: 1px solid #fff;
  border-radius: 0;
  background: #fff;
  color: #000;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  flex: 0 0 auto;
}
.oo-buybar__btn:hover { background: #e6e6e6; border-color: #e6e6e6; }
/* Label comes from CSS so GTM click triggers that match on text don't count this button twice */
.oo-buybar__btn::after { content: attr(data-label); }

/* Shown once the real Do košíka button is scrolled past, until you scroll back up to it */
body.oo-past-buy .oo-buybar {
  visibility: visible;
  transform: none;
  transition: transform .25s ease, visibility 0s linear 0s;
}

/* Desktop: the bar sits at the top and takes the header's place. While it is showing,
   the main header stays hidden even when scrolling up; once you are back at the buy box
   the bar slides away behind the header and the header works as normal again. */
@media (min-width: 992px) {
  .oo-buybar {
    top: 0;
    height: 64px;
    z-index: 899;
    border-bottom: 1px solid #262626;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .25);
    transform: translateY(-100%);
  }
  .oo-buybar__inner { height: 100%; }
  body.oo-past-buy:not(.ordering-process) #header {
    transform: translateY(-100%);
  }
}
@media (max-width: 1199px) {
  .oo-buybar__tabs { display: none; }
}

/* Phones and tablets: the bar sits at the bottom of the screen */
@media (max-width: 991px) {
  .oo-buybar {
    bottom: 0;
    border-top: 1px solid #262626;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, .2);
    padding-bottom: env(safe-area-inset-bottom);
    transform: translateY(100%);
  }
  .oo-buybar__inner {
    padding: 10px 16px;
    gap: 14px;
  }
  .oo-buybar__thumb,
  .oo-buybar__name { display: none; }
  .oo-buybar__price {
    margin-left: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }
  .oo-buybar__was { font-size: 12px; }
  .oo-buybar__now { font-size: 18px; line-height: 1.2; }
  .oo-buybar__btn { flex: 1 1 auto; height: 48px; }
  /* Room at the bottom of the page so the bar never covers the footer */
  body.oo-has-bar { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  /* Lift the Smartsupp bubble above the bar while the bar is showing */
  #smartsupp-widget-container [data-testid="widgetButtonFrame"] { transition: bottom .25s ease; }
  body.oo-past-buy #smartsupp-widget-container [data-testid="widgetButtonFrame"] {
    bottom: calc(86px + env(safe-area-inset-bottom)) !important;
  }
}

/* Shoptet notifications: small toast in the corner, right under whatever is pinned at the top
   (header, desktop buy bar, or the admin bar when you are logged in). The script measures
   that and sets --oo-msg-top, so it never covers the header or the cart button. */
:root { --oo-msg-top: 88px; }
@media (max-width: 991px) { :root { --oo-msg-top: 68px; } }
@media (max-width: 479px) { :root { --oo-msg-top: 48px; } }
.messages {
  top: var(--oo-msg-top) !important;
  left: auto !important;
  right: 16px !important;
  width: 380px;
  max-width: calc(100% - 32px);
}
.messages .msg {
  padding: 14px 18px;
  margin-bottom: 8px;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .15);
}
.messages .msg .container {
  width: auto;
  max-width: none;
  margin: 0;
  padding: 0;
}
@media (max-width: 991px) {
  .messages {
    left: 8px !important;
    right: 8px !important;
    width: auto;
    max-width: none;
  }
}
