/* ==========================================================================
   C-Sky Photonic - STYLESHEET
   Theme: #008080 (Teal) Navbar, Sidebar & Footer | White Background & Text
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. GLOBAL VARIABLES & RESET
   -------------------------------------------------------------------------- */
:root {
  /* Strict Equation: Header Height = Sidebar Width = Footer Height (20% of page) */
  --dimension-size: 20vh;

  /* User Specified Color Scheme */
  --theme-teal: #008080;
  --theme-teal-hover: #006666;
  --bg-page: #ffffff;
  --text-white: #ffffff;
  --text-dark: #1e293b;
  --border-light: #e2e8f0;

  --font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

html, body {
  height: 100%;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-page); /* White background */
  color: var(--text-dark);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s ease, background-color 0.2s ease;
}

/* --------------------------------------------------------------------------
   2. NAVBAR (#008080 Background, White Text, Full Width, Height = 20vh)
   -------------------------------------------------------------------------- */
.navbar {
  width: 100%;
  height: var(--dimension-size);        /* 20vh */
  background-color: var(--theme-teal);  /* #008080 */
  color: var(--text-white);             /* White text */

  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  gap: 1.5rem;
  flex-shrink: 0;
  z-index: 10;
}

.logo {
  display: flex;
  align-items: center;   
  gap: 1rem;              
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--text-white);
  white-space: nowrap;
}

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

.nav-links a {
 font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-white);
  position: relative;
  padding: 0.25rem 0;
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background-color: var(--text-white);
  transition: width 0.2s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

.search-box {
  padding: 0.55rem 1rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-white);
  font-size: 0.9rem;
  outline: none;
  min-width: 140px;
  max-width: 200px;
  transition: background-color 0.2s, border-color 0.2s;
}

.search-box::placeholder {
  color: rgba(255, 255, 255, 0.8);
}

.search-box:focus {
  background: #000000;
  color: var(--text-white);
  border-color: #000000;
}

/* BURGER BUTTON: Hidden on desktop, visible on mobile */
.mobile-toggle-btn {
  display: none;
  background: none;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 6px;
  color: var(--text-white);
  font-size: 1.5rem;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.mobile-toggle-btn:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

/* --------------------------------------------------------------------------
   3. HERO SECTION & SIDEBAR (#008080 Sidebar, White Background Area)
   -------------------------------------------------------------------------- */
.herosection {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, var(--dimension-size)) 1fr;
  grid-template-rows: 1fr;
  grid-template-areas: "sidebar content";
  overflow: hidden;
  background-color: var(--bg-page);
}

/* SIDEBAR: Starts below navbar on the left, Width = 20vh, Background = #008080 */
.sidebar {
  grid-area: sidebar;
  width: 20vh;
  min-width: 20vh;
  max-width: var(--dimension-size);
  position: sticky;
  top: 0;
  height: calc(100vh - (var(--dimension-size) * 2));
  align-self: start;
  background-color: var(--theme-teal);
  color: var(--text-white);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 0.75rem;
  gap: 0.75rem;
  overflow-y: auto;
  z-index: 10;
}

.breadcrumb {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.8rem;
}

.breadcrumb li + li::before {
  content: "/";
  margin: 0 10px;
  color: #888;
}

.content {
  margin: 5vh;
  overflow-y: auto;
}


.product-category {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 5vh;
  width: 100%;
  gap: 2.5vh;
}

.card {
  height: 35vh;
  border: 1px solid var(--border-light); /* Cleaned up harsh black border */
  border-radius: 8px;                    /* Soft modern corners */
  display: grid;
  grid-template-rows: 3fr 1fr;
  overflow: hidden;
  background-color: var(--bg-page);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Elegant card hover interaction */
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  border-color: var(--theme-teal);       /* Highlights card with your theme color */
}

.product-image {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 1.5rem;                       /* Prevents the image from hitting the card borders */
  background-color: #f8fafc;             /* Subtle light grey backdrop behind the product */
  overflow: hidden;
}

/* CRITICAL FIX: Ensures the dynamic product image scales cleanly without breaking layout */
.product-image img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;                   /* Guarantees the optics product never distorts */
  transition: transform 0.3s ease;
}

/* Subtle zoom effect on the image when the container is hovered */
.card:hover .product-image img {
  transform: scale(1.05);
}

.product-name {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  background-color: var(--bg-page);
}

.product-name a {
  width: 100%;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;               /* Gracefully cuts off overly long product names */
}

.product-name a:hover {
  color: var(--theme-teal); 
}         

/* --------------------------------------------------------------------------
   5. FOOTER (NO SCROLLBAR)
   -------------------------------------------------------------------------- */
.footer {
  width: 100%;
  min-height: var(--dimension-size);    /* At least 20vh */
  flex: 0 0 auto;
  background-color: var(--theme-teal);  /* #008080 */
  color: var(--text-white);             /* White text */
  box-sizing: border-box;

  /* 5 Equal Columns */
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1.75rem;
  padding: 1.5rem 2.5rem;
  align-items: start;
  align-content: center;
  overflow: hidden;
  z-index: 20;
}

.footer::-webkit-scrollbar {
  display: none;
}

.footer div {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  align-items: flex-start;
}

.footer h4 {
  color: var(--text-white);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.35rem;
  padding-bottom: 0.2rem;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.footer a {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.8rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s ease, transform 0.15s ease;
  display: inline-block;
}

.footer a:hover {
  color: var(--text-white);
  text-decoration: none;
  transform: translateX(3px);
}

.footer p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.76rem;
  line-height: 1.3;
  word-break: break-word;
}

/* --------------------------------------------------------------------------
   6. RESPONSIVE MEDIA QUERIES
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .product-category {
    grid-template-columns: repeat(3, 1fr); /* 3 columns on small desktops/tablets */
  }
}

@media (max-width: 768px) {
  .mobile-toggle-btn {
    display: block; /* Shows your burger button on mobile layouts */
  }
  .herosection {
    grid-template-columns: 1fr;
    grid-template-areas: "content"; /* Hides or alters sticky desktop layout */
  }
  .sidebar {
    display: none; /* Recommended layout adjustment for standard mobile screens */
  }
  .product-category {
    grid-template-columns: repeat(2, 1fr); /* 2 columns on mobile devices */
    gap: 1.5vh;
  }
  .footer {
    grid-template-columns: repeat(2, 1fr); /* Wraps columns cleanly instead of cutting off */
    height: auto;
  }
}

@media (max-width: 480px) {
  .product-category {
    grid-template-columns: 1fr; /* Full single card width on compact phones */
  }
  .footer {
    grid-template-columns: 1fr;
  }
}


/* Requested product card sizing: 200px total = 150px image + 50px name. */
.product-category .card {
  height: 200px;
  grid-template-rows: 150px 50px;
}
.product-category .card .product-image {
  height: 150px;
  padding: 10px;
  box-sizing: border-box;
}
.product-category .card .product-name {
  height: 50px;
  min-height: 50px;
  padding: 10px;
  box-sizing: border-box;
  visibility: visible;
  opacity: 1;
}
.content {
  overflow-y: scroll;
  min-height: 0;
}
