body {
  margin: 0; /* Remove default margin from the body */
  padding: 0; /* Remove default padding from the body */
  /* Fix background image path */
  background-image: url('https://bladezstorage.blob.core.windows.net/bladez-op-images/BackgroundParchment.jpg'); /* Use Azure Blob Storage URL */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #f4f4f4; /* Fallback color */
}

/* Add fallback for missing background image */
body::after {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  background-image: url('https://bladezstorage.blob.core.windows.net/bladez-op-images/BackgroundParchment.jpg'); /* Fix path */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
  opacity: 0.5; /* Adjust opacity for fallback */
}

header {
  margin: 0; /* Remove any default margin */
  padding: 0; /* Remove any default padding */
  width: 100%; /* Ensure the header spans the full width */
  position: relative; /* Ensure proper positioning */
  text-align: center; /* Center-align the content */
  background: radial-gradient(ellipse at center, #a00303 0%, #ff0000 25%, black 100%);
  box-sizing: border-box; /* Include padding and border in width/height */
}

header .logo-container img {
  height: auto;
  width: 150px;
  margin-bottom: 10px;
  display: block; /* Ensure proper centering */
  margin-left: auto;
  margin-right: auto;
}

header .businessName {
  color: black;
  text-shadow:
    -0.5px -1px rgb(222, 35, 35),
    -0.125px -0.25px rgb(222, 35, 35),
    -0.25px -0.5px rgb(222, 35, 35),
    0.125px 0.25px rgb(222, 194, 35),
    0.25px 0.5px rgb(222, 194, 35),
    0.375px 0.75px black,
    0.5px 1px black,
    0.625px 1.25px rgb(222, 194, 35),
    0.75px 1.5px rgb(222, 194, 35);
  text-align: center;
  font-family: "MedievalSharp", serif;
  font-size: 48px;
  margin: 0;
}

header .slogan {
  font-family: "MedievalSharp", serif;
  font-size: 1.2em;
  margin: 5px 0 20px;
  text-align: center;
}

header nav ul {
  display: flex;
  justify-content: center;
  gap: 40px;
  list-style: none;
  padding: 0;
  margin: 0;
}

header nav ul li a {
  text-decoration: none;
  color: aliceblue;
  font-weight: bold;
  transition: color 0.3s ease;
}

header nav ul li a:hover {
  color: #ffcc00;
}

.responsive-nav {
        display: flex;
        flex-wrap: wrap; /* Allow items to wrap */
        justify-content: center; /* Center items */
        gap: 20px; /* Add spacing between items */
}

.responsive-nav li {
  list-style: none;
  text-align: center; /* Center-align text below images */
}

.responsive-nav img.AdminFunctions {
  max-width: 300px; /* Limit image width */
  width: 100%; /* Ensure responsiveness */
  height: auto; /* Maintain aspect ratio */
  border-radius: 8px; /* Add rounded corners */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); /* Add subtle shadow */
  transition: transform 0.3s ease; /* Smooth hover effect */
}

.responsive-nav img.AdminFunctions:hover {
  transform: scale(1.05); /* Slight zoom on hover */
}

.ImageName {
  font-size: 18px; /* Adjust font size */
  margin-top: 10px; /* Add spacing above text */
  color: #333; /* Set text color */
  font-weight: bold; /* Make text bold */
}

.header-image {
  width: 100%; /* Ensure the header image covers the full width */
  height: auto; /* Maintain aspect ratio */
  max-height: 275px; /* Limit the height of the header image */
  object-fit: cover; /* Cover the area without stretching */
  transform: scaleX(-1); /* Flip the image horizontally */
}

.header-image-mirrored {
  width: 100%; /* Ensure the header image covers the full width */
  height: auto; /* Maintain aspect ratio */
  max-height: 275px; /* Limit the height of the header image */
  object-fit: cover;
}

main {
  padding: 5px; /* Reduce padding for smaller screens */
}

main section h2 {
  color: black;
  text-shadow:
    0.125px 0.25px rgb(222, 194, 35),
    0.25px 0.5px rgb(222, 194, 35),
    0.375px 0.75px aliceblue,
    0.5px 1px aliceblue,
    0.625px 1.25px rgb(222, 194, 35),
    0.75px 1.5px rgb(222, 194, 35); /* Fixed invalid syntax */
}

