/* ==========================================================================
   HoloPlaza Album Plugin — Frontend Styles
   Scope: .woocommerce-MyAccount-content
   Brand: #FF8C42 orange / #051518 dark background
   ========================================================================== */

/* === BASE / VARIABLES === */
:root {
  --hpa-primary:        #FF8C42;
  --hpa-primary-hover:  #e07a35;
  --hpa-bg-dark:        #051518;
  --hpa-bg-card:        #0d2327;
  --hpa-bg-card-hover:  #123035;
  --hpa-border:         #1a3a40;
  --hpa-text:           #e0e0e0;
  --hpa-text-muted:     #888;
  --hpa-danger:         #ef4444;
  --hpa-success:        #4ade80;
  --hpa-magic:          #a855f7;
  --hpa-pokemon:        #eab308;
  --hpa-yugioh:         #ef4444;
}

/* Scope everything inside WooCommerce My Account content */
.woocommerce-MyAccount-content {
  color: var(--hpa-text);
}

/* =========================================================================
   GAME TABS
   ========================================================================= */

.woocommerce-MyAccount-content .hpa-game-tabs {
  display:       flex;
  flex-wrap:     wrap;
  gap:           8px;
  margin-bottom: 20px;
}

.woocommerce-MyAccount-content .hpa-game-tab {
  background:    var(--hpa-bg-card);
  color:         var(--hpa-text-muted);
  border:        1px solid var(--hpa-border);
  border-radius: 20px;
  padding:       8px 20px;
  cursor:        pointer;
  font-size:     14px;
  transition:    all 0.2s ease;
  line-height:   1.4;
}

.woocommerce-MyAccount-content .hpa-game-tab:hover {
  border-color: var(--hpa-primary);
  color:        var(--hpa-text);
}

.woocommerce-MyAccount-content .hpa-game-tab.active {
  background:   var(--hpa-primary);
  color:        #000;
  border-color: var(--hpa-primary);
  font-weight:  700;
}

/* =========================================================================
   BUTTONS
   ========================================================================= */

.woocommerce-MyAccount-content .hpa-btn {
  display:        inline-flex;
  align-items:    center;
  gap:            6px;
  padding:        8px 16px;
  border-radius:  6px;
  border:         1px solid var(--hpa-border);
  background:     var(--hpa-bg-card);
  color:          var(--hpa-text);
  cursor:         pointer;
  font-size:      14px;
  font-family:    inherit;
  line-height:    1.4;
  text-decoration: none;
  transition:     all 0.2s ease;
  box-sizing:     border-box;
}

.woocommerce-MyAccount-content .hpa-btn:hover {
  border-color: var(--hpa-primary);
  color:        var(--hpa-primary);
  text-decoration: none;
}

.woocommerce-MyAccount-content .hpa-btn-primary {
  background:   var(--hpa-primary);
  color:        #000;
  border-color: var(--hpa-primary);
  font-weight:  700;
}

.woocommerce-MyAccount-content .hpa-btn-primary:hover {
  background:   var(--hpa-primary-hover);
  color:        #000;
  border-color: var(--hpa-primary-hover);
}

.woocommerce-MyAccount-content .hpa-btn-danger {
  color:        var(--hpa-danger);
  border-color: transparent;
  background:   transparent;
}

.woocommerce-MyAccount-content .hpa-btn-danger:hover {
  background:   rgba(239, 68, 68, 0.1);
  border-color: var(--hpa-danger);
  color:        var(--hpa-danger);
}

.woocommerce-MyAccount-content .hpa-btn-sm {
  padding:   6px 12px;
  font-size: 13px;
}

.woocommerce-MyAccount-content .hpa-btn-xs {
  padding:   4px 8px;
  font-size: 12px;
}

/* =========================================================================
   GRID LAYOUTS
   ========================================================================= */

.woocommerce-MyAccount-content .hpa-grid {
  display:               grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap:                   16px;
}

.woocommerce-MyAccount-content .hpa-cards-grid {
  display:               grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap:                   12px;
}

/* =========================================================================
   COLLECTION CARDS  &  DECK CARDS
   (hpa-collection-card and hpa-deck-card share the same visual style)
   ========================================================================= */

.woocommerce-MyAccount-content .hpa-collection-card,
.woocommerce-MyAccount-content .hpa-deck-card {
  background:    var(--hpa-bg-card);
  border:        1px solid var(--hpa-border);
  border-radius: 8px;
  padding:       20px;
  transition:    all 0.2s ease;
  position:      relative;
  overflow:      hidden;
}

.woocommerce-MyAccount-content .hpa-collection-card:hover,
.woocommerce-MyAccount-content .hpa-deck-card:hover {
  border-color: var(--hpa-primary);
  transform:    translateY(-2px);
  box-shadow:   0 4px 12px rgba(255, 140, 66, 0.1);
}

.woocommerce-MyAccount-content .hpa-collection-icon {
  width:         40px;
  height:        40px;
  border-radius: 8px;
  margin-bottom: 12px;
  display:       flex;
  align-items:   center;
  justify-content: center;
}

