/* ================= BODY ================= */

body {
  overflow-x: hidden;
  padding-top: 64px;
  padding-bottom: 64px;
}

/* ================= HEADER ================= */

.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 120;

  background: var(--ivory);
  border-bottom: 1px solid var(--border-soft);
}

/* CONTAINER */
.header__container {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--space-3) var(--space-4);
}

@media (min-width: 768px) {
  .header__container {
    padding: var(--space-3) var(--space-6);
  }
}

/* MOBILE */
.header__mobile {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

@media (min-width: 768px) {
  .header__mobile {
    display: none;
  }
}

/* LEFT / RIGHT / CENTER */
.header__left,
.header__center,
.header__right {
  width: 33.333%;
}

.header__left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.header__center {
  text-align: center;
  text-decoration: none;
  color: inherit;
}

.header__right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--space-4);
}

/* ICON */
.icon-sm {
  width: 20px;
  height: 20px;
}

/* ICON STATES */
.icon-dark {
  color: var(--text-primary);
}

.icon-sm.is-active {
  color: var(--matcha);
}

/* AVATAR */
.header__avatar {
  width: 24px;
  height: 24px;

  border-radius: 50%;
  background: var(--matcha);
  color: var(--ivory);

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 12px;
  font-weight: 600;
}

.header__avatar--lg {
  width: 32px;
  height: 32px;
  font-size: 14px;
}

/* CART */
.cart-btn {
  position: relative;
}

.cart-count {
  position: absolute;
  top: -6px;
  right: -6px;

  width: 18px;
  height: 18px;

  border-radius: 50%;
  background: var(--sakura);
  border: 1px solid var(--bronze);

  font-size: 11px;
  font-weight: 600;

  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-count.is-hidden {
  display: none;
}


/* ================= DESKTOP ================= */

.header__desktop {
  display: none;
}

@media (min-width: 768px) {
  .header__desktop {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
}

/* LOGO */
.header__logo-img {
  height: 48px;
}

/* NAV */
.header__nav {
  display: flex;
  gap: var(--space-7);

  font-size: 14px;
  font-weight: 500;
}

.header__nav > a {
  text-decoration: none;
  color: var(--text-primary);
}

.header__nav > a.is-active {
  border-bottom: 2px solid var(--matcha);
}

/* ACTIONS */
.header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.header__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  position: relative;
  overflow: hidden;

  padding: 6px 14px; /* 🔽 менше */
  border-radius: 999px;

  background: var(--matcha);
  color: var(--ivory);

  font-size: 12px; /* 🔽 як було */
  font-weight: 600;
  letter-spacing: 0.05em;
  text-decoration: none;

  box-shadow:
    0 6px 14px rgba(79,122,94,0.22), /* трохи легше */
    inset 0 1px 0 rgba(255,255,255,0.2);

  transition: all 0.3s ease;
}

/* HOVER */
.header__btn:hover {
  background: #3f634c;
  color: var(--ivory);

  transform: translateY(-1px); /* 🔽 менший рух */
  box-shadow:
    0 8px 18px rgba(79,122,94,0.3),
    inset 0 1px 0 rgba(255,255,255,0.25);
}

/* PROTECTION */
.header__btn:visited,
.header__btn:active {
  color: var(--ivory);
}

/* SHINE */
.header__btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent,
    rgba(255,255,255,0.5),
    transparent
  );
  transform: skewX(-20deg);
  transition: all 0.8s ease;
}

.header__btn:hover::after {
  left: 130%;
}

/* ================= OVERLAY ================= */

.mobile-menu__overlay {
  position: fixed;
  inset: 0;
  z-index: 199;

  background: rgba(0,0,0,0.4);

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-menu__overlay.is-active {
  opacity: 1;
  pointer-events: auto;
}

/* MENU */
.mobile-menu {
  position: fixed;
  inset: 0 auto 0 0;

  width: 75%;
  max-width: 320px;

  height: 100%;

  background: var(--ivory);
  z-index: 200;

  display: flex;
  flex-direction: column;

  box-shadow: var(--shadow-soft);

  transform: translateX(-100%); /* 👉 щоб був hidden state */
  transition: transform 0.3s ease;
}

/* ACTIVE */
.mobile-menu.is-active {
  transform: translateX(0);
}

/* HEADER */
.mobile-menu__header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: var(--space-4) var(--space-6);

  border-bottom: 1px solid var(--border-soft);
}

