/* LEWU Custom Common Stylesheet (Header & Footer Styles) */

:root {
  --primary-color: #dc3545;
  /* Red accent matching the logo and primary buttons */
  --primary-dark: #b02a37;
  /* 主色悬停和强调状态使用更深的红色，保持文字对比度。 */
  --primary-soft: #f8d7da;
  /* 表单选中、图标底色和轻提示使用低饱和浅红色。 */
  --navy-blue: #0f172a;
  /* Deep slate navy for banners and blocks */
  --navy-dark: #090d16;
  /* Darker footer background */
  --light-gray: #f8f9fa;
  /* Secondary layout background */
  --border-color: #e2e8f0;
  /* Muted card border color */
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --font-outfit: 'Open Sans', sans-serif;
  --font-inter: 'Open Sans', sans-serif;
}

body {
  font-family: var(--font-inter);
  color: var(--text-dark);
  background-color: #fcfcfd;
  overflow-x: hidden;
}

/* Base and utilities */
.outfit-font {
  font-family: var(--font-outfit);
}

.top-space {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.tracking-tighter {
  letter-spacing: 0;
}

.tracking-wider {
  letter-spacing: 0.08em;
}

.line-height-sm {
  line-height: 1.15;
}

.max-width-900 {
  max-width: 900px;
}

.max-width-600 {
  max-width: 600px;
}

/* Header Brand & Navigation */
.brand-logo {
  font-size: 2.25rem;
  letter-spacing: 0;
}

/* 中文网站统一继承首页红色主题，并同步覆盖 Element Plus 的品牌色变量。 */
.card-storefront-theme {
  --bs-primary: var(--primary-color);
  --bs-primary-rgb: 220, 53, 69;
  --bs-danger: var(--primary-color);
  --bs-danger-rgb: 220, 53, 69;
  --el-color-primary: var(--primary-color);
  --el-color-primary-light-3: #e77681;
  --el-color-primary-light-5: #ee9aa2;
  --el-color-primary-light-7: #f5bec3;
  --el-color-primary-light-8: #f8d7da;
  --el-color-primary-light-9: #fcebec;
  --el-color-primary-dark-2: var(--primary-dark);
  --el-color-danger: var(--primary-color);
  --el-color-danger-light-3: #e77681;
  --el-color-danger-light-5: #ee9aa2;
  --el-color-danger-light-7: #f5bec3;
  --el-color-danger-light-8: #f8d7da;
  --el-color-danger-light-9: #fcebec;
  --el-color-danger-dark-2: var(--primary-dark);
}

/* 统一常用主操作、链接和表单焦点，避免旧业务页继续显示默认蓝色或金色。 */
.card-storefront-theme .btn-primary,
.card-storefront-theme .btn-danger {
  --bs-btn-bg: var(--primary-color);
  --bs-btn-border-color: var(--primary-color);
  --bs-btn-hover-bg: var(--primary-dark);
  --bs-btn-hover-border-color: var(--primary-dark);
  --bs-btn-active-bg: var(--primary-dark);
  --bs-btn-active-border-color: var(--primary-dark);
}

.card-storefront-theme a:not(.btn):not(.nav-link):focus-visible,
.card-storefront-theme button:focus-visible,
.card-storefront-theme input:focus-visible,
.card-storefront-theme select:focus-visible,
.card-storefront-theme textarea:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* 后台配置 Logo 使用稳定尺寸，避免不同语言图片导致头部高度跳动。 */
.card-header-logo {
  display: block;
  width: auto;
  max-width: 150px;
  height: 46px;
  object-fit: contain;
}

.brand-subtitle {
  display: block;
  margin-top: -5px;
  color: var(--text-muted);
  font-family: var(--font-outfit);
  font-size: 0.6rem !important;
}

.search-form input {
  border-color: var(--border-color);
  box-shadow: none;
  font-family: var(--font-inter);
  font-size: 0.9rem;
  transition: all 0.25s ease;
}

.search-form input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
}

.nav-icon-link {
  transition: color 0.2s ease;
}

.nav-icon-link:hover {
  color: var(--primary-color) !important;
}

