/* ============================================================
   TechStyle — Shared components: header, footer, cards, nav
   ============================================================ */

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--border-soft);
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 84px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}
.brand-logo { width: 42px; height: 42px; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 21px;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.brand-name span { color: var(--primary); }
.brand-tag {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-light);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 30px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  color: var(--ink-soft);
}
.main-nav a {
  position: relative;
  padding: 6px 0;
  transition: color 0.2s var(--ease);
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.main-nav a:hover { color: var(--primary); }
.main-nav a:hover::after { transform: scaleX(1); }
.main-nav a.is-active { color: var(--primary); }
.main-nav a.is-active::after { transform: scaleX(1); }

.header-search {
  flex: 1;
  max-width: 420px;
  margin-left: auto;
}
.header-search form {
  display: flex;
  align-items: center;
  background: var(--bg-soft);
  border: 1.5px solid transparent;
  border-radius: var(--radius-full);
  padding: 4px 4px 4px 20px;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.header-search form:focus-within {
  border-color: var(--primary);
  background: #fff;
}
.header-search input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  padding: 8px 0;
  color: var(--ink);
}
.header-search input::placeholder { color: var(--muted-light); }
.header-search button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s var(--ease);
}
.header-search button svg { width: 17px; height: 17px; }
.header-search button:hover { background: var(--primary-dark); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
}
.header-action-link {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.header-action-link svg { width: 21px; height: 21px; }
.header-action-link:hover {
  background: var(--primary-light);
  color: var(--primary);
}
.icon-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 50%;
  background: var(--accent-red);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}
.nav-toggle svg { width: 24px; height: 24px; }

/* ---------- Sub nav / category bar ---------- */
.sub-nav {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border-soft);
}
.sub-nav .container {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 54px;
}
.category-toggle-wrap { position: relative; flex-shrink: 0; }
.category-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  transition: background 0.2s var(--ease);
}
.category-toggle svg { width: 17px; height: 17px; }
.category-toggle:hover { background: var(--primary-dark); }

.category-panel {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 300px;
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 10px;
  z-index: 50;
}
.category-panel.is-open { display: block; }
.category-panel a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.category-panel a:hover { background: var(--primary-light); color: var(--primary); }
.category-panel a svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--primary); }

.sub-nav .main-nav { font-size: 14.5px; }

/* ---------- Breadcrumb / page header ---------- */
.page-header {
  background: var(--bg-soft);
  padding: 22px 0;
  border-bottom: 1px solid var(--border-soft);
}
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
}
.breadcrumb a { transition: color 0.2s var(--ease); white-space: nowrap; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { color: var(--muted-light); }
.breadcrumb .current { color: var(--ink); }
.page-header h1 {
  font-size: 26px;
  margin-top: 6px;
}

/* ---------- Product Card ---------- */
.product-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
  position: relative;
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}
.product-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg-soft);
}
.product-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}
.product-card:hover .product-card__media img {
  transform: scale(1.08);
}
.product-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
}
.product-card__wish {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), color 0.2s var(--ease);
}
.product-card__wish svg { width: 16px; height: 16px; }
.product-card:hover .product-card__wish {
  opacity: 1;
  transform: translateY(0);
}
.product-card__wish:hover { color: var(--accent-red); }

.product-card__body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.product-card__name {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 42px;
}
.product-card__name:hover { color: var(--primary); }
.product-card__specs {
  font-size: 12.5px;
  color: var(--muted);
}
.product-card__price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 2px;
}
.product-card__price {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 800;
  color: var(--accent-red);
}
.product-card__price-old {
  font-size: 12.5px;
  color: var(--muted-light);
  text-decoration: line-through;
}
.product-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 6px;
}
.product-card__cart {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}
.product-card__cart svg { width: 17px; height: 17px; }
.product-card__cart:hover {
  background: var(--primary);
  color: #fff;
  transform: scale(1.08);
}

/* ---------- Category card ---------- */
.category-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.category-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-sm);
  border-color: var(--primary);
}
.category-card__icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), transform 0.3s var(--ease);
}
.category-card__icon svg { width: 28px; height: 28px; }
.category-card:hover .category-card__icon {
  background: var(--primary);
  color: #fff;
  transform: rotate(-6deg) scale(1.05);
}
.category-card__name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14.5px;
  color: var(--ink);
}
.category-card__sub {
  font-size: 12px;
  color: var(--muted-light);
  margin-top: -6px;
}

/* ---------- Brand strip ---------- */
.brand-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 20px;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
  filter: grayscale(1);
  opacity: 0.65;
}
.brand-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-sm);
  border-color: var(--primary);
  filter: grayscale(0);
  opacity: 1;
}
.brand-card span {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.02em;
  color: var(--ink);
}

/* ---------- Article grid + card ---------- */
.article-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.article-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.article-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}
.article-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.article-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}
.article-card:hover .article-card__media img { transform: scale(1.08); }
.article-card__tag {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(7, 20, 51, 0.85);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-full);
}
.article-card__body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.article-card__title {
  font-family: var(--font-heading);
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 44px;
  transition: color 0.2s var(--ease);
}
.article-card:hover .article-card__title { color: var(--primary); }
.article-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--muted);
}
.article-card__meta .link-arrow { font-size: 12.5px; }

/* ---------- Slider arrows (shared) ---------- */
.slider-arrows { display: flex; align-items: center; gap: 8px; }
.slider-arrow {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.slider-arrow svg { width: 16px; height: 16px; }
.slider-arrow:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.slider-arrow.swiper-button-disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-900);
  color: #b9c2d6;
  padding-top: 64px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.footer-brand .brand-name { color: #fff; }
.footer-brand .brand-tag { color: #7c8bab; }
.footer-about {
  margin-top: 16px;
  font-size: 13.5px;
  line-height: 1.7;
  color: #8a93ab;
  max-width: 300px;
}
.footer-social {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.footer-social a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}
.footer-social a svg { width: 16px; height: 16px; }
.footer-social a:hover {
  background: var(--primary);
  transform: translateY(-3px);
}
.footer-col h4 {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 18px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 12px; }
.footer-col a {
  font-size: 13.5px;
  color: #9aa4bd;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.2s var(--ease), transform 0.2s var(--ease);
}
.footer-col a svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--primary); }
.footer-col a:hover { color: #fff; transform: translateX(3px); }
.footer-contact li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: #9aa4bd;
  line-height: 1.6;
}
.footer-contact svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; color: var(--primary); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
  font-size: 13px;
  color: #7c8bab;
}
.back-to-top {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}
.back-to-top svg { width: 18px; height: 18px; }
.back-to-top:hover { background: var(--primary-dark); transform: translateY(-3px); }

/* ---------- Mobile nav drawer ---------- */
.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 10, 28, 0.55);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}
.mobile-nav-overlay.is-open { opacity: 1; pointer-events: auto; }
.mobile-nav {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 86vw);
  background: #fff;
  z-index: 201;
  padding: 24px;
  transform: translateX(100%);
  transition: transform 0.35s var(--ease);
  overflow-y: auto;
}
.mobile-nav.is-open { transform: translateX(0); }
.mobile-nav-close {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  margin-bottom: 20px;
}
.mobile-nav-close svg { width: 18px; height: 18px; }
.mobile-nav-links {
  display: flex;
  flex-direction: column;
}
.mobile-nav-links a {
  padding: 14px 4px;
  border-bottom: 1px solid var(--border-soft);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
}
.mobile-nav-links a.is-active { color: var(--primary); }
