/* Custom home page styles (extracted from web3dinfi_V6 home.css, recolored to light blue)
   Notes:
   - This file collects custom overrides for home page sections (categories, featured products),
     product detail page tweaks (specs/applications, PDF, slider arrows), and product list page alignment.
   - Product list mobile grid was iterated several times; final decision is a fixed 2-column grid on mobile,
     with alignment controlled by per-page item count (set to 12) instead of CSS hacks like centering last item.
     See comments around the mobile media query for product_list.
*/

:root {
  --brand: #3a8ee6;
  --brand-strong: #2f7dcc;
  --brand-light: #e8f2fc;
  --text-main: #333;
  --text-muted: #666;
}

/* Generic section spacing */
.section {
  padding: 60px 0;
}

.section-title {
  font-size: 2.2rem;
  font-weight: 700;
  text-align: center;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
}

/* Featured Products Section */
.featured-products {
  background: #fff;
}

.products-grid {
  margin-top: 2.5rem;
}

.products-grid .product-wrapper {
  margin-bottom: 2rem;
  display: block;
}

/* Product Categories Section */
.categories-section {
  background: #f8fbff;
}

.categories-grid {
  margin-top: 3rem;
}

.categories-grid .category-wrapper {
  margin-bottom: 2rem;
}

.category-card {
  background: #fff;
  padding: 2.5rem;
  border-radius: 6px;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

.category-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.14);
  text-decoration: none;
  color: inherit;
}

.category-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 4px;
  background: var(--brand);
  transition: left 0.3s ease;
}

.category-card:hover::before {
  left: 0;
}

.category-icon {
  margin-bottom: 1.5rem;
}

.category-icon i,
.category-icon img {
  font-size: 3.5rem;
  color: var(--brand);
  transition: color 0.3s ease;
  max-width: 72px;
  height: auto;
}

.category-card:hover .category-icon i,
.category-card:hover .category-icon img {
  color: var(--brand-strong);
}

.category-card h3 {
  font-size: 1.7rem;
  margin-bottom: 1rem;
  color: var(--text-main);
  font-weight: 600;
}

.category-card p {
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  font-size: 1.45rem;
  flex-grow: 1;
}

.category-count {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 1.3rem;
  font-weight: 600;
  margin-top: auto;
}

/* Small pill/button style that matches the brand color */
.pill-btn {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  padding: 0.55rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1.2rem;
  text-decoration: none;
  transition: filter 0.2s ease, transform 0.2s ease;
}

.pill-btn:hover {
  text-decoration: none;
  color: #fff;
  filter: brightness(0.92);
  transform: translateY(-1px);
}

/* Product cards */
.product-card {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.18);
  text-decoration: none;
}

.product-image {
  position: relative;
  overflow: hidden;
  background: #fff;
  min-height: 320px;
}

.product-image img {
  width: 100%;
  height: 320px;
  object-fit: contain;
  display: block;
}

