/* WooCommerce Product Comparision With Search - Clean Minimalistic Style */

.wc-product-compare-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  background: #ffffff;
  min-height: 100vh;
}

/* Search Section */
.wc-compare-search-section {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 32px;
  margin-bottom: 32px;
}

.wc-compare-search-container {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

.wc-compare-search-label {
  display: block;
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 16px;
  text-align: center;
}

.wc-compare-search-input {
  width: 100%;
  padding: 16px 24px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 16px;
  box-sizing: border-box;
  background: #fff;
  transition: all 0.2s ease;
  font-weight: 500;
}

.wc-compare-search-input:focus {
  outline: none;
  border-color: #3b82f6;
  background: #fff;
}

.wc-compare-search-input::placeholder {
  color: #9ca3af;
  font-weight: 400;
}

/* Search Results Dropdown */
.wc-compare-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-top: none;
  border-radius: 0 0 8px 8px;
  z-index: 1000;
  max-height: 400px;
  overflow-y: auto;
  display: none;
}

.wc-compare-suggestions-header {
  padding: 16px 24px;
  background: #f8fafc;
  color: #374151;
  font-weight: 600;
  font-size: 14px;
  text-align: center;
  border-bottom: 1px solid #e5e7eb;
}

.wc-compare-search-result-item {
  display: flex;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.wc-compare-search-result-item:hover {
  background: #f9fafb;
}

.wc-compare-search-result-item:last-child {
  border-bottom: none;
}

.wc-compare-search-result-image {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  margin-right: 16px;
  flex-shrink: 0;
  border: 1px solid #e5e7eb;
}

.wc-compare-search-result-content {
  flex: 1;
  min-width: 0;
}

.wc-compare-search-result-title {
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 6px 0;
  font-size: 15px;
  line-height: 1.4;
}

.wc-compare-search-result-price {
  color: #3b82f6;
  font-weight: 700;
  font-size: 14px;
  margin: 0;
}

.wc-compare-search-result-add {
  background: #3b82f6;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-left: 16px;
  transition: background-color 0.2s ease;
}

.wc-compare-search-result-add:hover {
  background: #2563eb;
}

.wc-compare-search-result-add.disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

/* Comparison Table */
.wc-compare-table-container {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 32px;
  margin-bottom: 32px;
}

.wc-compare-table-title {
  color: #1f2937;
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 32px 0;
  text-align: center;
}

.wc-compare-table {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.wc-compare-table table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
  background: #fff;
}

.wc-compare-table th,
.wc-compare-table td {
  padding: 20px;
  text-align: left;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: top;
}

.wc-compare-table th {
  background: #daf4ed; /* Default, overridden by plugin inline CSS if admin changes color */
  border: 1px solid #07a169; /* Default, overridden by plugin inline CSS if admin changes color */
  font-weight: 700;
  color: #1f2937;
  font-size: 15px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.wc-compare-table td {
  background: #fff;
  font-size: 14px;
  color: #374151;
  line-height: 1.6;
}

.wc-compare-table tr:hover td {
  background: #f9fafb;
}

/* Product Header */
.wc-compare-product-header {
  text-align: center;
  padding: 20px;
  background: #daf4ed; /* Default, overridden by plugin inline CSS if admin changes color */
  border-radius: 8px;
  margin-bottom: 16px;
}

.wc-compare-product-image {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
  margin: 0 auto 12px;
  display: block;
  border: 1px solid #e5e7eb;
  transition: transform 0.2s ease;
  background: #daf4ed; /* Default, overridden by plugin inline CSS if admin changes color */
}

.wc-compare-product-image:hover {
  transform: scale(1.02);
}

.wc-compare-product-title {
  font-size: 16px;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 8px 0;
  line-height: 1.4;
}

.wc-compare-product-price {
  font-size: 18px;
  font-weight: 800;
  color: #3b82f6;
  margin: 0 0 12px 0;
}

.wc-compare-remove-btn {
  background: #ef4444;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: block;
  margin: 0 auto;
  transition: background-color 0.2s ease;
}

.wc-compare-remove-btn:hover {
  background: #dc2626;
}

/* Product Data */
.wc-compare-product-data {
  line-height: 1.6;
}

.wc-compare-product-data strong {
  color: #1f2937;
  font-weight: 700;
}

/* Product Actions */
.wc-compare-product-actions {
  text-align: center;
}

.wc-compare-read-more-btn {
  background: #10b981;
  color: #fff;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  display: inline-block;
  transition: background-color 0.2s ease;
}

.wc-compare-read-more-btn:hover {
  background: #059669;
  color: #fff;
  text-decoration: none;
}

/* Empty State */
.wc-compare-empty {
  text-align: center;
  padding: 80px 20px;
  color: #6b7280;
  background: #fff;
  border-radius: 12px;
  border: 2px dashed #d1d5db;
}

.wc-compare-empty p {
  font-size: 18px;
  margin: 0;
  font-weight: 500;
}

/* Loading States */
.wc-compare-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: #6b7280;
  font-weight: 500;
}

.wc-compare-loading::after {
  content: "";
  width: 20px;
  height: 20px;
  border: 2px solid #e5e7eb;
  border-top: 2px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 12px;
}

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

/* Responsive Design */
@media (max-width: 1024px) {
  .wc-product-compare-container {
    padding: 16px;
  }

  .wc-compare-search-section,
  .wc-compare-table-container {
    padding: 24px;
  }

  .wc-compare-table-title {
    font-size: 24px;
  }
}

@media (max-width: 768px) {
  .wc-product-compare-container {
    padding: 12px;
  }

  .wc-compare-search-section,
  .wc-compare-table-container {
    padding: 20px;
    border-radius: 8px;
  }

  .wc-compare-search-label {
    font-size: 16px;
    margin-bottom: 12px;
  }

  .wc-compare-search-input {
    padding: 14px 20px;
    font-size: 16px;
  }

  .wc-compare-table {
    font-size: 13px;
  }

  .wc-compare-table th,
  .wc-compare-table td {
    padding: 12px;
  }

  .wc-compare-product-image {
    width: 80px;
    height: 80px;
  }

  .wc-compare-product-title {
    font-size: 14px;
  }

  .wc-compare-product-price {
    font-size: 16px;
  }

  .wc-compare-search-result-item {
    padding: 12px 16px;
  }

  .wc-compare-search-result-image {
    width: 48px;
    height: 48px;
    margin-right: 12px;
  }

  .wc-compare-search-result-add {
    padding: 8px 16px;
    font-size: 12px;
    margin-left: 12px;
  }

  .wc-compare-table-title {
    font-size: 20px;
    margin-bottom: 24px;
  }
}

@media (max-width: 480px) {
  .wc-compare-search-section,
  .wc-compare-table-container {
    padding: 16px;
  }

  .wc-compare-search-label {
    font-size: 14px;
    margin-bottom: 10px;
  }

  .wc-compare-table th,
  .wc-compare-table td {
    padding: 8px;
    font-size: 12px;
  }

  .wc-compare-product-image {
    width: 60px;
    height: 60px;
  }

  .wc-compare-product-title {
    font-size: 12px;
  }

  .wc-compare-product-price {
    font-size: 14px;
  }

  .wc-compare-remove-btn {
    padding: 6px 12px;
    font-size: 11px;
  }

  .wc-compare-read-more-btn {
    padding: 8px 16px;
    font-size: 12px;
  }
}

/* Smooth scrolling for table */
.wc-compare-table {
  scrollbar-width: thin;
  scrollbar-color: #d1d5db #f9fafb;
}

.wc-compare-table::-webkit-scrollbar {
  height: 6px;
}

.wc-compare-table::-webkit-scrollbar-track {
  background: #f9fafb;
  border-radius: 3px;
}

.wc-compare-table::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.wc-compare-table::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Focus states for accessibility */
.wc-compare-search-input:focus,
.wc-compare-remove-btn:focus,
.wc-compare-search-result-add:focus,
.wc-compare-read-more-btn:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.wc-compare-product-header .wc-compare-product-image {
  background: #daf4ed; /* Default, overridden by plugin inline CSS if admin changes color */
  border: none; /* No border for header image */
}
