/* Transitions */
.slide-cart-enter-from,
.slide-cart-leave-to {
  transform: translateX(100%);
  opacity: 0;
}

.slide-cart-enter-to,
.slide-cart-leave-from {
  transform: translateX(0);
  opacity: 1;
}

/* Main sidebar */
.cart-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 200px;
  height: 100vh;
  z-index: 9999;
  background: #fff;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s;
  opacity: 1;
  transform: translateX(0);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
}

.sidebar-main {
  width: 100%;
  height: 100%;
  position: relative;
}

.sidebar-content {
  width: 100%;
  flex: 1;
  max-height: 96vh;
  overflow-y: auto;
  padding: 0 16px;
}

/* Header section */

.cart-subtotal-box {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffeb85;
  border-radius: 8px;
  padding: 12px 0;
  position: relative;
  margin-bottom: 16px;
  font-family: inherit;
  margin-top: 48px;
}

.cart-icon {
  width: 32px;
  height: 32px;
  fill: #f36819;
  color: #f36819;
  margin: 0 8px 0 0;
}

.cart-subtotal-text {
  color: #f36819;
  font-size: 16px;
  font-weight: 600;
  margin-left: 4px;
  z-index: 1000;
  position: relative;
}

.cart-star {
  color: #ffb300;
  font-size: 20px;
  position: absolute;
  top: 8px;
}

.left-star {
  left: 10px;
}

.right-star {
  right: 10px;
}

/* Price section */
.price-section {
  text-align: center;
}

.price-display {
  font-size: 24px;
  font-weight: bold;
  color: #333;
}

/* Buttons */
.sidebar-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
  width: 100%;
  padding: 16px 0 0;
}

.checkout-btn {
  background: #ff8800;
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 12px 0;
  font-size: 16px;
  font-weight: bold;
  width: 100%;
  position: relative;
  box-shadow: 0 2px 8px rgba(255, 136, 0, 0.2);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.checkout-btn:hover:not(:disabled) {
  background: #ff9900;
  transform: translateY(-1px);
}

.checkout-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.checkout-subtext {
  font-size: 12px;
  font-weight: 400;
  color: #fffbe6;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.checkout-icon {
  font-size: 12px;
}

.goto-cart-btn {
  background: #fff;
  color: #222;
  border: 2px solid #222;
  border-radius: 24px;
  padding: 12px 0;
  font-size: 15px;
  font-weight: 500;
  width: 100%;
  cursor: pointer;
  transition: all 0.2s ease;
}

.goto-cart-btn:hover {
  background: #f5f5f5;
  color: #ff8800;
  border-color: #ff8800;
}

/* Close button */
.close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: all 0.2s ease;
  padding: 0;
}

.close-btn:hover {
  background: #e0e0e0;
  transform: scale(1.05);
}

.close-icon {
  width: 16px;
  height: 16px;
  color: #666;
}

/* Items list */
.sidebar-item-list {
  padding: 16px 0;
}

.select-all-section {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}

.sidebar-checkbox {
  margin-right: 8px;
  transform: scale(1.2);
  accent-color: #fb8114;
  position: relative;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background-color: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sidebar-checkbox:hover {
  border-color: #fb8114;
  background-color: #fb8114;
}

.sidebar-checkbox:hover::after {
  content: '✓';
  color: white;
  font-weight: bold;
  font-size: 14px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.sidebar-checkbox:checked {
  background-color: #fb8114;
  border-color: #fb8114;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.sidebar-checkbox:checked::after {
  content: '✓';
  color: white;
  font-weight: bold;
  font-size: 14px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.sidebar-cart-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  position: relative;
  align-items: center;
}

.sidebar-cart-item .sidebar-checkbox {
  position: absolute;
  left: 25px;
  top: 7px;
}

.sidebar-cart-img {
  width: 70%;
  height: auto;
  object-fit: cover;
  margin-right: 12px;
  border-radius: 4px;
  flex-shrink: 0;
}

.sidebar-cart-info {
  flex: 1;
  min-width: 0;
}

.item-details {
  margin-bottom: 8px;
}

.item-details p {
  margin: 0 0 8px 0;
  font-size: 14px;
  line-height: 1.4;
  color: #333;
}

.item-details p:first-child {
  margin: 15px 0 8px 0;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-inline-box;
}

.price-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}

.price-css {
  color: #e74c3c;
  font-weight: bold;
  font-size: 14px;
}

.sale-price-css {
  color: #777;
  text-decoration: line-through;
  font-size: 12px;
}

/* Quantity controls */
.number-input {
  display: flex;
  align-items: center;
  width: 120px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #ddd;
  background: white;
}

.number-input button {
  width: 32px;
  height: 32px;
  background-color: #f8f9fa;
  border: none;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
}

.number-input button:hover:not(:disabled) {
  background-color: #e9ecef;
}

.number-input button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.number-input input {
  width: 56px;
  height: 32px;
  text-align: center;
  border: none;
  font-size: 14px;
  outline: none;
  background: white;
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .cart-sidebar {
    width: 100vw;
    max-width: 400px;
  }

  .sidebar-content {
    padding: 0 12px;
  }

  .cart-subtotal-box {
    padding: 10px 0;
  }

  .cart-subtotal-text {
    font-size: 14px;
  }

  .price-display {
    font-size: 20px;
  }

  .checkout-btn {
    padding: 14px 0;
    font-size: 15px;
  }

  .goto-cart-btn {
    padding: 14px 0;
    font-size: 14px;
  }

  .sidebar-cart-item {
    padding: 10px;
  }

  .sidebar-cart-img {
    width: 45px;
    height: 45px;
  }

  .number-input {
    width: 100px;
  }

  .number-input button {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .number-input input {
    width: 44px;
    height: 28px;
    font-size: 13px;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .close-btn {
    width: 40px;
    height: 40px;
  }

  .checkout-btn,
  .goto-cart-btn {
    min-height: 48px;
  }

  .number-input button {
    min-width: 44px;
    min-height: 44px;
  }

  .sidebar-checkbox {
    width: 20px;
    height: 20px;
    transform: scale(1.1);
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .cart-sidebar {
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  }
}