.product-body {
  padding: 1.6rem 1.6rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.product-tag {
  color: var(--brand);
  font-weight: 600;
  font-size: 1.3rem;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.product-title {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.product-desc {
  color: var(--text-muted);
  font-size: 1.3rem;
  line-height: 1.65;
  margin: 0 0 0.25rem;
  min-height: 40px; /* reserve space for two lines */
}

.product-meta {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 0.6rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 65px; /* align specs block across cards */
}

.product-meta-item {
  display: flex;
  justify-content: space-between;
  color: var(--text-main);
  font-size: 1.2rem;
}

.meta-label {
  color: var(--text-muted);
}
.meta-value {
  font-weight: 700;
}

/* Support inline spec markup coming from ext_specs */
.product-meta .spec-item {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 1.3rem;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.product-meta .spec-item:last-child {
  margin-bottom: 0;
}

.product-meta .spec-name {
  color: var(--text-muted);
}

.product-meta .spec-value {
  font-weight: 700;
  color: var(--text-main);
}

.product-specs,
.product-apps {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 1rem 1.1rem;
  margin-top: 1rem;
}

.product-specs {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: transparent;
  padding: 0;
  margin-top: 0.5rem;
}

.product-apps {
  background: transparent;
  border-top: 1px solid #e6e9ef;
  padding-top: 14px;
}

.product-specs .spec-title,
.product-apps .spec-title {
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.6rem;
  font-size: 1.4rem;
}

.product-specs .specs-grid,
.product-specs .spec-list,
.product-apps .app-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
}

.product-specs .specs-grid .spec-item,
.product-specs .spec-list .spec-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 1.3rem;
  color: var(--text-main);
  line-height: 1.6;
}

.product-specs .specs-grid .spec-name,
.product-specs .spec-list .spec-name {
  color: var(--text-muted);
  font-weight: 600;
}

.product-specs .specs-grid .spec-value,
.product-specs .spec-list .spec-value {
  font-weight: 700;
  color: var(--text-main);
  text-align: right;
}

.product-apps .app-list li {
  list-style: none;
  color: var(--text-main);
  padding: 0.25rem 0;
  border-bottom: none;
  font-size: 1.3rem;
}

.product-apps .app-list li:last-child {
  border-bottom: none;
}

.product-pdf {
  text-align: left;
  background: transparent;
  padding: 0;
  margin-top: 14px;
  border-radius: 0;
  box-shadow: none;
}

.product-pdf a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
  text-decoration: none;
  font-weight: 600;
}

.product-pdf a:hover {
  color: var(--brand);
  text-decoration: none;
}

.product-pdf .pdf-icon {
  width: 28px;
  height: 28px;
}

/* ----------------------------------------
   Product detail slider (left gallery)
   ----------------------------------------
   - Stabilize bxSlider arrows to prevent jumpiness on hover.
   - Keep viewport overflow hidden.
*/
.showpic_box .bx-wrapper .bx-controls-direction a {
  top: 50% !important;
  margin-top: 0 !important;
  transform: translateY(-50%);
  transition: none;
}

.showpic_box .bx-wrapper {
  position: relative;
}

.showpic_box .bx-wrapper .bx-viewport {
  overflow: hidden !important;
}

/* Product list grid alignment */
.product_list::after {
  content: "";
  display: block;
  clear: both;
}

.product_list .product_img {
  /* Desktop list card wrapper for each product */
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 260px;
}

.product_list .product_img img {
  /* Desktop list image sizing and containment */
  width: 100%;
  height: 200px;
  object-fit: contain;
}

.product_list2 .product_img:nth-child(3n+1) {
  clear: both;
}

@media (max-width: 768px) {
  /* Mobile list: fixed 2-column grid. Rationale:
     - We set per-page items to 12 (divisible by 2 and 3) to avoid empty slots.
     - Keep items left-aligned; do NOT center the last single item.
  */
  .product_list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 12px;
    justify-items: start;
  }
  .product_list::after {
    display: none;
  }
  .product_list .product_img {
    /* Mobile card wrapper */
    width: 100%;
    max-width: 100%;
    float: none;
    min-height: 200px;
    margin-bottom: 0;
    padding-left: 8px;
    padding-right: 8px;
  }
  .product_list .product_img img {
    /* Mobile image height */
    height: 150px;
  }
  /* 如果只剩一个，跨两列居中 */
  .product_list .pagination {
    margin-top: 10px;
    text-align: center;
    grid-column: 1 / -1;
    justify-self: center;
  }
  .product_list .pagebar,
  .product_list2 .pagebar {
    grid-column: 1 / -1;
    justify-self: center;
  }
  .product_list2 .product_img:nth-child(3n+1) {
    clear: none;
  }
}

.product_list .pagebar,
.product_list2 .pagebar {
  clear: both;
  float: none;
  width: 100%;
  text-align: center;
  margin-top: 16px;
  display: block;
  /* Pagination forced to its own row (desktop + mobile) */
}

/* Nav dropdown
   - Align dropdown box to parent link text (no offset), same width as parent.
   - Unified colors: white text, black hover for both 2nd/3rd level.
   - Third level flies out to the right and inherits brand blue background. */
.navbar-nav .dropdown-menu.nav_small {
  text-align: left;
  left: 0;
  right: auto;
  min-width: 100%;
  padding: 6px 0;
  margin-top: 0;
}

.navbar-nav .dropdown-menu.nav_small li a {
  text-align: left;
  padding: 10px 32px;
  color: #fff;
  font-size: 14px;
}

.navbar-nav .dropdown-menu.nav_small li a:hover,
.navbar-nav .dropdown-menu.nav_small li a:focus {
  background: #000;
  color: #fff;
}

/* Nav dropdown: third-level flyout */
.navbar-nav .dropdown-menu.nav_small .dropdown-submenu {
  position: relative;
}

.navbar-nav .dropdown-menu.nav_small .dropdown-submenu > .dropdown-menu {
  display: none;
  visibility: hidden;
  opacity: 0;
  position: absolute;
  top: 0;
  left: 100%;
  min-width: 230px;
  padding: 8px 0;
  background: rgba(4, 110, 194, 0.92);
  border: none;
  border-radius: 0;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  transition: opacity 0.15s ease;
}

