/* ============================================================
    EBOOK DATA GRID — UPDATE 5.1.2
    Polished dark theme + koi glow accents + refined wishlist
    ============================================================ */

/* --- Base & Dark Theme --- */
#ebook-data-grid-app {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(to bottom, #000000 0%, #0a0a0a 120%);
  color: #f5f5f5;
}

#ebook-data-grid-app ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

#ebook-data-grid-app ::-webkit-scrollbar-track {
  background: #050505;
}

#ebook-data-grid-app ::-webkit-scrollbar-thumb {
  background: #1a1a1a;
  border-radius: 10px;
}

/* --- Headers & Filters --- */
.filter-label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
  color: #aaaaaa;
}

.reset-btn {
  color: #f69a5f;
  font-size: 0.875rem;
  text-decoration: none;
  border: 1px solid #25026f;
  padding: 0.25rem 0.75rem;
  border-radius: 0.375rem;
  transition: background-color 0.2s, color 0.2s;
}

.reset-btn:hover {
  background-color: #25026f;
  color: #f5f5f5;
}

/* --- Layout & Borders --- */
.border-b { border-bottom-width: 1px; }
.border-gray-700 { border-color: #111; }
.p-4 { padding: 1rem; }
@media (min-width: 640px) { .sm\:p-6 { padding: 1.5rem; } }
.mb-6 { margin-bottom: 1.5rem; }

.grid { display: grid; }
.gap-4 { gap: 1rem; }
.items-end { align-items: flex-end; }
.flex { display: flex; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }

@media (min-width: 1024px) {
  .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .md\:col-span-4 { grid-column: span 4 / span 4; }
}

/* --- Inputs & Selects --- */
.grid-input,
.grid-select {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #25026f;
  border-radius: 0.375rem;
  background-color: #0a0a0a;
  color: #f0f0f0;
  font-size: 0.875rem;
}

.grid-input:focus,
.grid-select:focus {
  outline: 2px solid transparent;
  box-shadow: 0 0 0 1px #f69a5f;
  border-color: #f69a5f;
}

.grid-select {
  -webkit-appearance: none;
  appearance: none;
  background-image: url('data:image/svg+xml;charset=UTF-8,%3csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none" stroke="%23f69a5f" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3e%3cpath d="m6 8 4 4 4-4"/%3e%3c/svg%3e');
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1.25em;
  padding-right: 2.5rem;
}

/* --- Table --- */
#data-grid-table { min-width: 100%; border-collapse: collapse; }
#data-grid-table thead { background-color: #0a0a0a; }

#data-grid-table th,
#data-grid-table td {
  padding: 0.75rem 1rem;
  vertical-align: middle;
  font-size: 0.875rem;
}

#data-grid-table th {
  text-align: left;
  font-weight: 500;
  color: #f69a5f;
  text-transform: uppercase;
  font-size: 0.75rem;
}

#data-grid-table tbody tr.product-row {
  cursor: pointer;
  border-top: 1px solid #111;
  transition: background-color 0.2s;
}

#data-grid-table tbody tr.product-row:hover {
  background-color: #111;
}

/* --- Clickable Filters --- */
.filter-trigger {
  cursor: pointer;
  transition: color 0.2s;
  text-decoration: underline;
  text-decoration-color: transparent;
}
.filter-trigger:hover {
  color: #f69a5f;
  text-decoration-color: #f69a5f;
}

#active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-pill {
  cursor: pointer;
  background-color: #25026f;
  color: #f69a5f;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
}

/* --- Expanded Details --- */
.details-row td { padding: 0; background-color: #0a0a0a; }

.details-container {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  gap: 1.5rem;
}
@media (min-width: 768px) { .details-container { flex-direction: row; } }

.details-image {
  display: none;
  flex-shrink: 0;
  width: 300px;
}
.details-image img {
  width: 100%;
  height: 100%;
  border-radius: 0.25rem;
  display: block;
  object-fit: contain;
}

.details-content { flex: 1; min-width: 0; }

.long-description-cell {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #111;
}

#data-grid-table tbody tr.product-row.is-expanded,
#data-grid-table tbody tr.product-row.is-expanded:hover {
  background-color: #0f0f0f;
}

.product-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* --- Cover Art Column --- */
.image-col {
  display: none;
  padding: 0.5rem;
  width: 100px;
}
.image-col img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
#data-grid-table.table-images-on .image-col { display: table-cell; }
#data-grid-table.table-images-on .details-image { display: block; }

/* --- Buttons --- */

/* --- Unified Button Styles (Consolidated) --- */
.action-btn {
  cursor: pointer;
  display: inline-block;
  padding: 0.75rem 1.25rem;
  border: 1px solid #333;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #f5f5f5;
  background: none;
  transition: all 0.25s ease;
  white-space: nowrap;
}

/* --- Add to Cart (fixed hover, same family as others) --- */
.action-btn.add-to-cart-btn {
  color: #f69a5f;
  border-color: #3a3a3a;
  background: transparent;
  box-shadow: 0 0 0 rgba(255, 152, 0, 0);
}
.action-btn.add-to-cart-btn:hover {
  border-color: #f69a5f;
  background-color: rgba(246, 154, 95, 0.1);
  color: #f69a5f;
  transform: translateY(-2px);
  box-shadow: 0 0 12px rgba(255,152,0,0.5);
}

/* --- Read More / Read Less (Consolidated) --- */
.excerpt-btn {
  background-color: #25026f;
  color: #f69a5f;
  border: 1px solid #25026f;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.excerpt-btn:hover {
  background-color: #f69a5f;
  color: #25026f;
  border-color: #f69a5f;
  transform: translateY(-2px);
  box-shadow: 0 0 12px rgba(255,152,0,0.5);
}

