/* Global Styles */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: #f9f9f9;
}

/* Header Styles */
header {
  background: #1a73e8;
  color: white;
  padding: 15px;
  text-align: center;
}

/* Navigation Styles */
nav {
  background: #333;
  display: flex;
  justify-content: center; /* keep the other links centered */
  gap: 20px;
  padding: 10px;
  position: relative;      /* needed for absolute positioning of cart */
}

nav a.cart-link {
  position: absolute;
  right: 20px;   /* distance from right edge */
  top: 50%;      /* vertical center */
  transform: translateY(-50%);
}

nav a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease;
}

nav a:hover {
  color: #1a73e8;
}

nav a.nav-active {
  color: #1a73e8;
}

#cart-item-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: red;
  color: white;
  border-radius: 50%;
  padding: 2px 6px;
  font-size: 12px;
  font-weight: bold;
  display: none; /* Hidden by default */
}

/* Product Grid */
.container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  padding: 20px;
}

/* Product Card Styles */
.product {
  background: white;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  text-align: center;
  transition: transform 0.2s ease;
}

.product:hover {
  transform: translateY(-2px);
}

.product img {
  max-width: 100%;
  height: 150px;
  object-fit: contain;
}

.product h3 {
  margin: 15px 0 10px 0;
  color: #333;
}

.product .description {
  font-size: 14px;
  color: #777;
  margin: 10px 0;
}

.product-page {
  display: flex;
  gap: 20px;
}

.product-image {
  flex: 1;
}

.product-info {
  flex: 1;
}

.product-page img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
  margin-bottom: 20px;
}

.product p {
  font-size: 18px;
  font-weight: bold;
  color: #1a73e8;
  margin: 10px 0;
}

.long-description {
  white-space: pre-line;  /* show \n as visible line breaks */
  line-height: 1.5;
}

/* Button Styles */
button {
  margin-top: 10px;
  padding: 10px 15px;
  border: none;
  background: #1a73e8;
  color: white;
  cursor: pointer;
  border-radius: 5px;
  font-size: 14px;
  transition: background-color 0.3s ease;
}

button:hover {
  background: #0c56c2;
}

/* Cart Page Centering Fix */
#cart-page {
  display: flex;
  flex-direction: column;
  align-items: center;   /* center everything horizontally */
  justify-content: center;
  background: white;
  margin: 40px auto;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  max-width: 800px;      /* keeps it nicely centered and not too wide */
}

#cart-page h2 {
  text-align: center;
  margin-bottom: 20px;
}

.cart-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.cart-table th,
.cart-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.cart-table th {
  background-color: #f2f2f2;
}

/* Checkout Confirmation Page */
#confirmation-details {
  display: flex;
  flex-direction: column;
  align-items: center;          /* centers all inner content */
  justify-content: center;
  background: white;
  margin: 40px auto;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  max-width: 800px;             /* same as cart page width */
  text-align: center;
}

#confirmation-details h2 {
  text-align: center;
  margin-bottom: 20px;
}

#confirmation-details p {
  text-align: center;
  margin-bottom: 15px;
  font-size: 16px;
}

#confirmation-details table {
  width: 100%;
  max-width: 700px;             /* consistent with cart */
  border-collapse: collapse;
  margin-bottom: 20px;
}

#confirmation-details th,
#confirmation-details td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

#confirmation-details th {
  background-color: #f2f2f2;
  font-weight: bold;
}

#confirmation-details button {
  margin-top: 10px;
  padding: 10px 20px;
  background: #1a73e8;
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#confirmation-details button:hover {
  background: #0c56c2;
}


/* Responsive Design */
@media (max-width: 768px) {
  nav {
    flex-direction: column;
    gap: 10px;
  }
  
  .container {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    padding: 15px;
  }
  
  #cart {
    margin: 15px;
    padding: 15px;
  }

  
}

/* Footer Styles */
  footer {
  background: #1a73e8;
  color: white;
  padding: 50px;
  text-align: center;
}
