/**
 * Antioch Continuing Education Shopping Cart Styles
 * Based on Elevate Cart styles
 */

/* Button styles */
#button-style,
.professional-development-sidebar a.button,
.professional-development-search-form .form-field.submit-field input,
#cart-wrapper #cart-checkout,
#cart-wrapper #cart-return {
  display: inline-block;
  min-width: 50%;
  margin: 8px auto;
  margin: 0.5rem auto;
  background: #4ea482;
  color: #fff;
  font-family: Asap Condensed, sans-serif;
  text-transform: uppercase;
  font-size: 18.7px;
  font-weight: 600;
  padding: 0.95em 1.7em;
  letter-spacing: 1px;
  border-radius: 0px;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
#cart-wrapper #cart-checkout {
  font-size: 16px;
}

#cart-checkout.has-items {
  animation: pulse 0.5s ease-in-out;
}
#cart-wrapper #cart-return {
  background: #858585;
  font-size: 16px;
}
#cart-wrapper #cart-checkout,
#cart-wrapper #cart-return {
  transition: background 0.2s ease, transform 0.1s ease;
}

#cart-wrapper #cart-checkout:hover,
#cart-wrapper #cart-return:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

#cart-wrapper #cart-checkout:active,
#cart-wrapper #cart-return:active {
  transform: translateY(0);
}
/* Cart wrapper */
#cart-wrapper {
  background: #fff !important;
  font-size: 0.9em;
  width: 320px;
  z-index: 999999 !important;
  opacity: 0;
  overflow-x: hidden;
  overflow-y: auto;
  height: 100% !important;
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  -webkit-box-shadow: 0px 1px 9px 0px #c9c9c9;
  -moz-box-shadow: 0px 1px 9px 0px #c9c9c9;
  box-shadow: 0px 1px 9px 0px #c9c9c9;
  display: flex;
  flex-direction: column;
  transform: translateX(100%); /* Start off-screen to the right */
  transition: transform 0.3s ease, opacity 0.3s ease; /* Animate transform instead of width */
  will-change: transform, opacity; /* Optimize for animation */
}
#cart-wrapper.cart-open {
  transform: translateX(0); /* Slide in from right */
  opacity: 1;
}
@media (max-width: 768px) {
  #cart-wrapper {
    width: 100% !important; /* Full width on mobile */
    max-width: 100%;
  }
  
  #cart-wrapper #cart-items li .item-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  #cart-wrapper #cart-items li .removeItem {
    align-self: flex-end;
    margin-top: 5px;
  }
}
/* Cart backdrop overlay */
#cart-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999998; /* Just below cart */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#cart-backdrop.active {
  opacity: 1;
  visibility: visible;
}

#cart-wrapper .button-container {
  text-align: center;
  padding: 10px;
}

#cart-wrapper h3 {
  margin: 25px 0 25px;
  text-align: center;
  font-size: 1.5em;
  font-weight: 500;
}

/* Cart summary container */
#cart-summary {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Cart header */
#cart-wrapper #cart-header {
  background: #e1e1e1;
  padding: 5px 10px;
  flex-shrink: 0;
}

#cart-wrapper #cart-header h4 {
  padding: 0;
  margin: 10px 0;
  font-weight: normal;
  text-transform: uppercase;
  color: #000;
}

#cart-wrapper #cart-header #cart-close {
  color: black;
  font-size: 2rem;
  font-weight: normal;
  font-style: normal;
  cursor: pointer;
  position: absolute;
  right: 8px;
  width: 45px;
  height: 45px;
  margin: 0px;
  padding: 7px;
}

/* Cart items */
#cart-wrapper #cart-items {
  padding: 0;
  margin: 0;
  list-style: none;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}
/* Add subtle scroll indicator */
#cart-wrapper #cart-items::-webkit-scrollbar {
  width: 8px;
}

#cart-wrapper #cart-items::-webkit-scrollbar-track {
  background: #f1f1f1;
}

#cart-wrapper #cart-items::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

#cart-wrapper #cart-items::-webkit-scrollbar-thumb:hover {
  background: #555;
}

