:root {
  --store-header-green: #98bb3f;
  --store-header-green-dark: #86a734;
  --store-header-line: #d7d7d7;
  --store-header-text: #111;
  --store-header-bg: #fefefe;
}

body {
  background: var(--store-header-bg);
}

.hdr,
.hdr * {
  box-sizing: border-box;
  font-family: "Vazirmatn", Arial, sans-serif;
  margin-bottom: 3px;
}

.hdr {
  background: var(--store-header-bg);
  width: 100%;
  border-bottom: 1px solid #efefef;
}

.hdr__row {
  max-width: 1320px;
  min-height: 88px;
  margin: 0 auto;
  padding: 16px 24px;
  display: grid;
  grid-template-columns: auto minmax(520px, 1fr) auto;
  align-items: center;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  white-space: nowrap;
  justify-self: start;
}

.brand__logoLink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.brand__logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  display: block;
}

.brand__text {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}

.brand__w1 {
  color: var(--store-header-text);
}

.brand__w2 {
  color: var(--store-header-green);
}

.search {
  min-width: 0;
  width: 100%;
  max-width: 820px;
  justify-self: stretch;
  position: relative;
  top: -15px;
}

.search__wrap {
  position: relative;
  width: 100%;
}

.search__input {
  width: 100%;
  height: 56px;
  padding: 0 64px 0 18px;
  border: 1.5px solid #cfcfcf;
  border-radius: 18px;
  background: #fff;
  color: #676767;
  font-size: 15px;
  font-weight: 500;
  outline: none;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.search__input::placeholder {
  color: #bdbdbd;
}

.search__input:focus {
  border-color: var(--store-header-green);
  box-shadow: 0 0 0 4px rgba(152, 187, 63, 0.14);
}

.search__btn {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: #f1f1ea;
  color: #555;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.search__btn:hover {
  background: #eaf1da;
  color: #222;
}

.hdr__actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  justify-self: end;
}

.cart {
  position: relative;
}

.cartIconBtn {
  width: 52px;
  height: 52px;
  border: 1px solid #161616;
  border-radius: 16px;
  background: #161616;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  padding: 0;
  transition:
    background-color 0.18s ease,
    transform 0.18s ease;
}

.cartIconBtn svg {
  transition: transform 0.18s ease;
}

.cartIconBtn:hover {
  background: #222;
}

.cartIconBtn:hover svg {
  transform: scale(1.28);
}

.cartIconBtn__badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--store-header-green);
  color: #fff;
  border: 2px solid #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.cartIconBtn__badge.is-hidden {
  display: none;
}

.cartChip {
  min-height: 54px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #111;
  border-radius: 16px;
  background: #111;
  color: #fff;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
}

.cartChip:hover {
  background: #1d1d1d;
}

.cartChip__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cartChip__label {
  font-size: 14px;
  font-weight: 700;
}

.cartChip__count {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--store-header-green);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.cartChip__count.is-hidden {
  display: none;
}

.profile {
  position: relative;
}

.profile__btn {
  min-height: 52px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #e1e1e1;
  border-radius: 16px;
  background: #fff;
  color: #222;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.profile__btn:hover {
  background: #f5f7f2;
  border-color: #ccc;
}

.profile__icon {
  width: 18px;
  height: 18px;
  color: #555;
  flex: 0 0 18px;
}

.profile__dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 220px;
  padding: 6px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: 0.18s ease;
  z-index: 30;
}

.profile.open .profile__dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.profile__header--link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
}

.profile__header--link:hover,
.profile__menu a:hover {
  background: #f5f5f5;
}

.profile__header strong {
  display: block;
  font-size: 14px;
}

.profile__header span {
  display: block;
  font-size: 12px;
  color: #777;
}

.profile__menu a,
.profile__logout {
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  color: #333;
  font-size: 13px;
  text-decoration: none;
}

.profile__logout {
  margin-top: 4px;
  color: #d32f2f;
}

.profile__logout:hover {
  background: rgba(211, 47, 47, 0.08);
}

.profile__chev {
  width: 16px;
  height: 16px;
  opacity: 0.5;
}

.cart__btn {
  border: 0;
}

.cart__dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 380px;
  padding: 14px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: 0.18s ease;
  z-index: 30;
}

.cart.open .cart__dropdown,
.cart__dropdown.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.cart__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 6px 14px;
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 14px;
}

.cart__header strong {
  font-size: 15px;
  font-weight: 700;
  color: #222;
}

.cart__header span {
  color: #666;
  font-size: 12px;
  font-weight: 500;
}

.cart__items {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 320px;
  overflow-y: auto;
  padding: 0 2px;
}

.cart__item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px;
  border-radius: 10px;
  background: #fafafa;
  border: 1px solid #f0f0f0;
  transition: all 0.2s ease;
}

.cart__item:hover {
  background: #f5f5f5;
  border-color: #e8e8e8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.cart__itemDelete {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  cursor: pointer;
  color: #999;
  transition: all 0.2s ease;
  flex-shrink: 0;
  padding: 0;
}

.cart__itemDelete:hover {
  background: #fee;
  border-color: #fcc;
  color: #e74c3c;
  transform: scale(1.08);
}

.cart__itemDelete svg {
  width: 18px;
  height: 18px;
}

