/* ==========================================================================
   Inventory Master - Main Table Styles
   ========================================================================== */

.wishlist-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.wishlist-table th,
.wishlist-table td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: left;
  font-size: 13px;
}

.wishlist-table th {
  background-color: #f2f2f2;
}

.wishlist-table tbody tr td:first-child {
  cursor: pointer;
}

.wishlist-table.project-mode tbody tr td:first-child {
  cursor: default;
}

.wishlist-table.project-mode tbody tr td:nth-child(2) {
  cursor: pointer;
}

.wishlist-table tbody tr:hover {
  background-color: #f5f9fc;
}

.wishlist-table input[type="number"] {
    font-size: 14px !important;
}

.wishlist-table input[type="text"],
.wishlist-table textarea {
  width: 100%;
  padding: 5px;
  border: 1px solid #ddd;
}

.wishlist-table .category-header td {
  background-color: #f0f0f0;
  font-weight: bold;
  text-align: left;
  padding: 10px;
}

.wishlist-table .category-header th {
    color: #fff;
}

/* ==========================================================================
   Inventory Master - Header Styles
   ========================================================================== */

.wishlist-header h2 {
  margin: 0;
}


/* ==========================================================================
   Inventory Master - Button Styles
   ========================================================================== */

.wishlist-buttons {
  display: flex;
  gap: 5px;
}

.wishlist-buttons button {
  margin: 10px 0;
  padding: 5px 10px;
  background-color: #0073aa;
  color: white;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.wishlist-buttons button:hover {
  background-color: #99997e;
}

.wishlist-buttons .dashicons {
    vertical-align: middle;
}

/* ==========================================================================
   Inventory Master - Filter Styles
   ========================================================================== */

#wishlist-filter-col {
  display: none;
}

#wishlist-filter {
  background-color: #fff;
  padding: 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-bottom: 20px;
}

.category-filters {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #eee;
}

.filter-group {
  margin-bottom: 15px;
}

.filter-group-toggle {
  background-color: #f5f5f5;
  padding: 8px 12px;
  margin: 0;
  cursor: pointer;
  border: 1px solid #ddd;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.filter-group-toggle:hover {
  background-color: #e9e9e9;
}

.filter-group .filter-options {
  padding: 10px;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 4px 4px;
  margin-top: -1px;
}

.acf-filters .filter-option {
  display: block;
  padding: 5px 0;
}

.acf-filters .filter-option.active {
  color: #007bff;
  font-weight: bold;
}

.toggle-icon {
  font-size: 12px;
  transition: transform 0.2s ease;
}

.filter-group-toggle[aria-expanded="true"] .toggle-icon {
  transform: rotate(180deg);
}

.wishlist-options {
  font-size: 14px;
}

/* ==========================================================================
   Inventory Master - Project Mode Styles
   ========================================================================== */

.project-check-col {
  width: 40px !important;
  min-width: 40px;
  text-align: center !important;
}

.sortable-check {
  cursor: pointer;
}

.inventory-instructions {
  font-size: 14px;
  color: #666;
  margin-right: auto;
}

.wishlist-options-right {
  margin-left: auto;
  white-space: nowrap;
}

@media screen and (max-width: 780px) {
  .wishlist-buttons {
    justify-content: center !important;
  }
  .wishlist-options {
    flex-wrap: wrap !important;
    justify-content: center !important;
  }
  .inventory-instructions {
    width: 100%;
    margin-bottom: 5px;
    text-align: center;
    margin-right: 0;
  }
  .wishlist-options-right {
    margin-left: 0;
    text-align: center;
  }
}

@media screen and (min-width: 681px) {
  .wishlist-table.project-mode th:nth-child(2),
  .wishlist-table.project-mode td:nth-child(2) {
    width: 15%;
  }
  .wishlist-table.project-mode th:nth-child(3),
  .wishlist-table.project-mode td:nth-child(3) {
    width: 5%;
  }
  .wishlist-table.project-mode th:nth-child(4),
  .wishlist-table.project-mode td:nth-child(4) {
    width: 11%;
  }
  .wishlist-table.project-mode th:nth-child(5),
  .wishlist-table.project-mode td:nth-child(5) {
    width: 7%;
  }
  .wishlist-table.project-mode th:nth-child(6),
  .wishlist-table.project-mode td:nth-child(6) {
    width: 7%;
  }
  .wishlist-table.project-mode th:nth-child(7),
  .wishlist-table.project-mode td:nth-child(7) {
    width: 10%;
  }
  .wishlist-table.project-mode th:nth-child(8),
  .wishlist-table.project-mode td:nth-child(8) {
    width: 9%;
  }
  .wishlist-table.project-mode th:nth-child(9),
  .wishlist-table.project-mode td:nth-child(9) {
    width: 10%;
  }
  .wishlist-table.project-mode th:nth-child(10),
  .wishlist-table.project-mode td:nth-child(10) {
    width: 10%;
  }
  .wishlist-table.project-mode th:nth-child(11),
  .wishlist-table.project-mode td:nth-child(11) {
    width: 9%;
  }
}

/* ==========================================================================
   Inventory Master - Overlay / Spinner
   ========================================================================== */

#wishlist-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.7);
  z-index: 99999989;
}

.spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50px;
  height: 50px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* ==========================================================================
   Inventory Master - Responsive Styles
   ========================================================================== */

