/* Header styles extracted from style.css */

.site-header {
  background: #fff;
  padding: 24px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid #f0f0f0;
  transition: padding 0.3s ease;
}

.site-header.is-scrolled {
  padding: 16px 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.site-header a {
  color: #1f1f1f;
  text-decoration: none;
  font-size: 16px;
  transition: color 0.3s;
  font-weight: 400;
  letter-spacing: 0.4px;
}

.site-header a:hover {
  color: #640406;
}

.site-header,
.site-header * {
  font-family: var(--font-sans);
}

.burger {
  display: none;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  padding: 0;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  /* Center the lines */
  gap: 6px;
  cursor: pointer;
  margin-left: -8px;
  /* Offset the padding/width to align visually */
}

.burger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #424040;
  border-radius: 1px;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, width 0.2s ease;
}

.burger.is-active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.burger.is-active span:nth-child(2) {
  opacity: 0;
  transform: translateX(-10px);
}

.burger.is-active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  width: 100%;
  position: relative;
}

.header-nav {
  display: flex;
  gap: 48px;
  align-items: center;
  flex: 1;
}

/* Dropdown Menu Styles */
.nav-dropdown {
  position: relative;
}

.nav-dropdown__trigger {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  appearance: none;
  outline: none;
}

.nav-dropdown__trigger:hover {
  color: #640406;
}

.nav-dropdown__trigger:focus-visible {
  text-decoration: underline;
}

.nav-dropdown__menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 180px;
  background: #fff;
  border: 1px solid #e6e1da;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
  padding: 12px 0;
  margin-top: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
  transform: translateX(-50%) translateY(-10px);
  z-index: 200;
}

.nav-dropdown:hover .nav-dropdown__menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown__item {
  display: block;
  padding: 10px 20px;
  font-size: 14px;
  color: #333;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.nav-dropdown__item:hover {
  background: #f9f7f5;
  color: #640406;
}

.nav-link {
  position: relative;
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1.2px;
  color: #333;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: #640406;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover::after {
  width: 100%;
}

.header-logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}

.header-logo img {
  display: block;
  height: auto;
  max-height: 48px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-logo:hover img {
  transform: scale(1.05);
}

.header-actions {
  display: flex;
  gap: 28px;
  align-items: center;
  justify-content: end;
  flex: 1;
}

.icon-link {
  width: 24px;
  height: 24px;
  object-fit: contain;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
  opacity: 0.9;
}

.icon-link:hover {
  transform: scale(1.1);
  opacity: 1;
}

.header-actions--compact {
  gap: 32px;
}

@media (max-width: 900px) {
  .header-nav {
    display: none;
  }

  .burger {
    display: flex;
  }

  .header-inner {
    /* Return to flex for reliable absolute centering of logo */
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .header-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    z-index: 10;
    /* Ensure above actions and other overlaps */
  }

  .header-actions {
    /* Ensure it stays on the right */
    margin-left: auto;
    justify-content: flex-end;
    z-index: 2;
    /* Ensure clickable */
  }

  .burger {
    z-index: 2;
    /* Ensure clickable */
  }
}

@media (max-width: 768px) {
  .site-header {
    padding: 14px 0;
  }

  .site-header .container-m {
    padding-left: 16px;
    padding-right: 16px;
  }

  /* Already handled by max-width 900px query above, but ensuring overrides */

  .header-actions {
    gap: 20px;
  }

  .header-logo img {
    max-height: 36px;
  }

  .header-actions {
    gap: 20px;
  }

  .header-actions--compact {
    gap: 20px;
  }

  /* Hide phone icon on mobile */
  .header-actions img[alt="Phone"] {
    display: none;
  }

  /* Hide profile link container on mobile to avoid flex gap */
  .header-actions>a:last-child {
    display: none;
  }

  /* Keep only cart and search visible on mobile, adjust size */
  .icon-link {
    width: 22px;
    height: 22px;
  }
}

/* Mobile Menu Styles */
.mobile-menu {
  display: none;
}

.mobile-menu.is-open {
  display: block;
}

.mobile-menu__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  z-index: 900;
  opacity: 0;
  animation: fadeIn 0.3s forwards;
}

.mobile-menu__panel {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  /* Fallback */
  height: 100dvh;
  width: 85vw;
  max-width: 360px;
  background: #fff;
  z-index: 910;
  box-shadow: 10px 0 40px rgba(0, 0, 0, 0.1);
  padding: 80px 24px 60px;
  /* Increased bottom padding */
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-menu.is-open .mobile-menu__panel {
  transform: translateX(0);
}

.mobile-menu__nav {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mobile-menu__nav .mobile-menu__link {
  font-size: 20px;
  font-weight: 400;
  color: #1a1a1a;
  text-decoration: none;
  letter-spacing: -0.02em;
  transition: color 0.2s ease, transform 0.2s ease;
  display: inline-block;
}

.mobile-menu__link:hover,
.mobile-menu__link:active {
  color: #a01f34;
  transform: translateX(4px);
}

.mobile-menu__accordion {
  padding: 0;
  border: none;
}

.mobile-menu__accordion summary {
  list-style: none;
  cursor: pointer;
}

.mobile-menu__accordion summary::-webkit-details-marker {
  display: none;
}

.mobile-menu__accordion summary.mobile-menu__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 4px;
}

.mobile-menu__accordion summary::after {
  content: "▸";
  font-size: 14px;
  color: #6b6b6b;
  transition: transform 0.2s ease;
}

.mobile-menu__accordion[open] summary::after {
  transform: rotate(90deg);
}

.mobile-menu__submenu {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 0 0 8px;
}

.mobile-menu__sublink {
  display: block;
  font-size: 18px;
  color: #3a3a3a;
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
}

.mobile-menu__sublink:hover,
.mobile-menu__sublink:active {
  color: #a01f34;
  transform: translateX(4px);
}

.mobile-menu__sublink--empty {
  font-size: 16px;
  color: #9a9a9a;
}

.mobile-user {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: 16px;
  background: #f9f9f9;
  text-decoration: none;
  color: #2b2b2b;
  transition: background 0.2s ease;
}

.mobile-user:hover {
  background: #f0f0f0;
}

.mobile-user__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid #e1d7c9;
}

.mobile-user__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mobile-user__meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}

.mobile-user__name {
  font-size: 15px;
  font-weight: 500;
  color: #1f1f1f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-user__email {
  font-size: 13px;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-menu__close {
  position: absolute;
  top: 45px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #eee;
  background: #fff;
  color: #1f1f1f;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.mobile-menu__close:hover {
  background: #f5f5f5;
  border-color: #ddd;
  transform: rotate(90deg);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.mobile-menu__footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-top: 15px;
  border-top: 1px solid #f2f2f2;
}

.mobile-menu__footer-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #999;
  margin-bottom: 16px;
}

.mobile-menu__contacts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mobile-menu__contact-link {
  font-size: 16px;
  color: #1a1a1a;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.mobile-menu__socials {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.mobile-menu__social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #eee;
  background: #fff;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu__social-link img {
  width: 20px;
  height: 20px;
  opacity: 0.8;
  transition: all 0.3s ease;
}

.mobile-menu__social-link:active {
  background: #f9f9f9;
  border-color: #ddd;
  transform: scale(0.95);
}

.mobile-menu__social-link:active img {
  opacity: 1;
  transform: scale(1.1);
}

.mobile-menu__user-section {
  display: flex;
  flex-direction: column;
}

.mobile-user {
  margin-top: 4px;
}