#product-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center; /* Center the grid horizontally */
  align-items: center;
  gap: 16px; /* Add spacing between items */
  padding: 5px; /* Add padding for better spacing */
}

.product-item {
  display: flex;
  flex-direction: column; /* Stack elements vertically */
  justify-content: space-between; /* Ensure space between content and buttons */
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 15px;
  text-align: center;
  box-shadow: 0 0 40px 5px rgb(30, 0, 0);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: auto; /* Allow auto height */
  max-width: 400px; /* Limit maximum width */
  margin: 0 auto; /* Center the card when it's the only one */
}

.product-item img {
  width: 100%; /* Ensure the image spans the full width of the product card */
  height: auto; /* Set a fixed height for uniformity */
  object-fit: contain; /* Ensure the entire image is visible without cropping */
  border-radius: 8px; /* Match card border radius */
  margin-bottom: 10px;
  cursor: pointer;
}

.product-item button {
  margin-top: auto; /* Push the button to the bottom of the card */
  width: auto;
  margin-bottom: 5px;
  margin-top: 0;
  box-sizing: border-box;
  font-family: serif;
  font-size: 20px;
  font-weight: bold;
  color: aliceblue;
  text-shadow: black 0.125px 0.25px, black 0.25px 0.5px, black 0.375px 0.75px, black 0.5px 1px, black 0.625px 1.25px, black 0.75px 1.5px;
  box-shadow: aliceblue 0px 0px 15px 1px;
  padding: 5px;
  border-top: 4px solid rgb(189, 209, 230);
  border-bottom: 4px solid rgb(121, 141, 160);
  border-right: 4px solid rgb(149, 172, 190);
  border-left: 4px solid rgb(156, 175, 194);
  outline: black solid 1px;
  background: linear-gradient(to right, rgba(255, 0, 0, 0.533), rgb(161, 0, 0), rgb(139, 0, 0), rgb(161, 0, 0), rgba(255, 0, 0, 0.533));
}

.product-item .add-to-cart,
.product-item .showcase-add-to-cart-btn {
  width: auto;
  margin-bottom: 5px;
  margin-top: 0;
  box-sizing: border-box;
  font-family: serif;
  font-size: 20px;
  font-weight: bold;
  color: aliceblue;
  text-shadow: black 0.125px 0.25px, black 0.25px 0.5px, black 0.375px 0.75px, black 0.5px 1px, black 0.625px 1.25px, black 0.75px 1.5px;
  box-shadow: aliceblue 0px 0px 15px 1px;
  padding: 5px;
  border-top: 4px solid rgb(189, 209, 230);
  border-bottom: 4px solid rgb(121, 141, 160);
  border-right: 4px solid rgb(149, 172, 190);
  border-left: 4px solid rgb(156, 175, 194);
  outline: black solid 1px;
  background: linear-gradient(to right, rgba(255, 0, 0, 0.533), rgb(161, 0, 0), rgb(139, 0, 0), rgb(161, 0, 0), rgba(255, 0, 0, 0.533));
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.product-item .add-to-cart:hover,
.product-item .showcase-add-to-cart-btn:hover {
  background-color: #0056b3;
}

.product-item h3,
.product-item p {
  word-wrap: break-word; /* Ensure long words break to fit within the card */
  overflow-wrap: break-word; /* Additional support for breaking long words */
  white-space: normal; /* Allow text to wrap to the next line */
  text-align: center; /* Align text to the center for better readability */
  margin: 5px 0; /* Add spacing between text elements */
  color: #555;
  max-width: 100%; /* Ensure text stays within the card's boundaries */
  overflow: hidden; /* Prevent text from overflowing */
}

.product-item:hover {
  transform: translateY(-5px); /* Slight lift on hover */
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2); /* Enhance shadow on hover */
}

/* Fixed duplicate and redundant rules for showcase-products-grid */
.showcase-products-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center; /* Center the grid horizontally */
  align-items: center;
  gap: 16px; /* Add spacing between items */
  padding: 5px; /* Add padding for better spacing */
}

.showcase-products-grid .product-item img {
  width: 100%; /* Ensure the image spans the full width of the product card */
  height: auto;
  object-fit: contain;
  border-radius: 8px 8px 0 0; /* Adjust border radius to match the top edges of the card */
  margin-bottom: 10px; /* Add spacing below the image */
}