.navbar-nav .dropdown-menu.nav_small .dropdown-submenu:hover > .dropdown-menu {
  display: block;
  visibility: visible;
  opacity: 1;
}

.navbar-nav .dropdown-menu.nav_small .dropdown-submenu > a {
  padding-right: 28px;
}

.navbar-nav .dropdown-menu.nav_small .dropdown-submenu > .dropdown-menu li a {
  padding: 10px 24px;
  color: #fff;
  background: transparent;
  font-size: 15px;
}

.navbar-nav .dropdown-menu.nav_small .dropdown-submenu > .dropdown-menu li a:hover,
.navbar-nav .dropdown-menu.nav_small .dropdown-submenu > .dropdown-menu li a:focus {
  background: #000;
  color: #fff;
}

/* Sidebar (Navigation/News/Contact) unified text list style */
.left_column,
.left_news,
.left_contact {
  font-size: 15px;
  line-height: 1.6;
  color: #444;
}

.panel-group#nav-accordion {
  margin-bottom: 30px; /* 调整数值控制最后一项和下一个栏目的的距离 */
  margin-top: 16px; /* 调整数值控制标题下划线与第一个项的距离 */
}

.panel-group#nav-accordion .panel {
  border: none !important;
  box-shadow: none;
  margin-bottom: 6px;
  border-bottom: 1px solid #e6e6e6 !important;
  padding-bottom: 4px;
}

.panel-group#nav-accordion .panel-heading {
  padding: 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid #e6e6e6;
  padding-bottom: 4px;
  margin-bottom: 4px;
}

.panel-group#nav-accordion .panel-title a {
  display: block !important;
  padding: 6px 0 !important;
  color: #2f2f2f !important;
  text-decoration: none !important;
  font-weight: 400 !important;
  font-size: 15px !important;
  position: relative;
  padding-right: 18px !important;
}

.panel-group#nav-accordion .panel-title a:hover {
  color: #4582e2 !important;
  text-decoration: none !important;
}

.panel-group#nav-accordion .panel-body {
  padding: 0 0 6px 0;
  border: none !important;
}

.panel-group#nav-accordion .panel-body ul {
  margin: 0;
  padding: 0 0 0 8px;
  list-style: none;
}

.panel-group#nav-accordion .panel-body li a {
  display: block !important;
  padding: 3px 0 !important;
  color: #2f2f2f !important;
  text-decoration: none !important;
  font-size: 15px !important;
  font-weight: 400 !important;
}

.panel-group#nav-accordion .panel-body li + li {
  border-top: 1px dotted #e6e6e6;
  padding-top: 4px !important;
}

.panel-group#nav-accordion .panel-body li a:hover {
  color: #4582e2 !important;
  text-decoration: none !important;
}

/* Remove button-like panel background for Navigation */
.panel-group#nav-accordion .panel,
.panel-group#nav-accordion .panel-collapse,
.panel-group#nav-accordion .panel-heading {
  background: transparent;
  border: none;
}

/* Accordion arrow indicator */
.nav-accordion-toggle::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  margin-top: -4px;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #777;
  transition: transform 0.15s ease;
}

.nav-accordion-toggle.collapsed::after {
  transform: rotate(-90deg); /* point right when collapsed */
}

/* Banner image as inline img (instead of background) */
.page_bg {
  height: auto !important;
  min-height: 0;
}

.page_bg img,
.page-bg-img {
  width: 100%;
  height: auto;
  display: block;
}

/*背景图加白色柔光蒙版*/
.page_bg {
    position: relative;
}

.page_bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.1);   /* 调透明度 0.2–0.6 */
    pointer-events: none;
}


