/* Global */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/*----------------------------------------------------------------------*/

/* Header & Navigation */

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background-color: aliceblue;
  gap: 20px;
  flex-wrap: wrap;
}

/* Search Bar */
.box {
  flex-grow: 1;
  display: flex;
  justify-content: center;
}

.box input[type=text] {
  width: 100%;
  max-width: 500px;
  padding: 10px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* Navigation items (Register, Login, Basket) */
.nav-bar-item {
  text-decoration: none;
  color: black;
  font-size: 16px;
  white-space: nowrap;
  padding: 20px 10px;
  transition: background-color 0.3s;
}

.nav-bar-item:hover {
  background-color:rgb(174, 179, 183);
}

/* Sub-nav below the search bar */
.sub-nav {
  display: flex;
  justify-content: center;
  background-color: #f8f9fa;
  padding: 15px 0;
  border-bottom: 1px solid #ddd;
  gap: 30px;
}

.sub-nav-item {
  text-decoration: none;
  color: #333;
  font-weight: 500;
}

.sub-nav-item:hover {
  text-decoration: underline;
}

/*----------------------------------------------------------------------*/
/* Index / Home */

/* Slideshow Container */
.slideshow-container {
  max-width: 1000px;
  width: 90%;
  height: 600px;
  margin:40px auto 10px auto;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.mySlides {
  height: 100%;
}

.mySlides img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.prev, .next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: auto;
  padding: 16px;
  color: white;
  font-weight: bold;
  font-size: 18px;
  transition: 0.6s ease;
  border-radius: 0 3px 3px 0;
  user-select: none;
  background-color: rgba(0,0,0,0.3);
}

.next {
  right: 0;
}

.prev:hover, .next:hover {
  background-color: rgba(0,0,0,0.8);
}

.dot {
  cursor: pointer;
  height: 15px;
  width: 15px;
  margin: 0 2px;
  background-color: #bbb;
  border-radius: 50%;
  display: inline-block;
  transition: background-color 0.3s ease;
}

.active, .dot:hover {
  background-color: #717171;
}

.fade {
  animation-name: fade;
  animation-duration: 1.5s;
}

@keyframes fade {
  from {opacity: .4}
  to {opacity: 1}
}

/*----------------------------------------------------------------------*/

/* Category Section Container */

.category-container {
  padding: 20px;
  gap: 20px;
  background-color: rgb(240, 248, 255);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.category-container a {
  display: block;
  transition: transform 0.2s;
}

.category-container a:hover {
  transform: scale(1.02);
}

.category-container img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}



/*----------------------------------------------------------------------*/

/* Category item */

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.category-card {
  background-color: rgb(240, 248, 255);
  border-radius: 8px;
  padding: 40px 20px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  border: 1px solid #eee;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}


.category-card h3 {
  font-size: 1.4rem;
  padding: 10px 10px;
  color: #2c3e50;
}

.category-card a {
  text-decoration: none;
  padding: 5px 10px;
  background-color: #34495e;
  color: white;
  border-radius: 5px;
  display: inline-block;
}

.category-card a:hover {
  text-decoration: underline;
}

/* Main Layout Container */
.category-layout {
    display: flex;
    gap: 20px;
    max-width: 1300px;
    margin: 30px auto;
    padding: 0 20px;
}

/* Sidebar Styling */
.filter-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #ddd;
    padding: 20px;
    border-radius: 4px;
}

/* The Grid System */
.product-grid {
    display: grid;
    /* This creates 3 columns if space allows, otherwise wraps */
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); 
    gap: 20px;
    flex-grow: 1;
}

/* Individual Product Cards */
.product-card {
    border: 1px solid #000; /* Matching the wireframe 'box' look */
    padding: 15px;
    background: #fff;
    display: flex;
    flex-direction: column;/* Global */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/*----------------------------------------------------------------------*/

/* Header & Navigation */

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background-color: aliceblue;
  gap: 20px;
  flex-wrap: wrap;
}

/* Search Bar */
.box {
  flex-grow: 1;
  display: flex;
  justify-content: center;
}