/* 登录后的会员名与操作文案保持单行，避免长账号挤压收藏和购物车入口。 */
.card-header-action-label {
  flex-shrink: 0;
  white-space: nowrap;
}

.card-header-member-name {
  overflow: hidden;
  max-width: 92px;
  text-overflow: ellipsis;
}

.card-header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

/* 收藏与购物车数量徽标固定在图标右上角，数量变化不会挤压头部布局。 */
.storefront-count-badge {
  position: absolute;
  top: -9px;
  right: -11px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

/* 网站端操作反馈使用稳定宽度，避免长文案遮挡商品操作按钮。 */
.storefront-feedback {
  z-index: 1090;
  width: min(360px, calc(100vw - 24px));
  margin: 12px !important;
}

/* Categories navigation */
.navbar-nav .nav-link {
  font-family: var(--font-inter);
  font-size: 0.9rem;
  transition: color 0.25s ease;
}

.navbar-nav .nav-link:hover {
  color: var(--primary-color) !important;
}

.category-nav-toggler {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 0;
  border-radius: 6px;
  color: var(--primary-color);
  font-family: var(--font-inter);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.55rem 0.75rem;
  width: 100%;
}

.category-nav-toggler:hover,
.category-nav-toggler:focus {
  color: var(--primary-color);
}

.category-nav-toggler:focus {
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
}

.category-nav-toggler-label {
  color: var(--text-dark);
}

.category-nav-toggler .fa-bars {
  color: var(--primary-color);
  font-size: 1.1rem;
}

.navbar-nav .nav-item.dropdown {
  position: relative;
}

.nav-category-toggle {
  cursor: pointer;
}

.nav-category-toggle::after {
  display: none;
}

.nav-category-toggle.show {
  color: var(--primary-color) !important;
}

.navbar-nav .nav-item.dropdown:hover>.nav-category-toggle {
  color: var(--primary-color) !important;
}

.navbar-nav .nav-item.dropdown:hover>.nav-category-menu {
  display: block;
}

.nav-category-menu {
  min-width: 280px;
  padding: 18px 0 17px;
  border: 1px solid #d9dee2 !important;
  border-radius: 1px !important;
  background-color: #ffffff;
  box-shadow: none !important;
  z-index: 1060;
}

.nav-category-menu .dropdown-item {
  padding: 8px 22px;
  color: #64727d;
  background-color: transparent;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
}

.nav-category-menu .dropdown-item:hover,
.nav-category-menu .dropdown-item:focus {
  color: #2f3a42;
  background-color: #f4f6f8;
}

/* Shop category mega menu */
.dropdown-toggle-custom {
  color: var(--text-muted);
  font-family: var(--font-inter);
}

.dropdown-toggle-custom:hover,
.dropdown-toggle-custom:focus {
  color: var(--primary-color);
  text-decoration: none;
}

.dropdown-toggle-custom i {
  transition: transform 0.25s ease;
}

.dropdown-toggle-custom[aria-expanded="true"] i {
  transform: rotate(180deg);
}

.shop-category-dropdown {
  position: relative;
}

.dropdown-menu {
  display: none;
}

.dropdown-menu.show {
  display: block;
}

/* 顶部语言与货币偏好弹层，两项独立选择并统一保存。 */
.card-preference-menu {
  width: min(360px, calc(100vw - 24px));
  padding: 20px;
  border: 1px solid #d9dee3 !important;
  border-radius: 8px !important;
  background-color: #ffffff;
}

.card-preference-title {
  margin: 0 0 8px;
  color: #191919;
  font-family: var(--font-inter);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
}

.card-preference-description {
  margin: 0 0 18px;
  color: #5f6b76;
  font-size: 0.82rem;
  line-height: 1.5;
}

.card-preference-form .form-label {
  margin-bottom: 7px;
  color: #2f3a42;
  font-size: 0.85rem;
  font-weight: 600;
}

.card-preference-form .form-select {
  min-height: 42px;
  border-color: #cfd6dc;
  border-radius: 4px;
  color: #26313a;
  font-size: 0.9rem;
}

.card-preference-form .form-select:focus {
  border-color: #7e8a94;
  box-shadow: 0 0 0 3px rgba(47, 58, 66, 0.1);
}

.card-preference-submit {
  min-height: 42px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 700;
}

.card-preference-compact {
  font-size: 0.72rem;
  white-space: nowrap;
}

.mega-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1050;
  min-width: 720px;
  padding: 1.5rem !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
  border-radius: 16px !important;
  background-color: #ffffff;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12) !important;
  transform: translateY(4px);
}