/* Game-specific icon colours */
.woocommerce-MyAccount-content .hpa-game-magic   { background: var(--hpa-magic); }
.woocommerce-MyAccount-content .hpa-game-pokemon  { background: var(--hpa-pokemon); }
.woocommerce-MyAccount-content .hpa-game-yugioh   { background: var(--hpa-yugioh); }
.woocommerce-MyAccount-content .hpa-game-other    { background: #666; }

.woocommerce-MyAccount-content .hpa-collection-card h4,
.woocommerce-MyAccount-content .hpa-deck-card h4 {
  color:       #fff;
  margin:      0 0 6px;
  font-size:   16px;
  font-weight: 600;
}

.woocommerce-MyAccount-content .hpa-collection-meta {
  color:         var(--hpa-text-muted);
  font-size:     13px;
  margin-bottom: 8px;
}

.woocommerce-MyAccount-content .hpa-collection-desc {
  color:         var(--hpa-text-muted);
  font-size:     13px;
  max-height:    40px;
  overflow:      hidden;
  text-overflow: ellipsis;
  display:       -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.woocommerce-MyAccount-content .hpa-collection-actions {
  margin-top: 12px;
  display:    flex;
  gap:        8px;
  flex-wrap:  wrap;
}

/* =========================================================================
   CARD ITEMS (collection / deck detail)
   ========================================================================= */

.woocommerce-MyAccount-content .hpa-card-item {
  display:       flex;
  background:    var(--hpa-bg-card);
  border:        1px solid var(--hpa-border);
  border-radius: 8px;
  overflow:      hidden;
  transition:    border-color 0.2s ease;
}

.woocommerce-MyAccount-content .hpa-card-item:hover {
  border-color: var(--hpa-primary);
}

.woocommerce-MyAccount-content .hpa-card-item img {
  width:       90px;
  height:      auto;
  object-fit:  contain;
  background:  #000;
  padding:     4px;
  flex-shrink: 0;
}

.woocommerce-MyAccount-content .hpa-card-details {
  flex:    1;
  padding: 10px;
  min-width: 0;
}

.woocommerce-MyAccount-content .hpa-card-details strong {
  display:       block;
  color:         #fff;
  font-size:     14px;
  margin-bottom: 4px;
  white-space:   nowrap;
  overflow:      hidden;
  text-overflow: ellipsis;
}

.woocommerce-MyAccount-content .hpa-card-details span {
  display:      inline-block;
  color:        var(--hpa-text-muted);
  font-size:    12px;
  margin-right: 8px;
}

.woocommerce-MyAccount-content .hpa-card-meta {
  margin-top:  6px;
  display:     flex;
  flex-wrap:   wrap;
  gap:         6px;
  align-items: center;
}

.woocommerce-MyAccount-content .hpa-condition {
  background:    var(--hpa-bg-dark);
  padding:       2px 6px;
  border-radius: 4px;
  font-size:     11px;
  font-weight:   700;
  color:         var(--hpa-text);
}

.woocommerce-MyAccount-content .hpa-foil-badge {
  background:    linear-gradient(135deg, #f0c27f, #fc5c7d, #6a82fb);
  color:         #fff;
  padding:       2px 8px;
  border-radius: 4px;
  font-size:     11px;
  font-weight:   700;
}

.woocommerce-MyAccount-content .hpa-purchase-price {
  color:     var(--hpa-primary);
  font-size: 12px;
}

.woocommerce-MyAccount-content .hpa-notes {
  color:       var(--hpa-text-muted);
  font-size:   12px;
  font-style:  italic;
  margin-top:  4px;
}

.woocommerce-MyAccount-content .hpa-card-actions {
  display:         flex;
  flex-direction:  column;
  gap:             4px;
  padding:         8px;
  justify-content: center;
  flex-shrink:     0;
}

/* =========================================================================
   FORMS
   ========================================================================= */

.woocommerce-MyAccount-content #hpa-new-collection-form,
.woocommerce-MyAccount-content #hpa-new-deck-form {
  background:    var(--hpa-bg-card);
  border:        1px solid var(--hpa-border);
  border-radius: 8px;
  padding:       20px;
  margin-bottom: 20px;
}

.woocommerce-MyAccount-content #hpa-create-collection-form,
.woocommerce-MyAccount-content #hpa-create-deck-form {
  display:     flex;
  flex-wrap:   wrap;
  gap:         12px;
  align-items: flex-end;
}

/* Inputs scoped to HoloPlaza containers */
.woocommerce-MyAccount-content #hpa-new-collection-form input[type="text"],
.woocommerce-MyAccount-content #hpa-new-collection-form select,
.woocommerce-MyAccount-content #hpa-new-collection-form textarea,
.woocommerce-MyAccount-content #hpa-new-deck-form input[type="text"],
.woocommerce-MyAccount-content #hpa-new-deck-form select,
.woocommerce-MyAccount-content #hpa-new-deck-form textarea,
.woocommerce-MyAccount-content .hpa-add-card-form input[type="text"],
.woocommerce-MyAccount-content .hpa-add-card-form input[type="number"],
.woocommerce-MyAccount-content .hpa-add-card-form select,
.woocommerce-MyAccount-content .hpa-add-card-form textarea,
.woocommerce-MyAccount-content .hpa-search-inline input[type="text"],
.woocommerce-MyAccount-content .hpa-valuator-controls input[type="text"],
.woocommerce-MyAccount-content .hpa-valuator-controls select {
  background:    var(--hpa-bg-dark);
  border:        1px solid var(--hpa-border);
  color:         var(--hpa-text);
  padding:       8px 12px;
  border-radius: 6px;
  font-size:     14px;
  font-family:   inherit;
  box-sizing:    border-box;
  transition:    border-color 0.2s ease;
}

.woocommerce-MyAccount-content #hpa-new-collection-form input[type="text"]:focus,
.woocommerce-MyAccount-content #hpa-new-collection-form select:focus,
.woocommerce-MyAccount-content #hpa-new-collection-form textarea:focus,
.woocommerce-MyAccount-content #hpa-new-deck-form input[type="text"]:focus,
.woocommerce-MyAccount-content #hpa-new-deck-form select:focus,
.woocommerce-MyAccount-content #hpa-new-deck-form textarea:focus,
.woocommerce-MyAccount-content .hpa-add-card-form input:focus,
.woocommerce-MyAccount-content .hpa-add-card-form select:focus,
.woocommerce-MyAccount-content .hpa-add-card-form textarea:focus,
.woocommerce-MyAccount-content .hpa-search-inline input:focus,
.woocommerce-MyAccount-content .hpa-valuator-controls input:focus,
.woocommerce-MyAccount-content .hpa-valuator-controls select:focus {
  border-color: var(--hpa-primary);
  outline:      none;
}

.woocommerce-MyAccount-content #hpa-new-collection-form textarea,
.woocommerce-MyAccount-content #hpa-new-deck-form textarea,
.woocommerce-MyAccount-content .hpa-add-card-form textarea {
  resize:     vertical;
  min-height: 60px;
}

/* =========================================================================
   SEARCH
   ========================================================================= */

.woocommerce-MyAccount-content .hpa-search-inline {
  display:       flex;
  gap:           8px;
  margin-bottom: 16px;
}

.woocommerce-MyAccount-content .hpa-search-inline input {
  flex: 1;
}

.woocommerce-MyAccount-content #hpa-search-results,
.woocommerce-MyAccount-content #hpa-deck-search-results {
  display:               grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap:                   10px;
  margin-bottom:         20px;
}

/* JS builds search items with class="hpa-search-result" (NOT hpa-search-result-card).
   Both class names are styled identically. */
.woocommerce-MyAccount-content .hpa-search-result,
.woocommerce-MyAccount-content .hpa-search-result-card {
  background:    var(--hpa-bg-card);
  border:        1px solid var(--hpa-border);
  border-radius: 8px;
  padding:       10px;
  text-align:    center;
  cursor:        pointer;
  transition:    all 0.2s ease;
}

.woocommerce-MyAccount-content .hpa-search-result:hover,
.woocommerce-MyAccount-content .hpa-search-result-card:hover {
  border-color: var(--hpa-primary);
  transform:    translateY(-2px);
}

.woocommerce-MyAccount-content .hpa-search-result img,
.woocommerce-MyAccount-content .hpa-search-result-card img {
  max-width:     100%;
  max-height:    180px;
  object-fit:    contain;
  margin-bottom: 8px;
  display:       block;
  margin-left:   auto;
  margin-right:  auto;
}

.woocommerce-MyAccount-content .hpa-search-result .card-name,
.woocommerce-MyAccount-content .hpa-search-result-card .card-name {
  color:         #fff;
  font-size:     13px;
  font-weight:   700;
  margin-bottom: 4px;
}

.woocommerce-MyAccount-content .hpa-search-result .card-set,
.woocommerce-MyAccount-content .hpa-search-result-card .card-set {
  color:     var(--hpa-text-muted);
  font-size: 11px;
}

.woocommerce-MyAccount-content .hpa-search-result .card-price,
.woocommerce-MyAccount-content .hpa-search-result-card .card-price {
  color:       var(--hpa-primary);
  font-weight: 700;
  font-size:   14px;
  margin-top:  6px;
}

/* =========================================================================
   ADD CARD FORM  (inline form appended under a search result)
   ========================================================================= */

.woocommerce-MyAccount-content .hpa-add-card-form,
.woocommerce-MyAccount-content .hpa-add-deck-card-form,
.woocommerce-MyAccount-content .hpa-edit-card-form {
  background:    var(--hpa-bg-dark);
  border:        1px solid var(--hpa-border);
  border-radius: 8px;
  padding:       16px;
  margin-top:    8px;
  display:       flex;
  flex-wrap:     wrap;
  gap:           10px;
  align-items:   flex-end;
}

.woocommerce-MyAccount-content .hpa-add-card-form label,
.woocommerce-MyAccount-content .hpa-add-deck-card-form label,
.woocommerce-MyAccount-content .hpa-edit-card-form label {
  color:          var(--hpa-text-muted);
  font-size:      12px;
  display:        flex;
  flex-direction: column;
  gap:            4px;
}

