/*
  Canon‑Style Printer Support & Shop Stylesheet
  --------------------------------------------------
  This CSS file defines the visual design for the printer
  support and shop website.  The look draws inspiration
  from Canon’s clean, trustworthy aesthetic: white and
  neutral surfaces, crisp typography and a bold red
  accent.  It uses modern CSS features such as flexbox,
  grid, custom properties and prefers‑color‑scheme for
  dark mode.  All styles maintain WCAG AA contrast and
  accessible focus states.
*/

:root {
  /* Colour palette */
  --accent: #D70018;
  --text-color: #222;
  --bg-color: #ffffff;
  --surface: #f5f5f5;
  --border-color: #e0e0e0;
  --focus-ring: #005fcc;
  /* Typography */
  --font-body: 'Inter', sans-serif;
  --font-heading: 'Inter', sans-serif;
  /* Spacing */
  --radius: 8px;
  --transition: 0.2s ease;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #121212;
    --surface: #1f1f1f;
    --text-color: #f5f5f5;
    --border-color: #333;
    --accent: #e53935;
    --focus-ring: #90caf9;
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  line-height: 1.6;
  background-color: var(--bg-color);
  color: var(--text-color);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* Prevent horizontal scrolling on small screens */
  overflow-x: hidden;
}

/* Ensure root element also hides horizontal overflow */
html {
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: underline;
}

header,
footer {
  background-color: var(--surface);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 1.5rem;
}

/* Support phone bar */
.support-phone {
  text-align: center;
  background-color: var(--surface);
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-color);
}

.support-phone a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

/* Support text within the hero section */
/* Support line within the hero section */
.hero-support {
  margin-top: 0.75rem;
  display: inline-block;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-color);
  background-color: var(--surface);
  border: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  max-width: 100%;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.hero-support a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

/* Support line on catalog and other pages */
.catalog-support {
  margin: 0.5rem 0 1.5rem;
  display: inline-block;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-color);
  background-color: var(--surface);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius);
  max-width: 100%;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.catalog-support a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

/* Sticky call button for mobile */
.sticky-call {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--accent);
  color: #fff;
  text-align: center;
  padding: 0.75rem;
  font-weight: 600;
  z-index: 999;
  text-decoration: none;
}

@media (max-width: 720px) {
  .sticky-call {
    display: block;
  }
}

/* Responsive navigation */
nav {
  position: relative;
}

nav .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

nav .menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--accent);
  cursor: pointer;
}

@media (max-width: 720px) {
  nav .menu-toggle {
    display: block;
  }
  nav .nav-links {
    display: none;
    flex-direction: column;
    background-color: var(--surface);
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
  }
  nav .nav-links.open {
    display: flex;
  }
}

header nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

header nav a {
  margin-right: 1rem;
  font-weight: 500;
}

header nav a:last-child {
  margin-right: 0;
}

main {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem 2rem;
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
  margin-bottom: 3rem;
}

.hero picture img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.hero-content {
  text-align: center;
}

.hero-content h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

.hero-content p {
  font-size: clamp(1rem, 2vw, 1.25rem);
  margin-bottom: 1.5rem;
  color: var(--text-color);
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background-color: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  font-weight: 500;
  transition: background-color var(--transition), transform var(--transition);
}

.btn:hover,
.btn:focus {
  background-color: darken(var(--accent), 5%);
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.btn-secondary:hover,
.btn-secondary:focus {
  background-color: var(--accent);
  color: #fff;
}

.search-section {
  margin-bottom: 2rem;
}

.search-section input[type="search"] {
  width: 100%;
  max-width: 400px;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 1rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  background-color: var(--surface);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background-color var(--transition), color var(--transition);
}

.chip.active,
.chip:hover {
  background-color: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.card {
  background-color: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: 0 4px 8px rgba(0,0,0,0.04);
  overflow: hidden;
  transition: transform var(--transition);
  display: flex;
  flex-direction: column;
}

.card:hover,
.card:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.08);
}

.card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.card-content {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-content h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.card-content ul {
  list-style: disc;
  margin-left: 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.card-content .buy-btn {
  margin-top: auto;
  align-self: flex-start;
  text-decoration: none;
}

details {
  background-color: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

details summary {
  cursor: pointer;
  font-weight: 600;
}

details[open] summary {
  color: var(--accent);
}

footer {
  border-top: 1px solid var(--border-color);
  background-color: var(--surface);
  padding: 1rem 1.5rem;
  font-size: 0.875rem;
}

footer .footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 0.5rem;
}

footer p {
  text-align: center;
  color: var(--text-color);
}

/* Responsive adjustments */
@media (min-width: 768px) {
  .hero {
    grid-template-columns: 1fr 1fr;
    text-align: left;
  }
  .hero-content {
    text-align: left;
  }
}