/* css/style.css */

/* --- 1. Imports & Variables --- */
@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@500;700&family=Inter:wght@400;500&display=swap');

:root {
  /* Color Palette (Section 5.2) */
  --color-bg: rgb(10, 25, 47);          /* Abyssal (Dark Navy) */
  --color-bg-light: rgb(20, 35, 55);    /* Lighter card background */
  --color-text: rgb(240, 240, 240);       /* High-Contrast White */
  --color-text-secondary: rgb(130, 140, 160); /* Muted Gray */
  --color-accent: #00FFFF;                /* Electric Cyan */

  /* Typography (Section 5.3) */
  --font-heading: 'Rubik', sans-serif;
  --font-body: 'Inter', sans-serif;
}

/* --- 2. Global Resets & Base Styles --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 100%; /* 16px */
  scroll-behavior: smooth;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.6;
}

main {
  /* Ensures main content is clear of fixed header if we add one */
  padding-top: 80px;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

/* --- 3. Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--color-text);
}

h1 { font-size: 3rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.5rem; }

p {
  margin-bottom: 1.25rem;
  color: var(--color-text-secondary);
}

p.lead {
  font-size: 1.25rem;
  color: var(--color-text);
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: opacity 0.3s ease;
}

a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

ul {
  list-style-position: inside;
  margin-bottom: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
  color: var(--color-text-secondary);
}

/* --- 4. Global Elements (Header & Footer) --- */
.site-header {
  background: var(--color-bg-light);
  border-bottom: 1px solid var(--color-accent);
  padding: 1rem 0;
  position: fixed; /* Fixed for demo, can be relative */
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
}

.logo span {
  color: var(--color-accent);
}

.main-nav {
  display: flex;
  gap: 1.5rem;
}

.main-nav a {
  font-family: var(--font-body);
  font-weight: 500;
  text-decoration: none;
  font-size: 1rem;
  transition: color 0.3s ease;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--color-text);
  text-decoration: none;
}

.site-footer {
  text-align: center;
  padding: 3rem 1.5rem 2rem;
  margin-top: 4rem;
  border-top: 1px solid var(--color-bg-light);
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

.footer-links {
  margin: 0.5rem 0;
}

.footer-links a {
  margin: 0 0.5rem;
}

/* --- 5. Components (Buttons, Cards) --- */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 5px;
  background: var(--color-accent);
  color: var(--color-bg);
  font-family: var(--font-body);
  font-weight: 700;
  text-decoration: none;
  border: 2px solid var(--color-accent);
  transition: all 0.3s ease;
  cursor: pointer;
  font-size: 1rem;
}

.btn:hover {
  background: transparent;
  color: var(--color-accent);
  text-decoration: none;
}

.btn-secondary {
  background: transparent;
  color: var(--color-accent);
}

.btn-secondary:hover {
  background: var(--color-accent);
  color: var(--color-bg);
}

/* Product Showcase Card (Section 5.4) */
.product-card {
  background: var(--color-bg-light);
  border-radius: 8px;
  padding: 1.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card:hover {
  transform: translateY(-5px);
  border-color: var(--color-accent);
}

.product-card img {
  border-radius: 5px;
  margin-bottom: 1rem;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--color-bg); /* Placeholder bg */
}

.product-card h3 {
  color: var(--color-accent);
}

.product-card .btn-secondary {
  margin-top: auto;
}

/* --- 6. Page-Specific Styles --- */

/* Section Utility */
.page-section {
  padding: 4rem 0;
  text-align: center;
}

.page-section.text-left {
  text-align: left;
}

/* Home: Hero */
.hero {
  padding: 6rem 0;
  text-align: center;
}
.hero h1 {
  font-size: 3.5rem;
}
.hero .sub-headline {
  font-size: 1.25rem;
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 1rem auto 2rem;
}
.hero .btn {
  margin: 0 0.5rem;
}

/* Home: Product Showcase */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 2rem;
}

/* Home: CTA Section */
.cta-section {
  background: var(--color-bg-light);
  padding: 4rem 1.5rem;
  border-radius: 8px;
  text-align: center;
}
.cta-section h2 {
  color: var(--color-accent);
}

/* About/Contact Form */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  text-align: left;
}
.form-group {
  margin-bottom: 1.5rem;
}
.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--color-text-secondary);
  background: var(--color-bg-light);
  color: var(--color-text);
  border-radius: 5px;
  font-family: var(--font-body);
}
.form-group textarea {
  min-height: 150px;
  resize: vertical;
}

