/* ==========================================================================
   TABLE OF CONTENTS
   1.  Design tokens
   2.  Base styles and keyboard accessibility
   3.  Topline and header navigation
   4.  Hero banner
   5.  Featured products
   6.  Categories
   7.  Service
   8.  Product single page (product.php)
   9.  Contact page (contact.php)
   10. Listing pages, breadcrumb, toolbar, pagination, back to top
   11. Footer
   12. Responsive overrides (large -> small)
   13. Reduced motion

   FONT NOTE: 'DM Sans' must be loaded in the HTML <head> (preconnect +
   <link rel="stylesheet"> with &display=swap, or a preloaded @font-face
   with font-display: swap). Arial is the fallback.
   ========================================================================== */


/* ==========================================================================
   1. DESIGN TOKENS
   ========================================================================== */
:root {
  /* Brand */
  --navy: #152b45;
  --blue: #2465b5;
  --blue-dark: #174f96;
  --blue2: #eaf2fc;
  --yellow: #e8bd3f;

  /* Text (consolidated tints; all pass 4.5:1 on white and --paper) */
  --ink: #1e2c3a;
  --text-body: #334155;     /* rich text, long-form copy */
  --text-soft: #40556b;     /* nav items, secondary labels, list items */
  --muted: #5a6b7d;         /* helper text, meta */
  --placeholder: #66768a;   /* input placeholder (was #94a3b8, too light) */
  --eyebrow: #3f6693;
  --nav-link: #526376;

  /* Surfaces */
  --paper: #f7f9fc;
  --line: #e3e9f0;
  --line-strong: #d8e1eb;   /* input and control borders */

  /* Effects */
  --shadow: 0 18px 48px rgba(23, 48, 77, .1);
  --focus: #174f96;         /* focus ring on light backgrounds */

  /* Type (--display was previously used but never defined) */
  --sans: 'DM Sans', Arial, sans-serif;
  --display: 'DM Sans', Arial, sans-serif;

  /* Layout */
  --header-offset: 150px;   /* sticky header height; used for scroll-padding and mobile menu height */

  /* Stacking scale */
  --z-slider: 10;
  --z-header: 20;
  --z-mobile-nav: 40;
  --z-dropdown: 50;
  --z-top: 99;
  --z-lightbox: 1000;
  --z-lightbox-ui: 1001;
}


/* ==========================================================================
   2. BASE STYLES AND KEYBOARD ACCESSIBILITY
   ========================================================================== */
* { box-sizing: border-box; }

html { font-size: 100%; scroll-behavior: smooth; scroll-padding-top: var(--header-offset); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.65 var(--sans); -webkit-font-smoothing: antialiased; }

img { display: block; max-width: 100%; height: auto; }

h1, h2, h3, h4, h5, h6 { margin: 0 0 .65em; color: var(--navy); font-family: var(--display); font-weight: 700; line-height: 1.2; }

/* Use one <h1> per page; h2/h3 elsewhere. Classes below keep sizes stable. */
h1 { font-size: clamp(1.75rem, 3.2vw, 2.4rem); line-height: 1.1; letter-spacing: -.04em; }
h2 { font-size: clamp(1.4rem, 2.4vw, 1.75rem); line-height: 1.18; letter-spacing: -.035em; }
h3 { font-size: 1.05rem; line-height: 1.3; }
h4 { font-size: .95rem; }
h5 { font-size: .875rem; }
h6 { font-size: .8125rem; letter-spacing: .02em; }

p { margin: 0 0 1rem; font-size: 1rem; line-height: 1.7; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }

.section { padding: clamp(16px, 2.5vw, 32px) 0; }
.wrap { width: min(1200px, calc(100% - 48px)); margin-inline: auto; }

/* Section heading row (title + optional side text/link) */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 24px; }
.section-head h2 { margin: 0; }
.section-head p { margin: 0; color: var(--muted); }