/* TITLE */
.mobile-menu__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

/* NAV */
.mobile-menu__nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);

  padding: var(--space-6);

  font-size: 14px;
  font-weight: 500;

  position: relative;
  z-index: 130;
}

/* LINK */
.mobile-menu__link {
  text-decoration: none;
  color: var(--text-primary);
  transition: color 0.2s ease;
}

.mobile-menu__link:hover {
  color: var(--matcha);
}

/* ACTIVE */
.mobile-menu__link.is-active {
  color: var(--matcha);
  font-weight: 600;
}

/* INLINE LINK */
.mobile-menu__link--inline {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

/* GROUP */
.mobile-menu__group {
  position: relative;
}

/* ARROW */
.mobile-menu__arrow {
  width: 14px;
  height: 14px;

  opacity: 0.7;
  transition: transform 0.3s ease;
}

/* DROPDOWN */
.mobile-menu__dropdown {
  position: absolute;
  top: 100%;
  left: 0;

  padding-top: var(--space-3);

  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;

  transition: all 0.3s ease;
}

/* SHOW */
.mobile-menu__group:hover .mobile-menu__dropdown,
.mobile-menu__group:focus-within .mobile-menu__dropdown {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ROTATE */
.mobile-menu__group:hover .mobile-menu__arrow {
  transform: rotate(180deg);
}

/* BOX */
.mobile-menu__dropdown-box {
  min-width: 280px;

  border-radius: 16px;
  background: #fff;

  border: 1px solid rgba(0,0,0,0.05);
  box-shadow: var(--shadow-luxury);

  overflow: hidden;
}

/* HEADER */
.mobile-menu__dropdown-header {
  padding: var(--space-4) var(--space-5);
  background: var(--ivory);
}

/* LABEL */
.mobile-menu__dropdown-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.7;
  color: var(--text-secondary);
}

/* TITLE */
.mobile-menu__dropdown-title {
  font-size: 14px;
  font-weight: 600;
  margin-top: var(--space-1);
  color: var(--text-primary);
}

/* LIST */
.mobile-menu__dropdown-list {
  padding: var(--space-2) 0;
}

/* ITEM */
.mobile-menu__dropdown-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);

  padding: var(--space-3) var(--space-5);

  text-decoration: none;
  color: var(--text-primary);

  transition: background 0.2s ease;
}

.mobile-menu__dropdown-item:hover {
  background: rgba(0,0,0,0.05);
}

/* DOT */
.mobile-menu__dot {
  width: 6px;
  height: 6px;
  margin-top: 6px;

  border-radius: 50%;
  background: var(--matcha);
  opacity: 0.8;
}

/* FOOTER */
.mobile-menu__dropdown-footer {
  padding: var(--space-4) var(--space-5);

  background: var(--ivory);
  border-top: 1px solid var(--border-soft);
}

/* LINK */
.mobile-menu__dropdown-link {
  font-size: 14px;
  font-weight: 600;

  color: var(--matcha);
  text-decoration: none;
}

/* ================= SEARCH BOX ================= */

.search-box {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);

  width: 90%;
  max-width: 420px;

  z-index: 999;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.search-box.is-active {
  opacity: 1;
  pointer-events: auto;
}

/* ================= CART OVERLAY ================= */

.cart-overlay {
  position: fixed;
  inset: 0;

  background: rgba(0,0,0,0.4);
  z-index: 998;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.cart-overlay.is-active {
  opacity: 1;
  pointer-events: auto;
}

/* ================= SIDEBAR ================= */

.cart-sidebar {
  position: fixed;
  top: 0;
  right: 0;

  height: 100%;
  width: 80%;
  max-width: 420px;

  background: #fff;
  z-index: 999;

  display: flex;
  flex-direction: column;

  box-shadow:
    -4px 0 12px rgba(0,0,0,0.05),
    -12px 0 32px rgba(0,0,0,0.06);

  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.cart-sidebar.is-active {
  transform: translateX(0);
}

/* HEADER */
.cart-sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-soft);

  gap: var(--space-3);
}

/* TITLE */
.cart-sidebar__title {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.05em;

  margin: 0;
  line-height: 1;

  color: var(--text-primary);
}

/* CLOSE */
.cart-sidebar__close {
  width: 36px;
  height: 36px;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 20px;
  line-height: 1;

  background: none;
  border: none;

  cursor: pointer;
  opacity: 0.6;
  flex-shrink: 0;

  transition: all 0.2s ease;
}

