/* ============================================
   CART DRAWER STYLES
   ============================================ */

/* Cart Overlay */
.cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 2500;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Cart Drawer Container */
.cart-drawer {
  position: fixed;
  top: 0;
  right: -480px;
  width: 480px;
  height: 100vh;
  background: white;
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.3);
  z-index: 3000;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: none;
  flex-direction: column;
  overflow: hidden;
  pointer-events: none;
  visibility: hidden;
}

.cart-drawer.active {
  right: 0;
  display: flex;
  pointer-events: auto;
  visibility: visible;
}

/* Cart Header */
.cart-header {
  padding: 28px 32px;
  background: var(--bg-gradient-1);
  box-shadow: 0 4px 20px rgba(106, 190, 182, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.cart-header::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -30%;
  width: 200px;
  height: 200px;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.2) 0%,
    transparent 70%
  );
  border-radius: 50%;
}

.cart-title {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.cart-title i {
  font-size: 28px;
  color: white;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.cart-title h2 {
  font-size: 24px;
  font-weight: 900;
  color: white;
  margin: 0;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cart-count {
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  color: white;
  font-size: 14px;
  font-weight: 900;
  padding: 6px 14px;
  border-radius: 20px;
  margin-left: 8px;
}

.cart-close {
  width: 44px;
  height: 44px;
  border: none;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  color: white;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all var(--transition-base);
  position: relative;
  z-index: 1;
}

.cart-close:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: rotate(90deg) scale(1.1);
}

/* Cart Content */
.cart-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
}

.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 40px 20px;
}

.cart-empty i {
  font-size: 80px;
  color: var(--surface-light);
  margin-bottom: 24px;
}

.cart-empty h3 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-color);
  margin: 0 0 12px 0;
}

.cart-empty p {
  font-size: 15px;
  color: var(--text-light);
  margin: 0 0 32px 0;
}

.shop-now-btn {
  padding: 14px 32px;
  background: var(--bg-gradient-1);
  color: white;
  text-decoration: none;
  border-radius: 30px;
  font-weight: 700;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-md);
}

.shop-now-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: var(--shadow-xl), 0 0 30px rgba(106, 190, 182, 0.4);
}

/* Cart Items List */
.cart-items {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cart-item {
  display: flex;
  gap: 16px;
  padding: 20px;
  background: var(--surface-gradient);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.cart-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--bg-gradient-1);
  transform: scaleY(0);
  transition: transform var(--transition-base);
}

.cart-item:hover::before {
  transform: scaleY(1);
}

.cart-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
}

.item-image {
  width: 100px;
  height: 100px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-base);
}

.cart-item:hover .item-image img {
  transform: scale(1.1);
}

.item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-color);
  margin: 0;
  line-height: 1.3;
}

.item-attributes {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.item-attribute {
  font-size: 13px;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.item-attribute i {
  font-size: 11px;
  color: var(--primary-color);
}

.item-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.item-price {
  font-size: 20px;
  font-weight: 900;
  background: var(--bg-gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  border-radius: 30px;
  padding: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.qty-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-gradient-1);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 900;
  transition: all var(--transition-base);
}

.qty-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(106, 190, 182, 0.3);
}

.qty-btn:active {
  transform: scale(0.95);
}

.qty-value {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-color);
  min-width: 28px;
  text-align: center;
}

.remove-item {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all var(--transition-base);
  opacity: 0;
}

.cart-item:hover .remove-item {
  opacity: 1;
}

.remove-item:hover {
  background: #ef4444;
  color: white;
  transform: scale(1.1);
}

/* Cart Footer */
.cart-footer {
  padding: 24px 32px;
  background: var(--surface-gradient);
  border-top: 2px solid rgba(0, 217, 255, 0.1);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
}

.cart-summary {
  margin-bottom: 20px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 15px;
}

.summary-label {
  color: var(--text-light);
  font-weight: 600;
}

.summary-value {
  color: var(--text-color);
  font-weight: 800;
}

.summary-row.total {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 2px solid rgba(0, 217, 255, 0.1);
  font-size: 18px;
}