@media screen and (min-width: 681px) {
  .wishlist-table th:nth-child(1),
  .wishlist-table td:nth-child(1) {
    width: 16%;
  }
  .wishlist-table th:nth-child(2),
  .wishlist-table td:nth-child(2) {
    width: 6%;
  }
  .wishlist-table th:nth-child(3),
  .wishlist-table td:nth-child(3) {
    width: 12%;
  }
  .wishlist-table th:nth-child(4),
  .wishlist-table td:nth-child(4) {
    width: 7.5%;
  }
  .wishlist-table th:nth-child(5),
  .wishlist-table td:nth-child(5) {
    width: 7.5%;
  }
  .wishlist-table th:nth-child(6),
  .wishlist-table td:nth-child(6) {
    width: 10%;
  }
  .wishlist-table th:nth-child(7),
  .wishlist-table td:nth-child(7) {
    width: 10%;
  }
  .wishlist-table th:nth-child(8),
  .wishlist-table td:nth-child(8) {
    width: 10%;
  }
  .wishlist-table th:nth-child(9),
  .wishlist-table td:nth-child(9) {
    width: 11%;
  }
  .wishlist-table th:nth-child(10),
  .wishlist-table td:nth-child(10) {
    width: 10%;
  }
  .wishlist-table input[type="number"] {
    min-width: 80px;
    width: 100%;
  }
}

@media screen and (max-width: 680px) {
  .wishlist-header-top {
    flex-direction: column;
    align-items: center;
  }
  .wishlist-header-top .wishlist-buttons {
    width: 100%;
    justify-content: center;
  }
  .wishlist-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .wishlist-table input[type="number"] {
    width: 85px !important;
    min-width: 85px;
  }
}

@media screen and (max-width: 768px) {
  .wishlist-table {
    font-size: 14px;
  }
  .wishlist-table th,
  .wishlist-table td {
    padding: 6px 4px;
  }
  .wishlist-table .category-header h3 {
    font-size: 16px;
  }
}

@media screen and (max-width: 480px) {
  .wishlist-table {
    font-size: 12px;
  }
  .wishlist-table th,
  .wishlist-table td {
    padding: 4px 2px;
  }
  .wishlist-table .category-header h3 {
    font-size: 14px;
  }
}

/* ==========================================================================
   Inventory Master - Color Popup
   ========================================================================== */

.inv-popup {
  position: absolute;
  z-index: 99999992;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  max-width: 360px;
  min-width: 260px;
  font-size: 14px;
}

.inv-popup-close {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 20px;
  cursor: pointer;
  color: #fff;
  line-height: 1;
}

.inv-popup-title {
  font-weight: bold;
  font-size: 16px;
  padding: 10px 15px;
  color: #fff;
  border-radius: 8px 8px 0 0;
}

.inv-popup-body {
  display: flex;
  gap: 12px;
  padding: 12px 15px;
}

.inv-popup-swatch {
  width: 120px;
  height: auto;
  max-height: 220px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.inv-popup-attrs {
  flex: 1;
}

.inv-popup-attrs p {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.4;
}

.inv-add-compare,
.inv-already-added {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 10px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

.inv-add-compare {
  background: #0073aa;
  color: #fff;
}

.inv-add-compare:hover {
  background: #99997e;
}

.inv-already-added {
  background: #27ae60;
  color: #fff;
}

.inv-already-added:hover {
  background: #99997e;
}

/* ==========================================================================
   Inventory Master - Compare Button
   ========================================================================== */

.inv-compare-btn {
  background-color: #27ae60 !important;
  color: white !important;
}

.inv-compare-btn:hover {
  background-color: #1e8c4c !important;
}

/* ==========================================================================
   Inventory Master - Toast Notification
   ========================================================================== */

.inv-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #333;
  color: #fff;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 14px;
  z-index: 99999995;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.inv-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   Inventory Master - Comparison Modal
   ========================================================================== */

#inv-comparison-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 99999990;
  overflow-y: auto;
}

.inv-modal-header {
  position: sticky;
  top: 0;
  z-index: 99999991;
  background: #333;
  padding: 10px 20px;
  display: flex;
  justify-content: flex-end;
}

.inv-modal-buttons {
  display: flex;
  gap: 8px;
}

.inv-modal-btn {
  padding: 6px 14px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  background: #0073aa;
  color: #fff;
  transition: all 0.2s;
}

.inv-modal-btn:hover {
  background: #005f8c;
}

.inv-modal-close-btn {
  background: #c0392b;
}

.inv-modal-close-btn:hover {
  background: #a93226;
}

.inv-modal-body {
  padding: 20px;
  overflow-x: auto;
}

.inv-comp-table {
  border-collapse: collapse;
  width: auto;
}

.inv-comp-table td {
  border: 1px solid #ddd;
  padding: 8px 10px;
  vertical-align: top;
  font-size: 13px;
}

.inv-comp-table img {
  border-radius: 4px;
}

.inv-comp-title {
  font-size: 14px !important;
}

body.inv-modal-open {
  overflow: hidden;
}

#inv-email-form {
  background: #f5f5f5;
  border-bottom: 1px solid #ddd;
  padding: 0;
}

.inv-email-form-inner {
  max-width: 400px;
  margin: 0 auto;
  padding: 20px;
}

.inv-email-form-inner h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.inv-email-form-inner input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  margin-bottom: 10px;
  box-sizing: border-box;
}

.inv-email-form-buttons {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

@media screen and (max-width: 780px) {
  .inv-popup {
    position: fixed;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%);
    max-width: 90vw;
  }
}