/* ===========================================================
   kaupankylmalaitteet.fi — Shared Stylesheet
   Visual direction: Airbnb-warm card system adapted for
   a Finnish used/refurbished commercial refrigeration dealer.
   Warm white canvas, Rausch-red accent, near-black text,
   generous radius, three-layer card shadows, DM Sans typography.
   =========================================================== */

/* ---------- 1. Design Tokens ---------- */
:root {
  /* Brand */
  --accent: #0066cc;
  --accent-dark: #0052cc;
  --accent-soft: #e6f0fa;

  /* Text */
  --text: #222222;
  --text-secondary: #6a6a6a;
  --text-muted: #929292;
  --text-on-accent: #ffffff;

  /* Surfaces */
  --bg: #ffffff;
  --bg-warm: #f8f8f8;
  --surface-light: #f2f2f2;
  --border: #e7e7e7;
  --border-dark: #c1c1c1;

  /* Shadows — Airbnb three-layer system */
  --shadow-card: 0 0 0 1px rgba(0,0,0,0.02), 0 2px 6px rgba(0,0,0,0.04), 0 4px 8px rgba(0,0,0,0.1);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lift: 0 8px 24px rgba(0,0,0,0.12);

  /* Radii */
  --r-btn: 8px;
  --r-badge: 14px;
  --r-card: 20px;
  --r-large: 32px;

  /* Layout */
  --container: 1200px;
  --narrow: 720px;

  /* Fonts */
  --font-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Header heights for sticky offset */
  --bar-top: 44px;
    --header-h: 72px;
}

/* ---------- 2. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }

html, body { max-width: 100%; overflow-x: hidden; }

/* ---------- 3. Sticky Bars ---------- */

/* Top bar: phone + email */
.bar-top {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--bar-top);
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  font-size: 0.875rem;
  font-weight: 500;
  overflow: hidden;
}
.bar-top a {
  display: inline-flex;
  white-space: nowrap;
  align-items: center;
  gap: 0.4rem;
  color: #fff;
  transition: color 0.15s;
}
.bar-top a:hover { color: var(--accent); }
.bar-top .sep { opacity: 0.35; }
.bar-top svg { width: 16px; height: 16px; }

/* ---------- 4. Header / Navigation ---------- */
.site-header {
  position: sticky;
  top: var(--bar-top);
  z-index: 998;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
  display: flex;
  align-items: center;
}
.site-header .header-inner {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.logo {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.logo .dot { color: var(--accent); }

.nav-toggle { display: none; }

.main-nav ul {
  display: flex;
  gap: 1.75rem;
  align-items: center;
}
.main-nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s, color 0.15s;
}
.main-nav a:hover,
.main-nav a.active {
  border-bottom-color: var(--accent);
  color: var(--text);
}

/* Mobile nav toggle */
.nav-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--text);
}

/* ---------- 5. Layout Utilities ---------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.container-narrow {
  max-width: var(--narrow);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.section { padding: 3rem 0; }
.section-lg { padding: 4rem 0; }
.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}
.section-sub {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 2rem;
}
.text-center { text-align: center; }

/* ---------- 6. Hero ---------- */
.hero {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  color: #fff;
  padding: 3.5rem 0;
}
.hero-inner {
  display: flex;
  align-items: center;
  gap: 3rem;
}
.hero-text {
  flex: 1 1 50%;
}
.hero-image {
  flex: 1 1 50%;
  border-radius: var(--r-large);
  overflow: hidden;
  aspect-ratio: 4 / 3;
}
.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero h1 {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}
.hero p {
  font-size: 1.125rem;
  opacity: 0.85;
  margin-bottom: 1.75rem;
  max-width: 520px;
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--r-btn);
  transition: background 0.15s, transform 0.15s;
}
.hero-cta:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

/* ---------- 7. Category Grid (Homepage) ---------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}
.category-card {
  display: block;
  background: #fff;
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}
.category-card:hover {
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
}
.category-card .img-placeholder {
  height: 180px;
  background: #e8e8e8 url('images/product-placeholder-image.avif') center/cover no-repeat;
}
.category-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}
.category-card .cat-body {
  padding: 1.25rem 1.25rem 1.5rem;
}
.category-card .cat-body h3 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.3rem;
}
.category-card .cat-body p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ---------- 8. Image Placeholder ---------- */
.img-placeholder {
  background: #e8e8e8 url('images/product-placeholder-image.avif') center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- 9. Product Cards ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2rem;
}
.product-card {
  background: #fff;
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
}