.woocommerce-MyAccount-content .hpa-add-card-form select,
.woocommerce-MyAccount-content .hpa-add-card-form input[type="text"],
.woocommerce-MyAccount-content .hpa-add-card-form input[type="number"],
.woocommerce-MyAccount-content .hpa-add-deck-card-form select,
.woocommerce-MyAccount-content .hpa-add-deck-card-form input[type="text"],
.woocommerce-MyAccount-content .hpa-add-deck-card-form input[type="number"],
.woocommerce-MyAccount-content .hpa-edit-card-form select,
.woocommerce-MyAccount-content .hpa-edit-card-form input[type="text"],
.woocommerce-MyAccount-content .hpa-edit-card-form input[type="number"],
.woocommerce-MyAccount-content .hpa-edit-card-form textarea {
  background:    var(--hpa-bg-card);
  border:        1px solid var(--hpa-border);
  color:         var(--hpa-text);
  border-radius: 4px;
  font-size:     13px;
  padding:       6px 10px;
  font-family:   inherit;
  box-sizing:    border-box;
}

.woocommerce-MyAccount-content .hpa-add-card-form select:focus,
.woocommerce-MyAccount-content .hpa-add-card-form input:focus,
.woocommerce-MyAccount-content .hpa-add-deck-card-form select:focus,
.woocommerce-MyAccount-content .hpa-add-deck-card-form input:focus,
.woocommerce-MyAccount-content .hpa-edit-card-form select:focus,
.woocommerce-MyAccount-content .hpa-edit-card-form input:focus,
.woocommerce-MyAccount-content .hpa-edit-card-form textarea:focus {
  border-color: var(--hpa-primary);
  outline:      none;
}

/* =========================================================================
   VALUATOR
   ========================================================================= */

.woocommerce-MyAccount-content .hpa-valuator-controls {
  display:       flex;
  gap:           12px;
  margin-bottom: 20px;
  align-items:   center;
  flex-wrap:     wrap;
}

/* #hpa-valuator-results holds a .hpa-valuator-summary div built by JS */
.woocommerce-MyAccount-content #hpa-valuator-results .hpa-valuator-summary,
.woocommerce-MyAccount-content #hpa-valuator-summary {
  display:               grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap:                   16px;
  margin-bottom:         24px;
}

.woocommerce-MyAccount-content .hpa-summary-card {
  background:    var(--hpa-bg-card);
  border:        1px solid var(--hpa-border);
  border-radius: 8px;
  padding:       20px;
  text-align:    center;
}

/* JS uses .hpa-summary-value / .hpa-summary-label class names */
.woocommerce-MyAccount-content .hpa-summary-card .value,
.woocommerce-MyAccount-content .hpa-summary-card .hpa-summary-value {
  font-size:   28px;
  font-weight: 700;
  color:       var(--hpa-primary);
  display:     block;
}

.woocommerce-MyAccount-content .hpa-summary-card .label,
.woocommerce-MyAccount-content .hpa-summary-card .hpa-summary-label {
  font-size:  13px;
  color:      var(--hpa-text-muted);
  margin-top: 4px;
  display:    block;
}

/* Valuation table.
   CSS previously used .hpa-valuation-table; JS builds .hpa-valuator-table.
   Both are now styled. */
.woocommerce-MyAccount-content .hpa-valuation-table,
.woocommerce-MyAccount-content .hpa-valuator-table {
  width:           100%;
  border-collapse: collapse;
  margin-top:      16px;
}

.woocommerce-MyAccount-content .hpa-valuation-table th,
.woocommerce-MyAccount-content .hpa-valuator-table th {
  text-align:    left;
  padding:       10px;
  color:         var(--hpa-text-muted);
  font-size:     12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--hpa-border);
}

.woocommerce-MyAccount-content .hpa-valuation-table td,
.woocommerce-MyAccount-content .hpa-valuator-table td {
  padding:        8px 10px;
  border-bottom:  1px solid var(--hpa-border);
  color:          var(--hpa-text);
  font-size:      13px;
  vertical-align: middle;
}

.woocommerce-MyAccount-content .hpa-valuation-table tr:hover td,
.woocommerce-MyAccount-content .hpa-valuator-table tr:hover td {
  background: var(--hpa-bg-card);
}

/* Thumbnail in the valuator table — JS class is hpa-table-thumb */
.woocommerce-MyAccount-content .hpa-valuation-table img,
.woocommerce-MyAccount-content .hpa-valuator-table img,
.woocommerce-MyAccount-content .hpa-table-thumb {
  width:         40px;
  height:        auto;
  border-radius: 4px;
  display:       block;
}

.woocommerce-MyAccount-content .hpa-profit {
  color:       var(--hpa-success);
  font-weight: 700;
}

.woocommerce-MyAccount-content .hpa-loss {
  color:       var(--hpa-danger);
  font-weight: 700;
}

/* =========================================================================
   STATE MESSAGES (loading / empty / error)
   Built by JS as <p class="hpa-loading|hpa-empty|hpa-error">
   ========================================================================= */

.woocommerce-MyAccount-content .hpa-loading {
  text-align: center;
  padding:    40px;
  color:      var(--hpa-text-muted);
}

.woocommerce-MyAccount-content .hpa-loading::after {
  content:        '';
  display:        inline-block;
  width:          20px;
  height:         20px;
  border:         2px solid var(--hpa-border);
  border-top-color: var(--hpa-primary);
  border-radius:  50%;
  animation:      hpa-spin 0.8s linear infinite;
  margin-left:    8px;
  vertical-align: middle;
}

@keyframes hpa-spin {
  to { transform: rotate(360deg); }
}

.woocommerce-MyAccount-content .hpa-empty {
  text-align:  center;
  padding:     40px;
  color:       var(--hpa-text-muted);
  font-size:   14px;
  font-style:  italic;
}

.woocommerce-MyAccount-content .hpa-error {
  text-align:  center;
  padding:     24px;
  color:       var(--hpa-danger);
  font-size:   14px;
  font-weight: 600;
}

/* =========================================================================
   STATS (shortcode)
   ========================================================================= */

.woocommerce-MyAccount-content .hpa-stats {
  display:               grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap:                   12px;
}

.woocommerce-MyAccount-content .hpa-stat-card {
  background:    var(--hpa-bg-card);
  border:        1px solid var(--hpa-border);
  border-radius: 8px;
  padding:       16px;
  text-align:    center;
}

.woocommerce-MyAccount-content .hpa-stat-number {
  display:     block;
  font-size:   32px;
  font-weight: 700;
  color:       var(--hpa-primary);
}

.woocommerce-MyAccount-content .hpa-stat-label {
  display:    block;
  font-size:  13px;
  color:      var(--hpa-text-muted);
  margin-top: 4px;
}

/* =========================================================================
   PUBLIC DECK (shortcode)
   ========================================================================= */

.woocommerce-MyAccount-content .hpa-public-deck {
  background:    var(--hpa-bg-dark);
  border-radius: 8px;
  padding:       24px;
}

.woocommerce-MyAccount-content .hpa-public-deck h3 {
  color:         #fff;
  margin-bottom: 8px;
}

.woocommerce-MyAccount-content .hpa-public-deck .deck-meta {
  color:         var(--hpa-text-muted);
  margin-bottom: 16px;
}

.woocommerce-MyAccount-content .hpa-public-deck .deck-section h4 {
  color:          var(--hpa-text);
  margin:         16px 0 8px;
  border-bottom:  1px solid var(--hpa-border);
  padding-bottom: 8px;
}

/* =========================================================================
   SECTION HEADERS
   ========================================================================= */

.woocommerce-MyAccount-content .hpa-collections-header {
  display:         flex;
  justify-content: space-between;
  align-items:     center;
  margin-bottom:   16px;
  flex-wrap:       wrap;
  gap:             8px;
}

.woocommerce-MyAccount-content .hpa-collections-header h3 {
  color:  #fff;
  margin: 0;
}

.woocommerce-MyAccount-content .hpa-add-card-section {
  margin-bottom: 24px;
}

.woocommerce-MyAccount-content .hpa-add-card-section h4 {
  color:         #fff;
  margin-bottom: 12px;
}

.woocommerce-MyAccount-content .hpa-description {
  color:         var(--hpa-text-muted);
  margin-bottom: 20px;
}

