/* === Reset & Base Styles === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Arial', sans-serif;
  background-color: #fff;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

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

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* === Layout === */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid hsl(223, 64%, 98%);
}

.logo a {
  font-weight: bold;
  font-size: 1.5rem;
  color: #000;
}

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

.nav a {
  color: hsl(219, 9%, 45%);
  transition: color 0.3s;
}

.nav a:hover,
.nav a.active {
  color: hsl(220, 13%, 13%);
  border-bottom: 2px solid hsl(26, 100%, 55%);
}

/* === Right Section === */
.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.cart-icon {
  position: relative;
  width: 24px;
  height: 24px;
  background: url('images/icon-cart.svg') no-repeat center;
  background-size: contain;
  cursor: pointer;
}

.cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: hsl(26, 100%, 55%);
  color: hsl(0, 0%, 100%);
  font-size: 12px;
  border-radius: 50%;
  padding: 2px 6px;
  display: none;
}

.profile-pic {
  width: 36px;
  height: 36px;
  background-color: hsl(220, 14%, 75%);
  color: hsl(0, 0%, 100%);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
}

/* === Product Container === */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.product-images {
  flex: 1 1 40%;
}

.product-details {
  flex: 1 1 40%;
}

.main-image,
.lightbox-image {
  width: 100%;
  position: relative;
  background-color: hsl(223, 64%, 98%);
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: 10px;
}

main-image img,
.lightbox-image img {
  width: 100%;
  height: auto;
  border-radius: 10px;
}

.sneaker-image,
.lightbox-sneaker {
  position: absolute;
  inset: 0;
  background: url('images/image-product-1.jpg') no-repeat center/cover;
  border-radius: 10px;
}

.thumbnails,
.lightbox-thumbnails {
  display: flex;
  gap: 1rem;
}

.thumbnail,
.lightbox-thumb {
  width: 80px;
  height: 80px;
  background-color: hsl(220, 14%, 75%);
  border-radius: 10px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.3s, border 0.3s;
}

.thumbnail.active,
.lightbox-thumb.active {
  opacity: 1;
  border: 2px solid hsl(26, 100%, 55%);
}

.thumbnail img,
.lightbox-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

/* === Product Details === */
.product-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
}

.brand {
  text-transform: uppercase;
  color: hsl(26, 100%, 55%);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 1px;
}

.product-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
}

.description {
  color: hsl(219, 9%, 45%);
}

.price-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.price-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.current-price {
  font-size: 1.5rem;
  font-weight: 700;
}

.discount {
  background: hsl(25, 100%, 94%);
  color: hsl(26, 100%, 55%);
  padding: 0.2rem 0.5rem;
  border-radius: 5px;
  font-weight: 700;
}

.original-price {
  text-decoration: line-through;
  color: hsl(220, 14%, 75%);
}

/* === Quantity & Add to Cart === */
.purchase-section {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.quantity-control {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: hsl(223, 64%, 98%);
  padding: 0.5rem 1rem;
  border-radius: 10px;
}

.qty-btn {
  font-size: 1.5rem;
  background: none;
  border: none;
  color: hsl(26, 100%, 55%);
  cursor: pointer;
}

.add-to-cart {
  background: hsl(26, 100%, 55%);
  color: hsl(0, 0%, 100%);
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.3s;
}

.add-to-cart:hover {
  background: hsl(26, 100%, 60%);
}

/* === Cart Sidebar === */
.cart-overlay {
  position: absolute;
  top: 60px;
  right: 20px;
  background-color: hsl(0, 0%, 100%);
  box-shadow: 0 5px 15px rgba(0,0,0,0.15);
  border-radius: 10px;
  width: 300px;
  z-index: 1000;
  display: none;
}

.cart-overlay.active {
  display: block; /* show when active */
}


.cart-sidebar {
  width: 300px;
  background: hsl(0, 0%, 100%);
  padding: 2rem;
  display: flex;
  flex-direction: column;
}

.cart-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.remove-item {
  margin-top: 10px;
  padding: 1rem;
  background: hsl(26, 100%, 55%);
  color: hsl(0, 0%, 100%);
  border: none;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}

.remove-item:hover {
  background: red;
}

.cart-empty {
  text-align: center;
  color: hsl(219, 9%, 45%);
}

.checkout-btn {
  margin-top: 10px;
  padding: 1rem;
  background: hsl(26, 100%, 55%);
  color: hsl(0, 0%, 100%);
  border: none;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}

/* === Lightbox === */
/* Lightbox Overlay */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  z-index: 9999;
  display: none;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* Ensure this is added when lightbox is opened */
body.lightbox-open {
  overflow: hidden;
}

.lightbox-content {
  background: hsl(0, 0%, 100%);
  padding: 1rem;
  border-radius: 10px;
  max-width: 500px;
  width: 100%;
  position: relative;
}

.lightbox-close,
.lightbox-nav {
  background: none;
  border: none;
  font-size: 1.5rem;
  position: absolute;
  top: 1rem;
  color: hsl(0, 0%, 100%);
  cursor: pointer;
}

.lightbox-close {
  right: 1rem;
}

.lightbox-prev {
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

/* === Responsive === */
@media screen and (max-width: 768px) {
  .container {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .nav {
    display: none;
  }

  .mobile-nav {
    display: block;
    font-size: 2rem;
    cursor: pointer;
  }
}
