/* Cart Drawer Styles */

/* Overlay */
.cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cart-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Cart Drawer */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 420px;
  height: 100%;
  background: #fff;
  z-index: 9999;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.cart-drawer.active {
  transform: translateX(0);
}

.side-panel-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Header */
.side-panel-header {
  padding: 20px;
  border-bottom: 1px solid #e9e9e9;
  flex-shrink: 0;
}

.side-panel-header > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.side-panel-header h4 {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  color: #1e4e1c;
}

.side-panel-close {
  cursor: pointer;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.side-panel-close:hover {
  opacity: 0.7;
}

/* Content */
.side-panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.product-cart-item--container {
  padding: 20px;
}

/* Free Shipping Bar */
.free-shipping {
  margin-bottom: 20px;
  padding: 15px;
  background: #f9f9f9;
  border-radius: 4px;
}

.free-shipping--text {
  font-size: 13px;
  color: #333;
  margin-bottom: 10px;
  text-align: center;
}

.free-shipping--text span {
  font-weight: 600;
  color: #1e4e1c;
}

.free-shipping--bar {
  height: 4px;
  background: #e9e9e9;
  border-radius: 2px;
  overflow: hidden;
}

.free-shipping--percentage {
  height: 100%;
  background: #1e4e1c;
  width: calc(var(--percentage, 0) * 100%);
  transition: width 0.3s ease;
}

/* Cart Items */
.product-cart-item {
  display: flex;
  gap: 15px;
  padding: 15px 0;
  border-bottom: 1px solid #e9e9e9;
}

.product-cart-item:last-child {
  border-bottom: none;
}

.product-cart-item-image {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  position: relative;
}

.product-cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

.product-cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-product-link {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #1e4e1c;
  text-decoration: none;
  margin-bottom: 5px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.cart-product-link:hover {
  text-decoration: underline;
}

.product-cart-item-info .price {
  font-size: 13px;
  color: #666;
  display: block;
  margin-bottom: 5px;
}

.product-cart-item-options {
  font-size: 12px;
  color: #888;
  margin-bottom: 8px;
}

/* Quantity Selector in Cart */
.cart-update.quantity {
  display: inline-flex;
  align-items: center;
  border: 1px solid #e9e9e9;
  border-radius: 3px;
  margin-top: 5px;
}

.cart-update.quantity button {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.cart-update.quantity button:hover {
  background: #f5f5f5;
}

.cart-update.quantity button.disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.cart-update.quantity .qty {
  width: 35px;
  height: 28px;
  border: none;
  text-align: center;
  font-size: 13px;
  -moz-appearance: textfield;
  background: transparent;
}

.cart-update.quantity .qty::-webkit-outer-spin-button,
.cart-update.quantity .qty::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Remove Button */
.product-cart-item-info .remove {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #E93636;
  text-decoration: none;
  margin-left: 10px;
  cursor: pointer;
}

.product-cart-item-info .remove:hover {
  opacity: 0.7;
}

/* Item Price */
.product-cart-item-price {
  text-align: right;
  flex-shrink: 0;
}

.product-cart-item-price .price {
  font-size: 14px;
  font-weight: 500;
  color: #1e4e1c;
}

/* Footer */
.side-panel-footer {
  padding: 20px;
  border-top: 1px solid #e9e9e9;
  flex-shrink: 0;
  background: #fff;
}

.cart-policy-text {
  font-size: 12px;
  color: #666;
  text-align: center;
  margin: 0 0 15px 0;
}

.checkout-button {
  width: 100%;
  padding: 15px 20px;
  background: #1e4e1c;
  color: #fff;
  border: none;
  border-radius: 3px;
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.checkout-button:hover {
  background: #163813;
}

.checkout-button span b {
  font-weight: normal;
  margin: 0 5px;
}

.view-cart-button {
  display: block;
  text-align: center;
  margin-top: 12px;
  font-size: 13px;
  color: #1e4e1c;
  text-decoration: underline;
}

.view-cart-button:hover {
  text-decoration: none;
}

/* Empty Cart */
.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.cart-empty p {
  color: #666;
  font-size: 15px;
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .cart-drawer {
    max-width: 100%;
  }
  
  .product-cart-item-image {
    width: 70px;
    height: 70px;
  }
}

/* Price formatting */
.product-cart-item ins {
  text-decoration: none;
}

.product-cart-item .amount {
  color: #1e4e1c;
}