.mega-menu .row {
  gap: 0;
}

.mega-menu h5 {
  margin-bottom: 0.75rem !important;
  padding-bottom: 0 !important;
  border-bottom: none !important;
  color: #191919 !important;
  font-family: var(--font-inter);
  font-size: 0.95rem !important;
  font-weight: 700;
}

.category-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.mega-menu a {
  color: #6b7280;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.mega-menu a:hover {
  color: var(--primary-color);
  text-decoration: none;
}

.mega-menu ul li a {
  display: block;
  color: #767676 !important;
  font-family: var(--font-inter);
  font-size: 0.85rem !important;
  transition: color 0.15s ease, text-decoration 0.15s ease;
}

.mega-menu ul li a:hover {
  color: #191919 !important;
  text-decoration: underline !important;
  padding-left: 0 !important;
}

/* Customize dropdown active color to dark gray */
.dropdown-item.active,
.dropdown-item:active {
  background-color: #475569 !important;
  color: #ffffff !important;
}

/* Newsletter and footer */
.send-mail {
  width: 100%;
  margin: 0 auto 1.5rem;
  color: #cccccc;
  font-size: 1.1rem;
  font-weight: normal;
  text-align: center;
}

.newsletter-form input {
  box-shadow: none !important;
}

.newsletter-form input:focus {
  border-color: #ffffff !important;
}

.hover-white {
  transition: color 0.2s ease;
}

.hover-white:hover {
  color: #ffffff !important;
}

#scrollTopBtn:hover {
  background-color: #bd2130 !important;
  transform: translateY(-3px) scale(1.05);
}

.copyright {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1rem 0;
  background-color: var(--navy-dark);
  color: #ffffff;
  font-size: 0.75rem;
  text-align: center;
}

.copyright-text {
  color: #a0a0a0;
  font-size: 0.9rem;
  text-align: center;
  margin: 0;
  margin: 0 auto;
}

.footer {
  padding: 3rem 0 0 0;
}
.mobile-category-drawer{display: none}
.list-page {
  text-align: center;
  width: 98%;
  margin: 1.5rem auto 2rem;display: flex;justify-content: center;
}

.pagination a {

  color: #0b112a !important
}

.pagination > .active > a, .pagination > .active > span, .pagination > .active > a:hover, .pagination > .active > span:hover, .pagination > .active > a:focus, .pagination > .active > span:focus {
  z-index: 3;
  color: #fff !important;
  cursor: default;
  background-color: #333 !important;
  border-color: #ddd !important;
}
/* Large desktop utilities */
@media (min-width: 1600px) {
  .container {
    max-width: 1500px !important;
  }
}

/* Tablet and desktop */
@media (min-width: 768px) {
  .mega-menu {
    width: 820px !important;
    left: -50px;
  }

  .flex-nowrap-md {
    flex-wrap: nowrap !important;
  }
}