.cart-sidebar__close:hover {
  opacity: 1;
  transform: rotate(90deg);
}

/* CONTENT */
.cart-sidebar__content {
  flex: 1;
  overflow-y: auto;

  padding: var(--space-4) var(--space-6);

  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* EMPTY */
.cart-sidebar__empty {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;

  margin-top: var(--space-8);
}

/* ITEM */
.cart-item {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
}

/* IMAGE */
.cart-item__img {
  width: 56px;
  height: 56px;

  object-fit: cover;
  border-radius: 8px;
}

/* BODY */
.cart-item__body {
  flex: 1;
}

/* NAME */
.cart-item__name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

/* META */
.cart-item__milk,
.cart-item__price {
  font-size: 12px;
  color: var(--text-muted);
}

/* QTY */
.cart-item__qty {
  display: flex;
  align-items: center;
  gap: var(--space-2);

  margin-top: var(--space-1);
}

/* ================= QTY BUTTON ================= */

.sidebar-qty-btn {
  border: 1px solid var(--border-soft);
  padding: 2px var(--space-2);
  border-radius: 6px;

  cursor: pointer;
  transition: background 0.2s ease;
}

.sidebar-qty-btn:hover {
  background: rgba(0,0,0,0.05);
}

/* ================= REMOVE ================= */

.sidebar-remove-btn {
  color: var(--text-secondary); /* 🔥 замість muted */
  cursor: pointer;
  transition: color 0.2s ease;
}

.sidebar-remove-btn:hover {
  color: #dc2626;
}

/* ================= FOOTER ================= */

.cart-sidebar__footer {
  padding: var(--space-5);
  border-top: 1px solid var(--border-soft);

  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* SUBTOTAL */
.cart-sidebar__subtotal {
  display: flex;
  justify-content: space-between;
  font-weight: 500;
  color: var(--text-primary);
}

/* LINK */
.cart-sidebar__link {
  display: block;

  border: 1px solid var(--border-soft);
  padding: var(--space-3);

  border-radius: 8px;
  text-align: center;

  text-decoration: none;
  color: var(--text-primary);

  transition: background 0.2s ease;
}

.cart-sidebar__link:hover {
  background: rgba(0,0,0,0.05);
}

/* CHECKOUT */
.cart-sidebar__checkout {
  display: block;

  background: var(--matcha);
  color: #ffffff;

  padding: 12px 16px; /* 🔥 трохи більше */

  border-radius: 8px;
  text-align: center;
  font-weight: 600;
  font-size: 14px; /* 🔥 важливо */

  text-decoration: none;
  transition: all 0.2s ease;
}

/* HOVER */
.cart-sidebar__checkout:hover {
  background: #3f634c;
}

/* 🔥 FOCUS (дуже важливо для accessibility) */
.cart-sidebar__checkout:focus {
  outline: 2px solid #1f3a2b;
  outline-offset: 2px;
}

/* ================= ICON BUTTON ================= */

.icon-btn {
  width: 36px;
  height: 36px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;
  border: none;
  background: none;

  cursor: pointer;

  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: var(--ivory);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.icon-btn:focus {
  outline: none;
}

.icon-btn:focus-visible {
  box-shadow: 0 0 0 2px var(--matcha);
}

/* Born2Matcha wordmark: use the brand symbol at its native proportions */
.header__brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text-primary);
  text-decoration: none;
  white-space: nowrap;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 27px;
  font-weight: 500;
  letter-spacing: .02em;
  line-height: 1;
}
.header__brand-mark {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: contain;
}
.header__brand-accent { color: var(--matcha); }
.header__brand--mobile { display: inline-flex; }
@media (min-width: 768px) {
  .header__brand--mobile { display: none; }
  .header__brand-mark { width: 42px; height: 42px; }
}
@media (max-width: 767px) {
  .header__mobile { justify-content: flex-start; gap: 12px; }
  .header__left { width: auto; flex: 0 0 auto; }
  .header__right { margin-left: auto; width: auto; }
}

.header__brand-full { display:block; width: 218px; height:auto; max-height:48px; object-fit:contain; }
@media (max-width: 767px) {
  .header__brand-full { width: 176px; max-height:40px; }
}

.partner-login-link { color: var(--text-primary); text-decoration: none; font-size: 13px; white-space: nowrap; }
.partner-login-link:hover { color: var(--matcha); }
@media (max-width: 767px) { .partner-login-link { display: none; } }
