/* PRODUCT COMPARISON SHORTLIST CSS */

/* Main Floating Button */
#pcs-floating-button {
  position: fixed;
  bottom: 30px;
  left: 30px;
  background: #0073aa;
  color: #fff;
  padding: 12px 20px;
  border-radius: 30px;
  cursor: pointer;
  font-weight: bold;
  font-size: 16px;
  z-index: 9998;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: background 0.2s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Floating Popup */
#pcs-shortlist-popup {
  position: fixed;
  bottom: 90px;
  right: 30px;
  width: 420px;
  max-height: 500px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  padding: 20px;
  display: none; /* Hidden by default, shown by JS */
  border-radius: 10px;
  z-index: 9999;
  overflow-y: auto; /* Enable scrolling for long lists */
  border: 1px solid #ddd;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Shortlist Header */
#pcs-shortlist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 18px;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

/* Close Button for Popup */
#pcs-close {
  cursor: pointer;
  font-weight: bold;
  font-size: 22px;
  color: #888;
  transition: color 0.2s ease;
  background: none; /* Ensure no default button background */
  border: none; /* Ensure no default button border */
  padding: 0; /* Remove default button padding */
}
#pcs-close:hover {
  color: #ff0000;
}

/* Message Container within Popup */
#pcs-message-container {
  display: none; /* Hidden by default, shown by JS */
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 5px;
  font-size: 14px;
  text-align: center;
  /* Background and color set by JS based on message type */
}

/* Shortlist Items List */
#pcs-shortlist-items {
  list-style: none;
  padding: 0;
  margin: 0;
}

#pcs-shortlist-items li {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

#pcs-shortlist-items li:last-child {
  border-bottom: none; /* No border for the last item */
  margin-bottom: 0;
  padding-bottom: 0;
}

#pcs-shortlist-items li img {
  width: 50px; /* Thumbnail size */
  height: 50px;
  object-fit: cover;
  margin-right: 10px;
  border-radius: 3px;
}

#pcs-shortlist-items li a {
  flex-grow: 1; /* Allow product name to take available space */
  text-decoration: none;
  color: #333;
  font-weight: 500;
  font-size: 15px;
}

#pcs-shortlist-items li a:hover {
  color: #0073aa;
}

/* Remove Item Button within Shortlist Popup */
.pcs-remove-item {
  background: none;
  border: none;
  color: #aaa;
  font-size: 20px;
  cursor: pointer;
  padding: 5px;
  line-height: 1;
  transition: color 0.2s ease;
  margin-left: 10px; /* Space between product name and button */
}

.pcs-remove-item:hover {
  color: #dc3545; /* Red on hover */
}

/* Popup Actions (Compare and Clear All buttons) */
.pcs-popup-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #eee;
}

/* Compare Button within Popup */
.pcs-compare-btn {
  flex: 1;
  padding: 12px 15px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  transition: background 0.2s ease, color 0.2s ease;
  cursor: pointer;
  background: #0073aa; /* Primary button color */
  color: #fff;
  text-decoration: none; /* For anchor tag */
  display: block; /* Ensure it takes full width */
}
.pcs-compare-btn:hover {
  background: #005177;
  color: #fff;
}

/* Clear All Button within Popup */
#pcs-clear-all {
  flex: 1;
  padding: 12px 15px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
  background: #f8f9fa; /* Light background */
  color: #333;
  border: 1px solid #ddd;
}
#pcs-clear-all:hover {
  color: #ccc;
  background: #ff0000;
  border-color: #ccc;
}

/* Add to Compare Button (on product listings) */
.pcs-add-btn{
  display: block; /* Changed to block for centering */
  width: fit-content; /*shrink to content width */
  margin: 10px auto; 
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: bold;
  font-size: 14px;
  transition: background 0.2s ease, color 0.2s ease;
  text-decoration: none;
  cursor: pointer;
  background: #000;
  color: #fff;
  border: none; /* Ensure no default button border */
}
.pcs-add-btn:hover{
  background: #333;
  color: #fff;
}

