/* Product Catalog Design */
#product-catalog-wrapper .section-border .section-background {
  /* Replace this with page class defined in template */
  background-color: #522c51;
  padding-bottom: 20px;
}

#product-catalog-wrapper .content-wrapper {
  padding: 0px 10px;
  max-width: 100%;
}

#catalog {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 10px 0px;
}

#last-updated {
  position: absolute;
  top: -5px;
  right: 13px;
  font-size: 10px;
  color: #ffffff;
}

#filter-wrapper {
  color: #fff;
  margin: auto;
  display: flex;
  justify-content: center;
  padding-top: 39px;
  font-family: 'adonis-web';
  font-size: 22px;
}

#filter-wrapper label {
  padding-right: 10px;

}

#filter-wrapper select {}

.product-card {
  border: 1px solid #ddd;
  padding: 9px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s;
  position: relative;
}

.product-card:hover {
  transform: scale(1.02);
}

.product-image-container {
  position: relative;
}

.product-card img {
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.upper-info {
  padding-bottom: 60px;
}

.lower-info {
  position: absolute;
  bottom: 0px;
  margin-bottom: 20px;
}

.product-card .title {
  font-size: 16px;
  font-weight: bold;
  line-height: 17px;
  margin-bottom: 4px;
  margin-top: 0px;
}

.product-card .product-brand {
  font-size: 14px;
  color: white;
  background-color: red;
  display: inline;
  padding: 2px 6px;
  border-radius: 0px;
  font-weight: bold;
  position: absolute;
  bottom: 10px;
  left: 0px;
  margin-bottom: 0px;
  border-bottom-left-radius: 7px;
}

.product-card .description {
  font-size: 12px;
  line-height: 14px;
  margin-top: 4px;
  margin-bottom: 10px;
  padding: 0px 2px;
}

.product-card .count {
  margin: 0px;
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
  color: #686868;
  padding: 0px;
  border-radius: 5px;
  line-height: 13px;
}

.product-card .sku {
  margin-top: 0px;
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 0px;
  color: white;
  background-color: #0e7ce5;
  padding: 5px 5px 3px 5px;
  border-radius: 5px;
  line-height: 13px;
  text-align: center;
}

.product-card .add-to-order {
  margin-top: 20px;
  background-color: #ef641f;
  color: white;
  border: none;
  font-family: 'adonis-web';
  padding: 8px 20px;
  font-size: 18px;
  border-radius: 6px;
}

.add-to-order {
  position: relative;
  transition: transform 0.1s ease;
}

.add-to-order:active {
  transform: translateY(-3px);
}

.item-added {
  position: absolute;
  right: 35px;
  /* adjust to sit above & right of button */
  top: -20px;
  font-size: 16px;
  color: green;
  opacity: 0;
  animation: floatUp 1s ease forwards;
}

@keyframes floatUp {
  0% {
    transform: translateY(0);
    opacity: 1;
  }

  100% {
    transform: translateY(-20px);
    opacity: 0;
  }
}

#cartButton {
  display: inline-block;
  /* or flex */
  transform-origin: center center;
}

#cartButton.bump {
  animation: bumpScale 0.4s ease;
}

@keyframes bumpScale {
  0% {
    transform: scale(1);
  }

  30% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
  }
}

#orderForm .form-logo {
  max-width: 193px;
  margin: auto;
  margin-top: 20px;
}

#orderForm .form-heading {
  margin-bottom: -30px;
  margin-top: 9px;
}

#orderForm .form-heading,
#orderForm .form-intro {
  text-align: center;
}

.pagination {
  margin: 20px 0;
  text-align: center;
}

.pagination button {
  margin: 5px 5px;
  padding: 6px 12px;
  border: none;
  background-color: #eee;
  cursor: pointer;
  border-radius: 6px;
  font-family: 'adonis-web';
}

.pagination button.active {
  background-color: #ef641f;
  color: #fff;
  font-weight: bold;
}

#top-pagination {
  margin-top: 30px;
  margin-bottom: 0px
}


/* Load in Product Cards Animation Definitions */
.product-card {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.product-card.visible {
  opacity: 1;
  transform: translateY(0);
}

#catalog-filters button.active {
  background-color: #333;
  color: #fff;
}

/* Overlay background */
#cartOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  /* hidden until showCart() */
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

/* Modal container */
#cartModal {
  background: #fff;
  width: 100%;
  max-width: 1000px;
  height: 100%;
  max-height: 90vh;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overflow-y: scroll;
  /* keep slide effect clean */
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* Header */
#cartHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: #f8f8f8;
  border-bottom: 1px solid #ddd;
}