/* =========================================================================
   DECK SECTIONS (main / sideboard two-column layout)
   ========================================================================= */

.woocommerce-MyAccount-content .hpa-deck-sections {
  display:               grid;
  grid-template-columns: 1fr 1fr;
  gap:                   20px;
}

/* =========================================================================
   RESPONSIVE — tablet (≤ 768px)
   ========================================================================= */

@media (max-width: 768px) {
  .woocommerce-MyAccount-content .hpa-deck-sections {
    grid-template-columns: 1fr;
  }
}

/* =========================================================================
   RESPONSIVE — mobile (≤ 600px)
   ========================================================================= */

@media (max-width: 600px) {
  .woocommerce-MyAccount-content .hpa-grid {
    grid-template-columns: 1fr;
  }

  .woocommerce-MyAccount-content .hpa-cards-grid {
    grid-template-columns: 1fr;
  }

  .woocommerce-MyAccount-content .hpa-card-item img {
    width: 60px;
  }

  .woocommerce-MyAccount-content #hpa-search-results,
  .woocommerce-MyAccount-content #hpa-deck-search-results {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .woocommerce-MyAccount-content .hpa-search-inline {
    flex-direction: column;
  }

  .woocommerce-MyAccount-content .hpa-game-tabs {
    gap: 4px;
  }

  .woocommerce-MyAccount-content .hpa-game-tab {
    padding:   6px 14px;
    font-size: 12px;
  }

  .woocommerce-MyAccount-content .hpa-summary-card .value,
  .woocommerce-MyAccount-content .hpa-summary-card .hpa-summary-value {
    font-size: 22px;
  }

  .woocommerce-MyAccount-content .hpa-stat-number {
    font-size: 24px;
  }

  .woocommerce-MyAccount-content #hpa-valuator-results .hpa-valuator-summary,
  .woocommerce-MyAccount-content #hpa-valuator-summary {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .woocommerce-MyAccount-content .hpa-valuator-controls {
    flex-direction: column;
    align-items:    stretch;
  }

  .woocommerce-MyAccount-content .hpa-collections-header {
    flex-direction: column;
    align-items:    flex-start;
  }

  .woocommerce-MyAccount-content #hpa-new-collection-form,
  .woocommerce-MyAccount-content #hpa-new-deck-form {
    flex-direction: column;
  }

  .woocommerce-MyAccount-content #hpa-create-collection-form,
  .woocommerce-MyAccount-content #hpa-create-deck-form {
    flex-direction: column;
  }

  .woocommerce-MyAccount-content .hpa-add-card-form,
  .woocommerce-MyAccount-content .hpa-add-deck-card-form,
  .woocommerce-MyAccount-content .hpa-edit-card-form {
    flex-direction: column;
  }
}

/* =========================================================================
   SHARE DECK — modal overlay
   ========================================================================= */

/* Fixed overlay with dark semi-transparent + blur background */
.hpa-share-overlay {
  position:        fixed;
  inset:           0;
  z-index:         99999;
  display:         flex;
  align-items:     center;
  justify-content: center;
  background:      rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

/* Modal card */
.hpa-share-modal {
  background:    var(--hpa-bg-card);
  border:        1px solid var(--hpa-border);
  border-radius: 8px;
  padding:       24px;
  max-width:     500px;
  width:         90%;
  box-shadow:    0 8px 32px rgba(0, 0, 0, 0.5);
}

.hpa-share-modal h4 {
  color:         #fff;
  font-size:     18px;
  font-weight:   700;
  margin:        0 0 8px;
}

/* Read-only URL input — used both in modal and shortcode page */
.hpa-share-url-input {
  width:         100%;
  background:    var(--hpa-bg-dark);
  color:         var(--hpa-text);
  border:        1px solid var(--hpa-border);
  border-radius: 6px;
  padding:       8px 12px;
  font-size:     13px;
  font-family:   monospace, monospace;
  box-sizing:    border-box;
  cursor:        text;
}

.hpa-share-url-input:focus {
  border-color: var(--hpa-primary);
  outline:      none;
}

/* Row of action buttons below the URL input */
.hpa-share-actions {
  display:    flex;
  flex-wrap:  wrap;
  gap:        8px;
  margin-top: 12px;
  align-items: center;
}

/* "¡Enlace copiado!" feedback text */
.hpa-copy-feedback {
  color:      var(--hpa-success);
  font-size:  13px;
  font-weight: 600;
  transition: opacity 0.3s ease;
}

/* =========================================================================
   SHARED DECK PAGE — public view header
   ========================================================================= */

.hpa-shared-deck-header {
  background:    var(--hpa-bg-card);
  border:        1px solid var(--hpa-border);
  border-radius: 8px;
  padding:       24px;
  margin-bottom: 24px;
}

.hpa-shared-deck-header .hpa-deck-title {
  color:       #fff;
  font-size:   24px;
  font-weight: 700;
  margin:      0 0 6px;
}

.hpa-shared-deck-header .owner {
  color:      var(--hpa-text-muted);
  font-size:  14px;
  margin:     0 0 12px;
}

.hpa-shared-deck-header .owner strong {
  color: var(--hpa-text);
}

.hpa-shared-deck-header .hpa-deck-meta {
  display:     flex;
  flex-wrap:   wrap;
  gap:         10px;
  align-items: center;
  margin-bottom: 12px;
}

.hpa-shared-deck-header .hpa-badge {
  background:    var(--hpa-primary);
  color:         #000;
  font-size:     12px;
  font-weight:   700;
  padding:       3px 10px;
  border-radius: 12px;
  text-transform: capitalize;
}

.hpa-shared-deck-header .hpa-deck-description {
  color:      var(--hpa-text-muted);
  font-size:  14px;
  margin-top: 8px;
}

/* Responsive adjustments for share actions on small screens */
@media (max-width: 600px) {
  .hpa-share-actions {
    flex-direction: column;
    align-items:    stretch;
  }

  .hpa-share-modal {
    padding: 16px;
  }

  .hpa-share-modal h4 {
    font-size: 16px;
  }
}

/* =========================================================================
   CATALOG BROWSER
   ========================================================================= */

.woocommerce-MyAccount-content .hpa-catalog-search {
  display:       flex;
  gap:           8px;
  margin-bottom: 12px;
}

.woocommerce-MyAccount-content .hpa-catalog-search input {
  flex:          1;
  background:    var(--hpa-bg-dark);
  border:        1px solid var(--hpa-border);
  color:         var(--hpa-text);
  padding:       8px 12px;
  border-radius: 6px;
  font-size:     14px;
  font-family:   inherit;
  box-sizing:    border-box;
  transition:    border-color 0.2s ease;
}

.woocommerce-MyAccount-content .hpa-catalog-search input:focus {
  border-color: var(--hpa-primary);
  outline:      none;
}

.woocommerce-MyAccount-content .hpa-catalog-filters {
  display:       flex;
  gap:           8px;
  margin-bottom: 16px;
  flex-wrap:     wrap;
}

.woocommerce-MyAccount-content .hpa-catalog-filters select {
  min-width:     150px;
  background:    var(--hpa-bg-dark);
  border:        1px solid var(--hpa-border);
  color:         var(--hpa-text);
  padding:       8px 12px;
  border-radius: 6px;
  font-size:     13px;
  font-family:   inherit;
  cursor:        pointer;
  transition:    border-color 0.2s ease;
}

.woocommerce-MyAccount-content .hpa-catalog-filters select:focus {
  border-color: var(--hpa-primary);
  outline:      none;
}

.woocommerce-MyAccount-content .hpa-catalog-grid {
  display:               grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap:                   12px;
}

.woocommerce-MyAccount-content .hpa-catalog-card {
  background:    var(--hpa-bg-card);
  border:        1px solid var(--hpa-border);
  border-radius: 8px;
  overflow:      hidden;
  transition:    all 0.2s;
  cursor:        pointer;
}

.woocommerce-MyAccount-content .hpa-catalog-card:hover {
  border-color: var(--hpa-primary);
  transform:    translateY(-3px);
  box-shadow:   0 6px 16px rgba(255, 140, 66, 0.15);
}

.woocommerce-MyAccount-content .hpa-catalog-card img {
  width:        100%;
  aspect-ratio: 5 / 7;
  object-fit:   contain;
  background:   #000;
  display:      block;
}

.woocommerce-MyAccount-content .hpa-catalog-card-info {
  padding: 8px;
}

.woocommerce-MyAccount-content .hpa-catalog-card-name {
  display:       block;
  color:         #fff;
  font-size:     12px;
  font-weight:   bold;
  white-space:   nowrap;
  overflow:      hidden;
  text-overflow: ellipsis;
}

.woocommerce-MyAccount-content .hpa-catalog-card-set {
  display:   block;
  color:     var(--hpa-text-muted);
  font-size: 11px;
}

.woocommerce-MyAccount-content .hpa-catalog-card-rarity {
  display:       inline-block;
  font-size:     10px;
  color:         var(--hpa-text-muted);
  background:    var(--hpa-bg-dark);
  padding:       1px 6px;
  border-radius: 3px;
  margin:        4px 0;
}

.woocommerce-MyAccount-content .hpa-catalog-card-prices {
  margin: 4px 0;
}

.woocommerce-MyAccount-content .hpa-price-eur {
  color:        var(--hpa-primary);
  font-weight:  bold;
  font-size:    13px;
  margin-right: 8px;
}

.woocommerce-MyAccount-content .hpa-price-usd {
  color:     var(--hpa-success);
  font-size: 12px;
}

/* Lightbox */
.hpa-lightbox {
  position:        fixed;
  top:             0;
  left:            0;
  width:           100%;
  height:          100%;
  background:      rgba(0, 0, 0, 0.9);
  display:         flex;
  align-items:     center;
  justify-content: center;
  z-index:         99999;
  cursor:          pointer;
}

.hpa-lightbox img {
  max-width:    90%;
  max-height:   90vh;
  object-fit:   contain;
  border-radius: 8px;
}

/* Pagination */
.woocommerce-MyAccount-content .hpa-pagination {
  display:         flex;
  justify-content: center;
  gap:             4px;
  margin-top:      20px;
  flex-wrap:       wrap;
}

.woocommerce-MyAccount-content .hpa-pagination-btn {
  min-width:     36px;
  height:        36px;
  border-radius: 6px;
  padding:       0 8px;
  font-size:     14px;
}

.woocommerce-MyAccount-content .hpa-pagination-btn.active {
  background:   var(--hpa-primary);
  color:        #000;
  border-color: var(--hpa-primary);
  font-weight:  700;
}

.woocommerce-MyAccount-content .hpa-pagination-btn:disabled {
  opacity: 0.35;
  cursor:  not-allowed;
}

.woocommerce-MyAccount-content .hpa-pagination-ellipsis {
  line-height: 36px;
  color:       var(--hpa-text-muted);
  padding:     0 4px;
}

/* Quick-add form (shown inside a catalog card) */
.woocommerce-MyAccount-content .hpa-quick-add {
  background:  var(--hpa-bg-dark);
  border:      1px solid var(--hpa-primary);
  border-radius: 8px;
  padding:     12px;
  margin-top:  8px;
  display:     flex;
  flex-wrap:   wrap;
  gap:         8px;
  align-items: flex-end;
}

.woocommerce-MyAccount-content .hpa-quick-add label {
  font-size:      11px;
  color:          var(--hpa-text-muted);
  display:        flex;
  flex-direction: column;
  gap:            2px;
}

.woocommerce-MyAccount-content .hpa-quick-add input,
.woocommerce-MyAccount-content .hpa-quick-add select {
  background:    var(--hpa-bg-card);
  border:        1px solid var(--hpa-border);
  color:         var(--hpa-text);
  padding:       4px 8px;
  border-radius: 4px;
  font-size:     12px;
  font-family:   inherit;
}

.woocommerce-MyAccount-content .hpa-quick-add input:focus,
.woocommerce-MyAccount-content .hpa-quick-add select:focus {
  border-color: var(--hpa-primary);
  outline:      none;
}

/* Responsive: catalog grid on small screens */
@media (max-width: 600px) {
  .woocommerce-MyAccount-content .hpa-catalog-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }

  .woocommerce-MyAccount-content .hpa-catalog-filters {
    flex-direction: column;
  }

  .woocommerce-MyAccount-content .hpa-catalog-filters select {
    min-width: auto;
    width:     100%;
  }

  .woocommerce-MyAccount-content .hpa-catalog-search {
    flex-direction: column;
  }
}

