/* ==========================================================================
   VIETNAMESE CART MODAL CSS - Shopping Cart Modal Styles
   ========================================================================== */

/* Cart Modal Overlay */
.cart-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.cart-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Cart Modal Container */
.cart-modal {
  background: #fefdf9;
  border-radius: 16px;
  width: 800px;
  max-width: 90vw;
  max-height: 800px;
  display: flex;
  flex-direction: column;
  transform: translateY(-20px);
  transition: transform 0.3s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.cart-modal-overlay.active .cart-modal {
  transform: translateY(0);
}

/* Header Section */
.cart-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px 16px;
  border-bottom: 1px solid #f0f0f0;
}

.cart-modal-title h3 {
  color: var(--On-background-Brand-Default, #231f20);
  font-family: var(--Type-Font-Serif, "Plus Jakarta Sans");
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  text-transform: uppercase;
}

.cart-modal-title .cart-count {
  color: var(--On-background-Global-Default, #8f888a);
  font-weight: 400;
  margin-left: 8px;
}

.cart-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--On-background-Brand-Default, #231f20);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.cart-modal-close:hover {
  background-color: #f5f5f5;
}

/* Content Section */
.cart-modal-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* Products List */
.cart-products-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 400px;
  overflow-y: auto;
  padding: 24px 32px;
}

.cart-empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--On-background-Global-Default, #8f888a);
  font-family: var(--Type-Font-Serif, "Plus Jakarta Sans");
  font-size: var(--Body-Size-Medium, 18px);
}

.cart-empty-state p {
  margin: 0;
}

/* Cart Item */
.cart-item {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid #f0f0f0;
}

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

.cart-item-image {
  width: 80px;
  height: 80px;
  overflow: hidden;
  flex-shrink: 0;
}

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

