:root {
  --cmcw-font-family: "Poppins", sans-serif;
}

.cmcw-shortcode-container {
  position: relative;
  display: inline-block;
  width: 25px;
  height: 25px;
  line-height: 0%;
}

.cmcw-cart-count {
  position: absolute;
  font-weight: bold;
  width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  border-radius: 50%;
  transform: translate(50%, -50%);
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
  font-family: var(--cmcw-font-family);
}

.cmcw-shortcode-container i {
  width: 100%;
  height: 100%;
  margin-bottom: -3px;
}

#cmcw-cart-sidebar {
  position: absolute;
  margin-top: -10px;
  margin-bottom: 2px;
  top: 100%; /* Position right below the toggle */
  right: 0;
  width: 300px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  overflow: hidden;
  display: none;
  opacity: 0;
  max-height: 500px;
  transition: max-height 0.4s ease, opacity 0.3s ease;
  z-index: 9999;
}

.cmcw-no-items {
  text-align: center;
}

.cmcw-cart-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px;
  background-color: #e8e8e8;
  border-bottom: 1px solid #00000022;
  border-radius: 8px 8px 0 0;
}

.cmcw-opened {
  display: block !important;
  max-height: 500px !important; /* Adjust based on your content */
  opacity: 1 !important;
}

#cmcw-cart-close {
  cursor: pointer;
  font-size: 20px;
  color: #000000;
}

#cmcw-cart-contents {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 350px;
}

.cmcw-cart-item-wrapper {
  flex: 1;
  overflow-y: auto;
}

.cmcw-cart-item {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 15px;
  padding: 5px 10px;
  border-bottom: 1px solid #eee;
}

.cmcw-cart-thumb img {
  justify-self: baseline;
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.cmcw-cart-details {
  display: flex;
  flex-direction: column;
  justify-items: baseline;
  line-height: 10px;
  gap: 5px;
  align-self: end;
}

.cmcw-cart-details strong {
  font-size: 14px;
  color: #333;
  display: block;
  margin-bottom: 5px;
}

.cmcw-cart-details p {
  display: block;
  font-size: 12px;
  color: #666;
}

.cmcw-cart-details .cmcw-quantity {
  font-weight: 600;
  font-size: 9px;
  color: #222;
}

/* Wrapper */
.cmcw-cart-footer {
  position: sticky;
  bottom: 0;
  background-color: #fff;
  padding: 15px 20px 20px 20px;
  border-top: 1px solid #eee;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.04);
  z-index: 2;
  line-height: 10px;
  border-radius: 0px 0px 8px 8px;
}

/* Total line */
.cmcw-cart-footer p {
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: #222;
  margin: 0px 0px 15px 0px;
}

.cmcw-cart-btns {
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 10px;
}

/* Buttons */
.cmcw-cart-footer a {
  display: inline-block;
  justify-content: space-evenly;
  text-align: center;
  padding: 10px 16px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  margin-right: 10px;
  transition: background 0.3s ease;
}

.cmcw-cart-btn {
  background-color: #000000;
  color: #fff;
  border: 1px solid transparent;
  text-decoration: none !important;
}

.cmcw-cart-btn:hover {
  background-color: #cdcdcd;
  color: #2c2c2c;
}

#cmcw-widget-cart-sidebar {
  position: fixed;
  top: 0;
  right: -100%;
  width: 320px;
  height: 100%;
  background-color: #fff;
  box-shadow: -4px 0 12px rgba(0, 0, 0, 0.1);
  transition: right 0.3s ease;
  z-index: 9999;
  display: flex;
  flex-direction: column;
}

.cmcw-widget-opened {
  right: 0% !important;
}

#cmcw-widget-cart-contents {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}