.box input[type=text] {
  width: 100%;
  max-width: 500px;
  padding: 10px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* Navigation items (Register, Login, Basket) */
.nav-bar-item {
  text-decoration: none;
  color: black;
  font-size: 16px;
  white-space: nowrap;
  padding: 20px 10px;
  transition: background-color 0.3s;
}

.nav-bar-item:hover {
  background-color:rgb(174, 179, 183);
}

/* Sub-nav below the search bar */
.sub-nav {
  display: flex;
  justify-content: center;
  background-color: #f8f9fa;
  padding: 15px 0;
  border-bottom: 1px solid #ddd;
  gap: 30px;
}

.sub-nav-item {
  text-decoration: none;
  color: #333;
  font-weight: 500;
}

.sub-nav-item:hover {
  text-decoration: underline;
}

/*----------------------------------------------------------------------*/
/* Index / Home */

/* Slideshow Container */
.slideshow-container {
  max-width: 1000px;
  width: 90%;
  height: 600px;
  margin:40px auto 10px auto;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.mySlides {
  height: 100%;
}

.mySlides img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.prev, .next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: auto;
  padding: 16px;
  color: white;
  font-weight: bold;
  font-size: 18px;
  transition: 0.6s ease;
  border-radius: 0 3px 3px 0;
  user-select: none;
  background-color: rgba(0,0,0,0.3);
}

.next {
  right: 0;
}

.prev:hover, .next:hover {
  background-color: rgba(0,0,0,0.8);
}

.dot {
  cursor: pointer;
  height: 15px;
  width: 15px;
  margin: 0 2px;
  background-color: #bbb;
  border-radius: 50%;
  display: inline-block;
  transition: background-color 0.3s ease;
}

.active, .dot:hover {
  background-color: #717171;
}

.fade {
  animation-name: fade;
  animation-duration: 1.5s;
}

@keyframes fade {
  from {opacity: .4}
  to {opacity: 1}
}

/*----------------------------------------------------------------------*/

/* Category Section Container */

.category-container {
  padding: 20px;
  gap: 20px;
  background-color: rgb(240, 248, 255);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.category-container a {
  display: block;
  transition: transform 0.2s;
}

.category-container a:hover {
  transform: scale(1.02);
}

.category-container img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.category-layout {
    display: flex;
    gap: 30px;
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
    align-items: flex-start; /* Keeps sidebar from stretching too tall */
}

/* Sidebar Styling */
.filter-sidebar {
    width: 250px;
    flex-shrink: 0;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f2f2f2;
}

.filter-header h3 {
    font-size: 1.1rem;
    color: #2c3e50;
}

.clear-filters {
    font-size: 0.8rem;
    color: #dc3545;
    text-decoration: none;
}

.clear-filters:hover {
    text-decoration: underline;
}

.filter-group {
    margin-bottom: 20px;
}

.filter-group h4 {
    margin-bottom: 10px;
    font-size: 1rem;
    color: #34495e;
}

.filter-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.95rem;
    cursor: pointer;
}

.filter-label input {
    margin-right: 8px;
}

/* Product Grid (Main Right Area) */
.product-grid-main {
    flex-grow: 1;
}

.product-grid {
    display: grid;
    /* This creates a responsive grid that fits about 3 items wide nicely */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

/* Product Cards */
.product-card {
    background-color: white;
    border-radius: 8px;
    border: 1px solid #eee;
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.product-image {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.product-image img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.product-details {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-sku {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 5px;
}

.product-title {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 15px;
    min-height: 45px; /* Keeps buttons aligned if titles vary in length */
}

.pricing {
    margin-bottom: 15px;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 6px;
}

.price-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.95rem;
}

/* Add to Cart Area on Category Page */
.add-to-cart-form {
    display: flex;
    gap: 10px;
    margin-top: auto; /* Pushes the button to the bottom of the card */
}

.qty-input {
    width: 60px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
}

.add-item-btn {
    flex-grow: 1;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 15px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.add-item-btn:hover {
    background-color: #218838;
}

.product-detail-container {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    max-width: 1000px;
    margin: 60px auto;
    padding: 30px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.product-detail-container .product-image {
    flex: 1;
    min-width: 300px;
    border: 1px solid #eee;
    padding: 20px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.product-detail-container .product-info {
    flex: 1.2;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.product-detail-container h1 {
    font-size: 2.2rem;
    color: #333;
    margin-bottom: 10px;
}

.product-detail-container .price {
    font-size: 2rem;
    color: #28a745;
    font-weight: bold;
    margin: 15px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.product-detail-container .specification {
    margin: 20px 0;
    line-height: 1.8;
    color: #555;
    font-size: 1.05rem;
}

.product-detail-container form {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.product-detail-container label {
    font-weight: bold;
    color: #333;
}

/* Mobile Responsiveness */
@media (max-width: 850px) {
    .category-layout {
        flex-direction: column;
    }
    
    .filter-sidebar {
        width: 100%;
    }
}

/*----------------------------------------------------------------------*/

/* Category item */

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.category-card {
  background-color: rgb(240, 248, 255);
  border-radius: 8px;
  padding: 40px 20px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  border: 1px solid #eee;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}


.category-card h3 {
  font-size: 1.4rem;
  padding: 10px 10px;
  color: #2c3e50;
}

.category-card a {
  text-decoration: none;
  padding: 5px 10px;
  background-color: #34495e;
  color: white;
  border-radius: 5px;
  display: inline-block;
}

.category-card a:hover {
  text-decoration: underline;
}


/*----------------------------------------------------------------------*/

/* Recommendation Container */

.recommendation-container {
    background-color: #333;
    padding: 20px;
    color: wheat;
    margin: 20px auto;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
}

.recommendation-container h1 {
    margin-bottom: 20px;
    text-align: center;
}

.recommendation-container a {
    display: inline-block;
    width: 280px;
    height: 280px;
    margin: 0 10px;
    background-color: #454545;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, background-color 0.2s;
    text-align: center;
    line-height: 280px;
    scroll-snap-align: start;
    text-decoration: none;
    color: white;
}

.recommendation-container a:hover {
    background-color: #717171;
    transform: scale(1.02);
}

.recommendation-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* over-coded much??? */
.new-items-more {
    display: flex;
    text-decoration: none;
    font-weight: bold;
}

.new-items-more:hover {
    background-color: #c03939;
}

/*----------------------------------------------------------------------*/

/* Login & Register */

.logo {
  display: flex;
  justify-content: center;
}

/* Details input*/
.form-container {
  max-width: 400px;
  width: 90%;
  margin: 40px auto;
  padding: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.form-container h1 {
  justify-self: center;
  margin-bottom: 20px;
  font-size: 2rem;
}

.form-group {
  margin-bottom: 12px;
}

.form-group input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ccc;
  font-size: 16px;
}

.submit-button {
  width: 100%;
  padding: 12px;
  background-color: #28a745;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 18px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.submit-button:hover {
  background-color: #218838;
}

.error-message {
  background-color: #f8d7da;
  color: crimson;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 20px;
  border-left: 4px solid #f5c6cb;
}

.success-message {
  background-color: #d4edda;
  color: #155724;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: #c3e6cb;
  border-left: 4px solid #c3e6cb;
}

.switch-account {
  text-align: center;
  margin-top: 20px;
}

.switch-account h2{
  font-size: 1rem;
  margin-bottom: 10px;
}

.switch-account a {
  color: white;
  text-decoration: none;
  background-color: #007bff;
  padding: 8px;
  border-radius: 4px;
}

.switch-account a:hover {
  text-decoration: underline;
}

/*----------------------------------------------------------------------*/

/* Footer */
.footer {
  background-color: antiquewhite;
  width: 100%;
  text-align: center;
  margin-top: auto;
  padding: 30px 20px;
}

.footer img {
  margin-bottom: 15px;
}

.footer h1 {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.footer p {
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.5;
}

/*----------------------------------------------------------------------*/

/* Admin Page */
.admin-container {
  max-width: 1200px;
  margin: 40px auto;
  padding: 20px;
}

.admin-form {
  background: #f9f9f9;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 40px;
}

.items-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.items-table th, .items-table td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: left;
}

.items-table th {
  background-color: #f2f2f2;
}

.btn-edit, .btn-delete {
  display: inline-block;
  padding: 5px 10px;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.9rem;
}

.btn-edit {
  background-color: #007bff;
  color: white;
  margin-right: 5px;
}

.btn-delete {
  background-color: #dc3545;
  color: white;
}

.btn-cancel {
  display: inline-block;
  margin-left: 10px;
  padding: 12px 20px;
  background-color: #6c757d;
  color: white;
  text-decoration: none;
  border-radius: 4px;
}

/* Add Item Section */
.recommendation-item {
  display: inline-block;
  width: 280px;
  height: 280px;
  margin: 0 10px;
  background-color: #454545;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s;
  text-align: center;
  text-decoration: none;
  color: white;
  position: relative;
}

.recommendation-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.item-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.7);
  padding: 5px;
  text-align: center;
}

.admin-layout {
  display: flex;
  min-height: 100vh;
}
.admin-main {
  flex: 1;
  padding: 30px;
  background: #f5f7fa;
}
.admin-form, .admin-list {
  background: white;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 30px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.items-table {
  width: 100%;
  border-collapse: collapse;
}
.items-table th, .items-table td {
  padding: 10px;
  border-bottom: 1px solid #ddd;
  text-align: left;
}
.btn-edit, .btn-delete {
  display: inline-block;
  padding: 4px 8px;
  margin-right: 5px;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.8rem;
}
.btn-edit { background: #3498db; color: white; }
.btn-delete { background: #e74c3c; color: white; }
.error-message { color: #e74c3c; background: #fdecea; padding: 10px; margin-bottom: 15px; border-radius: 4px; }
.success-message { color: #27ae60; background: #eafaf1; padding: 10px; margin-bottom: 15px; border-radius: 4px; }

/* Admin Header*/
.admin-sidebar {
  width: 240px;
  background-color: #2c3e50;
  color: #ecf0f1;
  padding: 20px;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
  padding: 0 20px 15px 20px;
  border-bottom: 1px solid #34495e;
  margin-bottom: 20px;
}

.sidebar-header h3 {
  margin: 0 0 5px 0;
  font-size: 1.2rem;
}

.logout-link {
  color: #e74c3c;
  text-decoration: none;
  font-size: 0.9rem;
}

.logout-link:hover {
  text-decoration: underline;
}

.sidebar-nav a, .sidebar-sort, .sidebar-search {
  display: block;
  padding: 10px 20px;
  color: #ecf0f1;
  text-decoration: none;
  transition: background 0.2s;
}

.sidebar-nav a:hover {
  background-color: #34495e;
}

.sidebar-search {
  display: flex;
  gap: 5px;
  padding: 10px 20px;
}

.sidebar-search input {
  flex: 1;
  padding: 6px;
  border: none;
  border-radius: 4px;
}

.sidebar-items-list {
  margin-top: 20px;
  border-top: 1px solid #34495e;
  padding-top: 10px;
}

.sidebar-items-list h4 {
  padding: 0 20px;
  margin: 10px 0;
  font-size: 1rem;
  color: #f1c40f;
}

.sidebar-items-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-items-list li a {
  display: block;
  padding: 6px 20px 5px 30px;
  font: 0.9rem;
}

.return-web {
  margin-top: 30px;
  font-weight: bold;
  border-top: 1px solid #34495e;
  padding-top: 15px;
}
/*----------------------------------------------------------------------*/

/* Search Results Page */
.search-results-container {
  max-width: 1200px;
  margin: 40px auto;
  padding: 20px;
}

.items-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.search-item {
  width: 280px;
  height: 280px;
  background-color: #454545;
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: white;
  position: relative;
  transition: transform 0.2s;
}

.search-item:hover {
  transform: scale(1.02);
}

.search-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.search-item .item-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.7);
  padding: 5px;
  text-align: center;
}

.no-image-placeholder {
  width: 100%;
  height: 100%;
  background-color: #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  font-size: 14px;
}

/*----------------------------------------------------------------------*/

/* Product information page */
.product-detail-container {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  max-width: 1200px;
  margin: 40px auto;
  padding: 20px;
}
.product-image {
  flex: 1;
  min-width: 250px;
}
.product-image img {
  width: 100%;
  max-width: 400px;
  border-radius: 8px;
}
.product-info {
  flex: 1;
}
.product-info .price {
  font-size: 1.8rem;
  color: #28a745;
  font-weight: bold;
  margin: 15px 0;
}
.product-info .specification {
  margin: 20px 0;
  line-height: 1.6;
}
.product-info input[type="number"] {
  width: 80px;
  padding: 8px;
  margin-right: 10px;
}


/*----------------------------------------------------------------------*/

/* Product Category page */
.category-page-container {
  max-width: 1200px;
  margin: 40px auto;
  padding: 20px;
}

.items-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: flex-start;
}

/*----------------------------------------------------------------------*/

/* Responisve */
@media (max-width: 768px) {
  .nav-bar {
    flex-direction: column;
    text-align: center;
  }

  .box {
    order: 3;
    width: 100%;
  }

  .sub-nav {
    gap: 15px;
  }

  .recommendation-container a {
    width: 200px;
    height: 200px;
    line-height: 200px;
  }

  .new-items-more {
    line-height: 200px;
  }
}
}

.product-image {
    width: 100%;
    height: 180px;
    background: #f9f9f9;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-title {
    font-size: 1.1rem;
    margin: 5px 0;
}

.pricing p {
    font-size: 0.9rem;
    margin: 4px 0;
}

.add-to-cart-form {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.qty-box {
    width: 60px;
    padding: 8px;
    border: 1px solid #000;
}

.add-btn {
    flex-grow: 1;
    background: #fff;
    border: 1px solid #000;
    padding: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

.add-btn:hover {
    background: #eee;
}

/* Responsive: stack sidebar on top for mobile */
@media (max-width: 900px) {
    .category-layout {
        flex-direction: column;
    }
    .filter-sidebar {
        width: 100%;
    }
}

/*----------------------------------------------------------------------*/

/* Recommendation Container */

.recommendation-container {
    background-color: #333;
    padding: 20px;
    color: wheat;
    margin: 20px auto;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
}

.recommendation-container h1 {
    margin-bottom: 20px;
    text-align: center;
}

.recommendation-container a {
    display: inline-block;
    width: 280px;
    height: 280px;
    margin: 0 10px;
    background-color: #454545;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, background-color 0.2s;
    text-align: center;
    line-height: 280px;
    scroll-snap-align: start;
    text-decoration: none;
    color: white;
}

.recommendation-container a:hover {
    background-color: #717171;
    transform: scale(1.02);
}

.recommendation-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* over-coded much??? */
.new-items-more {
    display: flex;
    text-decoration: none;
    font-weight: bold;
}

.new-items-more:hover {
    background-color: #c03939;
}

/*----------------------------------------------------------------------*/

/* Login & Register */

.logo {
  display: flex;
  justify-content: center;
}

.form-container {
  max-width: 400px;
  width: 90%;
  margin: 40px auto;
  padding: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.form-container h1 {
  justify-self: center;
  margin-bottom: 20px;
  font-size: 2rem;
}

.form-group {
  margin-bottom: 12px;
}

.form-group input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ccc;
  font-size: 16px;
}

.submit-button {
  padding: 12px;
  background-color: #28a745;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 18px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.submit-button:hover {
  background-color: #218838;
}

.error-message {
  background-color: #f8d7da;
  color: crimson;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 20px;
  border-left: 4px solid #f5c6cb;
}

.success-message {
  background-color: #d4edda;
  color: #155724;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: #c3e6cb;
  border-left: 4px solid #c3e6cb;
}

.switch-account {
  text-align: center;
  margin-top: 20px;
}

.switch-account h2{
  font-size: 1rem;
  margin-bottom: 10px;
}

.switch-account a {
  color: white;
  text-decoration: none;
  background-color: #007bff;
  padding: 8px;
  border-radius: 4px;
}

.switch-account a:hover {
  text-decoration: underline;
}

/*----------------------------------------------------------------------*/

/* Basket container - uses flex but allows wrapping */
.basket-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* Two-column layout for summary and totals */
.basket-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 30px;
}

.order-items {
    flex: 2;
    min-width: 250px;
}

.order-totals {
    flex: 1;
    min-width: 200px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    align-self: start;
}

/* Make table scroll horizontally on small screens */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px;
}

.cart-table th, .cart-table td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
    text-align: left;
}

.cart-table th {
    background-color: #f2f2f2;
    font-weight: 600;
}

.qty-input {
    width: 70px;
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
}

.remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}

.remove-btn:hover {
    background: #c82333;
}

.update-cart-btn {
    width: auto;
    margin-top: 15px;
    padding: 10px 20px;
    background-color: #007bff;
}

.update-cart-btn:hover {
    background-color: #0069d9;
}

.total-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 1rem;
}

.grand-total {
    font-weight: bold;
    font-size: 1.2rem;
    border-top: 1px solid #ccc;
    padding-top: 12px;
    margin-top: 8px;
}

.basket-form {
    text-align: right;
}

.submit-order {
    width: auto;
    padding: 12px 30px;
    background-color: #28a745;
}

.submit-order:hover {
    background-color: #218838;
}

.basket-page-wrapper {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: Arial, sans-serif;
}

.basket-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.basket-left {
    flex: 7;
}

.basket-right {
    flex: 3;
    position: sticky;
    top: 20px;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.cart-table th, .cart-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.summary-card {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    margin: 10px 0;
}

.checkout-btn {
    width: 100%;
    padding: 15px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 20px;
}

.update-btn {
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    cursor: pointer;
}

.remove-link-btn {
    background: none;
    border: none;
    color: #dc3545;
    text-decoration: underline;
    cursor: pointer;
}

/* Responsive: Stack them on top of each other on mobile */
@media (max-width: 768px) {
    .basket-layout {
        flex-direction: column;
    }
    .basket-right {
        width: 100%;
    }
}


/*----------------------------------------------------------------------*/

/* Admin Page */
.admin-container {
  max-width: 1200px;
  margin: 40px auto;
  padding: 20px;
}

.admin-form {
  background: #f9f9f9;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 40px;
}

.items-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.items-table th, .items-table td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: left;
}

.items-table th {
  background-color: #f2f2f2;
}

.btn-edit, .btn-delete {
  display: inline-block;
  padding: 5px 10px;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.9rem;
}

.btn-edit {
  background-color: #007bff;
  color: white;
  margin-right: 5px;
}

.btn-delete {
  background-color: #dc3545;
  color: white;
}

.btn-cancel {
  display: inline-block;
  margin-left: 10px;
  padding: 12px 20px;
  background-color: #6c757d;
  color: white;
  text-decoration: none;
  border-radius: 4px;
}

/* Add Item Section */
.recommendation-item {
  display: inline-block;
  width: 280px;
  height: 280px;
  margin: 0 10px;
  background-color: #454545;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s;
  text-align: center;
  text-decoration: none;
  color: white;
  position: relative;
}

.recommendation-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.item-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.7);
  padding: 5px;
  text-align: center;
}

.admin-layout {
  display: flex;
  min-height: 100vh;
}
.admin-main {
  flex: 1;
  padding: 30px;
  background: #f5f7fa;
}
.admin-form, .admin-list {
  background: white;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 30px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.items-table {
  width: 100%;
  border-collapse: collapse;
}
.items-table th, .items-table td {
  padding: 10px;
  border-bottom: 1px solid #ddd;
  text-align: left;
}
.btn-edit, .btn-delete {
  display: inline-block;
  padding: 4px 8px;
  margin-right: 5px;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.8rem;
}
.btn-edit { background: #3498db; color: white; }
.btn-delete { background: #e74c3c; color: white; }
.error-message { color: #e74c3c; background: #fdecea; padding: 10px; margin-bottom: 15px; border-radius: 4px; }
.success-message { color: #27ae60; background: #eafaf1; padding: 10px; margin-bottom: 15px; border-radius: 4px; }

/* Admin Header*/
.admin-sidebar {
  width: 240px;
  background-color: #2c3e50;
  color: #ecf0f1;
  padding: 20px;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
  padding: 0 20px 15px 20px;
  border-bottom: 1px solid #34495e;
  margin-bottom: 20px;
}

.sidebar-header h3 {
  margin: 0 0 5px 0;
  font-size: 1.2rem;
}

.logout-link {
  color: #e74c3c;
  text-decoration: none;
  font-size: 0.9rem;
}

.logout-link:hover {
  text-decoration: underline;
}

.sidebar-nav a, .sidebar-sort, .sidebar-search {
  display: block;
  padding: 10px 20px;
  color: #ecf0f1;
  text-decoration: none;
  transition: background 0.2s;
}

.sidebar-nav a:hover {
  background-color: #34495e;
}

.sidebar-search {
  display: flex;
  gap: 5px;
  padding: 10px 20px;
}

.sidebar-search input {
  flex: 1;
  padding: 6px;
  border: none;
  border-radius: 4px;
}

.sidebar-items-list {
  margin-top: 20px;
  border-top: 1px solid #34495e;
  padding-top: 10px;
}

.sidebar-items-list h4 {
  padding: 0 20px;
  margin: 10px 0;
  font-size: 1rem;
  color: #f1c40f;
}

.sidebar-items-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-items-list li a {
  display: block;
  padding: 6px 20px 5px 30px;
  font: 0.9rem;
}

.return-web {
  margin-top: 30px;
  font-weight: bold;
  border-top: 1px solid #34495e;
  padding-top: 15px;
}
/*----------------------------------------------------------------------*/

/* Search Results Page */
.search-results-container {
  max-width: 1200px;
  margin: 40px auto;
  padding: 20px;
}

.items-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.search-item {
  width: 280px;
  height: 280px;
  background-color: #454545;
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: white;
  position: relative;
  transition: transform 0.2s;
}

.search-item:hover {
  transform: scale(1.02);
}

.search-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.search-item .item-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.7);
  padding: 5px;
  text-align: center;
}

.no-image-placeholder {
  width: 100%;
  height: 100%;
  background-color: #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  font-size: 14px;
}

/*----------------------------------------------------------------------*/

/* Product information page */
.product-detail-container {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  max-width: 1200px;
  margin: 40px auto;
  padding: 20px;
}
.product-image {
  flex: 1;
  min-width: 250px;
}
.product-image img {
  width: 100%;
  max-width: 400px;
  border-radius: 8px;
}
.product-info {
  flex: 1;
}
.product-info .price {
  font-size: 1.8rem;
  color: #28a745;
  font-weight: bold;
  margin: 15px 0;
}
.product-info .specification {
  margin: 20px 0;
  line-height: 1.6;
}
.product-info input[type="number"] {
  width: 80px;
  padding: 8px;
  margin-right: 10px;
}

/*----------------------------------------------------------------------*/

.success-container {
  max-width: 600px;
  margin: 80px auto;
  text-align: center;
  padding: 80px;
  background: #f9f9f9;
  border-radius: 8px;
}

.success-container h1 {
  color: #28a745;
  margin-bottom: 20px;
}

.success-container p {
  margin: 20px;
}

/*----------------------------------------------------------------------*/

/* Product Category page */
.category-page-container {
  max-width: 1200px;
  margin: 40px auto;
  padding: 20px;
}

.items-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: flex-start;
}

/*----------------------------------------------------------------------*/

/* Breadcrumbs */
.breadcrumbs {
    padding: 12px 20px;
    background: #f8f9fa;
    font-size: 0.9rem;
    margin-bottom: 20px;
    border-radius: 4px;
}
.breadcrumbs a {
    text-decoration: none;
    color: #007bff;
}
.breadcrumbs a:hover {
    text-decoration: underline;
}
.breadcrumbs .separator {
    color: #6c757d;
    margin: 0 5px;
}
.breadcrumbs .current {
    color: #28a745;
    font-weight: 500;
}

/*----------------------------------------------------------------------*/

/* Fulfillment Selection in Basket */
.fulfillment-selection {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.fulfillment-selection p {
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.fulfillment-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    font-size: 0.95rem;
}

.fulfillment-label input[type="radio"] {
    cursor: pointer;
}

.summary-line.total {
    border-top: 2px solid #ddd;
    padding-top: 10px;
    margin-top: 10px;
}

/*----------------------------------------------------------------------*/

/* Responisve */
@media (max-width: 768px) {
  .nav-bar {
    flex-direction: column;
    text-align: center;
  }

  .box {
    order: 3;
    width: 100%;
  }

  .sub-nav {
    gap: 15px;
  }

  .recommendation-container a {
    width: 200px;
    height: 200px;
    line-height: 200px;
  }

  .new-items-more {
    line-height: 200px;
  }
}