.cart-item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cart-item-name {
  color: var(--On-background-Brand-Default, #231f20);
  font-family: var(--Type-Font-Serif, "Plus Jakarta Sans");
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 4px;
}

.cart-item-price-info {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
}

.current-price {
  color: #e33226;
  font-family: var(--Type-Font-Serif, "Plus Jakarta Sans");
  font-size: 16px;
  font-weight: 600;
}

.original-price {
  color: var(--On-background-Global-Default, #8f888a);
  font-family: var(--Type-Font-Serif, "Plus Jakarta Sans");
  font-size: 14px;
  font-weight: 400;
  text-decoration: line-through;
}

.cart-item-variant {
  color: var(--On-background-Global-Default, #8f888a);
  font-family: var(--Type-Font-Serif, "Plus Jakarta Sans");
  font-size: 14px;
  font-weight: 400;
  margin-bottom: 8px;
}

.sale-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #e33226;
  font-family: var(--Type-Font-Serif, "Plus Jakarta Sans");
  font-size: 12px;
  font-weight: 400;
}

.cart-item-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* New Quantity Actions Layout */
.cart-item-quantity-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.quantity-circle {
  width: 32px;
  height: 32px;
  border: 1px solid var(--On-background-Brand-Default, #231f20);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--Type-Font-Serif, "Plus Jakarta Sans");
  font-size: 16px;
  font-weight: 600;
  color: var(--On-background-Brand-Default, #231f20);
  background: transparent;
}

.cart-item-quantity {
  display: flex;
  align-items: center;
  justify-content: center;
}

.quantity-btn {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--On-background-Brand-Default, #231f20);
  transition: all 0.2s ease;
}

.quantity-btn:hover {
  background: var(--Background-Global-Secondary, #faf5f0);
  border-color: var(--Background-Brand-Primary, #520f09);
  color: var(--Background-Brand-Primary, #520f09);
  transform: scale(1.1);
}

.quantity-btn:active {
  transform: scale(0.95);
}

.cart-item-remove {
  background: none;
  border: none;
  color: var(--On-background-Global-Default, #8f888a);
  cursor: pointer;
  padding: 4px 8px;
  font-size: 12px;
  font-family: var(--Type-Font-Serif, "Plus Jakarta Sans");
  text-decoration: underline;
  transition: all 0.2s ease;
}

.cart-item-remove:hover {
  color: #e33226;
  transform: scale(1.05);
  text-decoration: none;
}

.cart-item-remove:active {
  transform: scale(0.95);
}

/* Total Section */
.cart-total-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px 32px 32px;
  border-top: 1px solid #f0f0f0;
  background: #fefdf9;
  border-radius: 0 0 16px 16px;
}

.cart-total-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.total-label {
  color: var(--On-background-Brand-Default, #231f20);
  font-family: var(--Type-Font-Serif, "Plus Jakarta Sans");
  font-size: 20px;
  font-weight: 600;
}

.total-amount {
  color: var(--On-background-Brand-Default, #231f20);
  font-family: var(--Type-Font-Serif, "Plus Jakarta Sans");
  font-size: 20px;
  font-weight: 600;
}

.cart-note {
  text-align: left;
}

.note-text {
  color: var(--On-background-Global-Default, #8f888a);
  font-family: var(--Type-Font-Serif, "Plus Jakarta Sans");
  font-size: 14px;
  font-weight: 400;
}

.cart-actions {
  display: flex;
  gap: 12px;
}

.cart-view-btn {
  flex: 1;
  padding: 16px 24px;
  background: transparent;
  color: var(--On-background-Brand-Default, #231f20);
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-family: var(--Type-Font-Serif, "Plus Jakarta Sans");
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
}

.cart-view-btn:hover {
  background: var(--Background-Global-Secondary, #faf5f0);
  border-color: var(--Background-Brand-Primary, #520f09);
  color: var(--Background-Brand-Primary, #520f09);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(82, 15, 9, 0.15);
}

.cart-view-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(82, 15, 9, 0.2);
}

.cart-buy-now-btn {
  flex: 1;
  padding: 16px 24px;
  background: var(--Background-Brand-Primary, #520f09);
  color: #fefdf9;
  border: none;
  border-radius: 8px;
  font-family: var(--Type-Font-Serif, "Plus Jakarta Sans");
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
}

.cart-buy-now-btn:hover {
  background: var(--Background-Brand-Primary-Hover, #63160f);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(82, 15, 9, 0.25);
}

.cart-buy-now-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(82, 15, 9, 0.3);
}

.cart-buy-now-btn:disabled {
  background: #cccccc;
  color: #888888;
  cursor: not-allowed;
}

/* Responsive Design */
@media (max-width: 575px) {
  .cart-modal {
    width: calc(100vw - 20px);
    max-height: 800px;
    border-radius: 12px;
  }

  .cart-modal-header {
    padding: 20px 24px 16px;
  }

  .cart-modal-title h3 {
    font-size: 20px;
  }

  .cart-products-list {
    padding: 20px 24px;
    max-height: 300px;
  }

  .cart-total-section {
    padding: 20px 24px 28px;
  }

  .cart-item {
    padding: 12px 0;
  }

  .cart-item-image {
    width: 60px;
    height: 60px;
  }

  .cart-item-name {
    font-size: 14px;
  }

  .current-price {
    font-size: 14px;
  }

  .original-price {
    font-size: 12px;
  }

  .cart-item-variant {
    font-size: 12px;
  }

  .quantity-btn {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .quantity-circle {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .total-label,
  .total-amount {
    font-size: 18px;
  }

  .cart-view-btn,
  .cart-buy-now-btn {
    font-size: 12px;
    padding: 14px 20px;
  }

  .note-text {
    font-size: 12px;
  }
}

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

.cart-products-list::-webkit-scrollbar-track {
  background: #f5f5f5;
  border-radius: 3px;
}

.cart-products-list::-webkit-scrollbar-thumb {
  background: #cccccc;
  border-radius: 3px;
}

.cart-products-list::-webkit-scrollbar-thumb:hover {
  background: #999999;
}
