/* ===== Base Reset ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --text-dark: #fff;
  --text-light: #111;
  --bg-dark: #000;
  --bg-light: #fff;
  --text-color: var(--text-dark);
  --nav-bg-dark: linear-gradient(90deg,#111,#000);
  --nav-bg-light: linear-gradient(90deg,#fff,#ccc);
  --nav-height: 60px;
  --gap-h: 1.25rem;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  scroll-behavior: smooth;
  background-color: var(--bg-dark);
  color: var(--text-dark);
  transition: background-color 0.3s ease, color 0.3s ease;
  margin: 0;
  padding: 0; 
}

body.light-mode {
  background-color: var(--bg-light);
  color: var(--text-light);
  --text-color: var(--text-light);
}

body.light-mode .hamburger span {
  background: #111; 
}

/* NAVBAR (two stacked rows inside one <nav>) */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1200;
  display: flex;
  flex-direction: column; /* stacked: top row + contact row */
  gap: 0;                 /* no gap between rows */
  background: var(--nav-bg-dark);
  color: var(--text-dark);
  box-shadow: 0 1px 0 rgba(255,255,255,0.02) inset;
}

/* Top row that contains logo / links / toggle */
.navbar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-h);
  padding: 0.45rem 1.5rem; /* slightly tighter so contact row sits flush */
  min-height: var(--nav-height);
  width: 100%;
  box-sizing: border-box;
}

/* Logo wrapper - keeps border strictly inside this box */
.logo-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 140px;    /* reserve stable space for logo - prevents overlap */
  min-width: 120px;
  position: relative;
  height: calc(var(--nav-height) - 10px);
}

/* svg border sits inside the wrapper and sized to wrapper */
.logo-border {
  position: absolute;
  inset: 0;               /* fits wrapper exactly */
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
  pointer-events: none;
}

/* Keep the rect inside the svg from overflowing; stroke color toggles with theme */
.logo-border-rect {
  stroke: var(--text-dark);
  stroke-width: 2;
  fill: none;
  stroke-dasharray: 340;
  stroke-dashoffset: 340;
  animation: drawRectBorder 8s linear infinite;
  rx: 8;
  ry: 8;
  vector-effect: non-scaling-stroke;
}

/* Logo image centered, sits above the svg border */
.logo {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 6px;              /* small padding to avoid touching the border */
}

.logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  max-width: 120px;
}

/* Animation for the border */
@keyframes drawRectBorder {
  0%   { stroke-dashoffset: 340; }
  25%  { stroke-dashoffset: 0; }
  50%  { stroke-dashoffset: 0; }
  75%  { stroke-dashoffset: 340; }
  100% { stroke-dashoffset: 340; }
}

/* NAV LINKS (center area) */
.nav-links {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1 1 auto; /* grow so links stay in middle and don't overlap logo */
}

/* each link */
.nav-links li {
  margin: 0;
}

.nav-links li a {
  display: inline-block;
  color: inherit;
  text-decoration: none;
  font-weight: 500;
  padding: 0.25rem 0.15rem;
  position: relative;
  transition: color 0.25s ease;
}

/* underline effect */
.nav-links li a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 0;
  height: 2px;
  background: currentColor;
  transition: width 0.28s ease;
}

.nav-links li a:hover::after,
.nav-links li a[aria-current="page"]::after {
  width: 100%;
}

/* Toggle button on right */
.toggle-mode {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  color: inherit;
  font-size: 20px;
  cursor: pointer;
  padding: 0.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* CONTACT ROW (icons + labels) - flush right under top row */
.navbar-contact {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  width: 100%;
  padding: 0.4rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.06); /* subtle divider */
  background: transparent; /* transparent so nav background continues */
  box-sizing: border-box;
}

/* Each contact link (icon + label) */
.navbar-contact a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: inherit;
  text-decoration: none;
  font-weight: 500;
  padding: 0.2rem 0.25rem;
  transition: color 0.2s ease, transform 0.15s ease;
  line-height: 1;
}

.navbar-contact a:hover {
  color: #ffcc00; /* accent hover color (keeps theme neutral) */
  transform: translateY(-2px);
}

/* icons size */
.navbar-contact i {
  font-size: 1.05rem;
  display: inline-block;
  width: 1.2rem;
  text-align: center;
}

/* Show text on larger screens; hide on smaller screens */
.navbar-contact span {
  display: inline-block;
}

