/* preview-tune.css — aesthetic polish for /preview only (no design-system fork) */

/* ── Header / subnav parity with main (72px nav) ─────────── */
.preview-subnav {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    border-bottom: 1px solid var(--border-light, #e8eef5);
    position: sticky;
    top: 72px;
    z-index: 890;
}
.preview-subnav-inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0.4rem 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 0.25rem;
    align-items: center;
    justify-content: flex-end;
}
.preview-subnav a {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted, #5A6B74);
    text-decoration: none;
    padding: 0.28rem 0.75rem;
    border-radius: 999px;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
    letter-spacing: 0.2px;
}
.preview-subnav a:hover {
    color: var(--primary, #236B82);
    background: var(--primary-glow, rgba(35, 107, 130, 0.08));
}
.preview-subnav a.active {
    color: var(--primary, #236B82);
    font-weight: 700;
    background: var(--primary-glow, rgba(35, 107, 130, 0.12));
}
.preview-subnav a i { margin-right: 0.25rem; font-size: 0.7rem; }

/* Products sticky cat-tabs under header + subnav */
body:has(.preview-subnav) .cat-tab-wrap:not(.preview-filter-tabs) {
    top: 112px !important;
}

@media (max-width: 900px) {
    .preview-subnav { display: none; }
    body:has(.preview-subnav) .cat-tab-wrap:not(.preview-filter-tabs) {
        top: 72px !important;
    }
}

/* ── Mobile menu ─────────────────────────────────────────── */
.mobile-menu a.active {
    color: var(--primary, #236B82);
    font-weight: 700;
    background: var(--primary-glow, rgba(35, 107, 130, 0.08));
}
.mobile-menu a.mobile-cta {
    background: var(--primary, #236B82);
    color: #fff !important;
    border-color: var(--primary, #236B82);
    margin-top: 0.5rem;
}
.mobile-menu a.mobile-cta i { color: #fff; }

/* ── Page hero: tighter + clearer hierarchy ──────────────── */
.page-hero {
    padding: 4.75rem 2rem 3.25rem !important;
}
.page-hero::after {
    height: 40px !important; /* less ellipse → less white gap */
}
.page-hero-eyebrow {
    margin-bottom: 0.65rem !important;
    letter-spacing: 3.5px !important;
}
.page-hero h1 {
    line-height: 1.15;
    margin: 0 auto;
    max-width: 18ch;
}
.page-hero-lead {
    margin: 0.85rem auto 0;
    max-width: 36rem;
    font-size: clamp(0.92rem, 1.6vw, 1.05rem);
    line-height: 1.55;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.82);
    letter-spacing: 0.2px;
}

/* Cut hero → content gap (main homepage rhythm, not 7rem) */
.page-hero + .section,
.page-hero + .section.categories-section,
.page-hero + main {
    padding-top: 2.25rem !important;
}
.page-hero + .section {
    padding-bottom: 5rem;
}
@media (max-width: 768px) {
    .page-hero { padding: 4rem 1.25rem 2.75rem !important; }
    .page-hero + .section,
    .page-hero + .section.categories-section { padding-top: 1.75rem !important; }
}

/* ── Empty states ────────────────────────────────────────── */
.preview-empty {
    text-align: center;
    color: var(--text-muted, #5A6B74);
    padding: 2.5rem 1rem;
}
.preview-empty > i {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    display: block;
    opacity: 0.4;
}
.preview-empty a {
    color: var(--primary, #236B82);
    font-weight: 600;
}

/* ── About prose: stronger contrast, tighter rhythm ──────── */
.preview-prose {
    max-width: 720px;
    margin: 0 auto;
    line-height: 1.75;
    color: var(--text-body, #334852);
    font-size: 1.02rem;
}
.preview-prose p {
    margin-bottom: 1rem;
    color: var(--text-body, #334852);
}
.preview-prose p:last-child { margin-bottom: 0; }

/* Tighten about section headers a touch vs main 4rem */
.section .section-header { margin-bottom: 2.75rem; }
.preview-section-head { margin-bottom: 1.75rem !important; }

.preview-cta-block { text-align: center; }
.preview-cta-block .section-desc {
    margin-bottom: 1.75rem;
    color: var(--text-body, #334852);
}
.preview-cta-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
}
.preview-cta-actions .category-link { margin-top: 0; }

/* ── Search form ─────────────────────────────────────────── */
.preview-search-form {
    max-width: 640px;
    margin: 0 auto 2.25rem;
}

/* ── Footer hours note ───────────────────────────────────── */
.footer-hours-note {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.75rem;
}
.footer-hours-note i { margin-right: 0.4rem; }

/* ── Filter tabs (projects/catalog) — cat-tab look, not sticky */
.preview-filter-tabs.cat-tab-wrap {
    position: static;
    top: auto;
    box-shadow: none;
    margin: 0 0 1.5rem;
    background: transparent;
    border-bottom: none;
}
.preview-filter-tabs .cat-tab-inner {
    padding: 0;
    border-bottom: 1px solid var(--border-light, #e8eef5);
    gap: 0;
}

/* ── Card grid polish: even gaps + reserved media box ────── */
.product-grid {
    gap: 1.25rem !important;
}
.prod-card-img {
    aspect-ratio: 4 / 3;
    background: var(--bg-page, #f4f7f9);
}
.prod-card-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.prod-card-img picture {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

/* Catalog / promotions: slightly larger radius to match --r-md brand */
.prod-card {
    border-radius: var(--r-md, 16px);
    overflow: hidden;
}

/* Index category cards — ensure image area never collapses */
.category-img-wrap {
    aspect-ratio: 16 / 10;
    display: flex;
    align-items: center;
    justify-content: center;
}
.category-img-wrap img {
    max-height: 100%;
    width: auto;
    object-fit: contain;
}

/* ── Single-row nav: hide legacy subnav, add "更多" dropdown ── */
.preview-subnav { display: none !important; }

.nav-item-more {
  position: relative;
  list-style: none;
}
.nav-more-btn {
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  opacity: 0.92;
}
.nav-more-btn:hover,
.nav-more-btn.active,
.nav-item-more.is-active .nav-more-btn {
  color: var(--primary, #236B82);
  opacity: 1;
}
.nav-more-btn i {
  font-size: 0.65rem;
  transition: transform 0.2s ease;
}
.nav-more-btn[aria-expanded="true"] i {
  transform: rotate(180deg);
}
.nav-more-menu {
  position: absolute;
  top: calc(100% + 0.75rem);
  left: 50%;
  transform: translateX(-50%);
  min-width: 10.5rem;
  margin: 0;
  padding: 0.4rem 0;
  list-style: none;
  background: #fff;
  border: 1px solid rgba(16, 42, 53, 0.08);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(16, 42, 53, 0.12);
  z-index: 80;
}
.nav-more-menu li { margin: 0; }
.nav-more-menu a {
  display: block;
  padding: 0.55rem 1rem;
  white-space: nowrap;
  color: var(--text-body, #334852);
  text-decoration: none;
  font-size: 0.92rem;
}
.nav-more-menu a:hover,
.nav-more-menu a.active {
  background: rgba(35, 107, 130, 0.08);
  color: var(--primary, #236B82);
}
.nav-more-menu a i { margin-right: 0.35rem; font-size: 0.75rem; }

/* Products sticky tabs: only under single header (no subnav height) */
body:has(.preview-subnav) .cat-tab-wrap:not(.preview-filter-tabs) {
  top: 72px;
}
@media (max-width: 980px) {
  .nav-item-more { display: none; }
}


/* card-polish 20260922 — full-color image cards (no grayscale) */
/* Hover lift, warm card ground, unified 4/3 crop, title weight */

.prod-card {
    background: #f7f5f2;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.prod-card:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 12px 28px rgba(16, 42, 53, 0.14);
    border-color: var(--border-mid, rgba(35, 107, 130, 0.28));
}

.prod-card-img {
    aspect-ratio: 4 / 3;
    background: #f7f5f2;
    border-radius: 0;
}

/* Lightbox grids (promotions / catalog / projects): consistent cover crop */
.prod-card-img[onclick] picture {
    display: block;
    width: 100%;
    height: 100%;
}
.prod-card-img[onclick] img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    padding: 0;
    transition: transform 200ms ease;
}
.prod-card:hover .prod-card-img[onclick] img {
    transform: scale(1.04);
}

/* Title hierarchy */
.prod-card-name {
    font-weight: 600;
    color: var(--text-main, #102A35);
    font-size: 0.9rem;
    letter-spacing: 0.01em;
}
.prod-card-code {
    color: var(--text-muted, #5A6B74);
    font-weight: 500;
}

@media (prefers-reduced-motion: reduce) {
    .prod-card,
    .prod-card-img img,
    .prod-card-img[onclick] img {
        transition: none !important;
    }
    .prod-card:hover {
        transform: none;
    }
    .prod-card:hover .prod-card-img img,
    .prod-card:hover .prod-card-img[onclick] img {
        transform: none;
    }
}


/* brand-tint thumbs 20260922 — promotions + catalog only (not projects) */
/* Soft brand blue/teal mute — NOT grayscale. Hover restores full color. */

.page-promotions .prod-card-img[onclick],
.page-catalog .prod-card-img[onclick] {
    position: relative;
    isolation: isolate;
}

.page-promotions .prod-card-img[onclick]::after,
.page-catalog .prod-card-img[onclick]::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: rgba(35, 107, 130, 0.32); /* --primary */
    mix-blend-mode: soft-light;
    opacity: 1;
    transition: opacity 200ms ease;
}

.page-promotions .prod-card-img[onclick] img,
.page-catalog .prod-card-img[onclick] img {
    filter: saturate(0.40) brightness(1.05);
    transition: transform 200ms ease, filter 200ms ease;
}

.page-promotions .prod-card:hover .prod-card-img[onclick]::after,
.page-catalog .prod-card:hover .prod-card-img[onclick]::after {
    opacity: 0;
}

.page-promotions .prod-card:hover .prod-card-img[onclick] img,
.page-catalog .prod-card:hover .prod-card-img[onclick] img {
    filter: none;
}

/* Projects: full-color thumbs, no brand fade */
.page-projects .prod-card-img[onclick] img,
.page-projects .prod-card-img img {
    filter: none !important;
}
.page-projects .prod-card-img[onclick]::after {
    display: none !important;
}

/* Lightbox full image: always full color (do not inherit card mute) */
#lightbox-img,
.lightbox-content img {
    filter: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .page-promotions .prod-card-img[onclick]::after,
    .page-catalog .prod-card-img[onclick]::after {
        transition: none !important;
    }
}

/* promo/catalog 4-col smaller thumbs 20260922 */
.page-promotions .product-grid,
.page-catalog .product-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 0.9rem !important;
    max-width: 920px;
    margin-left: auto;
    margin-right: auto;
}
.page-promotions .prod-card-img,
.page-catalog .prod-card-img {
    aspect-ratio: 4 / 3;
    max-height: 200px;
}
.page-promotions .prod-card-img[onclick] img,
.page-catalog .prod-card-img[onclick] img,
.page-promotions .prod-card-img img,
.page-catalog .prod-card-img img {
    max-height: 200px;
}
@media (max-width: 768px) {
    .page-promotions .product-grid,
    .page-catalog .product-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        max-width: none;
        gap: 0.75rem !important;
    }
    .page-promotions .prod-card-img,
    .page-catalog .prod-card-img,
    .page-promotions .prod-card-img img,
    .page-catalog .prod-card-img img,
    .page-promotions .prod-card-img[onclick] img,
    .page-catalog .prod-card-img[onclick] img {
        max-height: none;
    }
}
@media (max-width: 480px) {
    .page-promotions .product-grid,
    .page-catalog .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.6rem !important;
    }
}

/* promo/catalog thumb clarity 20260922 */
.page-promotions .prod-card-img,
.page-catalog .prod-card-img {
    aspect-ratio: 3 / 4;
    max-height: 200px;
    background: #f7f5f2;
}
.page-promotions .prod-card-img img,
.page-catalog .prod-card-img img,
.page-promotions .prod-card-img[onclick] img,
.page-catalog .prod-card-img[onclick] img {
    max-height: 200px;
    width: 100%;
    height: 100%;
    object-fit: contain !important;
    object-position: center top;
    padding: 0 !important;
    /* avoid muddy upscales of dense scans */
    image-rendering: auto;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
}
/* Restored brand fade (pre-clarity strength) — sharp images/ source kept */
.page-promotions .prod-card-img[onclick]::after,
.page-catalog .prod-card-img[onclick]::after {
    background: rgba(35, 107, 130, 0.32) !important;
}
.page-promotions .prod-card-img[onclick] img,
.page-catalog .prod-card-img[onclick] img {
    filter: saturate(0.40) brightness(1.05) !important;
}
.page-promotions .prod-card:hover .prod-card-img[onclick] img,
.page-catalog .prod-card:hover .prod-card-img[onclick] img {
    filter: none !important;
}
.page-promotions .prod-card:hover .prod-card-img[onclick]::after,
.page-catalog .prod-card:hover .prod-card-img[onclick]::after {
    opacity: 0 !important;
}
