/* ============================================================
   COART Building Materials — Main Stylesheet
   Modern / Engineering / Practical.  Aluminium-grey minimal palette.
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink: #16181b;          /* near-black text */
  --slate: #1f2226;        /* header / headings — deep charcoal */
  --steel: #4a6884;        /* accent / links  (aluminium blue-grey) */
  --steel-dark: #3a536b;
  --alum: #9aa0a6;         /* aluminium silver */
  --alum-light: #c9ced3;
  --bg: #ffffff;           /* white background */
  --bg-alt: #f5f6f7;       /* light grey section */
  --line: #e2e5e8;         /* border lines */
  --muted: #5f656b;        /* secondary text */
  --white: #ffffff;

  --radius: 6px;
  --radius-lg: 12px;
  --shadow: 0 1px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.10);
  --max-width: 1200px;
  --header-h: 68px;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; color: var(--slate); }
h1 { font-size: clamp(2.1rem, 4vw, 3.2rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -0.01em; }
h3 { font-size: 1.2rem; }
p { margin-bottom: 1rem; color: var(--muted); }

a { color: var(--steel); text-decoration: none; }
a:hover { color: var(--steel-dark); }

img { max-width: 100%; display: block; }

/* --- Section headings --- */
.section { padding: 80px 24px; }
.section-alt { background: var(--bg-alt); }
.section-inner { max-width: var(--max-width); margin: 0 auto; }

.section-label {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--steel);
  margin-bottom: 0.6rem;
}
.section-title { margin-bottom: 0.8rem; }
.section-lead { font-size: 1.12rem; color: var(--muted); max-width: 680px; margin-bottom: 2.8rem; }

/* --- Navigation --- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--header-h);
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center;
}
.nav-inner {
  width: 100%; max-width: var(--max-width); margin: 0 auto;
  padding: 0 24px; display: flex; align-items: center; justify-content: space-between;
}
.nav-logo { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--slate); font-size: 1.25rem; letter-spacing: -0.01em; }
.nav-logo img { height: 58px; width: auto; }
.nav-links { display: flex; list-style: none; gap: 28px; align-items: center; }
.nav-links a { color: var(--slate); font-size: 0.95rem; font-weight: 500; padding: 6px 2px; }
.nav-links a:hover { color: var(--steel); }
.nav-cta {
  background: var(--steel); color: var(--white) !important;
  padding: 10px 22px; border-radius: 28px; font-weight: 600; font-size: 0.9rem;
}
.nav-cta:hover { background: var(--steel-dark); }
.menu-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--slate); }

/* --- Hero --- */
.hero {
  min-height: 88vh;
  display: flex; align-items: center; justify-content: center; text-align: center;
  background-size: cover; background-position: center;
  color: var(--white); padding: 0 24px;
}
.hero-inner { max-width: 820px; }
.hero-badge {
  display: inline-block; background: rgba(255,255,255,0.16); color: rgba(255,255,255,0.94);
  font-size: 0.82rem; font-weight: 600; padding: 6px 18px; border-radius: 24px; margin-bottom: 1.4rem;
  letter-spacing: 0.04em;
}
.hero h1 { color: var(--white); margin-bottom: 1rem; }
.hero p { color: rgba(255,255,255,0.86); font-size: 1.15rem; max-width: 620px; margin: 0 auto 0.6rem; font-weight: 500; }
.hero-actions { display: flex; gap: 14px; justify-content: center; margin-top: 2rem; flex-wrap: wrap; }

.btn {
  display: inline-block; padding: 13px 30px; border-radius: 28px; font-weight: 600;
  font-size: 0.92rem; transition: all 0.2s; border: none; cursor: pointer;
}
.btn-primary { background: var(--white); color: var(--slate) !important; box-shadow: 0 4px 24px rgba(0,0,0,0.22); }
.btn-primary:hover { transform: translateY(-1px); }
.btn-ghost { border: 2px solid rgba(255,255,255,0.6); color: var(--white) !important; }
.btn-ghost:hover { background: rgba(255,255,255,0.12); }

/* --- Product category quick strip --- */
.cat-strip { background: var(--slate); padding: 0; }
.cat-strip-inner { max-width: var(--max-width); margin: 0 auto; display: grid; }
.cat-strip a {
  color: rgba(255,255,255,0.85); padding: 1.6rem 0.5rem; text-align: center;
  transition: all 0.2s; font-size: 0.86rem; font-weight: 500; border-right: 1px solid rgba(255,255,255,0.07);
}
.cat-strip a:hover { background: rgba(255,255,255,0.08); color: white; }
.cat-strip .icon { font-size: 1.5rem; display: block; margin-bottom: 0.35rem; }
.cat-strip .sub { display: block; font-size: 0.72rem; opacity: 0.6; font-weight: 400; margin-top: 2px; }

