/* Slide Cart Enhanced Styles */

:root {
  --slideCartBorderRadiusParent: 1.5em;
  --slideCartBorderRadiusChild: 0.5em;
}
/* Backdrop */
#wsc-slide-cart-backdrop {
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
  position: fixed;
  z-index: 998;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(2px) grayscale(50%);
  visibility: hidden;
  opacity: 0;
  transition: all 0.3s ease;
}

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

/* Box Shadow Utility */
.outsetBoxShadow {
  box-shadow: rgba(0, 0, 0, 0.05) 0px 0px 0.5em 0px,
    rgba(0, 0, 0, 0.08) 0px 0px 0px 1px !important;
}

/* Floating Cart Button */
.wsc-floating-cart {
  position: fixed;
  bottom: 2em;
  right: 1em;
  background: var(--global-palette1, #007cba);
  color: #fff;
  width: 3.5em;
  aspect-ratio: 1/1;
  border-radius: 50%;
  cursor: pointer;
  visibility: hidden;
  opacity: 0;
  transition: all 0.3s ease;
  align-items: center;
  justify-content: center;
  z-index: 999;
  display: none;
}

.wsc-floating-cart.active {
  visibility: visible;
  opacity: 1;
  display: flex;
}

.wsc-floating-cart:hover {
  transform: scale(1.05);
  box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 1em 0px,
    rgba(0, 0, 0, 0.12) 0px 0px 0px 1px;
}

.wsc-floating-cart div {
  display: flex;
  align-items: center;
  justify-content: center;
}

.wsc-floating-cart svg {
  width: 1.8em;
  height: 1.8em;
}

/* Cart Count Badge */
.wsc-items-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ff4757;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
}

/* Slide Cart Container */
.wsc-slide-cart {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  position: fixed;
  bottom: -100vh;
  left: 0;
  right: 0;
  width: 100%;
  max-height: 85vh;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: 1000;
  border-radius: var(--slideCartBorderRadiusParent)
    var(--slideCartBorderRadiusParent) 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.wsc-slide-cart.active {
  bottom: 0;
}

/* Cart Header */
.wsc-cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1em;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.75);
}

.wsc-cart-header h5 {
  margin: 0;
  font-size: 1.2em;
  font-weight: 600;
  color: #333;
}

.wsc-close {
  border: none;
  cursor: pointer;
  padding: 0.75em;
  width: 2.5em;
  height: 2.5em;
  border-radius: 50%;
  /*   background: rgba(0, 0, 0, 0.04); */
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}

.wsc-close:hover {
  background: rgba(0, 0, 0, 0.1);
}

.wsc-close svg {
  width: 1.2em;
  height: 1.2em;
}

.wsc-continue-shop {
  width: initial !important;
  height: initial !important;
  background: transparent !important;
  color: #333 !important;
}
/* Cart Body */
.wsc-cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  max-height: calc(85vh - 200px);
}

.wsc-cart-items-container {
  padding: 1em;
  display: flex;
  flex-direction: column;
  row-gap: 1em;
}

.wsc-cart-empty {
  padding: 3em 1.5em;
  text-align: center;
  color: #666;
}

.wsc-cart-empty p {
  margin: 0;
  font-size: 1.1em;
}

/* Cart Items */
.wsc-cart-item {
  display: flex;
  gap: 1em;
  padding: 0 0 1em 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  position: relative;
  transition: all 0.3s ease;
}

.wsc-cart-item:last-child {
  border-bottom: none;
  padding: 0;
}

.wsc-cart-item.updating {
  opacity: 0.6;
  pointer-events: none;
}

.wsc-cart-item.removing {
  opacity: 0.3;
  transform: translateX(-20px);
}

/* Product Image */
.wsc-item-image {
  flex-shrink: 0;
  width: 6em;
  aspect-ratio: 1/1;
  border-radius: var(--slideCartBorderRadiusChild);
  overflow: hidden;
}

.wsc-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wsc-item-image a {
  display: block;
  width: 100%;
  height: 100%;
}

/* Item Details */
.wsc-item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}

.wsc-item-title {
  font-weight: 600;
  line-height: 1.3;
}

.wsc-item-title a {
  color: #333;
  text-decoration: none;
  transition: color 0.2s ease;
}

.wsc-item-title a:hover {
  color: var(--global-palette1, #007cba);
}

/* Product Variations */
.wsc-item-variation {
  color: #666;
  line-height: 1.2;
  margin: 0.5em 0;
}
.wsc-item-variation > .variation {
  margin: 0;
}
.wsc-item-variation > .variation > dd {
  margin: 0 1em;
}
.wsc-item-variation > .variation > dt,
.wsc-item-variation > .variation > dd > p {
  font-size: 0.9em;
}
.wsc-item-variation > .variation > .variation-:last-child > p {
  margin-bottom: 0;
}

.wsc-variation-attribute {
  display: inline-block;
  margin-right: 0.5em;
  background: rgba(0, 0, 0, 0.05);
  padding: 0.2em 0.5em;
  border-radius: 4px;
  font-size: 0.85em;
}

/* Price Information */
.wsc-item-price-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0;
}

