:root {
  --primary-color: #3f51b5;
  --accent-color: #ff4081;
  --text-color: #333;
  --background-color: #f9f9f9;
  --font-family: 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
}

a {
  color: var(--primary-color);
  text-decoration: none;
}

.container {
  max-width: 1100px;
  margin: auto;
  padding: 0 1rem;
}

.logo-img {
  height: 100px;
  object-fit: contain;
  padding: 10px 0;
}


.flex-space-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-header {
  background: #fff;
  padding: 1rem 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.site-header .container {
  min-height: 120px;
  align-items: center;
  padding: 10px 0;
}


.main-nav a {
  margin: 0 12px;
  padding: 6px 0;
  text-decoration: none;
  font-weight: 500;
  color: #333;
  position: relative;
  transition: color 0.3s;

}

.main-nav a:hover {
  color: #007bff;
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0%;
  height: 2px;
  background: #007bff;
  transition: width 0.3s ease;
}

.main-nav a:hover::after {
  width: 100%;
}

.site-main {
  padding: 2rem 0;
}

.site-footer {
  background: #eaeaea;
  text-align: center;
  padding: 1rem 0;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .flex-space-between {
    flex-direction: column;
    align-items: flex-start;
  }

  .main-nav {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}


.login-wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
  background: #fff;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
  margin-top: 2rem;
  border-radius: 8px;
  overflow: hidden;
}

.login-banner {
  flex: 1 1 300px;
  text-align: center;
  background: #f5f5f5;
}

.login-banner img {
  max-width: 100%;
  height: auto;
  padding: 2rem;
}

.login-form {
  flex: 1 1 300px;
  padding: 2rem;
  background: #fff;
}

.login-form h2 {
  margin-bottom: 1.5rem;
  color: var(--primary-color);
  font-size: 1.5rem;
}

.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  padding: 0.6rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.btn-login {
  width: 100%;
  padding: 0.8rem;
  font-size: 1rem;
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.btn-login:hover {
  background: #2c3e99;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .login-wrapper {
    flex-direction: column;
  }

  .login-banner,
  .login-form {
    flex: 1 1 100%;
  }

  .login-banner img {
    padding: 1rem;
  }
}


.category-bar {

  padding: 10px 0;
  background-color: #f9f9f9;
  border-top: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  font-size: 0.95em;
  position: relative;
}

.category-bar span {
  margin-left: 1em;
}

.category-bar a {
  margin: 0 10px;
  text-decoration: none;
  font-weight: 500;
  color: #555;
  position: relative;
  transition: color 0.3s;
}

.category-bar a:hover {
  color: #d9534f;
}

.category-bar a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0%;
  height: 2px;
  background: #d9534f;
  transition: width 0.3s ease;
}

.category-bar a:hover::after {
  width: 100%;
}

.category-bar .category-label {
  font-weight: bold;
  color: var(--text-color);
  font-size: 0.95rem;
}


.custom-carousel {
  position: relative;
  overflow: hidden;
  margin-top: 1rem;
  border-radius: 8px;
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease-in-out;
}

.carousel-slide {
  min-width: 100%;
  flex-shrink: 0;
}

.carousel-slide img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 1;
  /* Roughly 2400x600 */
  object-fit: cover;
  border-radius: 8px;
}

.carousel-controls {
  position: absolute;
  width: 100%;
  top: 50%;
  display: flex;
  justify-content: space-between;
  transform: translateY(-50%);
  padding: 0 1rem;
}

.carousel-prev,
.carousel-next {
  cursor: pointer;
  font-size: 2rem;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  padding: 0.3rem 0.6rem;
  border-radius: 50%;
  user-select: none;
}

.product-card {
  width: 22%;
  margin: 1.5% 1%;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  display: inline-block;
  vertical-align: top;
  text-align: center;
  transition: box-shadow 0.3s ease;
  height: 370px;
  text-decoration: none;
  color: inherit;
}

.product-card:hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  text-decoration: none;
}

.product-card-image {
  background-color: #f9f9f9;
  height: 250px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
}

.product-card-image img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  border-radius: 4px;
}

.product-card-body {
  padding: 10px;
  font-weight: bold;
  font-size: 0.95rem;
  min-height: 50px;
  border-top: 1px solid #eee;
}

@media (max-width: 991px) {
  .product-card {
    width: 48%;
    margin: 1%;
  }
}