/* --- About / Company --- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 28px 0; }
.stat { background: var(--bg-alt); border-radius: var(--radius-lg); padding: 22px 18px; text-align: center; }
.stat .num { font-size: 2rem; font-weight: 800; color: var(--steel); }
.stat .lbl { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }
.check-list { list-style: none; }
.check-list li { padding: 9px 0; padding-left: 30px; position: relative; color: var(--slate); font-weight: 500; }
.check-list li::before { content: "✓"; position: absolute; left: 0; color: var(--steel); font-weight: 700; }
.check-list li span { display: block; font-weight: 400; color: var(--muted); font-size: 0.86rem; margin-top: 2px; }

/* --- Products --- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 26px; }
.product-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow); transition: all 0.25s; display: flex; flex-direction: column;
}
.product-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.product-card .thumb { aspect-ratio: 4/3; overflow: hidden; background: var(--bg-alt); }
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.product-card:hover .thumb img { transform: scale(1.04); }
.product-card .body { padding: 20px 22px 24px; flex: 1; display: flex; flex-direction: column; }
.product-card h3 { font-size: 1.08rem; margin-bottom: 6px; }
.product-card .cat { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--steel); font-weight: 700; }
.product-card p { font-size: 0.9rem; margin: 8px 0 14px; flex: 1; }
.product-card .foot { display: flex; justify-content: space-between; align-items: center; }
.product-card .models { font-size: 0.78rem; color: var(--muted); }
.product-card .arrow { color: var(--steel); font-weight: 700; }

/* --- Gallery (production photos / video) --- */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.gallery-grid figure { border-radius: var(--radius); overflow: hidden; background: var(--bg-alt); }
.gallery-grid img { width: 100%; aspect-ratio: 4/3; object-fit: cover; transition: transform 0.35s; }
.gallery-grid img:hover { transform: scale(1.05); }
.gallery-grid figcaption { font-size: 0.8rem; color: var(--muted); padding: 8px 10px; }

/* --- Services --- */
.service-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.service-card {
  display: flex; gap: 20px; background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 26px 24px; box-shadow: var(--shadow);
}
.service-card .icon { font-size: 1.9rem; flex-shrink: 0; }
.service-card h3 { margin-bottom: 6px; }
.service-card p { font-size: 0.92rem; }

/* --- Contact --- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
.contact-item { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.contact-item .ci { font-size: 1.2rem; flex-shrink: 0; }
.contact-item .k { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--steel); font-weight: 700; }
.contact-item .v { color: var(--slate); font-weight: 500; }
.contact-item .v a { color: var(--steel); }

/* --- Form --- */
.form { background: var(--bg-alt); border-radius: var(--radius-lg); padding: 30px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--slate); margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 0.95rem; font-family: inherit; background: white; color: var(--ink);
}
.form-group input:focus, .form-group textarea:focus { outline: 2px solid var(--steel); border-color: transparent; }
.btn-submit { width: 100%; background: var(--steel); color: white; padding: 14px; border: none; border-radius: var(--radius); font-size: 1rem; font-weight: 700; cursor: pointer; }
.btn-submit:hover { background: var(--steel-dark); }
.form-note { text-align: center; font-size: 0.78rem; color: var(--muted); margin-top: 12px; }
.form-success { text-align: center; color: #2e7d32; font-weight: 600; display: none; }
.form-success.show { display: block; }

/* --- Catalogues download --- */
.catalogue-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.catalogue-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; text-align: center;
}
.catalogue-card .cat-icon { font-size: 2.2rem; margin-bottom: 10px; }
.catalogue-card h3 { font-size: 1.02rem; }
.catalogue-card .size { font-size: 0.78rem; color: var(--muted); margin: 6px 0 14px; }
.catalogue-card .dl { background: var(--bg-alt); color: var(--steel); padding: 10px; border-radius: var(--radius); font-weight: 600; font-size: 0.88rem; margin-top: 8px; }
.catalogue-card .dl + .dl { margin-top: 8px; }
.catalogue-card .dl:first-of-type { margin-top: 0; }
.catalogue-card .dl:hover { background: var(--steel); color: white; }
.catalogue-card .soon { font-size: 0.78rem; color: var(--alum); padding: 10px; background: var(--bg-alt); border-radius: var(--radius); }

/* --- CTA banner --- */
.cta-banner { background: var(--slate); color: white; text-align: center; padding: 70px 24px; }
.cta-banner h2 { color: white; margin-bottom: 0.8rem; }
.cta-banner p { color: rgba(255,255,255,0.82); margin-bottom: 1.8rem; }
.cta-banner .btn-primary { color: var(--slate) !important; }

