/**
 * Product Comparison Styles
 * Modern, clean design for comparison feature
 */

/* ============================================
   COMPARISON BUTTON STYLES
   ============================================ */

.btn-compare {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #fff;
  border: 2px solid #8b3dff;
  color: #8b3dff;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.btn-compare:hover:not(:disabled) {
  background: #8b3dff;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 61, 255, 0.3);
}

.btn-compare:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f5f5f5;
  border-color: #ddd;
  color: #999;
}

.btn-compare[data-in-comparison="true"] {
  background: #8b3dff;
  color: #fff;
  border-color: #8b3dff;
}

.btn-compare[data-in-comparison="true"]:hover:not(:disabled) {
  background: #7a35e6;
  border-color: #7a35e6;
}

.btn-compare i {
  font-size: 14px;
}

/* Small button variant */
.btn-compare.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* Icon only variant */
.btn-compare.btn-icon {
  padding: 8px;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  justify-content: center;
}

.btn-compare.btn-icon .btn-text {
  display: none;
}

/* ============================================
   HEADER BADGE
   ============================================ */

.comparison-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  color: #333;
  text-decoration: none;
  transition: color 0.3s;
}

.comparison-link:hover {
  color: #8b3dff;
}

.comparison-link .header-btn {
  position: relative;
}

.comparison-link .badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: linear-gradient(135deg, #8b3dff 0%, #c724b1 100%);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 10px;
  min-width: 18px;
  height: 18px;
  text-align: center;
  display: none;
  animation: badgePop 0.3s ease-out;
  line-height: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

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

/* ============================================
   FLOATING COMPARISON BAR
   ============================================ */

.comparison-float {
  position: fixed;
  bottom: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #8b3dff 0%, #c724b1 100%);
  color: #fff;
  padding: 16px 24px;
  border-radius: 50px;
  box-shadow: 0 8px 32px rgba(139, 61, 255, 0.4);
  z-index: 9999;
  transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: none;
}

.comparison-float.show {
  bottom: 30px;
}

.comparison-float-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.comparison-float .count {
  background: rgba(255, 255, 255, 0.3);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 18px;
  font-weight: 700;
  min-width: 40px;
  text-align: center;
}

.comparison-float .text {
  font-size: 15px;
  font-weight: 600;
}

.comparison-float .btn {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
}

.comparison-float .btn-primary {
  background: #fff;
  color: #8b3dff;
}

.comparison-float .btn-primary:hover {
  background: #f0f0f0;
  transform: translateY(-2px);
}

.comparison-float .btn-default {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.comparison-float .btn-default:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .comparison-float {
    left: 10px;
    right: 10px;
    transform: none;
    border-radius: 16px;
    padding: 12px 16px;
  }

  .comparison-float-content {
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
  }

  .comparison-float .text {
    font-size: 13px;
  }

  .comparison-float .btn {
    padding: 6px 12px;
    font-size: 12px;
  }
}

/* ============================================
   NOTIFICATION TOAST
   ============================================ */

.comparison-notification {
  position: fixed;
  top: -100px;
  right: 20px;
  background: #fff;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10000;
  transition: top 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 300px;
  max-width: 400px;
}

.comparison-notification.show {
  top: 20px;
}

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

.comparison-notification.success {
  border-left: 4px solid #10b981;
}

.comparison-notification.success i {
  color: #10b981;
}

.comparison-notification.error {
  border-left: 4px solid #ef4444;
}

.comparison-notification.error i {
  color: #ef4444;
}

.comparison-notification span {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .comparison-notification {
    right: 10px;
    left: 10px;
    min-width: auto;
  }
}

/* ============================================
   COMPARISON PAGE STYLES
   ============================================ */

.comparison-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e5e7eb;
}

.comparison-header h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, #8b3dff 0%, #c724b1 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.comparison-table-wrapper {
  overflow-x: auto;
  margin-bottom: 30px;
}

.compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.compare-table th {
  background: linear-gradient(135deg, #8b3dff 0%, #c724b1 100%);
  color: #fff;
  padding: 16px;
  font-weight: 600;
  text-align: left;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.compare-table td {
  padding: 20px 16px;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: top;
}

.compare-table tr:last-child td {
  border-bottom: none;
}

.compare-table th:first-child,
.compare-table td:first-child {
  background: #f9fafb;
  font-weight: 600;
  color: #374151;
  min-width: 150px;
}

.product-image img {
  max-width: 200px;
  border-radius: 8px;
}

.product-info h3 {
  margin: 10px 0;
  font-size: 16px;
}

.product-price .price {
  font-size: 24px;
  font-weight: 700;
  color: #8b3dff;
}

.product-price .price-before-discount {
  font-size: 16px;
  color: #999;
  text-decoration: line-through;
  margin-left: 8px;
}

.remove-icon {
  color: #ef4444;
  font-size: 20px;
  transition: all 0.3s;
}

.remove-icon:hover {
  color: #dc2626;
  transform: scale(1.2);
}

/* Empty state */
.empty-comparison {
  text-align: center;
  padding: 80px 20px;
}

.empty-comparison i {
  color: #d1d5db;
  margin-bottom: 20px;
}

.empty-comparison h3 {
  font-size: 24px;
  color: #6b7280;
  margin-bottom: 12px;
}

.empty-comparison p {
  color: #9ca3af;
  margin-bottom: 24px;
}

.empty-comparison .btn {
  background: linear-gradient(135deg, #8b3dff 0%, #c724b1 100%);
  border: none;
  color: white;
  padding: 14px 32px;
  font-weight: 600;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
}

.empty-comparison .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 107, 53, 0.4);
  color: white;
}

.empty-comparison .btn i {
  color: white;
  margin: 0;
}


/* Responsive table */
@media (max-width: 992px) {
  .compare-table {
    font-size: 13px;
  }

  .product-image img {
    max-width: 150px;
  }

  .product-price .price {
    font-size: 18px;
  }
}

@media (max-width: 768px) {
  .comparison-header {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }

  .comparison-actions {
    width: 100%;
  }

  .comparison-actions .btn {
    flex: 1;
  }
}