/* =========================================================================
   DECK STATS PANEL
   ========================================================================= */

/* Container card */
.hpa-deck-stats {
  background:    var(--hpa-bg-card);
  border:        1px solid var(--hpa-border);
  border-radius: 8px;
  padding:       16px;
  margin:        16px 0;
}

/* Clickable section header */
.hpa-stats-toggle {
  color:       #fff;
  cursor:      pointer;
  margin:      0;
  user-select: none;
  font-size:   16px;
  font-weight: 600;
  display:     flex;
  align-items: center;
  gap:         8px;
}

.hpa-stats-toggle:hover {
  color: var(--hpa-primary);
}

.hpa-toggle-arrow {
  font-size:   12px;
  color:       var(--hpa-text-muted);
  transition:  transform 0.2s ease;
}

/* Collapsible content area */
.hpa-stats-content {
  margin-top: 16px;
}

/* Summary stats row */
.hpa-stats-summary {
  display:       flex;
  gap:           12px;
  margin-bottom: 20px;
  flex-wrap:     wrap;
}

.hpa-mini-stat {
  background:    var(--hpa-bg-dark);
  border:        1px solid var(--hpa-border);
  border-radius: 8px;
  padding:       14px 16px;
  text-align:    center;
  flex:          1;
  min-width:     110px;
}

.hpa-mini-stat .value {
  display:     block;
  font-size:   22px;
  font-weight: 700;
  color:       var(--hpa-primary);
}

