/* =========================
   FONTS AND COLORS
========================= */

/* Fonts */
@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&family=Roboto:wght@300;400;500&display=swap");

/* Root variables for colors and shadows */
:root {
  --bg: #ffffff; /* pure white background */
  --primary: #4caf50; /* main green for buttons/highlights */
  --secondary: #8bc34a; /* hover green */
  --muted: #555555; /* subtle text */
  --shadow: rgba(0, 0, 0, 0.08);
  --accent: #81d4fa; /* light blue accent */
}

/* =========================
   GLOBAL RESET
========================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Roboto", sans-serif;
  background: var(--bg);
  color: var(--muted);
}

/* =========================
   LOGO
========================= */
.logo-container {
  width: 100%;
  display: flex;
  justify-content: center; /* center logo */
  margin-top: 150px; /* spacing from top */
  z-index: 1100; /* above navbar */
  padding: 10px 0;
}

.logo-container img {
  width: 360px;
  height: auto;
}

.logo-wrapper img {
  width: 160px;
  height: auto;
  margin-bottom: 10px; /* spacing from other elements */
}

/* =========================
   LAYOUT
========================= */
.layout {
  display: grid;
  grid-template-columns: 1fr min(1200px, 90%) 1fr;
  gap: 16px;
  margin-top: 1rem; /* leave space for navbar */
}

.main-content {
  width: 100%;
}

/* =========================
   NAVBAR
========================= */

/* ===== NAVBAR (clean) ===== */
.header-container {
  position: relative;
} /* for absolute menu positioning */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--bg);
  display: flex;
  justify-content: center;
  box-shadow: 0 2px 10px var(--shadow);
  padding: 12px 0;
  z-index: 1000;
}

/* Desktop menu (visible) */
nav ul.nav-list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 25px;
  list-style: none;
}

/* Links */
nav ul.nav-list li a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-family: "Montserrat", sans-serif;
  padding: 12px 20px;
  border-radius: 8px;
  transition: all 0.3s ease;
  display: inline-block;
}
nav ul.nav-list li a:hover {
  background: var(--accent);
  box-shadow: 0 4px 12px var(--shadow);
  color: var(--primary);
}

/* Hamburger (hidden on desktop) */
.hamburger {
  display: none;
  position: absolute;
  top: -100px;
  right: 50px;
  width: 48px;
  height: 48px;
  background: transparent;
  border: 0;
  cursor: pointer;
  z-index: 1200;
  display: none;
}
.hamburger span {
  display: block;
  height: 3px;
  width: 100%;
  background: var(--muted);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.hamburger span + span {
  margin-top: 10px;
}
.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 6px);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile rules */
@media (max-width: 768px) {
  /* show hamburger on mobile */
  .hamburger {
    display: block;
  }

  /* hide menu by default on mobile */
  nav ul.nav-list {
    display: none; /* hidden by default */
    flex-direction: column;
    gap: 16px;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0; /* drop under navbar */
    background: var(--bg);
    padding: 16px 20px;
    box-shadow: 0 4px 12px var(--shadow);
  }

  /* show menu when <ul> has .open */
  nav ul.nav-list.open {
    display: flex;
  }
}

/* Total cost next to cart */
.total-cost {
  font-weight: 600;
  font-size: 1rem;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
}

/* =========================
   PRODUCTS / CATALOG
========================= */
.products-container,
.catalog-grid {
  display: grid;
  gap: 24px;
  padding: 20px 0;
}

.products-container {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.catalog-grid {
  grid-template-columns: repeat(5, 1fr);
}

.card,
.product-card {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 4px 12px var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.card:hover,
.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px var(--shadow);
}

.card img,
.product-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 12px;
  box-shadow: 0 2px 6px var(--accent);
}

.card h3,
.product-card h3 {
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  color: var(--primary);
  font-size: 1rem;
  margin-bottom: 6px;
}

.card p,
.product-card p {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.card button,
.product-card button {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.card button:hover,
.product-card button:hover {
  background: var(--secondary);
  box-shadow: 0 4px 12px var(--shadow);
}

/* Responsive product grids */
@media (max-width: 1200px) {
  .products-container,
  .catalog-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .products-container,
  .catalog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .products-container,
  .catalog-grid {
    grid-template-columns: repeat(1, 1fr);
  }
}

/* =========================
   CART PAGE
========================= */
.cart-page {
  display: flex;
  gap: 20px;
  max-width: 1200px;
  margin: 100px auto;
  padding: 0 20px;
  font-family: "Roboto", sans-serif;
}

.cart-left {
  flex: 3; /* 75% width */
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cart-right {
  flex: 1; /* 25% width */
  background: #f9f9f9;
  padding: 20px;
  border-radius: 14px;
  box-shadow: 0 4px 12px var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  height: fit-content;
}

.cart-item {
  display: flex;
  gap: 16px;
  background: #fff;
  padding: 16px;
  border-radius: 14px;
  box-shadow: 0 4px 12px var(--shadow);
  align-items: center;
}

.cart-item-img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 2px 6px var(--accent);
}

.cart-item-details h3 {
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
}

.cart-item-details p {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.cart-item-details input[type="number"] {
  width: 60px;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  text-align: center;
}

.remove-btn,
.clear-btn,
.checkout-btn {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.remove-btn:hover,
.clear-btn:hover,
.checkout-btn:hover {
  background: var(--secondary);
  box-shadow: 0 4px 12px var(--shadow);
}

.clear-btn {
  align-self: flex-start;
}

.checkout-btn {
  width: 100%;
}

/* Responsive cart page */
@media (max-width: 768px) {
  .cart-page {
    flex-direction: column;
    margin: 80px 10px;
    gap: 16px;
    padding: 0 10px;
  }

  .cart-left,
  .cart-right {
    flex: 1 1 100%;
    width: 100%;
  }

  .cart-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .cart-item-img {
    width: 100%;
    height: auto;
    max-height: 200px;
    border-radius: 12px;
  }

  .cart-item-details input[type="number"] {
    width: 50px;
    padding: 4px 6px;
  }

  .cart-right {
    align-items: stretch;
    padding: 16px;
  }

  .checkout-btn {
    padding: 12px 0;
  }
}

/* =========================
   FOOTER
========================= */
footer,
.footer {
  width: 100%;
  background: #f9f9f9;
  padding: 30px 20px;
  text-align: center;
  color: var(--muted);
  font-family: "Roboto", sans-serif;
  border-top: 1px solid var(--shadow);
}

.footer-logo img {
  width: 150px;
  height: auto;
  margin-bottom: 20px;
  filter: drop-shadow(0 2px 4px var(--accent));
}

.footer-text {
  font-family: "Montserrat", sans-serif;
  font-weight: 400;
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto 20px;
  line-height: 1.6;
}

.footer-rights {
  font-size: 0.875rem;
  color: var(--primary);
  font-weight: 600;
}

/* Footer responsive */
@media (max-width: 768px) {
  .footer-text {
    font-size: 0.9rem;
    padding: 0 10px;
  }

  .footer-logo img {
    width: 120px;
  }
}