/* COMPARISON TABLE STYLES */
.pcs-compare-container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 20px;
}

/* Wrapper for responsive scrolling */
.pcs-compare-table-wrapper {
  overflow-x: auto; /* Enables horizontal scrolling on small screens */
  margin-bottom: 2rem;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}

/* Comparison Table */
.pcs-compare-table {
  width: 100%;
  min-width: 800px; /* Ensures table is wide enough for content */
  border-collapse: collapse;
  font-size: 0.95rem;
  background: #fff;
}

/* Table Cells (common styles for th and td) */
.pcs-compare-table th,
.pcs-compare-table td {
  padding: 15px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #e5e5e5;
}

/* Feature Header Column (first column) */
.pcs-compare-table .pcs-feature-header {
  width: 200px;
  font-weight: 600;
  color: #333;
  background-color: #f8f9fa;
  position: sticky; /* Keeps header visible on horizontal scroll */
  left: 0;
  z-index: 2; /* Ensures it stays above other cells */
}

/* Product Header Row (top row for each product) */
.pcs-compare-table .pcs-product-header {
  text-align: center;
  background-color: #f8f9fa;
  border-left: 1px solid #e5e5e5;
  min-width: 200px;
  position: relative; /* Needed for positioning the remove button */
}

/* Product Title within Header */
.pcs-compare-table .pcs-product-title {
  font-weight: 600;
  margin-bottom: 10px;
  color: #333;
  font-size: 1.05rem;
}

/* Product Title Link */
.pcs-compare-table .pcs-product-title-link {
  text-decoration: none;
  color: inherit; /* Inherit color from parent */
}

.pcs-compare-table .pcs-product-title-link:hover .pcs-product-title {
  color: #0073aa; /* Change color on hover */
}

/* Product Thumbnail within Header */
.pcs-compare-table .pcs-product-thumbnail img {
  max-width: 150px;
  height: auto;
  border-radius: 4px;
  margin: 0 auto 10px; /* Center image */
  display: block;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}


/* Feature Sections "Product Information" */
.pcs-compare-table .pcs-feature-section td {
  background-color: #f1f3f5;
  font-weight: 600;
  color: #333;
  padding: 12px 15px;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  position: sticky; /* Keeps section headers visible on vertical scroll */
  top: 0;
  z-index: 1; /* Stays below feature header but above content */
}

/* Feature Name (e.g., "SKU", "Weight") */
.pcs-compare-table .pcs-feature-name {
  font-weight: 500;
  color: #555;
  background-color: #fbfbfb;
  position: sticky; /* Keeps feature names visible on horizontal scroll */
  left: 0;
  z-index: 2; /* Ensures it stays above other cells */
}

/* Controls at bottom of comparison table */
.pcs-compare-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  padding: 1.5rem;
  border-top: 1px solid #e5e5e5;
  background: #f9f9f9;
  border-radius: 8px;
}

/* Comparison Count text */
.pcs-compare-count {
  font-size: 1rem;
  color: #444;
  margin: 0;
  font-weight: 500;
}

.pcs-clear-all-btn{
  color: black;
  padding: 10px 16px ;
  border-radius: 10px;
}

.pcs-clear-all-btn:hover{
  color: white;
  background-color: red;
}

/* Spinner for loading states */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
  -webkit-animation: spin 1s ease-in-out infinite;
  vertical-align: middle;
  margin-right: 5px;
}

@keyframes spin {
  to { -webkit-transform: rotate(360deg); }
}
@-webkit-keyframes spin {
  to { -webkit-transform: rotate(360deg); }
}


/* Responsive adjustments */
@media (max-width: 768px) {
  #pcs-shortlist-popup {
    width: 90%; /* Make popup wider on smaller screens */
    right: 5%;
    left: 5%;
    bottom: 20px;
    max-height: 8;
  }
}