.hpa-mini-stat .label {
  display:    block;
  font-size:  11px;
  color:      var(--hpa-text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Individual stat sub-section */
.hpa-stat-section {
  margin-bottom: 20px;
}

.hpa-stat-section h5 {
  color:         var(--hpa-text);
  margin:        0 0 10px;
  font-size:     13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color:         var(--hpa-text-muted);
}

/* ---- Horizontal bar chart ---- */
.hpa-bar-chart {
  display:        flex;
  flex-direction: column;
  gap:            6px;
}

.hpa-bar-row {
  display:     flex;
  align-items: center;
  gap:         8px;
}

.hpa-bar-label {
  width:      110px;
  font-size:  12px;
  color:      var(--hpa-text-muted);
  text-align: right;
  flex-shrink: 0;
  white-space: nowrap;
  overflow:   hidden;
  text-overflow: ellipsis;
}

.hpa-bar-track {
  flex:          1;
  height:        18px;
  background:    var(--hpa-bg-dark);
  border-radius: 4px;
  overflow:      hidden;
}

.hpa-bar-fill {
  height:        100%;
  background:    var(--hpa-primary);
  border-radius: 4px;
  transition:    width 0.5s ease;
  min-width:     2px;
}

/* Game-specific bar fill colours */
.hpa-bar-fill-pokemon { background: var(--hpa-pokemon); }
.hpa-bar-fill-white   { background: #f9f9f9; }
.hpa-bar-fill-blue    { background: #5b8dd9; }
.hpa-bar-fill-black   { background: #9b59b6; }
.hpa-bar-fill-red     { background: var(--hpa-danger); }
.hpa-bar-fill-green   { background: var(--hpa-success); }
.hpa-bar-fill-colorless { background: #888; }

.hpa-bar-value {
  width:       32px;
  font-size:   12px;
  color:       var(--hpa-text);
  font-weight: 700;
  text-align:  left;
  flex-shrink: 0;
}

/* ---- Mana curve (vertical bars) ---- */
.hpa-curve-chart {
  display:     flex;
  align-items: flex-end;
  gap:         6px;
  height:      120px;
  padding:     0 4px;
}

.hpa-curve-bar {
  flex:            1;
  display:         flex;
  flex-direction:  column;
  align-items:     center;
  height:          100%;
  justify-content: flex-end;
}

.hpa-curve-count {
  font-size:    11px;
  color:        var(--hpa-text);
  margin-bottom: 4px;
  font-weight:  700;
}

.hpa-curve-fill {
  width:         100%;
  background:    var(--hpa-primary);
  border-radius: 4px 4px 0 0;
  transition:    height 0.5s ease;
  min-height:    2px;
}

.hpa-curve-label {
  font-size:  12px;
  color:      var(--hpa-text-muted);
  margin-top: 6px;
}

/* ---- Set tags ---- */
.hpa-set-tags {
  display:   flex;
  flex-wrap: wrap;
  gap:       6px;
}

.hpa-set-tag {
  background:    var(--hpa-bg-dark);
  border:        1px solid var(--hpa-border);
  color:         var(--hpa-text-muted);
  padding:       3px 10px;
  border-radius: 4px;
  font-size:     12px;
}

/* ---- Most valuable card ---- */
.hpa-valuable-card {
  display:     flex;
  gap:         12px;
  align-items: center;
}

.hpa-valuable-card img {
  width:         60px;
  border-radius: 4px;
  flex-shrink:   0;
}

.hpa-valuable-card strong {
  display:     block;
  color:       #fff;
  font-size:   14px;
  margin-bottom: 4px;
}

.hpa-valuable-card span {
  color:       var(--hpa-primary);
  font-size:   18px;
  font-weight: 700;
}

/* Responsive adjustments for stats on small screens */
@media (max-width: 600px) {
  .hpa-stats-summary {
    gap: 8px;
  }

  .hpa-mini-stat {
    min-width: 90px;
    padding:   10px 12px;
  }

  .hpa-mini-stat .value {
    font-size: 18px;
  }

  .hpa-bar-label {
    width:    80px;
    font-size: 11px;
  }

  .hpa-curve-chart {
    height: 90px;
    gap:    4px;
  }
}

/* =========================================================================
   EXPORT / IMPORT
   ========================================================================= */

.woocommerce-MyAccount-content .hpa-export-import-bar {
  display:   flex;
  gap:       8px;
  margin:    12px 0;
  flex-wrap: wrap;
}

.woocommerce-MyAccount-content .hpa-import-area {
  width: 100%;
}

.woocommerce-MyAccount-content .hpa-import-area textarea {
  width:       100%;
  min-height:  120px;
  background:  var(--hpa-bg-dark);
  color:       var(--hpa-text);
  border:      1px solid var(--hpa-border);
  border-radius: 8px;
  padding:     12px;
  font-family: monospace;
  font-size:   13px;
  resize:      vertical;
  box-sizing:  border-box;
  transition:  border-color 0.2s ease;
}

.woocommerce-MyAccount-content .hpa-import-area textarea:focus {
  border-color: var(--hpa-primary);
  outline:      none;
}

/* =========================================================================
   WISHLIST
   ========================================================================= */

.woocommerce-MyAccount-content .hpa-wishlist-card {
  display:    flex;
  background: var(--hpa-bg-card);
  border:     1px solid var(--hpa-border);
  border-radius: 8px;
  padding:    12px;
  gap:        12px;
  align-items: center;
  margin-bottom: 10px;
  transition: border-color 0.2s ease;
}

.woocommerce-MyAccount-content .hpa-wishlist-card:hover {
  border-color: var(--hpa-primary);
}

.woocommerce-MyAccount-content .hpa-wishlist-card img {
  width:         60px;
  border-radius: 4px;
  flex-shrink:   0;
  object-fit:    contain;
}

.woocommerce-MyAccount-content .hpa-wishlist-card.hpa-price-alert {
  border-color: var(--hpa-success);
  background:   rgba(74, 222, 128, 0.05);
}

.woocommerce-MyAccount-content .hpa-wishlist-price-target {
  color:     var(--hpa-text-muted);
  font-size: 12px;
}

.woocommerce-MyAccount-content .hpa-wishlist-price-current {
  font-weight: bold;
  font-size:   14px;
  color:       var(--hpa-text);
}

.woocommerce-MyAccount-content .hpa-wishlist-price-current.hpa-price-alert {
  color: var(--hpa-success);
}

.woocommerce-MyAccount-content .hpa-wishlist-btn {
  background:  none;
  border:      none;
  cursor:      pointer;
  font-size:   18px;
  color:       var(--hpa-text-muted);
  transition:  color 0.2s ease;
  flex-shrink: 0;
  padding:     4px 8px;
  line-height: 1;
}

.woocommerce-MyAccount-content .hpa-wishlist-btn:hover,
.woocommerce-MyAccount-content .hpa-wishlist-btn.active {
  color: #ef4444;
}

#hpa-wishlist-alerts {
  background:    rgba(74, 222, 128, 0.08);
  border:        1px solid var(--hpa-success);
  border-radius: 8px;
  padding:       16px;
  margin-bottom: 20px;
}

#hpa-wishlist-alerts h4 {
  margin: 0 0 12px;
}

/* =============================================================
   Card Hover Preview (Moxfield-style)
   ============================================================= */
#hpa-hover-preview {
    position: fixed;
    z-index: 100000;
    pointer-events: none;
    width: 280px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 140, 66, 0.3);
    transition: opacity 0.1s ease;
    background: #000;
}

#hpa-hover-preview img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}

#hpa-hover-preview .hpa-hover-price {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: #FF8C42;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    backdrop-filter: blur(4px);
}

#hpa-hover-preview .hpa-hover-price:empty {
    display: none;
}

/* Hide on mobile */
@media (max-width: 768px) {
    #hpa-hover-preview { display: none !important; }
}

/* =========================================================================
   SAMPLE HAND (Mano Inicial)
   ========================================================================= */

.woocommerce-MyAccount-content .hpa-sample-hand-section {
  margin: 16px 0;
}

.woocommerce-MyAccount-content .hpa-sample-hand-header {
  display:       flex;
  align-items:   center;
  gap:           8px;
  margin-bottom: 12px;
  flex-wrap:     wrap;
}

.woocommerce-MyAccount-content .hpa-sample-hand-header .hpa-text-muted {
  color:     var(--hpa-text-muted);
  font-size: 13px;
}

.woocommerce-MyAccount-content .hpa-sample-hand {
  display:         flex;
  justify-content: center;
  align-items:     flex-end;
  min-height:      280px;
  padding:         20px 20px 40px;
  background:      var(--hpa-bg-card);
  border:          1px solid var(--hpa-border);
  border-radius:   12px;
  overflow-x:      auto;
  position:        relative;
}

.woocommerce-MyAccount-content .hpa-hand-card {
  width:      140px;
  flex-shrink: 0;
  margin:     0 -15px; /* overlap cards to create fan */
  transform:  rotate(var(--rotation, 0deg)) translateY(var(--translate-y, 0px));
  transition: transform 0.3s ease, margin 0.3s ease;
  cursor:     pointer;
  position:   relative;
  z-index:    1;
}

.woocommerce-MyAccount-content .hpa-hand-card:hover {
  transform: rotate(0deg) translateY(-30px) scale(1.15);
  z-index:   10;
  margin:    0 5px;
}

.woocommerce-MyAccount-content .hpa-hand-card img {
  width:         100%;
  border-radius: 8px;
  box-shadow:    0 4px 12px rgba(0, 0, 0, 0.5);
  display:       block;
}