.eyebrow { margin-bottom: .5rem; display: inline-flex; align-items: center; gap: 9px; text-transform: uppercase; letter-spacing: .13em; color: var(--eyebrow); font-weight: 700; font-size: .8125rem; }
.eyebrow::before { content: ''; height: 2px; width: 20px; background: var(--yellow); }

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Focus ring: blue on light surfaces (yellow on white was ~1.8:1), yellow on dark ones */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.topline :focus-visible,
.back-to-top:focus-visible,
.lightbox-modal :focus-visible { outline-color: var(--yellow); }
::selection { background: #d5e7fb; color: var(--navy); }


/* ==========================================================================
   3. TOPLINE AND HEADER NAVIGATION
   ========================================================================== */
.topline { background: var(--navy); color: #e7eef8; font-size: .8125rem; }
.topline-inner { display: flex; justify-content: space-between; gap: 18px; padding: 8px 0; }
.topline a { text-decoration: none; color: #fff; }

/* Header container */
.site-header { position: sticky; top: 0; z-index: var(--z-header); background: rgba(255, 255, 255, .97); border-bottom: 1px solid var(--line); }
/* Blur only where it's cheap (desktop); phones keep the near-opaque fallback */
@media (min-width: 769px) {
  .site-header { -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
}
.header-main { min-height: 82px; display: grid; grid-template-columns: minmax(180px, 240px) 1fr auto; align-items: center; gap: 24px; padding: 12px 0; }

/* Brand logo */
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--navy); }
.brand-logo { width: 100%; max-width: 220px; max-height: 62px; object-fit: contain; object-position: left center; }

/* Search bar */
.search { display: flex; width: 100%; max-width: 510px; min-height: 46px; justify-self: center; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; overflow: hidden; }
.search:focus-within { outline: 3px solid rgba(36, 101, 181, .18); border-color: var(--blue); }
.search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; padding: 0 15px; color: var(--ink); }
.search input::placeholder { color: var(--placeholder); }
.search button { width: 50px; border: 0; background: var(--blue2); color: var(--blue); font-size: 1.5rem; cursor: pointer; }

/* Header action links */
.header-actions { display: flex; align-items: center; gap: 18px; white-space: nowrap; }
.header-actions a { text-decoration: none; color: var(--muted); font-weight: 600; }
.header-actions .contact-link { padding: 11px 17px; border-radius: 8px; color: #fff; background: var(--blue); }

/* Navigation bar */
.main-nav { background: #fff; }
.nav-inner { position: relative; display: flex; align-items: center; min-height: 54px; border-top: 1px solid #f0f3f6; }
.menu-toggle { display: none; align-items: center; gap: 8px; padding: 8px 12px; border: 0; background: transparent; font-weight: 700; cursor: pointer; }
.nav-links { display: flex; align-items: stretch; min-height: 54px; }
.nav-links > a { display: flex; align-items: center; text-decoration: none; padding: 0 21px; color: var(--nav-link); font-weight: 700; border-left: 1px solid #eef1f4; transition: color .2s ease, background .2s ease; }
.nav-links > a:hover { color: var(--blue); background: #f8fafd; }
/* Extra nav link that replaces the header-actions link once that is hidden (<=1024px) */
.nav-links > a.nav-extra { display: none; }

/* Dropdown container */
.nav-dropdown { position: relative; display: flex; align-items: center; border-left: 1px solid #eef1f4; }
.dropdown-toggle { display: inline-flex; align-items: center; gap: 8px; height: 54px; padding: 0 21px; border: none; background: transparent; color: var(--nav-link); font-family: inherit; font-weight: 700; cursor: pointer; transition: color .2s ease, background-color .2s ease; }
.dropdown-toggle:hover { color: var(--blue); background-color: #f8fafd; }

/* Chevron icon */
.chevron-icon { display: inline-block; transition: transform .25s cubic-bezier(.4, 0, .2, 1); color: var(--muted); flex-shrink: 0; }
.dropdown-toggle:hover .chevron-icon { color: var(--blue); }
.dropdown-toggle[aria-expanded="true"] .chevron-icon { transform: rotate(180deg); color: var(--blue); }

/* Dropdown menu (JS should also close it on Escape and on outside click) */
.dropdown-menu { position: absolute; top: 100%; left: 0; z-index: var(--z-dropdown); display: flex; flex-direction: column; min-width: max-content; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; opacity: 1; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, .05), 0 10px 15px -3px rgba(0, 0, 0, .08); transform: translateY(0); transition: opacity .2s ease, transform .2s ease, display .2s allow-discrete; max-height: min(70vh, 420px); overflow-y: auto; overscroll-behavior: contain; }
/* Hidden state: prevents auto-displaying on page load */
.dropdown-menu[hidden] { display: none !important; opacity: 0; transform: translateY(-8px); }
/* Entry transition */
@starting-style {
  .dropdown-menu:not([hidden]) { opacity: 0; transform: translateY(-8px); }
}
.dropdown-header { padding: 0 8px 8px; font-size: .8125rem; font-weight: 700; letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid #f0f3f6; margin-bottom: 8px; }
.dropdown-grid { display: grid; grid-template-columns: repeat(2, minmax(180px, 1fr)); gap: 4px 12px; }
.dropdown-menu a { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-radius: 8px; color: var(--text-soft); font-weight: 500; text-decoration: none; white-space: nowrap; transition: background-color .15s ease, color .15s ease; }
.dropdown-menu a:hover { background-color: var(--blue2); color: var(--blue); }
.dropdown-badge { font-size: .8125rem; font-weight: 600; padding: 2px 7px; border-radius: 9999px; background-color: #dbeafe; color: #1e40af; }
@media (max-width: 767px) {
  .dropdown-grid { grid-template-columns: 1fr; }
  .dropdown-menu { min-width: 100%; }
}


/* ==========================================================================
   4. HERO BANNER
   ========================================================================== */
.hero-panel { position: relative; min-height: 400px; border-radius: 22px; overflow: hidden; background: linear-gradient(105deg, #eaf2fb 0%, #dfe9f3 47%, #aabbd0 100%); }
.hero-slider { position: relative; width: 100%; overflow: hidden; }
/* touch-action lets the browser keep vertical scroll while JS handles horizontal swipe */
.slider-track { display: flex; width: 100%; touch-action: pan-y; transition: transform .5s cubic-bezier(.25, 1, .5, 1); }
.slide { min-width: 100%; display: grid; grid-template-columns: 1fr; align-items: center; gap: 24px; }
@media (min-width: 768px) {
  .slide { grid-template-columns: .92fr 1.08fr; gap: 0; }
}
.hero-text { padding: 32px 24px; position: relative; z-index: 2; }
@media (min-width: 768px) {
  .hero-text { padding: 48px 58px; }
}
.hero-title { margin: 17px 0; color: var(--navy); font-family: var(--display); font-size: clamp(1.75rem, 3.2vw, 2.4rem); font-weight: 700; line-height: 1.1; letter-spacing: -.04em; }
.hero-title span { color: var(--blue); }
.hero-text p { color: #4a5f75; margin-bottom: 26px; }

/* Actions and buttons */
.actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.button { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; gap: 12px; padding: 0 20px; border: 2px solid var(--blue); border-radius: 8px; font-weight: 700; background: var(--blue); color: #fff; text-decoration: none; cursor: pointer; transition: background .2s, border-color .2s, color .2s, transform .2s; }
.button:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.button--outline { background: #fff; color: var(--blue); }
.button--outline:hover { background: var(--blue2); border-color: var(--blue-dark); color: var(--blue-dark); }

/* Hero media */
.hero-media { padding: 0 24px 32px; display: flex; justify-content: center; align-items: center; }
.hero-media img { width: 100%; aspect-ratio: 4 / 3; max-height: 400px; object-fit: cover; border-radius: 16px; box-shadow: 0 12px 30px rgba(0, 0, 0, .08); }
@media (min-width: 768px) {
  .hero-media { padding: 12px 24px 12px 0; }
}

/* Slider controls */
.slider-btn, .slider-pause { position: absolute; z-index: var(--z-slider); display: flex; align-items: center; justify-content: center; border: none; border-radius: 50%; background: rgba(255, 255, 255, .9); color: var(--navy); cursor: pointer; box-shadow: 0 4px 12px rgba(0, 0, 0, .12); transition: background .2s, transform .2s; }
.slider-btn:hover, .slider-pause:hover { background: #fff; }
.slider-btn { top: 50%; width: 44px; height: 44px; font-size: 1.5rem; line-height: 1; transform: translateY(-50%); }
.slider-btn:hover { transform: translateY(-50%) scale(1.08); }
.slider-btn.prev { left: 16px; }
.slider-btn.next { right: 16px; }

/* Slide dots */
.slider-dots { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 14px; z-index: var(--z-slider); }
.dot { position: relative; width: 10px; height: 10px; padding: 0; border: none; border-radius: 50%; background: rgba(15, 37, 55, .35); cursor: pointer; transition: background .3s, width .3s; }
/* Expand hit target to 24px (WCAG 2.5.8) */
.dot::before { content: ''; position: absolute; inset: -7px; }
.dot.active { background: var(--blue); width: 24px; border-radius: 5px; }

/* Pause / play control (WCAG 2.2.2) */
.slider-pause { bottom: 10px; right: 16px; width: 36px; height: 36px; }
.slider-pause[hidden] { display: none; }
.slider-pause .icon-play { display: none; }
.slider-pause[data-state="paused"] .icon-pause { display: none; }
.slider-pause[data-state="paused"] .icon-play { display: block; }


/* ==========================================================================
   5. FEATURED PRODUCTS
   ========================================================================== */
.catalog { background: #eef3f8; }
.catalog-tools { display: flex; align-items: center; gap: 8px; }
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.product-card { background: #fff; border: 1px solid #e4eaf1; border-radius: 14px; overflow: hidden; transition: transform .2s, box-shadow .2s; display: flex; flex-direction: column; }

.product-art { position: relative; height: 300px; display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(145deg, #f7f9fc, #dfe8f2); overflow: hidden; }
.product-art img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; filter: drop-shadow(0 4px 8px rgba(21, 43, 69, .08)); border-radius: 14px; transition: transform .3s ease; }

/* Hover lift and zoom only on devices that really hover (avoids sticky hover on touch) */
@media (hover: hover) {
  .product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
  .product-card:hover .product-art img { transform: scale(1.04); }
}
.product-card:focus-within { box-shadow: var(--shadow); }

/* Condition tag over the image, top-left */
.condition { position: absolute; z-index: 2; left: 12px; top: 12px; padding: 4px 8px; border-radius: 5px; background: #fff; color: var(--text-soft); text-transform: uppercase; letter-spacing: .06em; font-size: .8125rem; font-weight: 700; box-shadow: 0 2px 6px rgba(0, 0, 0, .06); }
.product-info { padding: 16px; display: flex; flex-direction: column; flex-grow: 1; }
.product-type { color: var(--blue); font-size: .8125rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.product-info a { text-decoration: none; }
/* Class-based so the card works under an h2 (category page) or h3 (homepage) without changing size */
.product-title { margin: 6px 0 4px; font-size: 1.05rem; line-height: 1.3; letter-spacing: normal; }

/* Star rating */
.product-rating { display: flex; align-items: center; gap: 6px; font-size: .8125rem; margin-bottom: 8px; }
.stars-text { font-size: .95rem; letter-spacing: 1px; line-height: 1; }
.stars-active { color: var(--yellow); }
.stars-muted { color: #cbd5e1; }
.rating-num { font-weight: 700; color: var(--navy); }
.review-count { color: var(--muted); font-size: .8125rem; }
.product-info p { color: var(--muted); font-size: .875rem; margin: 0 0 14px; flex-grow: 1; line-height: 1.45;
                  /* Clamp to 3 lines */
                  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; }

/* Price + stock status */
.product-price-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.product-price { font-size: 1.1rem; font-weight: 800; color: var(--navy); display: flex; align-items: baseline; gap: 4px; }
.product-price small { font-size: .8125rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

/* In-stock badge */
.stock-status { display: inline-flex; align-items: center; gap: 5px; font-size: .875rem; font-weight: 700; color: #15803d; background: #f0fdf4; padding: 3px 8px; border-radius: 20px; border: 1px solid #bbf7d0; white-space: nowrap; }
.stock-dot { width: 6px; height: 6px; background-color: #22c55e; border-radius: 50%; display: inline-block; }
/* Unavailable states */
.stock-status.out-of-stock,
.stock-status.sold-out { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.stock-status.out-of-stock .stock-dot,
.stock-status.sold-out .stock-dot { background-color: #ef4444; }
.price-call { font-size: .875rem; color: var(--blue); font-weight: 700; }
.product-link { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #edf1f5; padding-top: 12px; text-decoration: none; color: var(--blue); font-weight: 700; }
.product-link:hover { color: var(--navy); }


/* ==========================================================================
   6. CATEGORIES
   ========================================================================== */
.category-layout { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.category-card { min-height: 160px; padding: 20px; border-radius: 14px; background: #fff; border: 1px solid var(--line); text-decoration: none; display: flex; flex-direction: column; justify-content: space-between; transition: transform .2s, box-shadow .2s, border-color .2s; }
@media (hover: hover) {
  .category-card:hover { transform: translateY(-3px); border-color: #c6d8ec; box-shadow: var(--shadow); }
}
.category-card:focus-visible { border-color: var(--blue); }
.category-icon { width: 42px; height: 42px; border-radius: 11px; background: var(--blue2); color: var(--blue); display: grid; place-items: center; font-size: 1.18rem; }
.category-card h3 { margin: 0 0 3px; }
.category-card p { color: var(--muted); font-size: .875rem; margin: 0; }
.card-arrow { align-self: flex-end; color: var(--blue); font-size: 1.1rem; }


/* ==========================================================================
   7. SERVICE
   ========================================================================== */
.service { display: grid; grid-template-columns: 1fr 1fr; gap: 35px; align-items: center; }
.service-visual { min-height: 420px; border-radius: 18px; position: relative; overflow: hidden; display: grid; place-items: center; background: var(--blue2); }
.service-visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* h1 or h2 (h2 recommended, since the page already has an h1) */
.service-text h1,
.service-text h2 { letter-spacing: -.055em; margin: 17px 0; }
.service-text span { color: var(--blue); }
.service-text p { color: var(--muted); margin: 12px 0 18px; }
.service-list { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; margin: 25px 0 28px; padding: 0; list-style: none; }
.service-list span { display: flex; align-items: center; gap: 9px; color: var(--text-soft); font-size: .875rem; font-weight: 600; }
.service-list .check { font-style: normal; font-weight: 700; color: var(--blue); }


/* ==========================================================================
   8. PRODUCT SINGLE PAGE (product.php)
   ========================================================================== */

/* Main layout */
.product-single-layout { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(28px, 4vw, 48px); align-items: start; }
.product-gallery-container { width: 100%; }
.product-gallery-container .product-art { height: clamp(400px, 50vh, 550px); border: 1px solid var(--line); border-radius: 18px; padding: 24px; cursor: zoom-in; }
.product-gallery-container .product-art img { filter: drop-shadow(0 6px 16px rgba(21, 43, 69, .08)); transition: transform .3s cubic-bezier(.25, 1, .5, 1); }
@media (hover: hover) {
  .product-gallery-container .product-art:hover img { transform: scale(1.04); }
}

/* Gallery thumbnails (6 per row; JS toggles the .active class only) */
.gallery-thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.gallery-thumbs img { width: calc((100% - 50px) / 6); height: 70px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 4px; cursor: pointer; transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease; }
.gallery-thumbs img:hover { border-color: var(--eyebrow); transform: translateY(-2px); }
.gallery-thumbs img.active { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(36, 101, 181, .2); }

/* Gallery prev / next buttons */
.gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: var(--z-slider); background: rgba(15, 27, 43, .65); color: #fff; border: none; width: 44px; height: 44px; border-radius: 50%; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background-color .2s ease, transform .2s ease; }
.gallery-nav:hover { background: rgba(15, 27, 43, .9); transform: translateY(-50%) scale(1.08); }
.gallery-nav.prev { left: 12px; }
.gallery-nav.next { right: 12px; }

/* ---- Details panel ---- */
.product-single-details { display: flex; flex-direction: column; }
.product-single-details h1 { margin: 8px 0 12px; color: var(--navy); }
.product-single-details .product-rating { margin-bottom: 18px; font-size: .875rem; }
.product-single-price-row { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.product-single-price { font-size: 1.75rem; font-weight: 800; color: var(--navy); display: flex; align-items: baseline; gap: 6px; }
.product-single-price small { font-size: .875rem; font-weight: 700; color: var(--muted); }

/* ---- Conversion helpers (new) ---- */
/* Key facts shown above the fold: Brand, Model, Year, Condition... */
.spec-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin: 0 0 24px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.spec-summary div { padding: 12px 16px; background: #fff; }
.spec-summary dt { margin: 0 0 2px; font-size: .8125rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.spec-summary dd { margin: 0; font-weight: 600; color: var(--navy); }

/* Primary call to action row (Request a quote / Call / WhatsApp) */
.product-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.product-cta .button { flex: 1 1 200px; }

/* Trust points (warranty, inspection, shipping...) */
.trust-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 0 0 28px; padding: 0; list-style: none; }
.trust-list li { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text-soft); font-size: .875rem; font-weight: 600; }

/* Sticky quote bar on phones (add <div class="cta-bar"> after the main content) */
.cta-bar { display: none; }
@media (max-width: 768px) {
  .cta-bar { position: fixed; inset: auto 0 0; z-index: var(--z-top); display: flex; gap: 10px; padding: 10px 17px calc(10px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .98); border-top: 1px solid var(--line); box-shadow: 0 -6px 18px rgba(20, 43, 68, .1); }
  .cta-bar .button { flex: 1; min-height: 46px; }
  body.has-cta-bar { padding-bottom: 76px; }
  body.has-cta-bar .back-to-top { bottom: 88px; }
}

/* Related products */
.related-products { margin-top: clamp(32px, 5vw, 56px); }

/* ---- CKEditor rich text container ---- */
.product-specs-content { color: var(--ink); font-family: var(--sans); font-size: 1rem; line-height: 1.75; word-wrap: break-word; overflow-wrap: break-word; }
.product-specs-content h1, .product-specs-content h2, .product-specs-content h3, .product-specs-content h4, .product-specs-content h5, .product-specs-content h6 { color: var(--navy); font-family: var(--display); font-weight: 700; margin-top: 1.6em; margin-bottom: .6em; line-height: 1.25; }
.product-specs-content h1:first-child, .product-specs-content h2:first-child, .product-specs-content h3:first-child { margin-top: 0; }
.product-specs-content h1 { font-size: 1.75rem; letter-spacing: -.03em; }
.product-specs-content h2 { font-size: 1.4rem; letter-spacing: -.02em; }
.product-specs-content h3 { font-size: 1.15rem; }
.product-specs-content h4 { font-size: 1rem; }
.product-specs-content p { margin-bottom: .25rem; color: var(--text-body); }
.product-specs-content a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; font-weight: 500; transition: color .15s ease; }
.product-specs-content a:hover { color: var(--blue-dark); }

/* Lists: outside markers so wrapped lines align with the text, not the bullet */
.product-specs-content ul, .product-specs-content ol { margin: 0 0 1.5rem; padding-left: 1.5rem; }
.product-specs-content li { margin-bottom: .25rem; color: var(--text-body); list-style-position: outside; padding-left: .25rem; }
.product-specs-content ul li::marker { color: var(--blue); }
.product-specs-content ol li::marker { color: var(--navy); font-weight: 700; }
.product-specs-content ul ul, .product-specs-content ol ol, .product-specs-content ul ol, .product-specs-content ol ul { margin-top: .5rem; margin-bottom: 0; }

/* Tables: separate model so border-radius + overflow clip reliably in all browsers.
   For wide tables, wrap in <div class="table-scroll">. */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1.5rem 0; }
.product-specs-content table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 1.5rem 0; font-size: .9375rem; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; box-shadow: 0 2px 6px rgba(0, 0, 0, .02); }
.table-scroll table { margin: 0; }
.product-specs-content th, .product-specs-content td { padding: 8px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.product-specs-content th { background: var(--blue2); color: var(--navy); font-weight: 700; font-family: var(--display); font-size: .875rem; text-transform: uppercase; letter-spacing: .04em; }
.product-specs-content tr:last-child td, .product-specs-content tr:last-child th { border-bottom: 0; }
.product-specs-content tr:nth-child(even) td { background: #f8fafc; }
.product-specs-content hr { border: 0; height: 1px; background: var(--line); margin: 2rem 0; }
.product-specs-content img { max-width: 100%; height: auto; border-radius: 8px; margin: 1rem 0; }
@media (max-width: 560px) {
  .product-specs-content th, .product-specs-content td { padding: 8px; font-size: .875rem; }
}

/* ---- Image lightbox (enlarged view). Use real <button>s for close/prev/next,
        trap focus while open, and close on Escape. ---- */
.lightbox-modal { display: none; position: fixed; inset: 0; z-index: var(--z-lightbox); background-color: rgba(15, 27, 43, .88); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); justify-content: center; align-items: center; padding: 24px; opacity: 0; transition: opacity .25s ease, display .25s allow-discrete; }
.lightbox-modal.is-active { display: flex; opacity: 1; }
@starting-style {
  .lightbox-modal.is-active { opacity: 0; }
}
.lightbox-content { max-width: 90vw; max-height: 85vh; object-fit: contain; border-radius: 12px; background: #fff; padding: 16px; box-shadow: 0 24px 60px rgba(0, 0, 0, .4); }
.lightbox-close { position: absolute; top: 16px; right: 20px; width: 48px; height: 48px; padding: 0; border: 0; background: transparent; color: #fff; font-size: 38px; font-weight: 300; cursor: pointer; line-height: 1; transition: color .2s ease, transform .2s ease; }
.lightbox-close:hover { color: var(--yellow); transform: scale(1.1); }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: var(--z-lightbox-ui); background: rgba(255, 255, 255, .15); color: #fff; border: none; width: 48px; height: 48px; border-radius: 50%; font-size: 24px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background-color .2s ease, transform .2s ease; }
.lightbox-nav:hover { background: rgba(255, 255, 255, .3); transform: translateY(-50%) scale(1.08); }
.lightbox-nav.prev { left: 24px; }
.lightbox-nav.next { right: 24px; }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .product-single-layout { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .gallery-thumbs img { width: calc((100% - 40px) / 5); }
}
@media (max-width: 560px) {
  .gallery-thumbs img { width: calc((100% - 30px) / 4); height: 60px; }
  .product-gallery-container .product-art { height: 300px; }
  .spec-summary { grid-template-columns: 1fr; }
}


/* ==========================================================================
   9. CONTACT PAGE (contact.php)
   ========================================================================== */
.contact-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: clamp(28px, 4vw, 48px); align-items: start; }

/* Left column: office and support info */
.contact-info-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: clamp(24px, 3vw, 36px); box-shadow: 0 4px 12px rgba(23, 48, 77, .03); }
.contact-info-card h2 { margin-bottom: 24px; }
.info-item { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
.info-item:last-child { margin-bottom: 0; }
.info-icon { width: 44px; height: 44px; border-radius: 10px; background: var(--blue2); color: var(--blue); display: grid; place-items: center; font-size: 1.25rem; flex-shrink: 0; }
.info-content h3 { margin: 0 0 4px; font-size: 1rem; color: var(--navy); }
.info-content p, .info-content a { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.6; text-decoration: none; }
.info-content a:hover { color: var(--blue); }

/* Right column: inquiry form */
.form-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: clamp(24px, 4vw, 40px); box-shadow: var(--shadow); }
.form-card h2 { margin-bottom: 6px; }
.form-card > p { color: var(--muted); margin-bottom: 24px; font-size: .95rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; font-size: .875rem; color: var(--navy); }
.form-group label span.required { color: #b91c1c; }
/* 44px minimum touch target; 16px+ text avoids iOS zoom-on-focus */
.form-group input, .form-group select, .form-group textarea { width: 100%; min-height: 44px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 8px; font-family: var(--sans); font-size: 1rem; color: var(--ink); background: #fff; transition: border-color .2s ease, box-shadow .2s ease; }
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--placeholder); }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(36, 101, 181, .2); }
.form-group textarea { resize: vertical; min-height: 140px; }

/* CAPTCHA */
.captcha-row { display: flex; align-items: center; gap: 15px; margin-bottom: 10px; flex-wrap: wrap; }
.captcha-row img { border: 1px solid var(--line-strong); border-radius: 5px; }
.captcha-row input { flex: 1; min-width: 220px; min-height: 44px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 8px; }
#reloadCaptcha { width: 44px; height: 44px; border: 1px solid var(--line-strong); border-radius: 8px; background-color: #f1f5f9; cursor: pointer; font-size: 18px; transition: background-color .3s; }
#reloadCaptcha:hover { background-color: #e2e8f0; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Alerts */
.alert { padding: 14px 18px; border-radius: 8px; margin-bottom: 24px; font-size: .9rem; font-weight: 600; line-height: 1.5; }
.alert-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-error ul { margin: 0; padding-left: 18px; }

@media (max-width: 900px) {
  .contact-grid { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 560px) {
  .form-row { grid-template-columns: 1fr; gap: 0; }
}


/* ==========================================================================
   10. LISTING PAGES, BREADCRUMB, TOOLBAR, SORT, EMPTY STATE, PAGINATION, BACK TO TOP
   ========================================================================== */
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0 0 12px; padding: 0; font-size: .875rem; color: var(--muted); }
.breadcrumb li + li::before { content: '/'; margin-right: 6px; color: #7a8a9c; }
.breadcrumb a { color: var(--blue); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb [aria-current] { color: var(--ink); font-weight: 600; }

.page-head { padding-bottom: 8px; }
.page-head h1 { margin: 0 0 8px; letter-spacing: -.055em; color: var(--navy); }
.page-head p { color: var(--muted); margin: 0; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-bottom: 20px; }
.result-count { margin: 0; color: var(--muted); font-size: .875rem; }
.sort { display: flex; align-items: center; gap: 8px; font-size: .875rem; }
.sort label { color: var(--muted); font-weight: 600; }
.sort select { min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--ink); font: inherit; }

.empty-state { padding: 40px 24px; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.empty-state p { color: var(--muted); }

.pagination ol { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; list-style: none; margin: 32px 0 0; padding: 0; }
.pagination .page-link { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 44px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--navy); font-weight: 700; text-decoration: none; }
.pagination a.page-link:hover { border-color: var(--blue); color: var(--blue); }
.pagination .is-current { background: var(--blue); border-color: var(--blue); color: #fff; }
.pagination .is-disabled { opacity: .5; }
.pagination .is-gap { min-width: 24px; padding: 0; border-color: transparent; background: transparent; }

.back-to-top { position: fixed; bottom: 24px; right: 24px; z-index: var(--z-top); width: 46px; height: 46px; border-radius: 50%; background-color: var(--navy); color: #fff; border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(0, 0, 0, .16); display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; visibility: hidden; transform: translateY(12px); transition: opacity .3s ease, transform .3s ease, visibility .3s ease, background-color .2s ease; }
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background-color: var(--blue); transform: translateY(-2px); }
@media (max-width: 560px) {
  .back-to-top { bottom: 16px; right: 16px; width: 44px; height: 44px; }
}


/* ==========================================================================
   11. FOOTER
   ========================================================================== */
.footer { margin-top: clamp(24px, 4vw, 40px); background: #fff; border-top: 1px solid var(--line); }
.footer-main { padding: 42px 0; display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.5fr; /* brands column gets more room */ gap: 32px; }

/* About */
.footer-about p { max-width: 320px; font-size: .875rem; color: var(--muted); margin: 14px 0; }
.footer-address { font-size: .875rem; color: var(--muted); font-style: normal; line-height: 1.6; }
.addr-header { display: block; font-weight: 700; }
.addr-text { font-size: .875rem; color: var(--muted); display: block; margin-bottom: .25rem; }
.footer-address a { text-decoration: none; }
.footer-address a:hover { color: var(--blue); }

/* Columns (headings are real <h2>s so screen-reader heading navigation works) */
.footer-title { margin: 0; font-family: var(--sans); font-size: .875rem; font-weight: 700; line-height: 1.65; letter-spacing: normal; color: var(--navy); }
.footer-list { list-style: none; margin: 0; padding: 0; }
.footer-col a { display: block; color: var(--muted); text-decoration: none; font-size: .875rem; margin-top: 10px; }
.footer-col a:hover { color: var(--blue); }

/* Brands: fills 7 rows per column, then starts a new column (change 7 to any limit) */
.footer-list--split { display: grid; grid-template-rows: repeat(7, auto); grid-auto-flow: column; grid-auto-columns: max-content; column-gap: 32px; }

/* Bottom bar */
.footer-bottom { padding: 17px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; color: var(--muted); font-size: .8125rem; }
.footer-bottom a { text-decoration: none; }


/* ==========================================================================
   12. RESPONSIVE OVERRIDES (large -> small)
   ========================================================================== */

/* ---------- Tablet: up to 1024px ---------- */
@media (max-width: 1024px) {
  /* Header */
  .header-main { grid-template-columns: 220px 1fr auto; gap: 18px; }
  .header-actions > a:not(.contact-link) { display: none; }
  .nav-links > a.nav-extra { display: flex; }
  .nav-links > a,
  .dropdown-toggle { padding-inline: 13px; font-size: .875rem; }

  /* Hero */
  .hero-text { padding-left: 38px; }

  /* Grids */
  .category-layout { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .product-art { height: 230px; }

  /* Footer: 2 columns; about and brands (last child) each span a full row */
  .footer-main { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
  .footer-col-brands { grid-column: 1 / -1; }
}

/* ---------- Mobile nav / stacked layouts: up to 768px ---------- */
@media (max-width: 768px) {
  /* Sticky header is two rows here (brand/actions + search) plus the nav bar */
  :root { --header-offset: 215px; }

  /* Brand + actions share row 1; search is a full-width row 2 */
  .header-main { grid-template-columns: 1fr auto; gap: 12px 16px; }
  .header-main .brand { grid-column: 1; grid-row: 1; }
  .header-actions { grid-column: 2; grid-row: 1; }
  .header-main .search { grid-column: 1 / -1; grid-row: 2; max-width: none; }
  .menu-toggle { display: flex; min-height: 44px; }

  /* Anchor the open menu to the full-width nav bar instead of the inset .wrap */
  .main-nav { position: relative; }
  .nav-inner { position: static; }
  .nav-links { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--line); z-index: var(--z-mobile-nav); padding: 8px 24px; box-shadow: 0 14px 22px rgba(20, 43, 68, .12);
              /* Header is sticky, so a tall menu scrolls internally */
              max-height: calc(100vh - var(--header-offset)); max-height: calc(100dvh - var(--header-offset)); overflow-y: auto; overscroll-behavior: contain; }
  .nav-links.is-open { display: flex; }
  .nav-links > a,
  .nav-dropdown { border-left: 0; border-top: 1px solid #eef1f4; }
  .nav-dropdown { flex-direction: column; align-items: stretch; width: 100%; }
  .dropdown-toggle { width: 100%; justify-content: space-between; }
  .dropdown-menu { position: static; min-width: 0; border: none; box-shadow: none; padding-left: 18px; max-height: none; overflow: visible; }

  /* Hero stacks; arrows would overlap the text, so dots, pause and swipe are the controls */
  .slide { grid-template-columns: 1fr; }
  .hero-text { padding: 36px 28px 16px; max-width: 100%; }
  .hero-media { padding: 0 14px 24px; }
  .slider-btn { display: none; }

  /* Service stacks */
  .service { grid-template-columns: 1fr; gap: 25px; }
}

/* ---------- Phone: up to 560px ---------- */
@media (max-width: 560px) {
  :root { --header-offset: 200px; }
  .wrap { width: calc(100% - 34px); }

  /* Topline + header */
  .topline-inner { justify-content: center; text-align: center; }
  .topline-inner span:last-child { display: none; }
  .header-main { min-height: 70px; gap: 12px; }
  .brand-logo { width: clamp(130px, 45vw, 190px); max-height: 48px; }
  .header-actions .contact-link { padding: 10px 12px; font-size: .875rem; }

  /* Nav */
  .nav-inner { min-height: 47px; justify-content: space-between; }
  .menu-toggle { color: var(--navy); font-size: .875rem; padding: 12px 0; }
  .nav-links { padding: 8px 17px; }
  .nav-links > a,
  .dropdown-toggle { padding: 12px 4px; border-bottom: 1px solid var(--line); font-size: .9375rem; }
  .dropdown-toggle { background: #fff; }
  .dropdown-menu { padding: 4px 8px 8px; border-radius: 0; }
  .dropdown-menu a { padding: 12px 8px; font-size: .875rem; }

  /* Hero */
  .hero-panel { border-radius: 15px; }
  .hero-text { padding: 32px 24px 20px; }
  .hero-text p { font-size: .9375rem; margin-bottom: 19px; }
  .button { min-height: 46px; padding-inline: 16px; font-size: .875rem; }

  /* Section heads + categories */
  .section-head { display: block; margin-bottom: 22px; }
  .section-head p { margin-top: 12px; font-size: .875rem; }
  .category-layout { gap: 10px; }
  .category-card { min-height: 145px; padding: 15px; }
  .category-card h3 { font-size: .9375rem; }
  .category-card p { font-size: .8125rem; }
  .category-icon { width: 37px; height: 37px; }

  /* Products: single column */
  .product-grid { grid-template-columns: 1fr; gap: 10px; }
  .product-art { height: 220px; }
  .product-info { padding: 12px; }
  .product-title { font-size: 1rem; }
  .product-info p { font-size: .875rem; }
  .product-link { font-size: .875rem; }
  .condition { top: 8px; left: 8px; padding: 4px 7px; }

  /* Service */
  .service-list { gap: 11px; }
  .service-list span { font-size: .875rem; }

  /* Footer: single column */
  .footer-main { grid-template-columns: 1fr; gap: 24px 16px; }
  .footer-list--split { grid-template-rows: none; grid-auto-flow: row; grid-template-columns: repeat(2, 1fr); }
  .footer-bottom { flex-direction: column; gap: 6px; }
}


/* ==========================================================================
   13. REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}