/* Mobile nav: stack third-level, no flyout; tap-to-open handled via Bootstrap collapse state */
@media (max-width: 768px) {
  .navbar-nav .dropdown-menu.nav_small {
    position: static;
    width: 100%;
    min-width: 0;
    box-shadow: none;
    background: #000;
  }

  .navbar-nav .dropdown-menu.nav_small .dropdown-submenu {
    position: static;
  }

  .navbar-nav .dropdown-menu.nav_small .dropdown-submenu > .dropdown-menu {
    position: static;
    left: 0;
    top: 0;
    min-width: 0;
    width: 100%;
    padding: 0;
    margin: 0;
    background: #000;
    box-shadow: none;
    border: none;
    display: none;
    visibility: visible;
    opacity: 1;
  }

  .navbar-nav .dropdown-menu.nav_small .dropdown-submenu.open > .dropdown-menu {
    display: block;
  }

  .navbar-nav .dropdown-menu.nav_small li a {
    padding: 10px 20px;
    color: #fff;
  }

  .navbar-nav .dropdown-menu.nav_small .dropdown-submenu > .dropdown-menu li a {
    padding-left: 30px;
  }

  /* Mobile: down arrow indicator for items with children */
  .navbar-nav .dropdown-menu.nav_small .dropdown-submenu > a {
    position: relative;
    padding-right: 36px;
  }

.navbar-nav .dropdown-menu.nav_small .dropdown-submenu > a::after {
    content: '';
    position: absolute;
    right: 16px;
    top: 50%;
    margin-top: -4px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #fff; /* simple down arrow */
    transition: none;
  }
}

/* Typography and sizing tweaks */
.navbar-nav > li > a {
  font-size: 16px;
  font-weight: 500;
}

.navbar-nav .dropdown-menu.nav_small li a {
  font-size: 15px;
  line-height: 1.8;
}

h1 {
  font-size: 30px;
  font-weight: 600;
}

h2 {
  font-size: 22px;
  font-weight: 600;
}

.bread_nav {
  font-size: 14px;
  color: #666;
}

.left_column h3,
.left_news h3,
.left_contact h3 {
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.left_news ul li a {
  font-size: 15px;
  line-height: 1.6;
}

.right_con p,
.right_contents p,
.about_con p {
  font-size: 16px;
  line-height: 1.7;
  color: #2f2f2f;
}

/* XFNano subcategory pills (keep markup intact) */
.xfnano-subnav {
  margin: 20px 0 18px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.xfnano-subnav-actions {
  margin-bottom: 6px;
  text-align: right;
}

.xfnano-subnav ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.xfnano-subnav ul.collapsed {
  max-height: 72px; /* about two rows of pills */
  overflow: hidden;
}

.xfnano-subnav ul.expanded {
  max-height: none;
}

.xfnano-subnav li {
  margin: 0;
  padding: 0;
}

.xfnano-subnav a {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--brand);
  color: var(--text-main);
  background: #fff;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  transition: all 0.2s ease;
}

.xfnano-subnav a:hover {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 8px rgba(58, 142, 230, 0.35);
  text-decoration: none;
}

.xfnano-subnav li.current a,
.xfnano-subnav a.active {
  background: #fff;
  border-color: var(--brand);
  color: var(--brand);
  box-shadow: 0 0 0 2px rgba(58, 142, 230, 0.12);
}

.caret-icon {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 4px;
  vertical-align: middle;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #333;
  transition: transform 0.15s ease;
}

.caret-icon.caret-down {
  transform: rotate(180deg);
}

@media (max-width: 768px) {
  .xfnano-subnav {
    padding: 0;
    margin: 6px 0 12px;
  }

  .xfnano-subnav a {
    padding: 6px 10px;
    font-size: 13px;
  }
}

/* Stabilize product slider arrows */
.proinfo_box h1.product_h1 {
  border-bottom: 1px solid #d7d7d7;
  padding-bottom: 6px;
  margin-bottom: 10px;
}

.proinfo_box .product_con {
  border-top: none !important;
  padding-top: 0;
}

.product-actions {
  margin-top: auto;
}

@media (max-width: 768px) {
  .product-image img {
    height: 220px;
  }
  .product-body {
    padding: 1.35rem 1.35rem 1.6rem;
  }
  .products-grid .product-wrapper {
    display: block;
    align-items: initial;
  }
  .product-image {
    min-height: 0;
  }
  .product-image img {
    height: auto;
    max-height: 240px;
  }
  .product-body {
    gap: 0.6rem;
  }
  .product-desc {
    min-height: 0;
  }
  .product-meta {
    min-height: 0;
    padding: 0.6rem 0.8rem;
  }
}

/* About content typography override */
.about_content {
  font-size: 16px;
  line-height: 32px;
  padding: 60px 25px 25px 25px;
}

.news_desc {
  font-size: 13px;
  line-height: 24px;
}

/* Responsive tweaks */
@media (max-width: 768px) {
  .category-card,
  .products-grid .card {
    padding: 1.75rem;
  }
  .section {
    padding: 40px 0;
  }
  .section-title {
    font-size: 1.9rem;
  }
}