.wsc-item-price {
  font-weight: 500;
  color: #666;
}

.wsc-item-total {
  font-weight: 600;
  color: #333;
  font-size: 1.1em;
}

/* Quantity Controls */
.wsc-item-quantity {
  display: flex;
  align-items: center;
  gap: 0.5em;
}

.wsc-qty-buttons {
  border: none;
  cursor: pointer;
  width: 2.2em;
  height: 2.2em;
  padding: 0.5em;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.05);
  transition: all 0.25s ease;
}

.wsc-qty-buttons:hover {
  background: rgba(0, 0, 0, 0.1);
}

.wsc-qty-buttons svg {
  width: 1em;
  height: 1em;
}

.wsc-item-quantity input {
  width: 3.5em;
  height: 2.2em;
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  font-size: 0.9em;
  background: white;
}

.wsc-item-quantity input:focus {
  outline: none;
  border-color: var(--global-palette1, #007cba);
  box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

/* Remove Button */
.wsc-remove-item {
  position: absolute;
  bottom: 1em;
  right: 0;
  background: rgba(255, 0, 0, 0.1);
  border: none;
  width: 2.2em;
  height: 2.2em;
  cursor: pointer;
  padding: 0.5em;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.25s ease;
}
.wsc-cart-item:last-child > .wsc-remove-item {
  bottom: 0em;
}

.wsc-remove-item:hover {
  background: rgba(255, 0, 0, 0.2);
}

.wsc-remove-item svg {
  width: 1em;
  height: 1em;
}

/* Cart Footer */
.wsc-cart-footer {
  padding: 1em;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.75);
  display: flex;
  flex-direction: column;
  row-gap: 1em;
}

/* Cart Totals */
.wsc-cart-totals {
  padding: 1em;
  /*   background: rgba(0, 0, 0, 0.04); */
  border-radius: var(--slideCartBorderRadiusChild);
}

.wsc-subtotal,
.wsc-discount,
.wsc-shipping,
.wsc-tax,
.wsc-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5em;
}

.wsc-discount {
  color: #28a745;
  font-weight: 500;
}

.wsc-discount-amount {
  color: #28a745;
}

.wsc-shipping,
.wsc-tax {
  color: #666;
  font-size: 0.9em;
}

.wsc-total {
  font-weight: 600;
  font-size: 1.1em;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  padding-top: 0.5em;
  margin-bottom: 0;
}
.wsc-shipping {
  margin: 0;
}

/* Cart Actions */
.wsc-cart-actions {
  display: flex;
  gap: 1em;
}

.wsc-cart-actions .button {
  flex: 1;
  padding: 1em 0;
  text-align: center;
  text-decoration: none;
  border-radius: var(--slideCartBorderRadiusChild);
  font-weight: 600;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.wsc-view-cart {
  background: rgba(0, 0, 0, 0.05);
  color: #333;
}

.wsc-view-cart:hover,
.wsc-continue-shop:hover {
  background: rgba(0, 0, 0, 0.1);
  transform: translateY(-0.1em);
}

.wsc-checkout {
  background: var(--global-palette1, #007cba);
  color: white;
}

.wsc-checkout:hover {
  background: var(--global-palette1, #005a87);
  transform: translateY(-1px);
}

/* Notifications */
.wsc-notification {
  position: fixed;
  top: 2em;
  right: 2em;
  padding: 1em 1.5em;
  border-radius: 8px;
  color: white;
  font-weight: 500;
  z-index: 10000;
  transform: translateX(100%);
  transition: all 0.3s ease;
  max-width: 300px;
}

.wsc-notification.show {
  transform: translateX(0);
}

.wsc-notification-success {
  background: #28a745;
}

.wsc-notification-error {
  background: #dc3545;
}

/* Loading States */
.wsc-cart-item.updating::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Body class when cart is open */
body.wsc-cart-open {
  overflow: hidden;
}

/* Responsive Design */
@media (min-width: 768px) {
  .wsc-slide-cart {
    left: auto;
    right: 0;
    width: 400px;
    max-height: 100vh;
    height: 100vh;
    border-radius: var(--slideCartBorderRadiusParent) 0 0
      var(--slideCartBorderRadiusParent);
    right: -50%;
    bottom: 0;
    z-index: 1001;
    justify-content: space-between;
  }
  .wsc-floating-cart {
    bottom: 5em;
    right: 5em;
  }
  .wsc-slide-cart.active {
    right: 0;
    bottom: 0;
  }

  #wsc-slide-cart-backdrop.active {
    background-color: rgba(0, 0, 0, 0.2);
  }
}
.wsc-floating-cart > div {
  inset: 0;
  margin: auto;
  position: absolute;
}

@media (max-width: 767px) {
  .wsc-item-image {
    width: 4em;
  }
}

/* Animation for adding items */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes slideToLeft {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.wsc-cart-item {
  animation: slideInUp 0.3s ease;
}

/* Scrollbar Styling */
.wsc-cart-body::-webkit-scrollbar {
  width: 6px;
}

.wsc-cart-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 3px;
}

.wsc-cart-body::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.wsc-cart-body::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}