.summary-row.total .summary-label {
  color: var(--text-color);
  font-weight: 900;
}

.summary-row.total .summary-value {
  font-size: 24px;
  background: var(--bg-gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cart-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkout-btn,
.view-cart-btn {
  padding: 16px;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all var(--transition-base);
  text-decoration: none;
}

.checkout-btn {
  background: var(--bg-gradient-1);
  color: white;
  box-shadow: var(--shadow-md), var(--glow);
}

.checkout-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl), 0 0 40px rgba(106, 190, 182, 0.5);
}

.view-cart-btn {
  background: white;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.view-cart-btn:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Scrollbar Styling */
.cart-content::-webkit-scrollbar {
  width: 8px;
}

.cart-content::-webkit-scrollbar-track {
  background: var(--surface-light);
  border-radius: 10px;
}

.cart-content::-webkit-scrollbar-thumb {
  background: var(--bg-gradient-1);
  border-radius: 10px;
}

.cart-content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #0a0e27 0%, #6abeb6 100%);
}

/* Animations */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.cart-drawer.active .cart-item {
  animation: slideInRight 0.4s ease forwards;
}

.cart-drawer.active .cart-item:nth-child(1) {
  animation-delay: 0.1s;
}

.cart-drawer.active .cart-item:nth-child(2) {
  animation-delay: 0.15s;
}

.cart-drawer.active .cart-item:nth-child(3) {
  animation-delay: 0.2s;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
  .cart-drawer {
    width: 420px;
    right: -420px;
  }

  .cart-header {
    padding: 24px 24px;
  }

  .cart-title h2 {
    font-size: 20px;
  }

  .cart-title i {
    font-size: 24px;
  }

  .cart-content {
    padding: 20px 24px;
  }

  .cart-footer {
    padding: 20px 24px;
  }

  .item-image {
    width: 90px;
    height: 90px;
  }

  .item-name {
    font-size: 15px;
  }

  .item-price {
    font-size: 18px;
  }
}

@media (max-width: 540px) {
  .cart-drawer {
    width: 100%;
    right: -100%;
  }

  .cart-drawer.active {
    right: 0;
  }

  .cart-header {
    padding: 20px;
  }

  .cart-title h2 {
    font-size: 18px;
  }

  .cart-title i {
    font-size: 22px;
  }

  .cart-count {
    font-size: 12px;
    padding: 4px 10px;
  }

  .cart-content {
    padding: 16px 20px;
  }

  .cart-footer {
    padding: 16px 20px;
  }

  .cart-item {
    padding: 16px;
    gap: 12px;
  }

  .item-image {
    width: 80px;
    height: 80px;
  }

  .item-name {
    font-size: 14px;
  }

  .item-attributes {
    gap: 8px;
  }

  .item-attribute {
    font-size: 12px;
  }

  .item-price {
    font-size: 16px;
  }

  .quantity-controls {
    gap: 8px;
  }

  .qty-btn {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .qty-value {
    font-size: 14px;
    min-width: 24px;
  }

  .remove-item {
    width: 28px;
    height: 28px;
    font-size: 12px;
    top: 12px;
    right: 12px;
  }

  .summary-row {
    font-size: 14px;
    margin-bottom: 10px;
  }

  .summary-row.total {
    font-size: 16px;
  }

  .summary-row.total .summary-value {
    font-size: 20px;
  }

  .checkout-btn,
  .view-cart-btn {
    padding: 14px;
    font-size: 14px;
  }
}

@media (max-width: 380px) {
  .cart-header {
    padding: 16px;
  }

  .cart-title {
    gap: 10px;
  }

  .cart-title h2 {
    font-size: 16px;
  }

  .cart-title i {
    font-size: 20px;
  }

  .cart-content {
    padding: 12px 16px;
  }

  .cart-footer {
    padding: 12px 16px;
  }

  .cart-item {
    padding: 12px;
    flex-direction: column;
  }

  .item-image {
    width: 100%;
    height: 160px;
  }

  .item-price-row {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .remove-item {
    opacity: 1;
  }
}
