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

body {
  background: rgb(255, 255, 255);
  transition: background-color 0.2s linear;
  font-family: Arial, Helvetica, sans-serif;
}
.hero h2 {
  font-family: 'Times New Roman', Times, serif
}


body {
  transition: background-color 0.2s linear, color 0.2s linear;
  padding-top: 160px; /* adjust to logo height */
  
}

a,
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  color: inherit;
}


/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: transparent;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-top: 20px;
}


/* Center only the About link */
.header nav a[href="#about"] {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 50px;
}

/* Keep the cart on the right */
.cart-link {
  margin-left: auto;
}


nav {
  display: flex;
  align-items: center;
}
nav a {
  margin-left: 24px;
  text-decoration: none;
  color: rgb(0, 0, 0);
  font-size: 12px;
  text-transform: uppercase;
  transition: color 0.2s;
}


.logo {
  letter-spacing: 0.15em;
}

nav a:hover {
  color: #d10000;
}

/* Hero */
.hero {
  padding: 80px 32px;
  max-width: 600px;
}

.hero h2 {
  font-size: 40px;
  font-weight: 300;
  line-height: 1.2;
}

.hero p {
  margin-top: 24px;
  color: #555;
}

.grid {
  display: flex;
  flex-wrap: wrap;
  gap: 48px;
  padding: 0 32px 96px;
}

.card {
  flex: 0 0 calc(33.333% - 32px); /* same width for all cards */
  text-align: center;
  display: flex;
  flex-direction: column; /* stack image and text vertically */
  align-items: center;
}

.card img {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 8px;
    transition: transform 0.25s ease, filter 0.25s ease;
}

.card p {
  margin: 4px 0;
  overflow-wrap: break-word; /* ensures long text wraps to next line */
  word-wrap: break-word;     /* legacy support */
}

.description {
  font-size: 12px;
  color: #555;
  margin-top: 4px; /* small spacing under the name */
}


.card:hover img {
  transform: scale(1.04);
  filter: drop-shadow(0 25px 45px rgba(209, 0, 0, 0.35));
  filter: drop-shadow(0 25px 45px var(--card-shadow));


}

.card {
  flex: 0 0 calc(33.333% - 32px);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;

  background-color: transparent; /* 🔥 key line */
}


.name {
  margin-top: 16px;
  font-size: 14px;
  transition: color 0.2s;
}

.card:hover .name {
  color: #ffffff;
}

.price {
  font-size: 13px;
  color: inherit;
  opacity: 0.75;
  transition: opacity 0.2s ease;
}

#product-description {
  white-space: pre-line;
  font-size: 12px;      /* bigger text */
  margin-top: 15px;     /* space above description */
  margin-bottom: 20px;  /* space below description */
  max-width: 400px;     /* keeps text readable */
}

.card:hover .price {
  opacity: 1;
}


.footer {
  border-top: 1px solid #e5e5e5;
  padding: 120px 32px;
  text-align: center;
  font-size: 16px;
  color: #ffffff;
  max-width: 900px;
  margin: 0 auto;
  line-height: 1.6;
}

.footer p {
  margin-bottom: 16px;
}


html {
  scroll-behavior: smooth;
}

.cart-link {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: block;
}

.cart-img {
  width: 180px;   /* bigger size */
  height: auto;
  transition: transform 0.3s ease, filter 0.3s ease;

}

.cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: red;
  color: white;
  font-size: 14px;
  padding: 4px 8px;
  border-radius: 50%;
  font-weight: bold;
}

.cart-link {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: block;
}

/* Hover effect */
.cart-link:hover .cart-img {
  transform: rotate(-8deg) scale(1.15);
  filter: drop-shadow(0 0 15px rgba(255, 0, 0, 0.6));
}
.cart-item {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 20px 0;
}

/* image wrapper */
.cart-img-wrapper {
  width: 110px;
  height: 110px;
  background: #f2f2f2;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  overflow: hidden;
}

/* actual image */
.cart-img-wrapper img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.cart-info p {
  margin: 4px 0;
}

#back-btn {
  position: relative;
  z-index: 2000;
  top: 20px;
  right: 20px;
  text-decoration: none;
  background-color: #000000;
  color: #ffffff;
  padding: 10px 15px;
  border-radius: 5px;
  font-weight: bold;
}

#back-btn:hover {
  background-color: #ff0000;
}

.logo-img {
  display: block;
  padding: 20px;
  margin-top: -30px;
  height: 150px;
  width: auto;
}


#total {
  position: fixed;
  top: 50px;
  right: 20px;
  font-size: 30vw; /* responsive size */
  font-weight: bold;
  text-align: right;
  max-width: 900px;
  white-space: nowrap;
  overflow: hidden;
}

#cart-items {
  max-width: 800px;
  padding: 20px;
  padding-right: 350px; /* space for fixed total */
  box-sizing: border-box;
}

#buy-btn {
  display: inline-block;
  margin-left: 20px;   /* aligns with cart padding */
  margin-top: 30px;
  text-decoration: none;
  background-color: black;
  color: white;
  padding: 14px 20px;
  border-radius: 8px;
  font-weight: bold;
}


#buy-btn:hover {
  background-color: #ff0000;
}

html {
  scroll-behavior: smooth;
}

/* MOBILE VERSION */
@media (max-width: 768px) {

  body {
    padding-top: 120px;
  }

  /* Header */
  .header {
    flex-direction: column;
    align-items: center;
    margin-top: 10px;
  }

  nav {
    flex-direction: column;
    gap: 10px;
  }

  nav a {
    margin-left: 0;
    font-size: 11px;
  }

  /* About link center fix */
  .header nav a[href="#about"] {
    position: static;
    transform: none;
    margin-top: 0;
  }

  /* Logo */
  .logo-img {
    height: 90px;
    margin-top: 0;
  }

  /* Hero section */
  .hero {
    padding: 40px 20px;
    max-width: 100%;
    text-align: center;
  }

  .hero h2 {
    font-size: 28px;
  }

  /* Product grid */
  .grid {
    gap: 24px;
    padding: 0 20px 60px;
  }

  .card {
    flex: 0 0 calc(50% - 12px); /* 2 products per row on phone */
  }

  .name {
    font-size: 13px;
  }

  .price {
    font-size: 12px;
  }

  /* Cart icon */
  .cart-img {
    width: 120px;
  }

  /* Cart page */
  #cart-items {
    padding: 20px;
    padding-right: 20px;
  }

  #total {
    position: static;
    font-size: 40px;
    text-align: left;
    margin: 20px;
  }

  /* Footer */
  .footer {
    padding: 60px 20px;
    font-size: 14px;
  }

}