.cart__itemLink {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.cart__itemThumb {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid #e8e8e8;
  background: #fff;
  flex-shrink: 0;
}

.cart__itemInfo {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cart__itemTitle {
  display: block;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  color: #222;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.cart__itemMeta {
  display: block;
  color: #888;
  font-size: 11px;
  line-height: 1.4;
}

.cart__itemPrice {
  display: block;
  margin-top: 38px;
  font-size: 13px;
  font-weight: 700;
  color: var(--store-header-green);
  white-space: nowrap;
}

.cart__more {
  padding: 8px 12px;
  margin-top: 4px;
  color: #666;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  background: #f8f8f8;
  border-radius: 8px;
}

.cart__empty {
  padding: 24px 16px;
  color: #999;
  font-size: 13px;
  text-align: center;
  line-height: 1.6;
}

.cart__empty.is-hidden {
  display: none;
}

.cart__footerLink {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 14px;
  padding: 12px;
  border-radius: 10px;
  background: var(--store-header-green);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
}

.cart__footerLink:hover {
  background: var(--store-header-green-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(152, 187, 63, 0.3);
}

body.has-authsheet-open {
  overflow: hidden;
}

.authsheet {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 5000;
}

.authsheet.is-open {
  display: flex;
}

.authsheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.authsheet__dialog {
  position: relative;
  width: min(460px, 100%);
  max-height: min(88vh, 760px);
  overflow-y: auto;
  padding: 24px;
  border: 1px solid rgba(152, 187, 63, 0.18);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(152, 187, 63, 0.12), transparent 42%),
    #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.2);
  direction: rtl;
}

.authsheet__close {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  background: #f3f5ee;
  color: #3b3b3b;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition:
    background-color 0.18s ease,
    transform 0.18s ease;
}

.authsheet__close:hover {
  background: #e9efda;
  transform: scale(1.04);
}

.authsheet__tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 18px;
  padding-left: 52px;
}

.authsheet__tab {
  min-height: 46px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #f9faf7;
  color: #4b5563;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.authsheet__tab:hover {
  border-color: #cad5a2;
  color: #202020;
}

.authsheet__tab.is-active {
  border-color: var(--store-header-green);
  background: var(--store-header-green);
  color: #fff;
  box-shadow: 0 12px 26px rgba(152, 187, 63, 0.24);
}

.authsheet__title {
  margin: 0 0 8px;
  color: #111827;
  font-size: 25px;
  font-weight: 800;
  line-height: 1.3;
}

.authsheet__subtitle {
  margin: 0 0 18px;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.8;
}

.authsheet__message {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.7;
}

.authsheet__message.is-hidden,
.authsheet__form.is-hidden {
  display: none;
}

.authsheet__message.is-success {
  border-color: rgba(34, 197, 94, 0.25);
  background: #effcf3;
  color: #15803d;
}

.authsheet__message.is-error {
  border-color: rgba(220, 38, 38, 0.18);
  background: #fef2f2;
  color: #b91c1c;
}

.authsheet__form {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.authsheet__label {
  color: #374151;
  font-size: 13px;
  font-weight: 600;
}

.authsheet__input {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid #d1d5db;
  border-radius: 14px;
  background: #fff;
  color: #111827;
  font-size: 14px;
  outline: none;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease;
}

.authsheet__input::placeholder {
  color: #9ca3af;
}

.authsheet__input:focus {
  border-color: var(--store-header-green);
  box-shadow: 0 0 0 4px rgba(152, 187, 63, 0.16);
}

.authsheet__submit {
  min-height: 50px;
  margin-top: 8px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(
    135deg,
    var(--store-header-green),
    var(--store-header-green-dark)
  );
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    opacity 0.18s ease;
}

.authsheet__submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(152, 187, 63, 0.26);
}

.authsheet__submit:disabled {
  opacity: 0.7;
  cursor: wait;
}

@media (max-width: 980px) {
  .hdr__row {
    grid-template-columns: 1fr auto auto;
    grid-template-areas:
      "brand cart profile"
      "search search search";
    gap: 12px;
  }

  .brand {
    grid-area: brand;
  }

  .search {
    grid-area: search;
    max-width: none;
  }

  .cart {
    grid-area: cart;
  }

  .profile {
    grid-area: profile;
  }

  .brand__text {
    font-size: 22px;
  }

  .cartChip__label,
  .profile__btn span {
    display: none;
  }

  .cartChip,
  .profile__btn {
    min-width: 54px;
    justify-content: center;
    padding: 0 12px;
  }

  .hdr__actions {
    gap: 10px;
  }

  .cart__dropdown {
    left: 0;
    width: min(380px, calc(100vw - 24px));
  }

  .profile__dropdown {
    left: 0;
  }

  .authsheet {
    padding: 18px;
  }
}

@media (max-width: 640px) {
  .hdr__row {
    padding: 14px 16px;
  }

  .brand__logo {
    width: 36px;
    height: 36px;
  }

  .brand__text {
    font-size: 20px;
  }

  .search__input,
  .cartChip,
  .profile__btn {
    min-height: 50px;
    height: 50px;
    border-radius: 14px;
  }

  .search__btn {
    width: 38px;
    height: 38px;
    right: 8px;
  }

  .search__input {
    padding-right: 54px;
    font-size: 14px;
  }

  .cart__dropdown,
  .profile__dropdown {
    width: min(340px, calc(100vw - 20px));
  }

  .authsheet {
    align-items: center;
    justify-content: center;
    padding: 18px;
  }

  .authsheet__dialog {
    width: min(420px, 100%);
    max-height: 92vh;
    padding: 22px 18px 20px;
    border-radius: 24px;
  }

  .authsheet__tabs {
    padding-left: 48px;
  }

  .authsheet__title {
    font-size: 22px;
  }
}