.showcase-products-grid .product-item h3,
.showcase-products-grid .product-item p {
  word-wrap: break-word; /* Ensure long words break to fit within the card */
  overflow-wrap: break-word; /* Additional support for breaking long words */
  white-space: normal; /* Allow text to wrap to the next line */
  text-align: center; /* Align text to the center for better readability */
  margin: 5px 0; /* Add spacing between text elements */
  color: #555;
  max-width: 100%; /* Ensure text stays within the card's boundaries */
}

.showcase-products-grid .product-item .add-to-cart {
  width: auto;
  margin-bottom: 5px;
  margin-top: 0;
  box-sizing: border-box;
  font-family: serif;
  font-size: 20px;
  font-weight: bold;
  color: aliceblue;
  text-shadow: black 0.125px 0.25px, black 0.25px 0.5px, black 0.375px 0.75px, black 0.5px 1px, black 0.625px 1.25px, black 0.75px 1.5px;
  box-shadow: aliceblue 0px 0px 15px 1px;
  padding: 5px;
  border-top: 4px solid rgb(189, 209, 230);
  border-bottom: 4px solid rgb(121, 141, 160);
  border-right: 4px solid rgb(149, 172, 190);
  border-left: 4px solid rgb(156, 175, 194);
  outline: black solid 1px;
  background: linear-gradient(to right, rgba(255, 0, 0, 0.533), rgb(161, 0, 0), rgb(139, 0, 0), rgb(161, 0, 0), rgba(255, 0, 0, 0.533));
}

.showcase-products-grid .product-item .add-to-cart:hover {
  background-color: #0056b3;
}

.showcase-products-grid .product-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3); /* Stronger shadow on hover */
}

.pagination-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 40px auto;
  gap: 15px;
  padding: 20px;
  max-width: 800px;
}

.pagination-info {
  text-align: center;
  font-size: 14px;
  color: #666;
  margin-bottom: 10px;
}

.pagination-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination-button {
  padding: 10px 15px;
  font-size: 16px;
  font-weight: bold;
  color: #fff;
  background-color: #333;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  min-width: 40px;
}

.pagination-button:hover {
  background-color: #555;
}

.pagination-button.active {
  background-color: #ff0000;
  box-shadow: goldenrod 0px 0px 30px 5px;
  color: black;
  cursor: default;
}

.pagination-ellipsis {
  padding: 10px 5px;
  color: #666;
  font-weight: bold;
}

footer {
  text-align: center;
  padding: 10px;
  background: #000000;
  color: white;
  font-size: 14px;
}

footer a {
  color: #ffcc00;
  text-decoration: underline;
}

.responsive-nav {
  display: flex;
  flex-wrap: wrap; /* Allow navigation items to wrap */
  justify-content: center; /* Center navigation items */
  align-items: center; /* Center items vertically */
  gap: 20px; /* Add spacing between items */
  text-align: center; /* Center text */
}

.responsive-logo {
  max-width: 100%; /* Ensure the logo scales within the viewport */
  height: auto;
  animation: spin360 5s linear infinite;
  background-image: url('https://bladezstorage.blob.core.windows.net/bladez-op-images/HeaderLogo.png'); /* Corrected URL */
}