@media (max-width: 600px) {
  .product-card {
    width: 98%;
    margin: 1% auto;
  }
}


.matrix-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
  text-align: center;
}

.matrix-table th,
.matrix-table td {
  border: 1px solid #ccc;
  padding: 0.6rem;
  font-size: 0.9rem;
}

.matrix-table th {
  background-color: #f5f5f5;
  font-weight: 600;
}

.matrix-table select,
.matrix-table input[type="number"] {
  width: 100%;
  padding: 0.3rem;
  font-size: 0.9rem;
  text-align: center;
}

.add-cart-button {
  padding: 0.8rem 2rem;
  font-size: 1rem;
  background-color: #000;
  color: #fff;
  border: none;
  border-radius: 0;
  /* sharp corners */
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease, opacity 0.3s ease;
}

.add-cart-button:hover:enabled {
  background-color: #222;
}

.add-cart-button:disabled {
  background-color: #ccc;
  color: #777;
  cursor: not-allowed;
  opacity: 0.6;
}


.summary-box {
  background-color: #f8f8f8;
  border: 1px solid #ddd;
  padding: 0.8rem 1rem;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  font-size: 1.05rem;
  font-weight: 500;
  color: #222;
  text-align: center;
  border-radius: 4px;
}


.product-image-gallery {
  padding: 1em;
}

.main-image-container {
  text-align: center;
  margin-bottom: 1em;
}

#main-product-image {
  max-width: 100%;
  max-height: 350px;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
}

.thumbnail-container {
  display: flex;
  justify-content: center;
  gap: 0.5em;
  flex-wrap: wrap;
}

.thumbnail-container img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border: 2px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: border 0.2s ease;
}

.thumbnail-container img.active-thumb {
  border-color: #000;
}


.modal {
  display: none;
  position: fixed;
  z-index: 999;
  padding-top: 60px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 80vh;
}

.close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #fff;
  font-size: 30px;
  font-weight: bold;
  cursor: pointer;
}


.summary-message {
  margin-top: 0.5em;
  font-size: 0.9em;
  color: #333;
  background-color: #f9f9f9;
  padding: 0.75em 1em;
  border-radius: 4px;
  line-height: 1.4em;
}


/* Cart icon alignment */
.cart-icon-link {
  margin-left: auto;
  font-size: 1.2em;
  position: relative;
}

.cart-badge {
  background: red;
  color: white;
  font-size: 0.7em;
  padding: 2px 8px;
  border-radius: 50%;
  position: absolute;
  top: -8px;
  right: -10px;
}

.checkout-button {
  background-color: #555;
  color: #fff;
  padding: 0.6em 1.2em;
  border: none;
  margin-left: 1em;
  text-decoration: none;
  font-weight: bold;
}

.checkout-button:hover {
  background-color: #333;
}



.cart-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2em 0;
}

.cart-items-section {
  margin-bottom: 2em;
}

.cart-item-header,
.cart-item-row {
  display: grid;
  grid-template-columns: 3fr 1fr 0.8fr 1fr 40px;
  gap: 1em;
  padding: 0.75em 0;
  align-items: center;
  border-bottom: 1px solid #ddd;
}

.cart-item-header {
  font-weight: bold;
  color: #555;
  border-bottom: 2px solid #999;
}

.cart-item-row img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  margin-right: 10px;
}

.cart-item-product {
  display: flex;
  align-items: center;
}

.cart-item-product div {
  font-size: 0.9em;
}

.cart-item-product small {
  color: #888;
}



.toggle-link {
  font-size: 0.85em;
  color: #0077cc;
  cursor: pointer;
  margin-top: 4px;
  display: inline-block;
}

.qty-break {
  font-size: 0.85em;
  background-color: #f5f5f5;
  padding: 0.75em;
  margin: -1em 0 1em 0;
  clear: both;
  width: 100% !important;
}

.cart-subtotal {
  max-width: 400px;
  margin-left: auto;
  padding-top: 1em;

  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1em;
  margin-bottom: 0.5em;
  align-items: flex-start;
  gap: 1em;
  background-color: #fff;
  flex-wrap: wrap;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  padding: 0.2em 0;
}

.summary-line.total {
  font-weight: bold;
  font-size: 1.1em;
}

.cart-bottom {
  display: flex;
  flex-direction: column;
  gap: 2em;
  width: 70%;
  float: right;
  padding: 10px;
}