/* Product Detail Page */
.product-header {
  text-align: center;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--color-bg-light);
}
.product-header .lead {
  font-size: 1.25rem;
  color: var(--color-text-secondary);
  max-width: 700px;
  margin: 0 auto 2rem;
}
.product-content {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  text-align: left;
}
.product-gallery img {
  border-radius: 5px;
  border: 1px solid var(--color-bg-light);
  margin-bottom: 1rem;
}
.legal-notice {
  font-size: 0.9rem;
  font-style: italic;
  margin-top: 2rem;
  color: var(--color-text-secondary);
}

/* Legal Pages */
.legal-content h2 {
  color: var(--color-accent);
  margin-top: 2rem;
}

/* --- 7. Mobile Responsiveness (Requirement 2) --- */
.hamburger-btn {
  display: none; /* Hidden on desktop */
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1001;
}

.hamburger-btn .bar {
  display: block;
  width: 25px;
  height: 3px;
  margin: 5px auto;
  background-color: var(--color-accent);
  transition: all 0.3s ease-in-out;
}

@media (max-width: 768px) {
  .main-nav {
    /* Mobile Menu: Fixed, full-screen overlay */
    position: fixed;
    top: 0;
    left: -100%; /* Start off-screen */
    width: 100%;
    height: 100vh;
    background: var(--color-bg);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    transition: left 0.3s ease-in-out;
  }

  .main-nav.is-active {
    left: 0; /* Slide in */
  }

  .main-nav a {
    font-size: 1.5rem;
  }

  .hamburger-btn {
    display: block; /* Show hamburger */
  }

  /* Hamburger "X" animation */
  .hamburger-btn.is-active .bar:nth-child(2) {
    opacity: 0;
  }
  .hamburger-btn.is-active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  .hamburger-btn.is-active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  /* Stack grids */
  .product-grid {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .product-content {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 4rem 0;
  }
  .hero h1 {
    font-size: 2.5rem;
  }
}

/* --- 8. Carousel Styles --- */
.carousel {
  position: relative;
  overflow: hidden;
  border-radius: 5px;
  background: var(--color-bg);
  cursor: pointer;
}

.carousel-track {
  display: flex;
  transition: transform 0.3s ease-in-out;
}

.carousel-slide {
  flex: 0 0 100%;
  min-width: 0;
  padding: 0 1rem; /* Adds some spacing around the image */
}

/* Override existing margin for images inside the carousel */
.carousel-slide img {
  margin-bottom: 0;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(10, 25, 47, 0.7);
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.5rem;
  font-weight: bold;
  box-sizing: border-box;
  padding-bottom: 0.7vh;
  cursor: pointer;
  transition: background 0.3s ease;
}

.carousel-btn:hover {
  background: var(--color-bg);
  color: var(--color-text);
  text-decoration: none;
}

.carousel-btn.prev {
  left: 10px;
}

.carousel-btn.next {
  right: 10px;
}

/* --- 9. Lightbox Styles --- */

.lightbox {
  /* Hidden by default */
  display: none; 
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85); /* Darker overlay */
  
  /* Use flex to center the content */
  justify-content: center;
  align-items: center;
  cursor: pointer; /* Change cursor to pointer to indicate closable */
}

.lightbox.is-active {
  /* Show when active */
  display: flex; 
}

.lightbox-content {
  position: relative;
  /* Clicks on the image shouldn't close the modal */
  cursor: default; 
}

.lightbox-img {
  max-width: 90vw; /* Max 90% of viewport width */
  max-height: 90vh; /* Max 90% of viewport height */
  object-fit: contain;
  border-radius: 5px;
}

/* Style the lightbox buttons */
.lightbox-btn {
  /* Re-use and adapt carousel button styles */
  position: fixed; /* Fixed to viewport */
  top: 50%;
  transform: translateY(-50%);
  z-index: 1001;
  background: rgba(10, 25, 47, 0.7);
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
  border-radius: 50%;
  width: 45px;
  height: 45px;
  font-size: 1.75rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease;
  
  /* Centering fix */
  box-sizing: border-box;
  padding-bottom: 0.7vh;
}

.lightbox-btn:hover {
  background: var(--color-bg);
  color: var(--color-text);
  text-decoration: none;
}

.lightbox-btn.prev {
  left: 20px;
}

.lightbox-btn.next {
  right: 20px;
}