.product-sticky {
  position: relative;
  border-left: 4px solid #d4a017;
  background: linear-gradient(to right, #fffdf5, #fff);
}
.product-sticky::before {
  content: "★ Vakiotuote";
  position: absolute;
  top: 12px;
  right: 12px;
  background: #d4a017;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 4px;
  z-index: 2;
  text-transform: uppercase;
}

/* Carousel */
.carousel {
  position: relative;
  height: 240px;
  overflow: hidden;
  background: var(--bg-warm);
}
.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.35s ease;
}
.carousel-slide {
  flex: 0 0 100%;
  height: 100%;
}
.carousel-slide .img-placeholder {
  width: 100%;
  height: 100%;
}
.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: background 0.15s;
  z-index: 5;
}
.carousel-btn:hover { background: #fff; }
.carousel-btn.prev { left: 0.75rem; }
.carousel-btn.next { right: 0.75rem; }
.carousel-dots {
  position: absolute;
  bottom: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.4rem;
  z-index: 5;
}
.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}
.carousel-dot.active { background: var(--accent); }

/* Card body */
.product-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.product-code {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}
.product-title {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}
.product-specs {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.4rem 0.75rem;
  font-size: 0.875rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.75rem;
}
.product-specs dt {
  font-weight: 600;
  color: var(--text-secondary);
}
.product-specs dd {
  color: var(--text);
}
.product-specs dt::after { content: ':'; }
.product-extra {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
  flex: 1;
}
.product-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--text);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--r-btn);
  transition: background 0.15s;
  align-self: flex-start;
}
.product-cta:hover { background: var(--accent); }

/* ---------- 10. Service / Info Blocks ---------- */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
}
.service-card {
  text-align: center;
  padding: 2rem 1.5rem;
}
.service-card .icon-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.75rem;
}
.service-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.service-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ---------- 11. CTA Banner ---------- */
.cta-banner {
  background: linear-gradient(135deg, var(--text) 0%, #333 100%);
  color: #fff;
  border-radius: var(--r-large);
  padding: 3rem;
  text-align: center;
  margin: 2rem 0;
}
.cta-banner h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.cta-banner p {
  opacity: 0.8;
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
}
.cta-banner .btn-accent {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  padding: 0.75rem 2rem;
  border-radius: var(--r-btn);
  font-size: 1rem;
  transition: background 0.15s;
}
.cta-banner .btn-accent:hover { background: var(--accent-dark); }

/* ---------- 12. Content Page (narrow) ---------- */
.page-content {
  padding: 3rem 0;
}
.page-content h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}
.page-content h2 {
  font-size: 1.35rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}
.page-content p {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 1rem;
}
.page-content ul {
  list-style: disc;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}
.page-content ul li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

/* ---------- 13. Trust Section ---------- */
.trust-section {
  background: var(--bg-warm);
  padding: 3rem 0;
}
.trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  text-align: center;
}
.trust-item {
  padding: 1rem;
}
.trust-item .trust-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.03em;
}
.trust-item .trust-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* ---------- 14. Footer ---------- */
.site-footer {
  background: var(--text);
  color: #fff;
  padding: 3rem 0 1.5rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-col h4 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  color: #fff;
}
.footer-col ul li {
  margin-bottom: 0.6rem;
}
.footer-col a {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
  transition: color 0.15s;
}
.footer-col a:hover { color: var(--accent); }
.footer-col p {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
  line-height: 1.6;
}
.footer-contact a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.95rem;
  color: #fff;
  font-weight: 500;
  margin-bottom: 0.5rem;
}
.footer-contact a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
}
.footer-logo {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  display: block;
}
.footer-logo .dot { color: var(--accent); }