.woocommerce-MyAccount-content .hpa-hand-card-name {
  display:    none;
  position:   absolute;
  bottom:     -28px;
  left:       50%;
  transform:  translateX(-50%);
  background: rgba(0, 0, 0, 0.92);
  color:      #fff;
  padding:    3px 8px;
  border-radius: 4px;
  font-size:  10px;
  white-space: nowrap;
  z-index:    11;
  pointer-events: none;
}

.woocommerce-MyAccount-content .hpa-hand-card:hover .hpa-hand-card-name {
  display: block;
}

/* Responsive — mobile */
@media (max-width: 600px) {
  .woocommerce-MyAccount-content .hpa-hand-card {
    width:  90px;
    margin: 0 -10px;
  }

  .woocommerce-MyAccount-content .hpa-sample-hand {
    min-height: 180px;
    padding:    10px 10px 30px;
  }
}

/* =========================================================================
   VIEW MODES & GROUPING TOOLBAR
   ========================================================================= */

.woocommerce-MyAccount-content .hpa-deck-toolbar {
  display:       flex;
  align-items:   center;
  gap:           16px;
  margin:        12px 0;
  flex-wrap:     wrap;
  padding:       10px 0;
  border-bottom: 1px solid var(--hpa-border);
}

.woocommerce-MyAccount-content .hpa-view-modes {
  display:       flex;
  gap:           2px;
  background:    var(--hpa-bg-dark);
  border-radius: 6px;
  padding:       2px;
}

.woocommerce-MyAccount-content .hpa-view-btn {
  background:    none;
  border:        none;
  color:         var(--hpa-text-muted);
  padding:       6px 12px;
  border-radius: 4px;
  cursor:        pointer;
  font-size:     16px;
  transition:    all 0.2s;
  line-height:   1;
}

.woocommerce-MyAccount-content .hpa-view-btn:hover {
  color: var(--hpa-text);
}

.woocommerce-MyAccount-content .hpa-view-btn.active {
  background: var(--hpa-primary);
  color:      #000;
}

.woocommerce-MyAccount-content .hpa-group-by label,
.woocommerce-MyAccount-content .hpa-sort-by label {
  color:        var(--hpa-text-muted);
  font-size:    12px;
  margin-right: 4px;
}

.woocommerce-MyAccount-content .hpa-group-by select,
.woocommerce-MyAccount-content .hpa-sort-by select {
  background:    var(--hpa-bg-dark);
  color:         var(--hpa-text);
  border:        1px solid var(--hpa-border);
  border-radius: 4px;
  padding:       4px 8px;
  font-size:     12px;
  font-family:   inherit;
  cursor:        pointer;
  transition:    border-color 0.2s;
}

.woocommerce-MyAccount-content .hpa-group-by select:focus,
.woocommerce-MyAccount-content .hpa-sort-by select:focus {
  border-color: var(--hpa-primary);
  outline:      none;
}

/* =========================================================================
   CARD GROUPS
   ========================================================================= */

.woocommerce-MyAccount-content .hpa-card-group {
  margin-bottom: 16px;
}

.woocommerce-MyAccount-content .hpa-group-header {
  color:         var(--hpa-text);
  font-size:     14px;
  cursor:        pointer;
  padding:       8px 0;
  border-bottom: 1px solid var(--hpa-border);
  user-select:   none;
  display:       flex;
  align-items:   center;
  gap:           8px;
  margin:        0;
}

.woocommerce-MyAccount-content .hpa-group-header:hover {
  color: var(--hpa-primary);
}

.woocommerce-MyAccount-content .hpa-group-toggle {
  font-size:  10px;
  transition: transform 0.2s;
  display:    inline-block;
}

.woocommerce-MyAccount-content .hpa-group-header[data-collapsed="true"] .hpa-group-toggle {
  transform: rotate(-90deg);
}

.woocommerce-MyAccount-content .hpa-group-count {
  color:       var(--hpa-text-muted);
  font-weight: normal;
  font-size:   13px;
}

/* =========================================================================
   LIST VIEW (default — wraps existing .hpa-card-item rows)
   ========================================================================= */

.woocommerce-MyAccount-content .hpa-view-list .hpa-group-cards {
  display:        flex;
  flex-direction: column;
  gap:            8px;
  padding:        10px 0;
}

/* =========================================================================
   GRID VIEW
   ========================================================================= */

.woocommerce-MyAccount-content .hpa-view-grid .hpa-group-cards {
  display:               grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap:                   10px;
  padding:               10px 0;
}

.woocommerce-MyAccount-content .hpa-grid-card {
  position:      relative;
  border-radius: 8px;
  overflow:      hidden;
  cursor:        pointer;
  transition:    transform 0.2s;
}

.woocommerce-MyAccount-content .hpa-grid-card:hover {
  transform: scale(1.05);
  z-index:   2;
}

.woocommerce-MyAccount-content .hpa-grid-card img {
  width:        100%;
  aspect-ratio: 5 / 7;
  object-fit:   contain;
  background:   #000;
  display:      block;
}

.woocommerce-MyAccount-content .hpa-grid-card-overlay {
  position:   absolute;
  bottom:     0;
  left:       0;
  right:      0;
  background: linear-gradient(transparent, rgba(0,0,0,0.9));
  padding:    20px 8px 6px;
}

.woocommerce-MyAccount-content .hpa-grid-card-qty {
  position:      absolute;
  top:           6px;
  right:         6px;
  background:    var(--hpa-primary);
  color:         #000;
  font-size:     11px;
  font-weight:   bold;
  padding:       2px 6px;
  border-radius: 4px;
}

.woocommerce-MyAccount-content .hpa-grid-card-name {
  color:         #fff;
  font-size:     11px;
  display:       block;
  white-space:   nowrap;
  overflow:      hidden;
  text-overflow: ellipsis;
}

/* =========================================================================
   IMAGES ONLY VIEW
   ========================================================================= */

.woocommerce-MyAccount-content .hpa-view-images .hpa-group-cards {
  display:               grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap:                   6px;
  padding:               10px 0;
}

.woocommerce-MyAccount-content .hpa-image-card {
  position:      relative;
  border-radius: 6px;
  overflow:      hidden;
  cursor:        pointer;
  transition:    transform 0.15s;
}

.woocommerce-MyAccount-content .hpa-image-card:hover {
  transform: scale(1.08);
  z-index:   2;
}

.woocommerce-MyAccount-content .hpa-image-card img {
  width:        100%;
  aspect-ratio: 5 / 7;
  object-fit:   contain;
  background:   #000;
  display:      block;
}

.woocommerce-MyAccount-content .hpa-image-qty {
  position:      absolute;
  top:           4px;
  right:         4px;
  background:    rgba(0,0,0,0.8);
  color:         #fff;
  font-size:     10px;
  font-weight:   bold;
  padding:       1px 5px;
  border-radius: 3px;
}

/* Responsive: toolbar on small screens */
@media (max-width: 600px) {
  .woocommerce-MyAccount-content .hpa-deck-toolbar {
    gap: 10px;
  }

  .woocommerce-MyAccount-content .hpa-view-grid .hpa-group-cards {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }

  .woocommerce-MyAccount-content .hpa-view-images .hpa-group-cards {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }
}


/* ==========================================================================
   SOCIAL FEATURES — Likes, Views, Comments
   ========================================================================== */

/* Social Stats bar */
.hpa-social-stats {
  display:     flex;
  align-items: center;
  gap:         16px;
  margin:      12px 0;
}

.hpa-like-btn {
  background:    var(--hpa-bg-card);
  border:        1px solid var(--hpa-border);
  color:         var(--hpa-text-muted);
  padding:       6px 16px;
  border-radius: 20px;
  cursor:        pointer;
  font-size:     14px;
  transition:    all 0.2s;
  display:       flex;
  align-items:   center;
  gap:           6px;
}