/* --- Footer --- */
.footer { background: var(--slate); color: rgba(255,255,255,0.9); padding: 56px 24px 28px; }
.footer-inner { max-width: var(--max-width); margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1.4fr; gap: 40px; }
.footer h4 { color: white; margin-bottom: 14px; font-size: 1rem; }
.footer p, .footer a { color: rgba(255,255,255,0.72); font-size: 0.88rem; display: block; padding: 4px 0; }
.footer a:hover { color: white; }
.footer-brand { font-weight: 800; font-size: 1.3rem; color: white; margin-bottom: 10px; }
.footer-bottom { max-width: var(--max-width); margin: 40px auto 0; padding-top: 22px; border-top: 1px solid rgba(255,255,255,0.12); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 0.8rem; color: rgba(255,255,255,0.6); }

/* --- Responsive --- */
@media (max-width: 900px) {
  .about-grid, .contact-grid, .service-grid { grid-template-columns: 1fr; gap: 36px; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 28px; }
  .stats-row { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .nav-links { display: none; position: absolute; top: var(--header-h); left: 0; right: 0; background: white; flex-direction: column; padding: 16px 24px; gap: 16px; border-bottom: 1px solid var(--line); }
  .nav-links.open { display: flex; }
  .nav-links .nav-cta { display: inline-block; text-align: center; }
  .menu-toggle { display: block; }
  .section { padding: 56px 20px; }
  .cat-strip-inner { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: 1fr; }
  .service-card { flex-direction: column; }
  .hero { min-height: 78vh; }
}

/* --- Product gallery (all catalogue images) --- */
.view-all-btn {
  margin-top: 12px; background: var(--bg-alt); border: 1px solid var(--line);
  color: var(--steel); padding: 10px 14px; border-radius: var(--radius);
  font-weight: 600; font-size: 0.86rem; cursor: pointer; transition: all 0.2s;
}
.view-all-btn:hover { background: var(--steel); color: white; }

.product-gallery { margin-top: 16px; }
.product-gallery.collapse { overflow: hidden; }
.pg-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px; max-height: 560px; overflow-y: auto; padding: 4px 2px;
}
.pg-item {
  margin: 0; cursor: zoom-in; border-radius: var(--radius); overflow: hidden;
  background: var(--bg-alt); transition: transform 0.2s; position: relative;
}
.pg-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; transition: transform 0.3s; }
.pg-item:hover { transform: translateY(-2px); }
.pg-item:hover img { transform: scale(1.04); }
.pg-item figcaption {
  position: absolute; bottom: 0; left: 0; right: 0; padding: 6px 8px;
  background: rgba(20,23,26,0.62); color: white; font-size: 0.7rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* --- Lightbox --- */
#lightbox {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  z-index: 2000; align-items: center; justify-content: center;
}
.lightbox-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.9); }
.lightbox-body {
  position: relative; z-index: 1; max-width: 92vw; max-height: 92vh;
  text-align: center; padding: 20px;
}
.lightbox-body img { max-width: 92vw; max-height: 82vh; border-radius: 6px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.lightbox-body p { color: rgba(255,255,255,0.85); margin-top: 12px; font-size: 0.9rem; }
.lightbox-close {
  position: absolute; top: -2px; right: -6px; background: rgba(255,255,255,0.15);
  border: none; color: white; width: 40px; height: 40px; border-radius: 50%;
  font-size: 1.6rem; cursor: pointer; line-height: 1;
}
.lightbox-close:hover { background: rgba(255,255,255,0.3); }

/* Lightbox prev/next navigation */
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 64px; height: 64px; border-radius: 50%; border: none;
  background: rgba(20,24,28,0.55); color: white; font-size: 2.4rem;
  cursor: pointer; line-height: 1; transition: background 0.2s; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.lightbox-nav:hover { background: rgba(20,24,28,0.78); }
.lightbox-nav.prev { left: 22px; }
.lightbox-nav.next { right: 22px; }

/* Generic carousel prev/next buttons — large, on both ends */
.car-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 64px; height: 64px; border-radius: 50%; border: none;
  background: rgba(20,24,28,0.5); color: white; font-size: 2.4rem;
  cursor: pointer; line-height: 1; transition: background 0.2s; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.28);
}
.car-nav:hover { background: rgba(20,24,28,0.75); }
.car-nav.prev { left: 18px; }
.car-nav.next { right: 18px; }
/* About carousel buttons */
.about-carousel { position: relative; }
.about-carousel .car-nav { top: 50%; }
/* Hero nav buttons — fixed to viewport sides, both ends */
.hero .hero-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.hero .hero-nav.prev { left: 26px; }
.hero .hero-nav.next { right: 26px; }
@media (max-width: 720px) {
  .car-nav, .lightbox-nav { width: 48px; height: 48px; font-size: 1.8rem; }
  .car-nav.prev, .lightbox-nav.prev { left: 10px; }
  .car-nav.next, .lightbox-nav.next { right: 10px; }
}
/* expanded video shelf */
.prod-more-shelf { margin-top: 14px; max-width: none; grid-template-columns: repeat(3, 1fr); }


