:root {
  color-scheme: light;
  --page-surface: #faf9f6;
  --panel-surface: #fff;
  --panel-muted: #f3f2ed;
  --panel-line: #deddd6;
  --glass-surface: linear-gradient(125deg, #fffffff0, #ffffffa6);
  --glass-edge: #ffffffed;
  --cover-wash: linear-gradient(90deg, #faf8f2fa 0%, #faf8f2ed 32%, #faf8f263 58%, #faf8f200 78%);
  --cover-text: #21221d;
  --cover-muted: #45483f;
  --cover-label: #674900;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page-surface: #080808;
  --panel-surface: #191919;
  --panel-muted: #111111;
  --panel-line: #3b3b3b;
  --glass-surface: linear-gradient(125deg, #101010fe, #050505fc);
  --glass-edge: #393939;
  --cover-wash: linear-gradient(90deg, #151515fa 0%, #151515e8 32%, #1515156b 60%, #15151512 83%);
  --cover-text: #f6f6f6;
  --cover-muted: #e4e4e4;
  --cover-label: #ffce58;
  --mf-black: #f5f5f5;
  --mf-text-main: #f1f1f1;
  --mf-text-muted: #c3c3c3;
  --mf-text-light: #b6b6b6;
  --mf-border: var(--panel-line);
  --mf-bg-card: var(--panel-surface);
  --mf-bg-light: var(--panel-muted);
  --mf-bg-muted: var(--panel-muted);
}
body { background: var(--page-surface); }
.site-header, .site-header.scrolled {
  background: var(--glass-surface) !important;
  border: 1px solid var(--glass-edge) !important;
  border-radius: 32px !important;
  backdrop-filter: blur(26px) saturate(150%);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  box-shadow: 0 10px 30px #15180f14, inset 0 1px 0 #ffffff4a !important;
}
.theme-toggle {
  display: grid;
  place-items: center;
  inline-size: 62px;
  min-block-size: 44px;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: #5d6055;
  cursor: pointer;
  border-radius: 999px;
}
.theme-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  place-items: center;
  inline-size: 100%;
  block-size: 32px;
  border: 1px solid var(--panel-line);
  border-radius: inherit;
  background: var(--panel-muted);
}
.theme-track::before {
  content: '';
  position: absolute;
  inset: 2px auto 2px 2px;
  inline-size: calc(50% - 2px);
  border: 1px solid #b78319;
  border-radius: inherit;
  background: #fff8e5;
  transition: transform .16s ease;
}
.theme-icon { position: relative; display: block; }
.theme-sun { width: 10px; height: 10px; border: 1.5px solid currentColor; border-radius: 100%; }
.theme-sun::before {
  content: '';
  position: absolute;
  width: 2px;
  height: 2px;
  top: 2.5px;
  left: 2.5px;
  border-radius: 50%;
  box-shadow: 0 -7px, 0 7px, 7px 0, -7px 0, 5px 5px, -5px 5px, 5px -5px, -5px -5px;
}
.theme-moon { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 4px -2px 0 currentColor; transform: rotate(-18deg); }
.theme-toggle[aria-checked="false"] .theme-sun { color: #805900; }
.theme-toggle[aria-checked="true"] { color: #c4c4c4; }
.theme-toggle[aria-checked="true"] .theme-track::before { transform: translateX(100%); background: #2a2a2a; }
.theme-toggle[aria-checked="true"] .theme-moon { color: #ffd474; }
.theme-toggle:hover .theme-track { border-color: #a77d20; }
@media (max-width: 480px) { .theme-toggle { inline-size: 54px; } }
@media (prefers-reduced-motion: reduce) { .theme-track::before { transition: none; } }
.project-hero {
  position: relative;
  isolation: isolate;
  background: #d8d9cd !important;
  min-height: clamp(510px, 48vw, 660px);
  display: grid;
  align-items: center;
  padding-block: 48px;
}
.project-cover, .project-hero::after { position: absolute; inset: 0; width: 100%; height: 100%; }
.project-cover { z-index: -2; object-fit: cover; object-position: center 54%; filter: saturate(.73); }
.project-hero::after { content: ''; z-index: -1; background: var(--cover-wash); pointer-events: none; }
.project-hero .hero-grid { display: block; }
.project-hero .hero-content { width: min(100%, 570px); text-align: left; }
.project-hero h1 { color: var(--cover-text); }
.project-hero .section-subtitle { color: var(--cover-muted); }
.project-hero .project-eyebrow { color: var(--cover-label); }
.home-search { position: relative; }
.home-search label, .hero-catalog-link { color: var(--cover-text); }
.hero-catalog-link:hover { color: var(--cover-label); }
.home-search-controls {
  background: var(--panel-surface);
  border-color: var(--panel-line);
  box-shadow: 0 4px 18px #1415091c;
}
.home-search input {
  min-height: 44px;
  background: var(--panel-surface);
  color: var(--mf-text-main);
}
.home-search-results {
  position: absolute;
  z-index: 3;
  inset: calc(100% + 7px) 0 auto;
  max-height: 270px;
  overflow: auto;
  padding: 4px;
  list-style: none;
  border: 1px solid var(--panel-line);
  border-radius: 10px;
  background: var(--panel-surface);
  color: var(--mf-text-main);
  box-shadow: 0 10px 30px #0003;
}
.home-search-results li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 8px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-size: .875rem;
}
.home-search-results small { color: var(--mf-text-muted); flex: none; }
.home-search-results li:hover, .home-search-results li[aria-selected="true"] { background: var(--panel-muted); }
.product-card .product-card-actions .buy-now, .detail-cta-box .buy-now {
  background: #ffb511;
  color: #211706;
  border-color: #ffb511;
}
.product-card .product-card-actions .buy-now:hover, .detail-cta-box .buy-now:hover {
  background: #e9a30d;
  color: #211706;
  border-color: #e9a30d;
}
.site-footer { background: #0c0d0b !important; }
[data-theme="dark"] .brand-logo-img { content: url('../images/logo/masterfix-logo-horizontal-dark.svg'); }
[data-theme="dark"] .mobile-menu,
[data-theme="dark"] .catalog-controls,
[data-theme="dark"] .catalog-status-bar,
[data-theme="dark"] .product-card,
[data-theme="dark"] .application-card,
[data-theme="dark"] .trust-card,
[data-theme="dark"] .about-values > *,
[data-theme="dark"] .detail-cta-box,
[data-theme="dark"] .specs-table,
[data-theme="dark"] .extra-filters select,
[data-theme="dark"] .search-input,
[data-theme="dark"] .section[style*="background"],
[data-theme="dark"] .section-sm[style*="background"] {
  background: var(--panel-surface) !important;
  border-color: var(--panel-line) !important;
  color: var(--mf-text-main);
}
[data-theme="dark"] .project-quote,
[data-theme="dark"] .application-section,
[data-theme="dark"] .about-principles,
[data-theme="dark"] .catalog-hero,
[data-theme="dark"] .product-detail-section {
  background: var(--panel-muted) !important;
  border-color: var(--panel-line) !important;
}
[data-theme="dark"] .project-quote p,
[data-theme="dark"] .product-availability,
[data-theme="dark"] .product-card .product-category-text,
[data-theme="dark"] .product-card .product-price-label,
[data-theme="dark"] .about-story p,
[data-theme="dark"] .about-values p,
[data-theme="dark"] .application-card p,
[data-theme="dark"] .site-header .nav-link { color: var(--mf-text-muted); }
[data-theme="dark"] .site-header .nav-link.active,
[data-theme="dark"] .site-header .nav-link:hover { color: var(--mf-text-main); }
[data-theme="dark"] .site-header .btn-whatsapp, [data-theme="dark"] .mobile-menu .btn-whatsapp {
  background: var(--panel-surface);
  color: var(--mf-text-main);
  border-color: var(--panel-line);
}
[data-theme="dark"] .site-header .btn-whatsapp svg { color: #51df88; }
[data-theme="dark"] .btn-outline { color: var(--mf-text-main); border-color: var(--panel-line); }
[data-theme="dark"] .btn-outline:hover { background: var(--panel-surface); color: var(--mf-text-main); }
[data-theme="dark"] .badge-dark { color: #fff; background: #252620; }
[data-theme="dark"] .mobile-drawer,
[data-theme="dark"] .specs-table tr:nth-child(even) { background-color: var(--panel-muted); }
[data-theme="dark"] .catalog-quote .btn-primary,
[data-theme="dark"] .section .btn-primary:not(.whatsapp-trigger) { color: #211706; }
[data-theme="dark"] .project-quote .btn-primary { color: #fff; }

[data-theme="dark"] .cta-banner {
  background: linear-gradient(135deg, #191919, #262626) !important;
  border: 1px solid #404040;
}
[data-theme="dark"] .cta-banner::after { background: #ffb5110d; }
[data-theme="dark"] .cta-banner-title { color: #f5f5f5; }
[data-theme="dark"] .cta-banner-desc { color: #d6d6d6; }
[data-theme="dark"] .cta-banner .section-tag { background: #ffb511; color: #251a09; }
[data-theme="dark"] .cta-banner .btn-whatsapp { color: #092617; }
[data-theme="dark"] .cta-banner .btn-outline { border-color: #878787; color: #f5f5f5; }
[data-theme="dark"] .trust-icon-box {
  background: #282828 !important;
  border-color: #525252 !important;
  color: #ffce58;
}
[data-theme="dark"] .trust-icon-box svg { stroke: currentColor; }
[data-theme="dark"] .categories-section .category-card { border-color: #444444; background: #202020; }
[data-theme="dark"] .categories-section .category-card-bg { opacity: 1; filter: saturate(.85); }
[data-theme="dark"] .categories-section .category-card-overlay { background: linear-gradient(0deg, #151515f2, #15151526 48%, transparent 80%); }
[data-theme="dark"] .categories-section .category-card-title { color: #fff; }
[data-theme="dark"] .categories-section .category-card-arrow { background: #ffb511; color: #251a09; }
@media (max-width: 740px) {
  :root { --cover-wash: linear-gradient(90deg, #faf8f2fa, #faf8f2cb 65%, #faf8f266); }
  :root[data-theme="dark"] { --cover-wash: linear-gradient(90deg, #151515f5, #151515ce 65%, #15151574); }
  .project-hero { min-height: 490px; }
  .project-cover { object-position: 60% center; }
  .site-header, .site-header.scrolled { border-radius: 27px !important; }
}
@media (max-width: 480px) {
  .site-header .brand-logo-img { width: clamp(100px, 30vw, 144px); }
  .nav-actions { gap: 4px; }
  .project-hero .hero-content { max-width: 100%; }
  .home-search-results li { gap: 8px; }
}
.regular-price { display: block; color: var(--mf-text-muted); font-size: .875rem; font-weight: 500; line-height: 1.4; }
.sale-price-label { display: block; color: var(--mf-text-muted); font-size: .875rem; font-weight: 650; }
.specs-table th { padding: .65rem .85rem; border: 1px solid var(--mf-border); text-align: left; overflow-wrap: anywhere; }
.specs-table td { overflow-wrap: anywhere; }
/* Product browsing and navigation across both themes. */
[data-theme="dark"] .product-detail-layout,
[data-theme="dark"] .gallery-main-viewport,
[data-theme="dark"] .gallery-thumb-btn,
[data-theme="dark"] .mobile-drawer-content,
[data-theme="dark"] #category-select {
  background: var(--panel-surface) !important;
  color: var(--mf-text-main);
  border-color: var(--panel-line);
}
[data-theme="dark"] #category-select option { background: var(--panel-surface); color: var(--mf-text-main); }
[data-theme="dark"] .mobile-nav-link { color: var(--mf-text-main); }
[data-theme="dark"] .mobile-nav-link.active { color: #ffce58; border-color: #ffb511; }
[data-theme="dark"] .mobile-drawer-content .btn-whatsapp,
[data-theme="dark"] .floating-whatsapp-btn { background: #25d366; color: #092617; }
[data-theme="dark"] .floating-whatsapp-badge { background: #202020; color: #fff; border-color: #858585; }
[data-theme="dark"] .product-status-pill { background: #243b2a; color: #b5ecc2; }
[data-theme="dark"] .product-status-dot { background: #6ada8c; }
[data-theme="dark"] .product-status-pill.status-unavailable { background: #3a3026; color: #f4d4a8; }
.product-status-pill.status-unavailable .product-status-dot { background: #b47437; }
.product-status-dot { flex: 0 0 6px; }
.product-detail-meta-bar { flex-wrap: wrap; gap: 6px 8px; }
.product-sku-box { white-space: nowrap; }
.product-detail-info { min-width: 0; }
#category-select { max-width: 100%; min-height: 44px; }
@media (max-width: 700px) {
  .catalog-results .product-grid, #featured-products-grid, #related-products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .product-card .product-card-media { aspect-ratio: 4/3; height: auto; min-height: 0; }
  .product-card .product-card-img { height: 100%; }
  .product-card .product-card-body, .catalog-results .product-card .product-card-body { padding: 10px; gap: 6px; }
  .product-card .product-card-title { font-size: .875rem; line-height: 1.3; }
  .product-card .product-category-text, .product-card .product-availability, .product-card .product-price-label { font-size: .6875rem; }
  .product-card .product-price-val { font-size: 1rem; }
  .product-card .product-price-box { flex-wrap: wrap; gap: 3px; }
  .product-card .product-card-actions .btn { font-size: .75rem; min-height: 44px; padding-inline: 5px; gap: 4px; }
  .product-card .product-card-actions .btn svg { width: 13px; height: 13px; }
  .breadcrumb { flex-wrap: wrap; justify-content: flex-start; row-gap: 4px; font-size: .8125rem; align-items: baseline; }
  .breadcrumb #breadcrumb-product, .breadcrumb .breadcrumb-product-separator { display: none; }
  .product-detail-layout { grid-template-columns: minmax(0, 1fr); padding: 14px; gap: 18px; }
  .gallery-main-viewport { padding-top: 62%; }
  .product-detail-title { font-size: clamp(1.4rem, 5.8vw, 1.85rem); }
  .product-detail-meta-bar { font-size: .75rem; margin-bottom: .8rem; }
  .product-status-pill { font-size: .75rem; }
  .floating-whatsapp-btn { width: 44px; height: 44px; animation: none; }
}
/* Keep dark surfaces neutral; brand colours belong on actions and status. */
[data-theme="dark"] .project-hero { background: #111 !important; }
[data-theme="dark"] .project-cover { filter: grayscale(1) brightness(.83); }
[data-theme="dark"] .categories-section .category-card-bg { filter: saturate(.35); }
[data-theme="dark"] .site-footer { background: #0d0d0d !important; }
[data-theme="dark"] .about-vision { background: #141414; }
[data-theme="dark"] .service-status { background: #202020; border-color: #454545; }
[data-theme="dark"] .project-quote .btn { background: #282828; border-color: #484848; }
[data-theme="dark"] .project-quote .btn:hover { background: #353535; }
[data-theme="dark"] .product-card .badge-yellow { background: #333; color: #ffd474; }
[data-theme="dark"] .badge-dark { background: #262626; }
[data-theme="dark"] .cta-banner::after { background: #ffffff08; }
[data-theme="dark"] .product-status-pill.status-unavailable { background: #303030; color: #e0e0e0; }
[data-theme="dark"] .product-status-pill.status-unavailable .product-status-dot { background: #bcbcbc; }

[data-theme='dark'] .site-header, [data-theme='dark'] .site-header.scrolled {
  backdrop-filter: blur(26px) saturate(0);
  -webkit-backdrop-filter: blur(26px) saturate(0);
  box-shadow: 0 10px 30px #0005, inset 0 1px 0 #ffffff12 !important;
}
/* The home cover continues behind the floating navigation island. */
body:has(.project-hero) { --home-header-overlap: 98px; }
body:has(.project-hero) > main { margin-top: calc(-1 * var(--home-header-overlap)); }
.project-hero {
  padding-block-start: calc(48px + var(--home-header-overlap));
  min-height: calc(clamp(510px, 48vw, 660px) + var(--home-header-overlap));
}
:root {
  --cover-wash: linear-gradient(90deg, #faf8f2f5 0%, #faf8f2d4 30%, #faf8f23d 55%, transparent 75%);
}
:root[data-theme="dark"] {
  --cover-wash: linear-gradient(90deg, #111111fa 0%, #111111e8 32%, #1111115c 59%, #1111110a 84%);
}
.project-cover, [data-theme="dark"] .project-cover { filter: none; }
.categories-section .category-card {
  display: grid;
  grid-template-rows: auto auto;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  background: var(--panel-surface);
  border-color: var(--panel-line);
}
.categories-section .category-card .category-card-bg {
  position: static;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16/10;
  object-fit: cover;
  filter: none;
  opacity: 1;
  transform: none;
}
.categories-section .category-card-content { align-items: center; padding: 13px 16px; gap: 10px; }
.categories-section .category-card-title { color: var(--mf-text-main); }
.categories-section .category-card-arrow { flex: 0 0 32px; color: #211706; }
.site-footer .footer-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px clamp(20px, 5vw, 72px);
  align-items: start;
}
@media (max-width: 950px) { body:has(.project-hero) { --home-header-overlap: 92px; } }
@media (max-width: 740px) {
  :root { --cover-wash: linear-gradient(90deg, #faf8f2f5, #faf8f2c2 64%, #faf8f247); }
  :root[data-theme="dark"] { --cover-wash: linear-gradient(90deg, #111111f5, #111111c9 66%, #1111115e); }
  .project-hero { min-height: calc(490px + var(--home-header-overlap)); }
}
@media (max-width: 700px) {
  body:has(.project-hero) { --home-header-overlap: 80px; }
  .site-footer .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 18px; }
  .site-footer .footer-col-brand { grid-column: 1 / -1; }
}
@media (max-width: 360px) {
  .site-footer .footer-grid { grid-template-columns: minmax(0, 1fr); }
}