.hpa-like-btn:hover {
  border-color: #ef4444;
  color:        #ef4444;
}

.hpa-like-btn.liked {
  background:   rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  color:        #ef4444;
}

.hpa-view-count {
  color:     var(--hpa-text-muted);
  font-size: 14px;
}

/* Comments section */
.hpa-comments-section {
  margin-top:    32px;
  padding-top:   24px;
  border-top:    1px solid var(--hpa-border);
}

.hpa-comments-section h4 {
  color:         #fff;
  font-size:     18px;
  margin-bottom: 16px;
}

.hpa-comment-form {
  margin-bottom: 24px;
}

.hpa-comment-form textarea {
  width:      100%;
  min-height: 80px;
  background: var(--hpa-bg-dark);
  color:      var(--hpa-text);
  border:     1px solid var(--hpa-border);
  border-radius: 8px;
  padding:    12px;
  font-size:  14px;
  resize:     vertical;
  box-sizing: border-box;
  font-family: inherit;
}

.hpa-comment-form textarea:focus {
  border-color: var(--hpa-primary);
  outline:      none;
}

.hpa-comment-form button {
  margin-top: 8px;
}

.hpa-comment {
  display:       flex;
  gap:           12px;
  margin-bottom: 16px;
}

.hpa-comment-avatar {
  width:      36px;
  height:     36px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}

.hpa-comment-body {
  flex: 1;
}

.hpa-comment-header {
  display:     flex;
  align-items: center;
  gap:         8px;
  margin-bottom: 4px;
}

.hpa-comment-header strong {
  color:     #fff;
  font-size: 14px;
}

.hpa-comment-date {
  color:     var(--hpa-text-muted);
  font-size: 12px;
}

.hpa-comment-text {
  color:       var(--hpa-text);
  font-size:   14px;
  margin:      0;
  line-height: 1.5;
  word-break:  break-word;
}

.hpa-comment-actions {
  display:    flex;
  gap:        12px;
  margin-top: 6px;
}

.hpa-comment-actions button {
  background: none;
  border:     none;
  color:      var(--hpa-text-muted);
  font-size:  12px;
  cursor:     pointer;
  padding:    0;
}

.hpa-comment-actions button:hover {
  color: var(--hpa-primary);
}

.hpa-delete-comment-btn:hover {
  color: var(--hpa-danger) !important;
}

.hpa-comment-replies {
  margin-left:  24px;
  margin-top:   12px;
  padding-left: 12px;
  border-left:  2px solid var(--hpa-border);
}

#hpa-comments-list .hpa-no-comments {
  color:      var(--hpa-text-muted);
  font-style: italic;
}

/* =========================================================================
   BARCODE LOOKUP & SET BROWSER
   ========================================================================= */

/* Search tabs pill bar */
.woocommerce-MyAccount-content .hpa-search-tabs {
  display:         flex;
  gap:             2px;
  margin-bottom:   16px;
  background:      var(--hpa-bg-dark);
  border-radius:   8px;
  padding:         3px;
}

.woocommerce-MyAccount-content .hpa-search-tab {
  flex:          1;
  background:    none;
  border:        none;
  color:         var(--hpa-text-muted);
  padding:       8px 16px;
  border-radius: 6px;
  cursor:        pointer;
  font-size:     13px;
  transition:    all 0.2s;
  text-align:    center;
  font-family:   inherit;
  line-height:   1.4;
}

.woocommerce-MyAccount-content .hpa-search-tab:hover {
  color: var(--hpa-text);
}

.woocommerce-MyAccount-content .hpa-search-tab.active {
  background:  var(--hpa-primary);
  color:       #000;
  font-weight: bold;
}

/* Barcode input group */
.woocommerce-MyAccount-content .hpa-barcode-input-group {
  display:       flex;
  gap:           8px;
  margin-bottom: 8px;
}

.woocommerce-MyAccount-content .hpa-barcode-input-group input {
  flex:        1;
  font-size:   18px;
  letter-spacing: 2px;
  font-family: monospace;
  text-align:  center;
  padding:     12px;
  background:  var(--hpa-bg-card);
  border:      1px solid var(--hpa-border);
  border-radius: 6px;
  color:       var(--hpa-text);
  box-sizing:  border-box;
}

.woocommerce-MyAccount-content .hpa-barcode-input-group input:focus {
  outline:      none;
  border-color: var(--hpa-primary);
}

.woocommerce-MyAccount-content .hpa-hint {
  color:       var(--hpa-text-muted);
  font-size:   12px;
  margin:      0 0 16px;
}

/* Barcode result card */
.woocommerce-MyAccount-content .hpa-barcode-result-card {
  display:       flex;
  gap:           20px;
  background:    var(--hpa-bg-card);
  border:        1px solid var(--hpa-primary);
  border-radius: 12px;
  padding:       20px;
  margin-top:    16px;
  flex-wrap:     wrap;
}

.woocommerce-MyAccount-content .hpa-barcode-result-card img {
  width:         180px;
  border-radius: 8px;
  object-fit:    contain;
  flex-shrink:   0;
}

.woocommerce-MyAccount-content .hpa-barcode-result-info {
  flex: 1;
  min-width: 200px;
}

.woocommerce-MyAccount-content .hpa-barcode-result-info h3 {
  color:  #fff;
  margin: 0 0 4px;
}

.woocommerce-MyAccount-content .hpa-barcode-result-info .subtitle {
  color:         var(--hpa-text-muted);
  font-size:     14px;
  margin-bottom: 12px;
}

.woocommerce-MyAccount-content .hpa-barcode-result-info .detail-row {
  display:         flex;
  justify-content: space-between;
  padding:         6px 0;
  border-bottom:   1px solid var(--hpa-border);
  font-size:       13px;
}

.woocommerce-MyAccount-content .hpa-barcode-result-info .detail-label {
  color: var(--hpa-text-muted);
}

.woocommerce-MyAccount-content .hpa-barcode-result-info .detail-value {
  color:       var(--hpa-text);
  font-weight: bold;
}

.woocommerce-MyAccount-content .hpa-barcode-result-info .price-row .detail-value {
  color:     var(--hpa-primary);
  font-size: 16px;
}

/* Set browse dropdown */
.woocommerce-MyAccount-content #hpa-browse-set-select {
  width:         100%;
  padding:       10px 12px;
  background:    var(--hpa-bg-card);
  border:        1px solid var(--hpa-border);
  border-radius: 6px;
  color:         var(--hpa-text);
  font-size:     14px;
  margin-bottom: 16px;
  box-sizing:    border-box;
}

.woocommerce-MyAccount-content #hpa-browse-set-select:focus {
  outline:      none;
  border-color: var(--hpa-primary);
}

/* Set browse pagination */
.woocommerce-MyAccount-content #hpa-set-browse-pagination {
  display:    flex;
  flex-wrap:  wrap;
  gap:        6px;
  margin-top: 16px;
}

.woocommerce-MyAccount-content #hpa-set-browse-pagination button {
  background:    var(--hpa-bg-card);
  border:        1px solid var(--hpa-border);
  color:         var(--hpa-text-muted);
  padding:       6px 12px;
  border-radius: 4px;
  cursor:        pointer;
  font-size:     13px;
  transition:    all 0.2s;
}

.woocommerce-MyAccount-content #hpa-set-browse-pagination button:hover,
.woocommerce-MyAccount-content #hpa-set-browse-pagination button.hpa-page-active {
  background:   var(--hpa-primary);
  border-color: var(--hpa-primary);
  color:        #000;
  font-weight:  bold;
}

/* Responsive: stack image above info on narrow screens */
@media (max-width: 500px) {
  .woocommerce-MyAccount-content .hpa-barcode-result-card {
    flex-direction: column;
  }
  .woocommerce-MyAccount-content .hpa-barcode-result-card img {
    width: 100%;
    max-width: 240px;
    margin: 0 auto;
  }
}