/* --- Product card carousel --- */
.product-card { cursor: pointer; text-align: left; font-family: inherit; scroll-margin-top: 90px; }
.pc-carousel { position: relative; width: 100%; height: 100%; }
.pc-carousel img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.6s ease; }
.pc-carousel img.active { opacity: 1; }
.pc-dots { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; }
.pc-dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.5); }
.pc-dots span.active { background: var(--white); }

/* --- About carousel --- */
.about-carousel { position: relative; aspect-ratio: 4/3; background: var(--bg-alt); }
.about-carousel img { width: 100%; height: 100%; object-fit: cover; }

/* --- Product modal --- */
.product-modal { position: fixed; inset: 0; z-index: 1500; display: flex; align-items: center; justify-content: center; }
.pm-overlay { position: absolute; inset: 0; background: rgba(18,21,24,0.85); }
.pm-window { position: relative; z-index: 1; width: 92vw; height: 90vh; background: var(--white); border-radius: 12px; box-shadow: 0 30px 80px rgba(0,0,0,0.4); display: flex; flex-direction: column; overflow: hidden; }
.pm-close { position: absolute; top: 12px; right: 12px; z-index: 5; width: 40px; height: 40px; border-radius: 50%; border: none; background: rgba(0,0,0,0.35); color: white; font-size: 1.5rem; cursor: pointer; line-height: 1; }
.pm-close:hover { background: rgba(0,0,0,0.55); }
.pm-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.pm-head h3 { margin: 0; font-size: 1.2rem; }
.pm-head span { color: var(--muted); font-size: 0.85rem; }
.pm-mainshow { width: 100%; }
.pm-main { margin: 0; }
#pm-main-img { width: 100%; max-height: 46vh; object-fit: contain; background: var(--bg-alt); }
.pm-section, .pm-tabs { display: flex; gap: 10px; padding: 14px 24px 0; flex-wrap: wrap; }
.pm-tabs button { padding: 8px 16px; border: 1px solid var(--line); background: var(--white); border-radius: 20px; cursor: pointer; font-size: 0.86rem; font-weight: 600; color: var(--steel); }
.pm-tabs button.active { background: var(--steel); color: white; border-color: var(--steel); }
.pm-body { flex: 1; overflow-y: auto; padding: 18px 24px 28px; }
.pm-panel .pm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.pm-item { margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--bg-alt); cursor: zoom-in; position: relative; }
.pm-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; transition: transform 0.3s; }
.pm-item:hover img { transform: scale(1.05); }
.pm-item figcaption { position: absolute; bottom: 0; left: 0; right: 0; padding: 6px 8px; background: rgba(20,23,26,0.62); color: white; font-size: 0.7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --- Videos in modal + production --- */
.pm-video { border-radius: var(--radius); overflow: hidden; background: #000; margin-bottom: 14px; }
.pm-video video { width: 100%; display: block; max-height: 60vh; }
.pm-video p { padding: 8px 10px; color: var(--muted); font-size: 0.8rem; background: var(--white); margin: 0; }
.pm-videos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }

/* --- Production sections (grouped by product) — small tile entry, expandable --- */
.production-list { display: flex; flex-direction: column; gap: 44px; }
.production-block { border-top: 1px solid var(--line); padding-top: 28px; }
.production-block h3 { margin-bottom: 16px; font-size: 1.15rem; }
.prod-shelf {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 14px; max-width: 640px;
}
.prod-item {
  margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--bg-alt);
  cursor: zoom-in; position: relative;
}
.prod-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; transition: transform 0.3s; }
.prod-item:hover img { transform: scale(1.05); }
.prod-more {
  display: block; margin-top: 14px; padding: 10px 20px;
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--steel); font-weight: 600; font-size: 0.86rem; cursor: pointer; transition: all 0.2s;
}
.prod-more:hover { background: var(--steel); color: white; border-color: var(--steel); }
.prod-video { border-radius: var(--radius); overflow: hidden; background: #000; }
.prod-video video { width: 100%; display: block; aspect-ratio: 16/9; object-fit: cover; }
/* production images: no filename caption */
.prod-item figcaption { display: none; }
/* page gallery modal (pg-window) */
.pg-window .pm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }

@media (max-width: 720px) {
  .pm-window { width: 96vw; height: 94vh; }
  .pm-body { padding: 14px; }
}