#cart-wrapper #cart-items .removeItem {
  text-decoration: none;
  color: #d9534f;
  font-weight: 500;
  font-size: 0.85em;
  padding: 4px 8px;
  border: 1px solid #d9534f;
  border-radius: 3px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

#cart-wrapper #cart-items .removeItem:hover {
  background: #d9534f;
  color: #fff;
  text-decoration: none;
}

/* Or use an icon instead */
#cart-wrapper #cart-items .removeItem::before {
  content: "✕ ";
  font-weight: bold;
}
@keyframes slideInFromRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
#cart-wrapper #cart-items li {
  list-style: none;
  margin: 0;
  border-bottom: 1px solid #eee;
  padding: 15px 10px; /* More breathing room */
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: background-color 0.2s ease;
  animation: slideInFromRight 0.3s ease-out;
}

#cart-wrapper #cart-items li:hover {
  background-color: #f9f9f9;
}

#cart-wrapper #cart-items li:last-child {
  border-bottom: none;
}

#cart-wrapper #cart-items li .item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

#cart-wrapper #cart-items li b {
  font-weight: normal;
  flex: 1;
}

#cart-wrapper #cart-items li a {
  flex-shrink: 0;
}

#cart-wrapper #cart-items li .item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#cart-wrapper #cart-items li .date {
  font-size: 0.9em;
  color: #000;
}

#cart-wrapper #cart-items li .price {
  font-size: 0.9em;
  color: #000;
  font-weight: bold;
  text-align: right;
}
/* Better empty state */
#cart-wrapper #cart-items:empty::before {
  content: "🛒";
  display: block;
  text-align: center;
  font-size: 4em;
  opacity: 0.3;
  margin-top: 40px;
}

#checkout-sum h3.empty-message {
  color: #999;
  font-weight: 400;
  font-size: 1.2em;
}

/* Checkout sum */
#checkout-sum {
  flex-shrink: 0;
  padding: 0 10px;
}

#checkout-sum h3 {
  text-align: center;
  margin: 20px 0;
  color: #000;
  font-size: 1.5em;
}

#cart-wrapper #cart-return {
  cursor: pointer;
}

/* Cart messages */
.cart-added-msg {
  background: none repeat scroll 0 0 #666;
  border: 2px solid #ccc;
  color: #f3f3f3;
  opacity: 0.9;
  padding: 5px 15px;
  position: fixed;
  top: 100px;
  border-radius: 15px;
  z-index: 10000;
}

/* Cart sum badge */
.cart-sum {
  font-weight: 600;
  width: 30px;
  height: 30px;
  line-height: 30px;
  font-size: 20px;
  text-align: center;
  background: #4ea482;
  color: black;
  border-radius: 20px;
  display: inline-block;
  margin-right: 20px;
  margin-left: 10px;
}

/* My cart trigger */
#my-cart {
  cursor: pointer;
}

#my-cart h3 {
  text-align: center;
  cursor: pointer;
  padding: 0;
  margin: 10px 0 0;
  font-weight: normal;
  text-transform: uppercase;
  color: #000;
  font-size: 18px;
}

#my-cart .cart-sum {
  margin: 0;
  margin-top: -6px;
}

/* Global cart container */
.global-cart {
  display: inline-block;
  text-align: left;
  vertical-align: middle;
  position: relative;
}

@media (max-width: 1023px) {
  .nav-primary .global-cart {
    margin-left: 10px;
  }
}

.global-cart svg {
  height: 18px;
  padding: 20px 0px 20px 15px;
  cursor: pointer;
  box-sizing:content-box;
}

/* Global cart count badge */
.global-cart-count {
  position: absolute;
  top: 5px;
  right: 2px;
  background: #4ea482;
  border-radius: 50%;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  text-align: center;
  color: black;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: transform 0.2s ease;
}

.global-cart-count:hover {
  transform: scale(1.1);
}

/* Animate when count changes */
@keyframes pop {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

.global-cart-count.updated {
  animation: pop 0.3s ease-out;
}

/* Add to cart button */
.add-to-cart.button {
  background-color: #119eda;
}
.view-cart.button {
  background: #e17819;
}