@keyframes spin360 {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.modal-products-grid {
  display: grid; /* Use grid layout */
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Flexible layout */
  gap: 20px;
  width: 100%; /* Ensure full width inside modal */
  justify-content: center; /* Center the grid horizontally */
  align-items: start; /* Align items to the top */
  margin: 0 auto; /* Center the grid within the modal */
  padding: 20px;
}

.modal-products-grid .product-item {
  height: 350px; /* Set a fixed height for uniformity in the modal */
}

.modal-products-grid .product-item img {
  width: 100%; /* Ensure the image spans the full width of the product card */
  height: 150px; /* Set a fixed height for images */
  object-fit: cover; /* Maintain aspect ratio and fill the space */
  border-radius: 8px 8px 0 0; /* Adjust border radius to match the top edges of the card */
  margin-bottom: 10px; /* Add spacing below the image */
}

.modal-products-grid .product-item h3,
.modal-products-grid .product-item p {
  word-wrap: break-word; /* Ensure long words break to fit within the card */
  overflow-wrap: break-word; /* Additional support for breaking long words */
  white-space: normal; /* Allow text to wrap to the next line */
  text-align: center; /* Align text to the center for better readability */
  margin: 5px 0; /* Add spacing between text elements */
  color: #555;
  max-width: 100%; /* Ensure text stays within the card's boundaries */
  overflow: hidden; /* Prevent text from overflowing */
}

.modal .product-item .add-to-cart-btn {
  width: auto;
  font-family: "MedievalSharp", serif;
  text-decoration: none;
  padding: 5px;
  margin-bottom: 5px;
  margin-top: 5px;
  border-top: 4px solid rgb(189, 209, 230);
  border-bottom: 4px solid rgb(121, 141, 160);
  border-right: 4px solid rgb(149, 172, 190);
  border-left: 4px solid rgb(156, 175, 194);
  box-shadow: inset 0 0 6px 1px rgba(145, 20, 20, 0.466);
  outline: 1px solid black;
  background: linear-gradient(to right, #570505, #cc0000, #b30000, #cc0000, #570505); 
  box-sizing: border-box;
  font-family: serif;
  font-size: 20px;
  font-weight: bold;
  color: aliceblue;
  text-shadow: 0.125px 0.25px black, 0.25px 0.5px black, 0.375px 0.75px black, 0.5px 1px black, 0.625px 1.25px black, 0.75px 1.5px black;
  box-shadow: 0 0 15px 1px aliceblue;
  cursor: pointer;
}

.modal-products-grid .product-item .add-to-cart:hover {
  background-color: #0056b3;
}

.modal-products-grid .product-item:hover {
  transform: translateY(-5px);
}

nav {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 20px 0;
  font-size: 18px; /* Consistent font size */
  font-family: "MedievalSharp", serif;
}

nav ul {
  display: flex;
  justify-content: center;
  gap: 20px;
  list-style: none;
  padding: 0;
  margin: 0;
}

nav ul li {
  list-style: none;
}

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

nav ul li a:hover {
  color: #ffcc00;
}

/* --- Toolbar Layout Fix and Button Placement --- */
.products-toolbar {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-top: 20px;
  /* Center horizontally */
  justify-content: center;
  margin-left: 0;
  width: 100%;
  position: static;
}

.products-per-page-container {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.products-per-page-container label {
  font-family: "MedievalSharp", serif;
  font-size: 18px;
  margin-top: 10px; /* Align label with select */
}

.products-per-page-container select {
  font-size: 16px; /* Increase font size for better readability */
  padding: 10px 12px; /* Add more padding to prevent text cutoff */
  border-radius: 5px;
  border: 1px solid #ccc;
  height: auto; /* Allow height to adjust based on content */
  box-sizing: border-box;
  background: #fff;
  font-family: "MedievalSharp", serif;
  color: black;
  cursor: pointer;
  text-align: center;
  max-width: 200px;
  margin: 0;
  line-height: 1.5; /* Ensure proper spacing between lines of text */
}

#filter-form select:focus {
  border-color: #007bff; /* Highlight border on focus */
  outline: none; /* Remove default outline */
  box-shadow: 0 0 5px rgba(0, 123, 255, 0.5); /* Add subtle glow effect */
}

/* Filter form: pulldowns in a row, buttons in a row below, left-aligned */
#filter-form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  margin: 0;
  padding: 0;
  position: static;
  transform: none;
  background: none;
}

.filter-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.filter-buttons-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

#filter-form select {
  font-size: 16px; /* Increase font size for better readability */
  padding: 10px 12px; /* Add more padding to prevent text cutoff */
  border-radius: 5px;
  border: 1px solid #ccc;
  height: auto; /* Allow height to adjust based on content */
  box-sizing: border-box;
  background: #fff;
  font-family: "MedievalSharp", serif;
  color: black;
  cursor: pointer;
  text-align: center;
  max-width: 200px;
  margin: 0;
  line-height: 1.5; /* Ensure proper spacing between lines of text */
}