/* --- Button Groups --- */
.details-buttons {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  justify-content: flex-start;
  flex-wrap: wrap;
  transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out;
  will-change: transform, opacity;
}
.details-buttons .action-btn {
  font-size: 1rem;
  font-weight: 600;
  padding: 0.8em 1.6em;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* --- Animations --- */
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 10px rgba(255,152,0,0.4); }
  50% { box-shadow: 0 0 22px rgba(255,152,0,0.8); }
}

/* --- Fade-In for Expanded Images --- */
.details-image img {
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.details-image img.loaded {
  opacity: 1;
  transform: scale(1);
}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
  #data-grid-table thead { display: none; }
  #data-grid-table tr {
    display: block;
    border-bottom: 2px solid #111;
    margin-bottom: 1rem;
  }
  #data-grid-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #111;
  }
  #data-grid-table td:before {
    content: attr(data-label);
    font-weight: bold;
    color: #f69a5f;
    margin-right: 1rem;
  }
  #data-grid-table td:last-child { border-bottom: 0; }
  .actions-col { 
    flex-direction: column; 
    align-items: flex-end; 
    gap: 0.5rem;
  }
  .actions-col .action-btn,
  .actions-col .wishlist-btn-wrapper {
    margin-left: 0;
    margin-top: 0.5rem;
    width: 100%;
    text-align: center;
  }
  .actions-col .wishlist-btn-wrapper .ebook-wishlist-toggle {
     width: 100%;
     justify-content: center;
  }
}

/*
 * These are your ORIGINAL styles for the buttons, restored.
 * The pill button:
 */
.ebook-wishlist-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #3a3a3a;
  border-radius: 9999px;
  background: #0a0a0a;
  color: #f69a5f;
  font-size: 0.85rem;
  padding: 0.4rem 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all 0.25s ease;
}

.ebook-wishlist-toggle:hover {
  background: #f69a5f;
  color: #000;
  transform: translateY(-2px);
  box-shadow: 0 0 12px rgba(255,152,0,0.6);
}

.ebook-wishlist-toggle.is-active {
  background: linear-gradient(135deg, #f69a5f, #ffb84d);
  color: #000;
  border: none;
  box-shadow: 0 0 12px rgba(255,152,0,0.6);
}

.ebook-wishlist-toggle.is-busy {
  opacity: 0.6;
  cursor: wait;
}

.ebook-wishlist-icon {
  font-size: 1rem;
  line-height: 1;
}

/* The square button (unused by shortcode, but part of your file) */
.ebook-wishlist-main-btn {
  border: 1px solid #333;
  background: none;
  color: #ccc;
  font-weight: 600;
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.25s ease;
}
.ebook-wishlist-main-btn:hover {
  color: #f69a5f;
  border-color: #f69a5f;
  box-shadow: 0 0 10px rgba(255,152,0,0.4);
}


/* === Fix button alignment === */
.actions-col,
.details-buttons {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: flex-start;
}

.actions-col button,
.details-buttons button {
  white-space: nowrap;
}

.read-wishlist {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

#data-grid-table td.actions-col {
  vertical-align: middle !important;
}

@media (max-width: 768px) {
  /* Make sure the pill button is full width in mobile row */
  .actions-col .ebook-wishlist-toggle {
    width: 100%;
    justify-content: center;
    padding: 0.6rem 1rem;
  }
  
  /* Make sure wrapper is full width in mobile details */
  .details-buttons .wishlist-btn-wrapper {
      width: 100%;
  }
  
  /* Make sure button fills that wrapper */
  .details-buttons .ebook-wishlist-toggle {
     width: 100%;
     justify-content: center;
  }
}
/* ============================================================
    CUSTOM WISHLIST (EBOOK SIMPLE WISHLIST) - CORRECTED
    ============================================================ */

.wishlist-btn-wrapper {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  min-width: 110px;
  margin-left: 6px;
}

.actions-col .wishlist-btn-wrapper {
  margin-left: 8px;
}

.details-buttons .wishlist-btn-wrapper {
  display: inline-flex;
  align-items: center;
  margin-left: 0; 
}

.wishlist-btn-wrapper .ebook-wishlist-btn-wrapper {
    display: inline-flex !important;
    min-width: 0 !important;
    margin-left: 0 !important; 
}

/* * This is the main fix:
 * All pill-styles are now applied to .ebook-wishlist-main-btn,
 * which is the class that actually exists in the HTML.
 */
.ebook-wishlist-main-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #3a3a3a;
  border-radius: 9999px;
  background: #0a0a0a;
  color: #f69a5f;
  font-size: 0.85rem;
  padding: 0.4rem 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all 0.25s ease;
  font-weight: 600;
  white-space: nowrap;
}

.ebook-wishlist-main-btn:hover {
  background: #f69a5f;
  color: #000;
  transform: translateY(-2px);
  box-shadow: 0 0 12px rgba(255,152,0,0.6);
}

.ebook-wishlist-main-btn.is-active {
  background: linear-gradient(135deg, #f69a5f, #ffb84d);
  color: #000;
  border: none;
  box-shadow: 0 0 12px rgba(255,152,0,0.6);
}

.ebook-wishlist-main-btn.is-busy {
  opacity: 0.6;
  cursor: wait;
}

.ebook-wishlist-icon {
  font-size: 1rem;
  line-height: 1;
}

.actions-col,
.details-buttons {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: flex-start;
}

.actions-col button,
.details-buttons button {
  white-space: nowrap;
}

.read-wishlist {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

