/* ==========================================================================
   MARSTRON - rules shared by several pages (moved out of page-level <style> blocks)
   Loaded after style.css by common/header.html.
   ========================================================================== */

/* --- Accessibility helpers --- */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 5000;
  background: var(--oneplus-red);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 13px;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 12px;
}

/* --- Footer additions --- */
.footer-col .footer-col-title {
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: 0.2px;
}

.footer-brand .footer-contact-lines a {
  color: #94a3b8;
  transition: color 0.2s;
}

.footer-brand .footer-contact-lines a:hover {
  color: #ffffff;
}

.footer-custom-html {
  max-width: 1360px;
  margin: 0 auto 24px;
  font-size: 12px;
  line-height: 1.6;
  color: #94a3b8;
}

.footer-legal-links {
  display: flex;
  gap: 18px;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 8px;
}

.footer-legal-links a {
  color: #cbd5e1;
  transition: color 0.2s;
}

.footer-legal-links a:hover {
  color: #eb0028;
}

/* --- Category pill rail (home + products) --- */
.cat-rail-wrapper::-webkit-scrollbar { display: none; }
.cat-rail { display: flex; gap: 10px; padding-bottom: 4px; }
.cat-pill:hover { border-color: var(--oneplus-red); color: var(--oneplus-red); }
.cat-pill-dot {
  width: 26px; height: 26px; border-radius: 50%; background: var(--light-bg);
  display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0;
}
.cat-pill-img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }

/* --- Product card parts identical on home + products --- */
.product-img-link { display: block; width: 100%; height: 100%; }
.product-title a:hover { color: var(--oneplus-red); }
.product-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.product-view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: #383737;
  transition: all 0.2s ease;
}
.product-view-btn:hover {
  color: #fff;
  background: #323232;
  transform: translateY(-1px);
}

/* --- Compact product card (common/product_item.html) --- */
.mini-card {
  background: #fff; border: 1px solid var(--border-light); border-radius: var(--radius-md); overflow: hidden;
  display: flex; flex-direction: column; position: relative; transition: var(--transition);
}
.mini-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: #cbd5e1; }
.mini-card-badge {
  position: absolute; top: 10px; left: 10px; background: var(--oneplus-red); color: #fff;
  font-size: 10px; font-weight: 800; padding: 3px 9px; border-radius: var(--radius-pill); z-index: 2;
}
.mini-card-media { display: block; background: var(--light-bg); height: 200px; overflow: hidden; }
.mini-card-media img { width: 100%; height: 100%; object-fit: contain; padding: 12px; box-sizing: border-box; transition: transform 0.5s ease; } /* whole photo, not cropped */
.mini-card:hover .mini-card-media img { transform: scale(1.05); }
.mini-card-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; flex-grow: 1; }
.mini-card-title { font-size: 13px; font-weight: 700; color: var(--text-main); line-height: 1.4; }
.mini-card-title a { color: inherit; text-decoration: none; transition: color 0.2s; }
.mini-card-title a:hover { color: var(--oneplus-red); }
.mini-card-summary {
  font-size: 12.5px; color: var(--text-muted); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mini-card-price { display: flex; align-items: baseline; gap: 6px; margin-top: auto; }
.mini-card-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid #f1f5f9; }
.mini-card-price-now { font-size: 15px; font-weight: 800; color: var(--oneplus-red); }
.mini-card-price-was { font-size: 11px; color: var(--text-light); text-decoration: line-through; }
@media (max-width: 768px) {
  .mini-card-media { height: 140px; }
}

/* --- Blog cards (blogs list + related posts on blog details) --- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

@media (max-width: 1024px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .blog-grid { grid-template-columns: 1fr; }
}

.blog-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  color: inherit;
  text-decoration: none;
}

.blog-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
  border-color: #cbd5e1;
}

.blog-card-media {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  background: #0f172a;
}

.blog-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.blog-card:hover .blog-card-media img {
  transform: scale(1.06);
}

.blog-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(13, 15, 18, 0.85);
  backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.blog-card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.blog-meta-row {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: #64748b;
  margin-bottom: 12px;
  font-weight: 500;
}

.blog-card-title {
  font-size: 19px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.35;
  margin-bottom: 12px;
  transition: color 0.2s;
}

.blog-card:hover .blog-card-title {
  color: var(--oneplus-red);
}

.blog-card-excerpt {
  font-size: 14px;
  color: #475569;
  line-height: 1.6;
  margin-bottom: 24px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

.blog-card-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  border-top: 1px solid #f1f5f9;
  padding-top: 16px;
  margin-top: auto;
}

.read-full-btn {
  font-size: 13px;
  font-weight: 700;
  color: var(--oneplus-red);
  transition: transform 0.2s;
}

.blog-card:hover .read-full-btn {
  transform: translateX(4px);
}

/* --- Simple numbered pagination (blogs) --- */
.page-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 48px;
  flex-wrap: wrap;
}

.page-links a,
.page-links span {
  min-width: 40px;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  border: 1px solid var(--border-light);
  background: #ffffff;
  color: var(--text-main);
}

.page-links a:hover {
  background: var(--dark-primary);
  border-color: var(--dark-primary);
  color: #ffffff;
}

.page-links .is-current {
  background: var(--oneplus-red);
  border-color: var(--oneplus-red);
  color: #ffffff;
}

.page-links .is-disabled {
  opacity: 0.4;
}

/* --- Empty state (blogs etc.) --- */
.empty-block {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
}

.empty-block h2 { font-size: 18px; font-weight: 800; color: var(--text-main); margin-bottom: 6px; }
.empty-block p { font-size: 13px; color: var(--text-muted); }