#apply-filters-btn,
#clear-filters-btn {
  height: 36px;
  padding: 0 18px;
  font-size: 1em;
  border-radius: 5px;
  border: 1px solid black;
  font-family: "MedievalSharp", serif;
  font-weight: bold;
  box-sizing: border-box;
  background: rgba(75, 41, 3, 0.329);
  color: rgb(24, 0, 0);
  text-shadow: 0.125px 0.25px rgb(222, 194, 35), 0.25px 0.5px rgb(222, 194, 35);
  cursor: pointer;
  transition: color 0.3s ease;
  margin: 0;
}

#apply-filters-btn:hover,
#clear-filters-btn:hover {
  color: aliceblue;
  text-decoration: underline;
}

/* Centering for filtering system and showcase button */
.products-toolbar {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-top: 20px;
  /* Center horizontally */
  justify-content: center;
  margin-left: 0;
  width: 100%;
  position: static;
}

.centered-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 20px;
  /* Center horizontally */
  justify-content: center;
  width: 100%;
}

.productNote {
  /* Center text */
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

/* Center the showcase button */
#showcase-modal-btn {
  display: block;
  margin-left: auto;
  margin-right: auto;
  padding: 5px 5px;
  font-size: 18px;
}

/* Modal overlay styling */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7); /* Semi-transparent background */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000; /* Ensure it appears above other elements */
}

/* Modal content styling */
.modal-content {
  background-color: #6e0303;
  border-radius: 8px;
  padding: 20px;
  width: 90%;
  max-width: 800px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  position: relative;
  text-align: center;
}

.modal-content h1 {
  color: black;
  text-shadow:
    -0.5px -1px rgb(222, 35, 35),
    -0.125px -0.25px rgb(222, 35, 35),
    -0.25px -0.5px rgb(222, 35, 35),
    0.125px 0.25px rgb(222, 194, 35),
    0.25px 0.5px rgb(222, 194, 35),
    0.375px 0.75px black,
    0.5px 1px black,
    0.625px 1.25px rgb(222, 194, 35),
    0.75px 1.5px rgb(222, 194, 35);
  text-align: center;
  font-family: "MedievalSharp", serif;
  font-size: 48px;
  margin: 0;
}

.modal-content p {
  font-size: 24px;
  color: aliceblue;
  margin: 10px 0;
} 

/* Close button styling */
.close-modal {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 24px;
  font-weight: bold;
  color: #333;
  cursor: pointer;
  transition: color 0.3s ease;
}

.close-modal:hover {
  color: #ff0000;
}

/* Showcase products grid styling */
.showcase-products-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin-top: 20px;
}

/* Product card styling */
.product-card {
  display: flex;
  flex-direction: column; /* Stack elements vertically */
  justify-content: space-between; /* Ensure space between content and buttons */
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 15px;
  text-align: center;
  box-shadow: 0 0 40px 5px rgb(30, 0, 0);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: auto; /* Allow auto height */
  max-width: 400px; /* Limit maximum width */
  margin: 0 auto; /* Center the card when it's the only one */
}

.product-card img {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  margin-bottom: 10px;
  cursor: pointer;
}

.product-card h3,
.product-card p {
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  text-align: center;
  margin: 5px 0;
  color: #555;
}

.product-card button {
  margin-top: auto;
  width: auto;
  padding: 5px;
  font-family: serif;
  font-size: 16px;
  font-weight: bold;
  color: aliceblue;
  background: linear-gradient(to right, rgba(255, 0, 0, 0.533), rgb(161, 0, 0), rgb(139, 0, 0), rgb(161, 0, 0), rgba(255, 0, 0, 0.533));
  border: 4px solid rgb(156, 175, 194);
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.product-card button:hover {
  background-color: #0056b3;
}

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

/* Image popup styling */
.image-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1100;
}

.image-popup .popup-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
}

.image-popup img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.image-popup .close-popup {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 24px;
  font-weight: bold;
  color: #fff;
  cursor: pointer;
  transition: color 0.3s ease;
}

.image-popup .close-popup:hover {
  color: #ff0000;
}

/* Responsive: stack vertically on small screens */
@media (max-width: 900px) {
  .products-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-left: 0;
  }
  .products-per-page-container,
  #filter-form {
    width: 100%;
    justify-content: center;
  }
  #filter-form {
    align-items: center;
  }
  .filter-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 8px;
  }
  .filter-buttons-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
}