@media(min-width: 768px) {
  .cart-bottom {
    flex-direction: row;
  }
}

.form-left {
  order: 2;
  flex: 1;
  padding-left: 1em;
  padding-top: 1em;
  border-top: 1px solid #777;

}

.cart-form-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1em;
  text-align: left;
  /* Ensure input labels and fields are aligned left */
}

.cart-form-section label {
  font-size: 0.85em;
  font-weight: bold;
  display: block;
  margin-bottom: 0.3em;
}

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.1rem;
}

.cart-form-section textarea,
.cart-form-section input {
  padding: 0.5em;
  font-size: 0.9em;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.delivery-method {
  grid-column: 1 / -1;
  margin-top: 1em;
}

.action-buttons {
  text-align: right;
  /* Align buttons to the right of the page */
  margin-top: 2em;

}

.action-buttons button {
  padding: 0.8rem 2rem;
  font-size: 1rem;
  background-color: #000;
  color: #fff;
  border: none;
  border-radius: 0;
  /* sharp corners */
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease, opacity 0.3s ease;
}

#btn_place_order:disabled {
  background-color: #ccc;
  color: #777;
  cursor: not-allowed;
  opacity: 0.6;
}


.radio-tile-group {
  display: flex;
  gap: 1em;
  margin-top: 0.5em;
}

.radio-tile-group input[type="radio"] {
  display: none;
}

.radio-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.8em 1.2em;
  border: 2px solid #ccc;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
  background-color: #fff;
  min-width: 120px;
  text-align: center;
}

.radio-tile:hover {
  border-color: #007bff;
}

.radio-tile-group input[type="radio"]:checked+.radio-tile {
  border-color: #007bff;
  background-color: #e7f0ff;
  color: #007bff;
}

.invalid-field {
  border: 1px solid #e30513 !important;
  background: #fff5f5;
}

.save-msg {
  font-size: 0.8em;
  color: green;
  display: none;
  margin-top: 0.2em;
}


.radio-tile {
  border: 1px solid #ccc;
  padding: 1em;
  border-radius: 6px;
  margin-right: 1em;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-block;
}

input[type="radio"]:checked+.radio-tile {
  border-color: #007bff;
  background: #e6f0ff;
}

.radio-tile-group.invalid-field {
  border: 1px solid red;
  padding: 0.5em;
  border-radius: 6px;
}


.cart-card {
  display: flex;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1em;
  margin-bottom: 1em;
  align-items: flex-start;
  gap: 1em;
  background-color: #fff;
  flex-wrap: wrap;
}

.cart-card-left img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 6px;
}

.cart-card-middle {
  flex: 1;
  font-size: 0.95em;
}

.product-name {
  font-weight: bold;
  margin-bottom: 0.3em;
}

.product-code {
  color: #555;
  font-size: 0.85em;
  margin-bottom: 0.5em;
}


.product-total {
  font-weight: bold;
  margin-bottom: 0.3em;
}

.product-price {
  font-size: 0.85em;
  color: #999;
}

.toggle-link {
  font-size: 0.85em;
  color: #0066cc;
  cursor: pointer;
}

.cart-card-right {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5em;
}

.qty-label {
  font-weight: bold;
  color: #555;
  font-size: 0.85em;
}

.qty-input {
  width: 60px;
  padding: 0.3em;
  text-align: center;
  border: 1px solid #ccc;
  border-radius: 15px;
}

.delete-icon {
  background-color: #eee;
  border-radius: 50%;
  display: inline-block;
  width: 26px;
  height: 26px;
  text-align: center;
  line-height: 26px;
  color: #c00;
  font-weight: bold;
  font-size: 1.1em;
  cursor: pointer;
}

@media (max-width: 600px) {
  .cart-card {
    flex-direction: column;
    align-items: stretch;
  }

  .cart-card-right {
    flex-direction: row;
    justify-content: space-between;
  }
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #ddd9d9; /* Dark background */
    color: #000000;
    padding: 1em;
    border-radius: 6px;
    margin-bottom: 1em;
}

.cart-header h1 {
    margin: 0;
    font-size: 1.8em;
    color: #000000;
}

.empty-cart-btn {
    background-color: #c62828;
    color: #fff;
    border: none;
    padding: 0.6em 1.2em;
    font-size: 1em;    
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.empty-cart-btn:hover {
    background-color: #a11919;
}