/* Small screens: hide text and tighten layout */
@media (max-width: 768px) {
  .logo-wrapper { flex: 0 0 100px; min-width: 90px; }
  .logo img { max-width: 90px; }
  .nav-links { gap: 0.75rem; }
  .navbar-top { padding: 0.35rem 1rem; }
  .navbar-contact { padding: 0.35rem 1rem; gap: 1rem; border-top-width: 1px; }

  /* hide labels on small screens (only icons remain) */
  .navbar-contact span { display: none; }

  /* shrink nav links so they wrap nicely */
  .nav-links { gap: 0.75rem; font-size: 0.95rem; }
}

/* Light-mode overrides (respect your existing .light-mode body toggling) */
body.light-mode .navbar {
  background: var(--nav-bg-light);
  color: var(--text-light);
}

body.light-mode .logo-border-rect {
  stroke: var(--text-light);
}

body.light-mode .navbar-contact {
  border-top-color: rgba(0,0,0,0.06);
}

/* Accessibility focus states */
.nav-links li a:focus,
.navbar-contact a:focus,
.toggle-mode:focus {
  outline: 3px solid rgba(255,204,0,0.18);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Safety: ensure svg doesn't overflow & cause overlap */
.logo-wrapper,
.logo,
.logo-border { overflow: hidden; }

/* Ensure no accidental margins/gaps from other rules */
.navbar, .navbar-top, .navbar-contact { margin: 0; }

/* ===== Light/Dark Theme Colors ===== */
:root {
  --icon-bar-bg: #fff; /* default light mode */
}
@media (prefers-color-scheme: dark) {
  :root { --icon-bar-bg: #000; }
}
body.light-mode { --icon-bar-bg: #fff; }
body:not(.light-mode) { --icon-bar-bg: #000; }
/* Product card */
body.light-mode .product-card {
  background: #f0f2f5;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); 
}

  .products-container {
    padding: 3rem 2rem;
  }
  
  .product-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 0;
    padding-top: 0;

  }
  
  .product-card {
    background: #181f2a;
    border: 1px solid rgba(255,255,255,0.07);
    padding: 0.6rem;
    border-radius: 12px;
    text-align: center;
    overflow: hidden;
    margin-top: 0;
    transition: transform 0.3s cubic-bezier(.25,.8,.25,1), box-shadow 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    cursor: pointer;

  }
  
  .product-card img {
    width: 100%;
    border-radius: 0.75rem;
    object-fit: cover;
    transition: transform 0.3s cubic-bezier(.25,.8,.25,1);
  }
  
  .product-card h3 {
    margin-top: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
  }

  .product-card p {
  font-size: 0.9rem;
  margin-top: 0.25rem;
  line-height: 1.3;
  max-height: 2.6rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
  
  .product-card:hover {
    transform: scale(1.05);
  }

  .product-card:hover img {
  transform: translateY(-10px) scale(1.03);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  z-index: 2;
}
  
  /* Responsive layout for PC & Tablet */
  @media (min-width: 768px) {
    .product-grid {
      grid-template-columns: repeat(3, 1fr);
    }
  }

/* ===== Footer ===== */
footer {
    background: linear-gradient(90deg, #111 0%, #000 100%);
    color: var(--text-dark);
    padding: 3rem 2rem;
    transition: background 0.3s ease;
  }
  
  body.light-mode footer {
    background: linear-gradient(90deg, #fff 0%, #ccc 100%);
    color: var(--text-light);
  }
  
  .footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2rem;
  }
  
  .footer-column {
    flex: 1;
    min-width: 250px;
  }
  
  .footer-column h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
  }
  
  .footer-column ul {
    list-style: none;
    padding: 0;
  }
  
  .footer-column ul li {
    margin-bottom: 0.5rem;
  }
  
  .footer-column ul li a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
    position: relative;
  }
  
  .footer-column ul li a::after {
    content: "";
    position: absolute;
    width: 0%;
    height: 2px;
    left: 0;
    bottom: -3px;
    background: currentColor;
    transition: width 0.3s ease;
  }
  
  .footer-column ul li a:hover::after {
    width: 100%;
  }
  
  .footer-map iframe {
    width: 100%;
    height: 200px;
    border: none;
    border-radius: 12px;
    transition: box-shadow 0.3s ease;
  }
  
  .footer-map iframe:hover {
    box-shadow: 0 0 0 3px #00ffee;
  }

  @media (max-width: 600px) {
  .nav-links {
    flex-wrap: wrap;
    gap: 0.2rem 0;
    justify-content: center;
    align-items: center;
    width: auto;
    margin: 0;
    padding: 0;
  }
  .nav-links li {
    flex: 0 0 50%;
    text-align: center;
    margin: 0;
    min-width: 0;
    max-width: none;
  }
  .navbar {
    height: auto;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }
}