/* ---------- 15. Lightbox ---------- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.85);
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--r-btn);
  overflow: hidden;
}
.lightbox-content img {
  max-width: 90vw;
  max-height: 90vh;
  display: block;
  border-radius: var(--r-btn);
}
.lightbox-content .img-placeholder {
  width: 600px;
  height: 400px;
  font-size: 1rem;
}
.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  z-index: 10;
}
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255,255,255,0.35);
}
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }


/* ---------- 19. Contact Form Modal ---------- */
.form-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2100;
  align-items: center;
  justify-content: center;
}
.form-modal.open { display: flex; }
.form-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  cursor: pointer;
}
.form-modal-box {
  position: relative;
  background: #fff;
  border-radius: var(--r-card);
  padding: 2rem;
  max-width: 400px;
  width: calc(100% - 2rem);
  box-shadow: var(--shadow-lift);
  z-index: 1;
}
.form-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-light);
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.form-modal-close:hover { background: var(--border); }
.form-modal-box h3 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.3rem;
}
.form-modal-sub {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}
.form-field { margin-bottom: 1rem; }
.form-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--text);
}
.form-field input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border-dark);
  border-radius: var(--r-btn);
  font-size: 1rem;
  font-family: var(--font-body);
  color: var(--text);
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.form-field input:focus {
  outline: none;
  border-color: var(--accent);
}
.form-submit {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.75rem;
  border-radius: var(--r-btn);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.form-submit:hover { background: var(--accent-dark); }
.form-success {
  text-align: center;
  padding: 2rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
}

/* ---------- 20. Secondary Button ---------- */
.btn-outline {
  display: inline-block;
  background: transparent;
  color: #fff;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: var(--r-btn);
  font-size: 1rem;
  border: 2px solid rgba(255,255,255,0.3);
  margin-left: 0.75rem;
  transition: border-color 0.15s, background 0.15s;
}
.btn-outline:hover {
  border-color: #fff;
  background: rgba(255,255,255,0.1);
}

/* ---------- 16. Breadcrumb ---------- */
.breadcrumb {
  padding: 1.25rem 0 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { margin: 0 0.4rem; }

/* ---------- 17. Page Header ---------- */
.page-header {
  padding: 2rem 0 1rem;
}
.page-header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.3rem;
}
.page-header p {
  color: var(--text-secondary);
  font-size: 1.05rem;
}

/* ---------- 18. Responsive ---------- */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root {
      --bar-top: 40px;
      --header-h: 64px;
  }

  .bar-top { font-size: 0.8rem; gap: 1rem; overflow: hidden; }

  .nav-toggle { display: flex; align-items: center; }

  .main-nav {
    display: none;
    position: fixed;
    top: calc(var(--bar-top) + var(--header-h));
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(100vh - var(--bar-top) - var(--header-h));
    background: #fff;
    padding: 1rem 1.5rem;
    transform: translateX(100%);
    transition: transform 0.25s;
    z-index: 997;
    overflow-y: auto;
  }
  .main-nav.open { display: block; transform: translateX(0); }
  .main-nav ul {
    flex-direction: column;
    gap: 0;
    padding-top: 1rem;
  }
  .main-nav ul li {
    width: 100%;
    border-bottom: 1px solid var(--border);
  }
  .main-nav a {
    display: block;
    padding: 1rem 0;
    font-size: 1.1rem;
    border-bottom: none;
  }

  .hero { padding: 2rem 0; }
  .hero-inner { flex-direction: column; gap: 1.5rem; }
  .hero-image { width: 100%; }
  .hero h1 { font-size: 1.85rem; }
  .hero p { font-size: 1rem; }

  .section { padding: 2rem 0; }
  .section-title { font-size: 1.4rem; }

  .product-grid { grid-template-columns: 1fr; }

  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-bottom { flex-direction: column; gap: 0.5rem; text-align: center; }

  .cta-banner { padding: 2rem 1.5rem; }
  .cta-banner h2 { font-size: 1.35rem; }
}

@media (max-width: 480px) {
  .bar-top { font-size: 0.72rem; gap: 0.75rem; }
  .bar-top .sep { display: none; }
  .bar-top .phone-label { display: none; }
  .form-modal-box {
    padding: 1.5rem;
    max-width: calc(100% - 1rem);
  }
  .btn-outline {
    margin-left: 0;
    margin-top: 0.75rem;
  }
  .hero h1 { font-size: 1.5rem; }
  .hero-image { aspect-ratio: 16 / 10; }
  .category-grid { grid-template-columns: 1fr; }
}