#cartHeader h2 {
  margin: 0;
  font-size: 18px;
}

#closeCart {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
}

/* Step carousel */
.cart-steps {
  display: flex;
  flex-grow: 1;
  height: 100%;
  transition: transform 0.4s ease;
  /* IMPORTANT: let the flex children define width */
  width: 100%;
}

/* Each step is exactly the modal width */
.cart-step {
  flex: 0 0 100%;
  /* lock each step to 100% of modal width */
  max-width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 20px;
  box-sizing: border-box;
}

/* Slide states */
#cartModal.active-step-1 .cart-steps {
  transform: translateX(0%);
}

#cartModal.active-step-2 .cart-steps {
  transform: translateX(-100%);
}

#cartModal.active-step-3 .cart-steps {
  transform: translateX(-200%);
}

#cartStep3 {
  justify-items: center;
  margin-top: 35%;
}

/* Cart item rows */
.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}

.cart-info {
  flex: 1;
}

.cart-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qty-btn,
.remove-btn {
  padding: 4px 8px;
  border: 1px solid #ddd;
  background: #f8f8f8;
  cursor: pointer;
  border-radius: 4px;
  font-size: 14px;
}

/* Form container */
#orderForm {
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* space between fields */
  max-width: 530px;
  margin: auto;
}

/* Each label stacks nicely */
#orderForm label {
  display: flex;
  flex-direction: column;
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

/* Inputs and textarea full width */
#orderForm input,
#orderForm textarea {
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
}

/* Bigger notes field */
#orderForm textarea {
  min-height: 80px;
  resize: vertical;
}

/* Footer */
#cartFooter {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 16px 20px;
  border-top: 1px solid #ddd;
  background: #f8f8f8;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

#submitOrder,
#clearOrder {
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}

#closeCartFinal {
  padding: 10px 25px;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  font-family: 'adonis-web';
  background-color: #0077cc;
  color: #fff;
}

#submitOrder {
  background: #0077cc;
  color: white;
}

#submitOrder.ready-to-submit {
  background: orange;
}

#submitOrder[disabled] {
  background: #ccc;
  cursor: not-allowed;
}

#clearOrder {
  background: #eee;
  color: #333;
}

#backButton {
  background: #eee;
  color: #333;
  border: none;
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
}

/* Floating button */
#cartButton {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #0077cc;
  color: #fff;
  font-size: 14px;
  font-weight: bold;
  padding: 12px 16px;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  z-index: 999;
  transition: background 0.2s ease;
}

#cartButton:hover {
  background: #005fa3;
}

/* Mobile tweaks */
@media (max-width: 768px) {}

/* ================================================================= */
/* MOBILE ONLY STYLES */
/* ================================================================= */
@media (max-width: 768px) {
  #last-updated {
    position: absolute;
    top: unset;
    bottom: -5px;
  }

  #filter-wrapper {
    padding-top: 4px;
  }

  #top-pagination {
    margin-top: 20px;
    margin-bottom: 8px;
  }

  .product-card .description {
    margin-bottom: 10px;
  }

  .product-card .upper-info {
    padding-bottom: 43px;
  }

  .product-card .lower-info {
    position: absolute;
    bottom: 0px;
    margin-bottom: 11px;
  }

  .product-card .count {
    font-size: 10px;
    line-height: 10px;
  }

  .product-card .add-to-order {
    margin-top: 14px;
    padding: 5px 11px;
    font-size: 15px;
    border-radius: 6px;
  }

  #cartModal {
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
  }

  #cartButton {
    font-size: 13px;
    padding: 10px 14px;
    bottom: 15px;
    right: 15px;
  }

}

/* ================================================================= */
/* DESKTOP STYLES */
/* ================================================================= */
@media (min-width: 769px) {


  #catalog {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
  }

  .product-card {
    font-size: 20px;
    font-weight: bold;
    line-height: 24px;
    margin-bottom: 4px;
    margin-top: 0px;
    padding: 1rem;
    background-color: #e5e5e5;
  }

  .product-card .title {
    font-size: 20px;
    line-height: 24px;
  }

  .product-card .product-brand {
    bottom: 5px;
  }

  .product-card .sku {
    font-size: 15px;
    padding: 7px 2px 7px 9px;
    border-radius: 5px;
    line-height: 13px;
    text-align: left;
  }

  .product-card .description {
    font-size: 18px;
    line-height: 25px;
    font-weight: 100;
    margin-bottom: 14px;
  }

  .product-card .count {
    font-size: 14px;
  }
}