/* --- Inline form status message (contact / warranty / notify) --- */
.form-status {
  margin-top: 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  padding: 10px 14px;
}

.form-status[hidden] { display: none; }
.form-status.is-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.form-status.is-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

/* --- Mobile bottom navigation (common/mobile_bottom_nav.html) --- */
:root { --bottom-nav-h: 64px; }
.bottom-nav { display: none; }

@media (max-width: 992px) {
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 990;
    height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
    padding: 0 6px env(safe-area-inset-bottom);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-light);
    box-shadow: 0 -6px 24px rgba(13, 15, 18, 0.06);
  }
  .bottom-nav-item {
    flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px; min-width: 0; font-size: 10.5px; font-weight: 600; letter-spacing: 0.2px; color: var(--text-muted);
    -webkit-tap-highlight-color: transparent; transition: color 0.2s;
  }
  .bottom-nav-item svg {
    width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8;
    stroke-linecap: round; stroke-linejoin: round;
  }
  .bottom-nav-item.is-active { color: var(--oneplus-red); font-weight: 800; }
  .bottom-nav-item.is-active::before {
    content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--oneplus-red);
  }
  .bottom-nav-item:active { color: var(--oneplus-red); }
  .bottom-nav-item:focus-visible { outline: 2px solid var(--oneplus-red); outline-offset: -4px; border-radius: 10px; }
  .bottom-nav-icon { position: relative; display: inline-flex; }
  .bottom-nav-badge {
    position: absolute; top: -5px; right: -9px; min-width: 17px; height: 17px; padding: 0 4px;
    border-radius: var(--radius-pill); background: var(--oneplus-red); color: #fff; border: 2px solid #fff;
    font-size: 9px; font-weight: 800; line-height: 13px; text-align: center;
  }
  .bottom-nav-badge[hidden] { display: none; }

  /* Keep page content, toasts and sticky bars clear of the nav */
  body { padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); }
  .toast-container { bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 12px); right: 12px; left: 12px; }
  .mobile-pdp-sticky-bar { bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)) !important; padding-bottom: 10px !important; }
}

@media print { .bottom-nav { display: none !important; } }

/* --- Brand lockup: logo icon + MARSTRON wordmark (images/brand/) --- */
.brand-logo { gap: 10px; line-height: 0; flex-shrink: 0; }
.brand-logo .brand-icon { height: 40px; width: auto; display: block; }
.brand-logo .brand-wordmark { height: 18px; width: auto; display: block; }
.brand-logo-footer .brand-icon { height: 52px; }
.brand-logo-footer .brand-wordmark { height: 22px; }
.footer-brand .brand-tagline {
  margin: 10px 0 14px; font-size: 10.5px; font-weight: 700; letter-spacing: 1.4px;
  text-transform: uppercase; color: #ff5a1f;
}
.mobile-drawer-header .brand-icon { height: 34px; }
.mobile-drawer-header .brand-wordmark { height: 15px; }

@media (max-width: 992px) {
  /* Account lives in the bottom nav on phones/tablets */
  .nav-actions .account-menu { display: none; }
}
@media (max-width: 768px) {
  .brand-logo { gap: 7px; }
  .brand-logo .brand-icon { height: 32px; }
  .brand-logo .brand-wordmark { height: 14px; }
}
@media (max-width: 380px) {
  .brand-logo .brand-wordmark { height: 12px; }
}

/* --- Hero slides: product shown without the white photo box --------------------------------
   .is-cutout      transparent product image (hero-*.webp): floats on the dark slide with a soft
                   shadow and the red glow behind it.
   .has-stage      photo that still has its white studio background (earbuds): a light circular
                   "stage" sits behind it and mix-blend-mode: multiply melts the white photo
                   background into the stage, so no rectangle shows. Use it for any product photo
                   that cannot be cut out cleanly (white product on a white background).         */
.hero-media-wrap { min-height: 440px; }
.hero-media-wrap img.is-cutout {
  height: 460px; max-width: 520px; object-fit: contain;
  border: none; border-radius: 0; box-shadow: none; background: none;
  filter: drop-shadow(0 28px 38px rgba(0, 0, 0, 0.65)) drop-shadow(0 0 40px rgba(235, 0, 40, 0.16));
}
.hero-media-wrap .glow-backdrop { width: 460px; height: 460px; }

.hero-media-wrap.has-stage { background: #08090b; isolation: isolate; }  /* blend against the section colour: the slide fades in inside its own layer */
.hero-media-wrap .hero-stage {
  position: absolute; z-index: 1; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle at 38% 30%, #f3f6fb 0%, #d9e0ee 62%, #b9c4da 100%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 0 10px rgba(255, 255, 255, 0.05), 0 0 90px rgba(235, 0, 40, 0.22);
}
.hero-media-wrap img.is-stage-photo {
  height: 460px; max-width: 520px; object-fit: contain; mix-blend-mode: multiply;
  clip-path: inset(2px);  /* hide the photo's 1px edge rows */
  border: none; border-radius: 0; box-shadow: none; background: none;
}
.hero-media-wrap:hover img.is-cutout, .hero-media-wrap:hover img.is-stage-photo { transform: translateY(-6px) scale(1.02); }

@media (max-width: 768px) {
  .hero-media-wrap { min-height: 280px; }
  .hero-media-wrap img.is-cutout, .hero-media-wrap img.is-stage-photo { max-height: 280px; height: 280px; }
  .hero-media-wrap .glow-backdrop { width: 260px; height: 260px; }
  .hero-media-wrap .hero-stage { width: 250px; height: 250px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-media-wrap:hover img.is-cutout, .hero-media-wrap:hover img.is-stage-photo { transform: none; }
}
