/*---------------------------------------------
  Shopping Cart Styles
---------------------------------------------*/

/* Cart Button in Header */
.cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  margin-left: 16px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.cart-btn:hover {
  background: #7a2dd8;
  transform: scale(1.1);
}

.cart-btn i {
  font-size: 20px;
}

.cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ff0064;
  color: white;
  font-size: 12px;
  font-weight: bold;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Shopping Cart Modal */
.shopping-cart-modal {
  max-width: 700px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.shopping-cart-modal h2 {
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  font-size: 28px;
}

.shopping-cart-modal h2 i {
  color: #ffb502;
}

.cart-content {
  margin-top: 24px;
}

/* Empty Cart Message */
.empty-cart-message {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.empty-cart-message i {
  font-size: 80px;
  color: #ddd;
  margin-bottom: 20px;
}

.empty-cart-message p {
  font-size: 18px;
  color: #999;
  margin: 0;
}

/* Cart Items Container */
#cart-items-container {
  margin-bottom: 24px;
}

/* Cart Item */
.cart-item {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 2px solid transparent;
  transition: all 0.3s ease;
  position: relative;
}

.cart-item:hover {
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(86, 0, 195, 0.1);
}

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

.cart-item-name {
  font-size: 20px;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 8px;
}

.cart-item-details {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 8px;
}

.cart-item-detail {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #666;
  font-size: 14px;
}

.cart-item-detail i {
  color: var(--primary-color);
}

.cart-item-price {
  font-size: 24px;
  font-weight: bold;
  color: #28a745;
  margin-right: 12px;
  flex-shrink: 0;
  white-space: nowrap;
}

.cart-item-price small {
  font-size: 14px;
  color: #999;
}

.cart-item-remove {
  background: #dc3545;
  color: white;
  border: none;
  width: 28px;
  height: 28px;
  min-width: 28px;
  max-width: 28px;
  flex: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-size: 12px;
  padding: 0;
}

.cart-item-remove:hover {
  background: #c82333;
  transform: scale(1.1);
}

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

/* Cart Summary */
.cart-summary {
  border-top: 2px solid #dee2e6;
  padding-top: 24px;
  margin-top: 24px;
}

.cart-total {
  background: linear-gradient(135deg, var(--primary-color), #7a2dd8);
  color: white;
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  margin-bottom: 24px;
}

.cart-total h4 {
  margin: 0;
  font-size: 28px;
  font-weight: bold;
}

.cart-total small {
  font-size: 16px;
  opacity: 0.9;
}

/* Cart Actions */
.cart-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.cart-actions button {
  flex: 1;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: bold;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.cart-actions .btn-secondary {
  background: #6c757d;
}

.cart-actions .btn-secondary:hover {
  background: #5a6268;
}

.cart-actions .btn-primary {
  background: #28a745;
}

.cart-actions .btn-primary:hover {
  background: #218838;
}

.cart-actions .btn-continue {
  background: var(--primary-color);
  width: 100%;
}

.cart-actions .btn-continue:hover {
  background: #7a2dd8;
}

/* Package Color Badges */
.package-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
  margin-right: 8px;
}

.package-badge.blue {
  background: rgba(56, 120, 254, 0.1);
  color: #3878fe;
}

.package-badge.green {
  background: rgba(2, 197, 149, 0.1);
  color: #02c595;
}

.package-badge.yellow {
  background: rgba(255, 181, 2, 0.1);
  color: #ffb502;
}

.package-badge.pink {
  background: rgba(255, 0, 100, 0.1);
  color: #ff0064;
}

.package-badge.purple {
  background: rgba(155, 95, 254, 0.1);
  color: #9b5ffe;
}

.package-badge.gray {
  background: rgba(108, 117, 125, 0.1);
  color: #6c757d;
}

/* Responsive Design */
@media (max-width: 768px) {
  .cart-btn {
    width: 40px;
    height: 40px;
    margin-left: 8px;
  }

  .cart-btn i {
    font-size: 18px;
  }

  .shopping-cart-modal {
    width: 95%;
    max-height: 90vh;
  }

  .shopping-cart-modal h2 {
    font-size: 24px;
  }

  .cart-item {
    flex-direction: column;
    align-items: flex-start;
    padding-right: 50px;
  }

  .cart-item-price {
    margin-right: 0;
    margin-top: 12px;
  }

  .cart-item-remove {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
  }

  .cart-actions {
    flex-direction: column;
  }

  .cart-actions button {
    width: 100%;
  }
}

/* Animation for adding to cart */
@keyframes addToCart {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

.cart-btn.adding {
  animation: addToCart 0.4s ease;
}

/* Success notification */
.cart-notification {
  position: fixed;
  top: 100px;
  right: 20px;
  background: #28a745;
  color: white;
  padding: 16px 24px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideIn 0.3s ease;
}

.cart-notification i {
  font-size: 20px;
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

.cart-notification.removing {
  animation: slideOut 0.3s ease;
}

/*---------------------------------------------
  Checkout Styles
---------------------------------------------*/

/* Checkout Header */
.checkout-header {
  position: relative;
  margin-bottom: 32px;
}

.back-to-cart {
  background: none;
  border: none;
  color: var(--primary-color);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 0;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.back-to-cart:hover {
  color: #7a2dd8;
  transform: translateX(-4px);
}

.checkout-header h2 {
  color: var(--primary-color);
  font-size: 32px;
  margin-bottom: 8px;
}

.checkout-subtitle {
  color: #28a745;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkout-subtitle i {
  font-size: 14px;
}

/* Checkout Content */
.checkout-content {
  margin-top: 24px;
}

.checkout-section {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  border: 2px solid #e9ecef;
}

.checkout-section h4 {
  color: var(--primary-color);
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Form Groups */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  color: #333;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 14px;
}

.form-group .form-control {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  font-size: 16px;
  transition: all 0.3s ease;
}

.form-group .form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(86, 0, 195, 0.1);
}

.form-group .form-control.invalid {
  border-color: #dc3545;
}

.form-group .form-control.valid {
  border-color: #28a745;
}

/* Field Errors */
.field-error {
  display: block;
  color: #dc3545;
  font-size: 13px;
  margin-top: 6px;
  min-height: 18px;
  font-weight: 500;
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

/* Order Summary */
.order-summary-section {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.checkout-items-list {
  margin-bottom: 20px;
}

.checkout-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #dee2e6;
}

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

.checkout-item-name {
  font-size: 16px;
  color: #333;
  font-weight: 600;
}

.checkout-item-price {
  font-size: 18px;
  color: var(--primary-color);
  font-weight: bold;
}

/* Order Totals */
.order-totals {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid #dee2e6;
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 16px;
}

.total-row span:first-child {
  color: #666;
}

.total-row span:last-child {
  font-weight: 600;
  color: #333;
}

.total-final {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 2px solid #dee2e6;
  font-size: 20px;
  font-weight: bold;
}

.total-final span {
  color: var(--primary-color);
  font-size: 24px;
}

/* Credit Card Fields */
#credit-card-fields {
  margin-top: 20px;
}

/* Checkout Actions */
.checkout-actions {
  margin-top: 32px;
  text-align: center;
}

.btn-pay {
  width: 100%;
  max-width: 400px;
  padding: 16px 32px;
  font-size: 18px;
  font-weight: bold;
  background: #28a745;
  position: relative;
}

.btn-pay:hover {
  background: #218838;
}

.btn-pay .loader {
  display: none;
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border: 3px solid #ffffff;
  border-top: 3px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.btn-pay.loading .loader {
  display: block;
}

.btn-pay.loading .button-text {
  opacity: 0.6;
}

@keyframes spin {
  0% { transform: translateY(-50%) rotate(0deg); }
  100% { transform: translateY(-50%) rotate(360deg); }
}

/* Success View */
#success-view {
  text-align: center;
  padding: 40px 20px;
}

.success-content {
  max-width: 500px;
  margin: 0 auto;
}

.success-icon {
  font-size: 80px;
  color: #28a745;
  margin-bottom: 24px;
  animation: successPop 0.5s ease;
}

@keyframes successPop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.success-content h2 {
  color: var(--primary-color);
  font-size: 32px;
  margin-bottom: 16px;
}

.success-message {
  font-size: 18px;
  color: #666;
  line-height: 1.6;
  margin-bottom: 32px;
}

.success-details {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 32px;
  border: 2px solid #e9ecef;
}

.success-details p {
  margin: 8px 0;
  font-size: 16px;
  color: #333;
}

.success-details strong {
  color: var(--primary-color);
  margin-right: 8px;
}

/* Card Number Formatting */
#card-number {
  letter-spacing: 2px;
  font-family: 'Courier New', monospace;
}

/* Terms and Conditions Section */
.terms-section {
  background: #fff9e6;
  border-color: #ffb502;
}

.checkbox-group {
  margin-bottom: 16px;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  cursor: pointer;
  margin-top: 2px;
}

.checkbox-label span {
  color: #333;
  font-weight: 500;
}

.policy-link {
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: underline;
  transition: color 0.3s ease;
}

.policy-link:hover {
  color: #7a2dd8;
}

.policy-links {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #dee2e6;
}

.policy-links p {
  font-size: 14px;
  color: #666;
  margin-bottom: 8px;
}

.policy-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.policy-links ul li {
  font-size: 14px;
}

/* Pay Button Disabled State */
.btn-pay:disabled {
  background: #6c757d;
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-pay:disabled:hover {
  background: #6c757d;
  transform: none;
}

/* Responsive Checkout */
@media (max-width: 768px) {
  .checkout-header h2 {
    font-size: 24px;
  }

  .checkout-subtitle {
    font-size: 14px;
  }

  .checkout-section {
    padding: 16px;
  }

  .checkout-section h4 {
    font-size: 18px;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .checkout-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .total-final span {
    font-size: 20px;
  }

  .btn-pay {
    font-size: 16px;
    padding: 14px 24px;
  }
}

