/*
Theme Name: Baxin
Theme URI: https://www.cnbaxin.com
Author: Wenzhou Baxin Electronic Technology
Description: Custom catalogue theme for Wenzhou Baxin Electronic Technology — auto connectors, crimp terminals, wiring harnesses and tools. Four-language UI (EN / 中文 / Русский / Español), product catalogue driven by custom post types.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.1
License: Proprietary
Text Domain: baxin
*/

/*
 * The visual design lives in assets/css/style.css and its siblings, ported
 * unchanged from the original site so the WordPress build matches it exactly.
 * This file only holds the small amount of CSS WordPress itself needs.
 */

/* WordPress core alignment classes */
.alignleft { float: left; margin: 0 20px 20px 0; }
.alignright { float: right; margin: 0 0 20px 20px; }
.aligncenter { display: block; margin: 0 auto 20px; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 13px; color: #6b7280; text-align: center; }
.sticky, .bypostauthor { position: relative; }

/* Skip link, visible only on keyboard focus */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100000;
  padding: 10px 16px;
  background: #111;
  color: #fff;
}
.skip-link:focus { left: 0; }
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

/* Admin bar offset on the fixed header */
.admin-bar .header-navigation.sticky { top: 32px; }
@media screen and (max-width: 782px) {
  .admin-bar .header-navigation.sticky { top: 46px; }
}

/* Enquiry honeypot: hidden from people, still reachable by bots */
.bx-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Form feedback */
.form-message {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.5;
}
.form-message-ok { color: #1a7f37; }
.form-message-error { color: #b42318; }

/* Language switcher: the markup is shared with the original site, but links
   replace React buttons, so the active row needs an anchor-friendly style. */
.lang-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
}
.lang-menu a.is-active { font-weight: 600; }
.lang-trigger { cursor: pointer; }

/* Product cards: model numbers are the only label, so keep them readable */
.product-item .product-info .title a { word-break: break-word; }
.product-sub {
  display: inline-block;
  margin-top: 4px;
  font-size: 13px;
  color: #6b7280;
}

/* Series filter list in the catalogue sidebar */
.category-nav li.is-active > a { font-weight: 600; }

/* Pagination: the original markup expects the theme's p-list classes */
.page-pagination .p-list li span,
.page-pagination .p-list li a { cursor: pointer; }

/* Empty state */
.bx-empty {
  padding: 40px 0;
  color: #6b7280;
}

/* Video modal, moved here from the SPA build */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.86);
}
.video-modal-inner {
  position: relative;
  width: min(1100px, 100%);
}
.video-modal video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 82vh;
  background: #000;
  border-radius: 4px;
}
.video-modal-close {
  position: absolute;
  top: -44px;
  right: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.video-modal-close:hover { background: rgba(255, 255, 255, 0.28); }
body.bx-modal-open { overflow: hidden; }

@media (max-width: 575px) {
  .video-modal-close { top: -40px; right: 4px; }
}

/* ---------- Mobile drawer ----------
   The bundled template stylesheet hides the hamburger at every width, and the
   drawer only exists once `.breakpoint-on` is on the header. Both rules are
   re-declared here because this file loads last. */
.header-right-nav ul li.navbar-toggle-btn { display: none; }

.header-navigation.breakpoint-on .header-right-nav ul li.navbar-toggle-btn {
  display: inline-flex;
  align-items: center;
}

.header-navigation.breakpoint-on .header-right-nav ul li.navbar-toggle-btn .navbar-toggler {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 30px;
  height: 26px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.header-navigation.breakpoint-on .header-right-nav .navbar-toggler span {
  display: block;
  width: 100%;
  height: 2px;
  background: #141d38;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Menu list must stay off-canvas until the drawer is opened. */
.header-navigation.breakpoint-on .nav-menu:not(.menu-on) {
  left: -300px;
}

/* ---------- Language dropdown ----------
   Declared again so the collapsed state wins over the template's list styles. */
.lang-switcher .lang-menu {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.lang-switcher.is-open .lang-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
