:root {
  --coffee-storefront-header-height: 68px;
  --coffee-storefront-gap: 0px;
}

.coffee-storefront-header {
  display: flex;
  background: #ffffff;
  color: #0b1120;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  min-height: var(--coffee-storefront-header-height);
}

.coffee-storefront-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  padding: 10px 18px;
  max-width: 1200px;
  margin: 0 auto;
  box-sizing: border-box;
  position: relative; /* for mobile dropdown positioning */
}

.coffee-storefront-brand {
  display: flex;
  align-items: center;
  min-width: 0;
}

.coffee-storefront-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-width: 0;
}

.coffee-storefront-logo {
  height: 36px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
}

.coffee-storefront-logo-text {
  color: #0b1120;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* NAV (desktop defaults) */
.coffee-storefront-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 6px 0;
  margin: 0;
  flex-wrap: nowrap; /* prevent wrapping */
}

.coffee-storefront-menu {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0;
  margin: 0;
  list-style: none;
  flex-wrap: nowrap; /* prevent wrapping */
}

.coffee-storefront-link,
.coffee-storefront-menu a {
  color: #0b1120;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.coffee-storefront-link:hover,
.coffee-storefront-link:focus-visible,
.coffee-storefront-menu a:hover,
.coffee-storefront-menu a:focus-visible {
  background-color: rgba(0, 0, 0, 0.06);
  color: #000000;
  outline: none;
}

.coffee-storefront-link:focus-visible,
.coffee-storefront-menu a:focus-visible {
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.25);
}

/* Hamburger button (hidden on desktop) */
.coffee-storefront-toggle {
  display: none;
  appearance: none;
  border: 0;
  background: transparent;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  line-height: 0;
}

.coffee-storefront-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.25);
}

.coffee-storefront-toggle-icon {
  width: 22px;
  height: 16px;
  position: relative;
  display: inline-block;
}

.coffee-storefront-toggle-icon span {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #0b1120;
  border-radius: 2px;
  transition: transform 0.2s ease, top 0.2s ease, opacity 0.2s ease;
}

.coffee-storefront-toggle-icon span:nth-child(1) { top: 0; }
.coffee-storefront-toggle-icon span:nth-child(2) { top: 7px; }
.coffee-storefront-toggle-icon span:nth-child(3) { top: 14px; }

/* Editor wrapper + iframe positioning */
.coffee-editor-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-top: 0;
  margin-top: 0 !important;
  translate: 0 calc(-1 * var(--coffee-storefront-gap, 0px));
}

.coffee-editor-iframe {
  position: relative;
  top: var(--coffee-storefront-header-height);
  margin-top: 0;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-sizing: border-box;
}

/* MOBILE: collapse menu into hamburger + dropdown panel */
@media (max-width: 900px) {
  .coffee-storefront-inner {
    gap: 12px;
  }

  .coffee-storefront-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
  }

  /* Hide inline nav; show as dropdown when open */
  .coffee-storefront-nav {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 10px;
    right: 10px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 10px 10px 12px;
    max-height: calc(100vh - var(--coffee-storefront-header-height) - 24px);
    overflow: auto;
    z-index: 250;
  }

  .coffee-storefront-menu {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .coffee-storefront-link,
  .coffee-storefront-menu a {
    display: block;
    width: 100%;
    padding: 12px 12px;
    border-radius: 10px;
  }

  /* Open state */
  .coffee-storefront-header.is-menu-open .coffee-storefront-nav {
    display: block;
  }

  /* Animate hamburger into an X */
  .coffee-storefront-header.is-menu-open .coffee-storefront-toggle-icon span:nth-child(1) {
    top: 7px;
    transform: rotate(45deg);
  }
  .coffee-storefront-header.is-menu-open .coffee-storefront-toggle-icon span:nth-child(2) {
    opacity: 0;
  }
  .coffee-storefront-header.is-menu-open .coffee-storefront-toggle-icon span:nth-child(3) {
    top: 7px;
    transform: rotate(-45deg);
  }
}
