/* =========================
   RESET & BASE
========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
  background-color: #1d212d;
  color: #f2f2f2;
  line-height: 1.6;
}

/* =========================
   HEADER & TOP LOGO
========================= */
#top-logo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 20px;
  background: #111;
  border-bottom: 2px solid #333;
}

#top-logo video {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 0 12px rgba(0,255,153,0.4);
}

.branding {
  font-family: 'Orbitron', sans-serif;
  font-size: 2.8rem;
  font-weight: 900;
  color: #00ff99;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow: 1px 1px 4px #000;
  flex: 1;
  text-align: center;
}

/* =========================
   TOP USER LINKS & DROPDOWNS
========================= */
.top-user-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.top-user-links a,
.dropbtn {
  text-decoration: none;
  color: #fff;
  font-weight: bold;
  padding: 6px 12px;
  border-radius: 6px;
  background-color: #222;
  transition: all 0.3s;
}

.top-user-links a:hover,
.dropbtn:hover {
  background-color: #00ff99;
  color: #000;
}

/* Dropdown container */
.dropdown {
  position: relative;
}

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  background: #222;
  min-width: 200px;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.3);
  z-index: 1000;
}

.dropdown-content a {
  display: block;
  padding: 12px 16px;
  color: #fff;
  font-weight: 500;
  transition: all 0.3s;
}

.dropdown-content a:hover {
  background-color: #00ff99;
  color: #000;
}

.dropdown:hover .dropdown-content {
  display: block;
}

/* =========================
   NAVIGATION
========================= */
nav {
  background-color: #222;
  padding: 12px 0;
}

nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
}

nav ul li a {
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  padding: 6px 10px;
  transition: all 0.3s;
}

nav ul li a:hover {
  color: #1abc9c;
}

/* =========================
   PRODUCT GRID
========================= */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

/* PRODUCT CARD */
.product {
  background: #222;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  height: 380px;
  transition: transform 0.3s, box-shadow 0.3s;
  border: 1px solid #333;
}

.product:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0,255,153,0.2);
}

.product img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.product h3 {
  margin: 10px 0 6px;
  font-size: 18px;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #fff;
}

.product p {
  font-size: 14px;
  margin: 4px 0;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #ccc;
}

.product button {
  margin-top: auto;
  padding: 12px;
  border-radius: 8px;
  border: none;
  background-color: #00ff99;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.product button:hover {
  background-color: #00cc7a;
  transform: translateY(-2px);
}

/* =========================
   CATEGORY NAV (GLOBAL)
========================= */

nav {
  overflow-x: auto;
  scrollbar-width: thin;
}

#category-nav {
  display: flex;
  flex-direction: row;
  gap: 12px;
  padding: 10px 15px;
  list-style: none;
  margin: 0;
  white-space: nowrap;
}

#category-nav li {
  flex: 0 0 auto;
  padding: 8px 14px;
  border-radius: 999px;
  background: #111;
  color: #fff;
  cursor: pointer;
  font-size: 0.9rem;
  border: 1px solid #222;
  transition: all 0.2s ease;
}

#category-nav li:hover {
  background: #00ff99;
  color: #000;
}

/* active category */
#category-nav li.active {
  background: #00ff99;
  color: #000;
  font-weight: 600;
}

#product-controls {
  padding: 10px 15px;
}

#product-search {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #222;
  background: #111;
  color: #fff;
  font-size: 1rem;
}

/* =========================
   FOOTER
========================= */
footer {
  text-align: center;
  background-color: #111;
  color: #eee;
  padding: 25px 15px;
  border-top: 1px solid #333;
}

/* =========================
   MOBILE & TABLET (≤768px)
========================= */
@media (max-width: 768px) {

  /* Top logo stack */
  #top-logo {
    flex-direction: column;
    text-align: center;
    gap: 12px;
    padding: 10px 15px;
  }

  .branding {
    font-size: 1.8rem;
  }



  /* Horizontal scroll per category */
  .products-grid {
    display: flex;
    flex-direction: row;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 10px;
    scroll-snap-type: x mandatory;
  }

  .products-grid::-webkit-scrollbar {
    height: 6px;
  }

  .products-grid::-webkit-scrollbar-thumb {
    background-color: #00ff99;
    border-radius: 3px;
  }

  .product {
    flex: 0 0 160px; /* each card width */
    height: 300px;
    scroll-snap-align: start;
    padding: 12px;
  }

  .product img {
    height: 120px;
  }

  .product h3 {
    font-size: 16px;
    -webkit-line-clamp: 2;
  }

  .product p {
    font-size: 13px;
    -webkit-line-clamp: 3;
  }

  .product button {
    padding: 10px;
    font-size: 0.9rem;
  }

  /* Checkout button: fixed at bottom, safe-area aware */
  #checkout-button {
    position: fixed;
    bottom: env(safe-area-inset-bottom, 10px);
    left: 10px;
    right: 10px;
    z-index: 1000;
    padding: 14px;
    background-color: #00ff99;
    color: #000;
    font-weight: bold;
    border: none;
    border-radius: 12px;
    text-align: center;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,255,153,0.3);
    transition: all 0.3s;
  }

  #checkout-button:hover {
    background-color: #00cc7a;
    transform: translateY(-2px);
  }

  /* Cart section adjustments */
  #cart {
    max-height: 250px;
    overflow-y: auto;
  }

  #cart-details ul {
    padding-left: 0;
  }
}
