/* Full-width shop header: logo left + menu-ecommerce right */

.amb-template-header {
  width: 100%;
  background: #fff;
  color: var(--amb-navy, #032046);
  font-family: var(--amb-font-body, inherit);
  box-sizing: border-box;
}

.amb-template-header *,
.amb-template-header *::before,
.amb-template-header *::after {
  box-sizing: border-box;
}

.amb-template-header__inner {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.65rem 1.1rem;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 1.25rem;
  row-gap: 0.5rem;
}

.amb-template-header__brand {
  min-width: 0;
  justify-self: start;
}

.amb-template-header__logo {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  text-decoration: none !important;
  color: inherit !important;
}

.amb-template-header__logo-img {
  display: block;
  width: auto;
  max-width: min(320px, 58vw);
  height: auto;
  max-height: 78px;
  object-fit: contain;
  object-position: left center;
}

.amb-template-header__logo-text {
  font-family: var(--amb-font-display, inherit);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--amb-blue, #335da4);
  line-height: 1.2;
}

.amb-template-header__menu {
  min-width: 0;
  justify-self: end;
  width: auto;
  max-width: 100%;
}

/* Keep menu compact on the right in this header context */
.amb-template-header .amb-ecom-menu {
  width: auto;
  max-width: 100%;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 0.85rem 1.1rem;
}

.amb-template-header .amb-ecom-menu__left {
  order: 1;
  display: flex;
  align-items: center;
  gap: 0.15rem 0.85rem;
  flex-wrap: nowrap;
}

.amb-template-header .amb-ecom-menu__cart {
  order: 2;
  margin-left: 0 !important;
}

.amb-template-header .amb-ecom-menu__toggle {
  display: inline-flex !important;
  align-items: center !important;
  line-height: 1 !important;
}

.amb-template-header .amb-ecom-menu__chevron {
  display: block;
  flex: 0 0 auto;
  position: relative;
  top: 0.05em;
}

.amb-template-header .amb-ecom-menu__mega {
  left: auto;
  right: 0;
}

@media (max-width: 767px) {
  .amb-template-header__inner {
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 0.55rem 0.85rem;
    column-gap: 0.75rem;
  }

  .amb-template-header__logo-img {
    max-width: min(220px, 52vw);
    max-height: 58px;
  }

  /* One row: logo left, stacked actions right */
  .amb-template-header .amb-ecom-menu {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 0.28rem;
    width: auto;
  }

  /* Cart above Collezioni on mobile */
  .amb-template-header .amb-ecom-menu__cart {
    order: 1;
    margin-left: 0 !important;
    flex: 0 0 auto;
    gap: 0.28rem !important;
    padding: 0.32rem 0.65rem 0.32rem 0.5rem !important;
    font-size: 0.78rem !important;
    border-radius: var(--amb-btn-radius, 6px) !important;
    box-shadow: -3px 3px 0 0 var(--amb-btn-shadow, #e8d9c4) !important;
  }

  .amb-template-header .amb-ecom-menu__collections {
    order: 2;
    margin-left: 0 !important;
    flex: 0 0 auto;
  }

  .amb-template-header .amb-ecom-menu__cart-icon {
    width: 1.35rem;
    height: 1.2rem;
  }

  .amb-template-header .amb-ecom-menu__cart-svg {
    width: 1.2rem;
    height: 1.05rem;
  }

  .amb-template-header .amb-ecom-menu__cart-count {
    min-width: 0.95rem !important;
    height: 0.95rem !important;
    font-size: 0.58rem !important;
    right: -0.28rem !important;
    top: -0.32rem !important;
    border-width: 1.5px !important;
  }

  .amb-template-header .amb-ecom-menu__toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.3rem !important;
    padding-top: 0.1rem !important;
    padding-bottom: 0.1rem !important;
    font-size: 0.9rem !important;
    line-height: 1 !important;
  }

  .amb-template-header .amb-ecom-menu__chevron {
    display: block;
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    position: relative;
    top: 0.05em;
  }

  .amb-template-header .amb-ecom-menu__mega {
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 0;
    left: auto;
    width: min(320px, 88vw);
    min-width: 0;
    z-index: 60;
  }
}