/* Tablet and smaller responsive navigation */
@media (max-width: 991.98px) {
  .top-space {
    padding-top: 0.75rem;
    padding-bottom: 0.2rem;
  }
  /* 移动端分类改为独立视口抽屉，分类数量不会再撑高主导航。 */
  .mobile-category-drawer {
    display: block;
    overflow-x: hidden;
    overflow-y: auto;
    position: absolute;
    inset: 0;
    z-index: 5;
    width: 100%;
    height: var(--mobile-category-available-height, 100dvh);
    max-height: none;
    padding-bottom: env(safe-area-inset-bottom);
    background-color: #ffffff;
    overscroll-behavior: contain;
    pointer-events: none;
    transform: translate3d(100%, 0, 0);
    transition: none;
    visibility: hidden;
    will-change: transform;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  .mobile-category-drawer.is-open {
    pointer-events: auto;
    transform: translate3d(0, 0, 0);
    visibility: visible;
  }

  .mobile-category-drawer-header {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 1rem 1.1rem 0.9rem;
    border-bottom: 1px solid var(--border-color);
    background-color: #ffffff;
  }

  .mobile-category-back {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 42px;
    padding: 0;
    border: 0;
    color: var(--primary-color);
    background: transparent;
    font-family: var(--font-inter);
    font-size: 0.9rem;
    font-weight: 700;
  }

  .mobile-category-drawer-title {
    margin: 0.7rem 0 0;
    color: var(--text-dark);
    font-family: var(--font-inter);
    font-size: 1rem;
    font-weight: 700;
  }

  .mobile-category-drawer-list {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    list-style: none;
    margin: 0;
    padding: 0.85rem 0;
  }

  .mobile-category-drawer-list a {
    display: block;
    min-height: 44px;
    padding: 0.75rem 1.1rem;
    color: #64727d;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
    text-decoration: none;
  }

  .mobile-category-drawer-list a:hover,
  .mobile-category-drawer-list a:focus {
    color: #2f3a42;
    background-color: #f4f6f8;
  }

  #categoriesNav {
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    width: 100%;
    max-height: var(--mobile-category-available-height, calc(100dvh - 120px));
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  #categoriesNav.is-submenu-open {
    height: var(--mobile-category-available-height, calc(100dvh - 120px));
    overflow: hidden;
  }

  #categoriesNav .navbar-nav {
    gap: 0.1rem;
    padding: 0.5rem 0 0.9rem !important;
    transition: opacity 0.22s ease, transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    white-space: normal !important;
    will-change: opacity, transform;
  }

  #categoriesNav.is-submenu-open .navbar-nav {
    opacity: 0;
    pointer-events: none;
    transform: translate3d(-18px, 0, 0);
  }

  #categoriesNav .nav-link {
    padding: 0.75rem 0 !important;
  }

  #categoriesNav .nav-category-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
  }

  #categoriesNav .nav-category-toggle::after {
    display: inline-block;
    flex: 0 0 auto;
    width: 0.55rem;
    height: 0.55rem;
    margin-left: auto;
    margin-right: 0.2rem;
    border-top: 2px solid #94a3b8;
    border-right: 2px solid #94a3b8;
    content: "";
    transform: rotate(45deg);
  }

  #categoriesNav .nav-item.dropdown:hover>.nav-category-menu {
    display: none !important;
  }

  #categoriesNav .nav-item.dropdown:hover>.nav-category-menu.show,
  #categoriesNav .nav-category-menu.show {
    display: none !important;
  }

  .nav-category-menu {
    width: 100%;
    min-width: 100%;
    margin-top: 0 !important;
    padding: 0.65rem 0;
    border-radius: 4px !important;
  }

  .nav-category-menu .dropdown-item {
    white-space: normal;
  }

  .mega-menu {
    width: calc(100vw - 2rem);
    min-width: auto;
  }

  .end-menu {
    display: none;
  }
}

/* Phone responsive footer */
@media (max-width: 767.98px) {
  .card-header-actions {
    gap: 0.5rem !important;
  }

  .card-language-switcher {
    padding-left: 0.75rem !important;
  }

  .card-preference-menu {
    padding: 18px;
  }

  .shop-category-dropdown {
    display: none !important;
  }

  .mega-menu {
    width: calc(100vw - 32px) !important;
    left: -20px !important;
  }

  .end-contact li {
    width: 100%;
  }
  .publisher-products .section-subtitle{display: none}
}

/* 移动端二级分类由独立抽屉承载，主导航只保留一级分类入口。 */
@media (max-width: 991.98px) {
  #categoriesNav .nav-item.dropdown:hover > .nav-category-menu,
  #categoriesNav .nav-category-menu,
  #categoriesNav .nav-category-menu.show {
    display: none !important;
  }
}

/* 分类抽屉打开期间固定页面，关闭时由脚本恢复原来的滚动位置。 */
@media (max-width: 991.98px) {
  html.mobile-category-open,
  body.mobile-category-open {
    overflow: hidden;
  }

  body.mobile-category-open {
    position: fixed;
    right: 0;
    left: 0;
    width: 100%;
  }
}
