/**
 * VendorPlus core styles — part 6 of 10: Mobile and tablet responsive fixes
 *
 * Split from the single 18,135-line vendor-plus.css. The parts are chained as
 * style dependencies and MUST load in numeric order: rules here are overridden
 * by later parts, and 173 selector pairs in this sheet set the same property
 * twice. Reordering the parts changes computed styles.
 *
 * Do not reorder rules between parts. To verify the split is still faithful:
 *     php vendorplus-core/tests/stylesheet-split-guard-test.php
 *
 * Lines 11024-12205 of the original file.
 */

/* ==========================================================================
   MOBILE RESPONSIVE FIXES
   ========================================================================== */

/* Prevent all elements from breaking viewport */
.vplus-content-area,
.vplus-lot-nav,
.vplus-action-row,
.vplus-lot-filters,
.vplus-lot-list,
.vplus-lot-item,
.vplus-lot-summary,
.card,
.card-body {
  max-width: 100%;
  box-sizing: border-box;
}

/* Mobile Button Styles - Small Screens */
@media (max-width: 767px) {
  /* Navigation bar wrapping */
  .vplus-lot-nav {
    flex-wrap: wrap;
    gap: 0.375rem;
  }

  .vplus-lot-nav > * {
    max-width: 100%;
  }

  /* D8 — mobile only: Create New Item is the far more common action on a
     phone, so it comes before Bulk Import Items. Done with flex `order` rather
     than a markup move because there is ONE DOM order shared with desktop,
     where the established left-to-right order is deliberate. The Back link
     keeps its own order:-1 (set at the 480px breakpoint) and stays first. */
  .vplus-lot-nav .btn-new-lot {
    order: 1;
  }
  .vplus-lot-nav .vplus-bulk-actions {
    order: 2;
  }
  /* AI Speed Lotting drops BELOW Create New Auction on phones — it is the
     specialist route, and the two create buttons are the common actions.
     This REVERSES the desktop rule (Speed is 1 there), so the value must beat
     every other button's: new-lot(1) and bulk-actions(2) above, and
     Create New Auction, which inherits order:2 from the base block. */
  .vplus-lot-nav .btn-speed-lotting {
    order: 3;
  }

  /* Action row wrapping for mobile */
  .vplus-action-row {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  /* `.btn-new-lot` was in this group, which shrank it to 0.8125rem while the
     Bulk Import button beside it kept the default size — the two sit directly
     above one another in the stacked lot nav, so the mismatch was obvious.
     (`.btn-bulk-import` never matched anything: no markup uses that class.)
     Lot-nav sizing is owned by the `.vplus-lot-nav .btn-new-lot` rule below. */
  .vplus-action-row .btn,
  .vplus-btn-sync-to,
  .vplus-btn-pull-from {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.8125rem;
    padding: 0.375rem 0.5rem;
  }

  /* Hide button labels on small screens, show icons */
  .vplus-action-row .btn .btn-link-label {
    display: none;
  }

  /* Show all lot-nav labels on mobile (buttons wrap at this width) */
  .vplus-lot-nav .btn .btn-link-label {
    display: inline;
  }

  /* Filter panel on mobile */
  .vplus-lot-filters {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Cards should not exceed viewport (except those with dropdowns) */
  .card:not(.vplus-sales-list .card):not(.vplus-submission-card):not(
      .vplus-settings-card
    ) {
    overflow: hidden;
  }
  #vplus-sale-filter {
    overflow: visible;
  }
  #vplus-sale-filter .card {
    overflow: visible !important;
  }

  /* Lot item responsive */
  .vplus-lot-item .lot-title {
    font-size: 0.9rem;
    word-break: break-word;
  }

  /* Form rows on mobile */
  .form-row .btn-group {
    flex-wrap: wrap;
  }

  .form-row .btn-group .btn {
    flex: 1 1 auto;
    min-width: 0;
  }
}

/* Very small screens (under 480px) */
@media (max-width: 480px) {
  /* Stack action buttons vertically */
  .vplus-action-row {
    flex-direction: column;
  }

  .vplus-action-row .btn {
    width: 100%;
    justify-content: center;
  }

  /* Lot nav goes full width */
  .vplus-lot-nav {
    flex-direction: column;
    align-items: stretch;
  }

  .vplus-lot-nav .me-auto {
    order: -1;
    margin-bottom: 0.5rem;
  }

  /* Show button labels on full-width buttons */
  .vplus-action-row .btn .btn-link-label {
    display: inline;
  }

  /* Badge pills wrapping */
  .vplus-lot-item .badges {
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .vplus-lot-item .badge {
    font-size: 0.7rem;
  }
}

/* Tablet adjustments (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
  .vplus-lot-nav .btn .btn-link-label {
    display: inline;
  }

  .vplus-action-row .btn {
    padding: 0.375rem 0.625rem;
  }
}

/* Lot form card responsive */
@media (max-width: 575px) {
  .vplus-lot-card .card-header {
    padding: 0.75rem 1rem;
  }

  .vplus-lot-card .card-body {
    padding: 1rem;
  }

  /* Express mode form rows */
  #express-lot-number-row,
  #express-auto-lot-numbering-row {
    flex: 1 1 100%;
  }
}

/* ==========================================
   DICTATION FEATURE STYLES
   ========================================== */

/* Dictation button styling */
.vp-dictation-btn {
  transition: all 0.2s ease;
  background-color: #fff;
  color: #212529;
  border-color: #dee2e6;
}

.vp-dictation-btn:hover {
  color: #fff;
  background-color: #dc3545;
  border-color: #dc3545;
}

/* Active state - white background with red icon and border (no red fill) */
.vp-dictation-btn.active {
  color: #dc3545; /* Red icon */
  background-color: #fff; /* White background to show progress */
  border-color: #dc3545;
  animation: vp-pulse-btn 1.5s infinite;
}

.vp-dictation-btn.active:hover {
  background-color: #fff;
  border-color: #b02a37;
  color: #b02a37;
}

/* Card-level dictation button */
.vp-dictation-card-btn {
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
  white-space: nowrap;
  background-color: #fff;
  color: #212529;
  border-color: #dee2e6;
}

.vp-dictation-card-btn:hover {
  color: #fff;
  background-color: #dc3545;
  border-color: #dc3545;
}

.vp-dictation-card-btn .vp-dictation-btn-label {
  margin-left: 0.25rem;
}

@media (max-width: 576px) {
  .vp-dictation-card-btn .vp-dictation-btn-label {
    display: none;
  }
}

/* Field-level dictation button */
.vp-dictation-field-btn {
  flex-shrink: 0;
  padding: 0.375rem 0.75rem;
  border-top-right-radius: var(--bs-border-radius, 0.375rem) !important;
  border-bottom-right-radius: var(--bs-border-radius, 0.375rem) !important;
}

/* Ensure form-floating has flex inside input-group */
.input-group > .form-floating {
  flex: 1 1 auto;
  width: 1%;
  min-width: 0;
}

/* Input group with dictation button maintains proper borders */
.input-group > .form-floating > .form-control {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

/* Field recording state - pulsing red border */
.vp-dictation-active {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
  animation: vp-pulse-border 1.5s infinite;
}

/* Quill editor active state */
.ql-editor.vp-dictation-active {
  outline: 2px solid #dc3545 !important;
  outline-offset: -2px;
  animation: vp-pulse-border 1.5s infinite;
}

.ql-container:has(.ql-editor.vp-dictation-active) {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

/* Field completion state - green border */
.vp-dictation-complete {
  border-color: #198754 !important;
  box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25) !important;
  animation: vp-border-fade 1.5s forwards;
}

/* Quill editor complete state */
.ql-editor.vp-dictation-complete {
  outline: 2px solid #198754 !important;
  outline-offset: -2px;
}

.ql-container:has(.ql-editor.vp-dictation-complete) {
  border-color: #198754 !important;
  box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25) !important;
}

/* Card active state during sequence dictation */
.vp-dictation-sequence-active {
  box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.3);
  border-radius: 0.375rem;
}

/* Pulsing button animation */
@keyframes vp-pulse-btn {
  0% {
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(220, 53, 69, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
  }
}

/* Pulsing border animation */
@keyframes vp-pulse-border {
  0% {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
  }
  50% {
    border-color: #ff6b7a;
    box-shadow: 0 0 0 0.35rem rgba(220, 53, 69, 0.15);
  }
  100% {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
  }
}

/* Border fade animation for completion */
@keyframes vp-border-fade {
  0% {
    border-color: #198754;
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25);
  }
  80% {
    border-color: #198754;
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25);
  }
  100% {
    border-color: var(--bs-border-color, #dee2e6);
    box-shadow: none;
  }
}

/* Hide dictation buttons when not supported (JS will handle this) */
.vp-dictation-unsupported .vp-dictation-btn {
  display: none !important;
}

/* Field processing state (waiting for Whisper API) */
.vp-dictation-processing {
  border-color: #6c757d !important;
  box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.25) !important;
  animation: vp-pulse-processing 1s infinite;
}

@keyframes vp-pulse-processing {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Audio Level Bar - visual feedback during dictation */
.vp-audio-level-bar {
  position: relative;
  height: 6px;
  background: #e9ecef;
  border-radius: 3px;
  margin-top: 4px;
  overflow: hidden;
}

.vp-audio-level-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(
    90deg,
    #28a745,
    #28a745 70%,
    #ffc107 85%,
    #dc3545
  );
  border-radius: 3px;
  transition: width 0.05s ease-out;
}

.vp-audio-level-bar.peaking .vp-audio-level-fill {
  background: linear-gradient(90deg, #28a745, #ffc107 50%, #dc3545);
}

/* Timeout indicator on dictation button - fills from top to bottom */
.vp-dictation-btn {
  position: relative;
  overflow: hidden;
}

.vp-dictation-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    180deg,
    rgba(220, 53, 69, 0.8) 0%,
    rgba(220, 53, 69, 0.6) 100%
  );
  transform: scaleY(0);
  transform-origin: top;
  transition: none;
  pointer-events: none;
  z-index: 0;
}

.vp-dictation-btn.active.timeout-active::after {
  animation: vp-timeout-fill-down var(--timeout-duration, 2500ms) linear
    forwards;
}

/* When progress is filling, icon should stay visible (white on red) */
.vp-dictation-btn.active.timeout-active {
  color: #dc3545;
}

.vp-dictation-btn > * {
  position: relative;
  z-index: 1;
}

@keyframes vp-timeout-fill-down {
  from {
    transform: scaleY(0);
  }
  to {
    transform: scaleY(1);
  }
}

/* Interim (in-progress) transcription display */
.vp-interim-display {
  font-size: 0.8rem;
  color: #6c757d;
  font-style: italic;
  padding: 4px 8px;
  background: #f8f9fa;
  border-radius: 4px;
  margin-top: 4px;
  min-height: 24px;
  border-left: 3px solid #007bff;
  opacity: 0.8;
}

/* Whisper toggle wrapper styling */
.vp-whisper-toggle-wrapper {
  transition: all 0.3s ease;
}

.vp-whisper-toggle-wrapper:has(#vp-whisper-toggle:checked) {
  background: rgba(102, 126, 234, 0.12) !important;
  border-color: rgba(102, 126, 234, 0.5) !important;
}

/* Card header adjustments for dictate button */
.vplus-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.vplus-card-header[data-bs-toggle="collapse"] {
  cursor: pointer;
}

.vplus-card-header > i:first-child {
  flex-shrink: 0;
}

.vplus-card-header
  > span:not(.vplus-collapse-icon):not(.vp-dictation-btn-label) {
  flex-grow: 1;
}

.vplus-card-header .vplus-collapse-icon {
  flex-shrink: 0;
}

.vplus-card-header-blank-lots {
  background: linear-gradient(135deg, #4a5568 0%, #1a202c 100%);
  color: #fff;
}

/* Express Mode card header */
#vplus-card--express > .vplus-card-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

/* Express Mode distinct header styling - matches Express button */
.vplus-express-card-header {
  background: linear-gradient(45deg, #ff4500, #ffa500);
  color: #fff;
  border-color: rgba(172, 43, 11, 1);
  text-shadow: 1px 1px 2px rgba(172, 43, 11, 0.5);
  border-bottom: 1px solid rgba(172, 43, 11, 0.5);
  padding: 0.75rem 1rem;
  border-radius: 0.375rem 0.375rem 0 0;
}

.vplus-express-card-header i {
  color: #fff;
}

.vplus-express-card-header span {
  color: #fff;
}

/* Dictation button label override - prevent white-on-white */
.vplus-express-card-header .vp-dictation-btn-label {
  color: #333 !important;
}

/* Express Mode dictation button - white styling for orange header */
.vp-dictation-express-btn {
  background-color: rgba(255, 255, 255, 0.95);
  color: #ff4500;
  border-color: rgba(255, 255, 255, 0.8);
}

.vp-dictation-express-btn:hover {
  background-color: #dc3545;
  color: #fff;
  border-color: #dc3545;
}

/* ==========================================
   MOBILE & TABLET BUTTON FIXES
   ========================================== */

/* Ensure consistent button sizing on smaller screens */
@media (max-width: 767px) {
  /* Button consistency - prevent crushing */
  .btn {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Input group buttons should not overflow */
  .input-group .btn {
    flex-shrink: 0;
    white-space: nowrap;
  }

  /* Card header buttons on mobile */
  .card-header .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
  }

  /* Hide button labels on small screens */
  .card-header .btn .btn-label,
  .card-header .btn .btn-link-label {
    display: none;
  }

  /* Dictation field buttons on mobile */
  .vp-dictation-field-btn {
    padding: 0.375rem 0.5rem;
  }

  /* Action row buttons */
  .vplus-action-row .btn {
    width: auto;
    flex: 0 1 auto;
    min-width: 0;
  }

  /* Express mode form buttons */
  #vplus-express-form .btn-group .btn {
    flex: 1;
    min-width: 0;
  }
}

/* Tablet specific fixes */
@media (min-width: 768px) and (max-width: 991px) {
  /* Prevent button crushing on tablets */
  .btn {
    min-height: 38px;
  }

  /* Card-level buttons sizing */
  .vp-dictation-card-btn {
    padding: 0.375rem 0.625rem;
    font-size: 0.85rem;
  }

  /* Input groups with multiple buttons */
  .input-group .btn + .btn {
    margin-left: -1px;
  }
}

/* ==========================================
   AUCTIONEERS BADGE VISIBILITY FIX
   ========================================== */

/* Ensure Bootstrap badge colors are visible */
#vplus-auctioneers-card .badge,
.vplus-settings-content .badge {
  display: inline-block;
  padding: 0.35em 0.65em;
  font-size: 0.75em;
  font-weight: 500;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.25rem;
}

/* Ensure Bootstrap bg-* classes work on badges */
#vplus-auctioneers-card .badge.bg-primary,
.vplus-settings-content .badge.bg-primary {
  background-color: var(--bs-primary, #0d6efd) !important;
  color: #fff !important;
}

#vplus-auctioneers-card .badge.bg-success,
.vplus-settings-content .badge.bg-success {
  background-color: #198754 !important;
  color: #fff !important;
}

#vplus-auctioneers-card .badge.bg-info,
.vplus-settings-content .badge.bg-info {
  background-color: #0dcaf0 !important;
  color: #000 !important;
}

#vplus-auctioneers-card .badge.bg-warning,
.vplus-settings-content .badge.bg-warning {
  background-color: #ffc107 !important;
  color: #000 !important;
}

#vplus-auctioneers-card .badge.bg-danger,
.vplus-settings-content .badge.bg-danger {
  background-color: #dc3545 !important;
  color: #fff !important;
}

#vplus-auctioneers-card .badge.bg-secondary,
.vplus-settings-content .badge.bg-secondary {
  background-color: #6c757d !important;
  color: #fff !important;
}

/* ==========================================
   MOBILE RESPONSIVE FIXES (≤768px)
   ========================================== */

/* Phase 2a — Touch-device tooltip safety.
   On touch / coarse-pointer devices, hover/focus-triggered Bootstrap tooltips
   commonly fail to auto-dismiss (no mouseleave), so they stick open and overlap
   content (e.g. the Auction Manager status-tab tooltips overlapping the first
   cards). pointer-events:none guarantees a lingering tooltip can never block a
   tap "through" it. Scoped to (hover:none)/(pointer:coarse) so desktop — even in
   a narrow window — keeps fully interactive tooltips. The deliberately rich,
   tap-to-open auto-increment tooltip is excluded so it still works. */
@media (hover: none), (pointer: coarse) {
  .tooltip:not(.vplus-auto-increment-tooltip) {
    pointer-events: none;
  }
}

@media (max-width: 768px) {
  /* Ensure tooltips stay within viewport */
  .tooltip {
    max-width: calc(100vw - 20px) !important;
  }

  .tooltip .tooltip-inner {
    max-width: calc(100vw - 30px);
    text-align: left;
    padding: 8px 12px;
  }

  /* Dictation button tooltip - prevent covering input field */
  .vp-dictation-btn[data-bs-toggle="tooltip"] + .tooltip {
    margin-bottom: 8px;
  }

  /* --------------------------------------
     Archive Lot Card Layout Fixes
     -------------------------------------- */
  .vplus-lot-summary .row {
    flex-wrap: wrap;
  }

  .vplus-lot-summary-main {
    gap: 0.5rem;
  }

  .vplus-lot-summary-main > .col {
    flex: 1 1 100%;
    order: 1;
    margin-bottom: 0.5rem;
  }

  .vplus-lot-summary-main > .col-auto:first-child {
    order: 0;
    flex: 0 0 auto;
  }

  .vplus-lot-summary-main > .col-12.order-3 {
    order: 3;
    margin-top: 0.5rem;
    flex-wrap: wrap;
    gap: 0.25rem !important;
  }

  /* Badge stacking on mobile */
  .vplus-lot-summary .badge {
    font-size: 0.7rem;
    padding: 0.25em 0.5em;
  }

  /* Expandable details row on mobile */
  .vplus-lot-summary-details .row {
    flex-direction: column;
  }

  .vplus-lot-summary-details .col-auto {
    width: 100%;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.5rem 0;
  }

  .vplus-lot-summary-details .col-auto:last-child {
    border-bottom: none;
  }

  /* --------------------------------------
     Archive Sale Button Grid Fixes
     -------------------------------------- */
  .vplus-action-row .btn {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    white-space: nowrap;
  }

  .vplus-action-row .col-12.col-md-auto {
    flex-wrap: wrap;
    gap: 0.5rem !important;
  }

  .vplus-action-row .btn .btn-link-label {
    display: none;
  }

  .vplus-action-row .btn .badge {
    margin-left: 0.25rem;
  }

  /* Sync buttons on mobile - stack vertically */
  #vplus-sync-to-dashboard-btn,
  #vplus-pull-from-dashboard-btn,
  #vplus-sync-statuses-btn,
  #vplus-bulk-ai-btn {
    flex: 1 1 45%;
    min-width: 120px;
  }

  /* --------------------------------------
     Pricing Row Fields - Full Width (col-12)
     -------------------------------------- */
  /* R3.1: #reserve-row added to the full-width set. It used to be excluded to
     "preserve conditional logic" for its Quick-set-reserve calculator, but that
     left it rendering half-width beside full-width siblings — a broken mobile
     stack. It stacks full-width now; the calculator wraps below via the
     #reserve-row .input-group { flex-wrap: wrap } rule already present below. */
  #purchase-price-row,
  #display-price-row,
  #opening-bid-row,
  #soft-minimum-offer-row,
  #minimum-offer-row,
  #bid-increment-row,
  #reserve-row,
  #quantity-row {
    flex: 0 0 100%;
    max-width: 100%;
    width: 100%;
  }

  /* Ensure input groups don't get cut off */
  #purchase-price-row .input-group,
  #display-price-row .input-group,
  #opening-bid-row .input-group,
  #soft-minimum-offer-row .input-group,
  #minimum-offer-row .input-group,
  #bid-increment-row .input-group,
  #quantity-row .input-group {
    flex-wrap: nowrap;
  }

  /* Reserve row needs wrap to accommodate calculator dropdown */
  #reserve-row .input-group {
    flex-wrap: wrap;
  }

  #reserve-row .vp-reserve-calculator {
    flex: 0 0 100%;
    width: 100%;
  }

  #purchase-price-row .form-floating,
  #display-price-row .form-floating,
  #opening-bid-row .form-floating,
  #soft-minimum-offer-row .form-floating,
  #minimum-offer-row .form-floating,
  #bid-increment-row .form-floating,
  #reserve-row .form-floating,
  #quantity-row .form-floating {
    flex: 1 1 auto;
    min-width: 0;
  }

  /* --------------------------------------
     Lot Nav Mobile Improvements
     -------------------------------------- */
  .vplus-lot-nav {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .vplus-lot-nav .btn {
    flex: 1 1 auto;
    min-width: 80px;
  }

  /* --------------------------------------
     Filter Card Mobile Improvements
     -------------------------------------- */
  .card-body .row > [class*="col-md-"] {
    margin-bottom: 0.75rem;
  }

  /* Photo filter button group - prevent squishing */
  #vplus-photo-filter {
    flex-wrap: wrap;
  }

  #vplus-photo-filter label.btn {
    flex: 1 1 30%;
    min-width: 70px;
    padding: 0.375rem 0.5rem;
    font-size: 0.8rem;
  }

  /* --------------------------------------
     Form Input Groups - Prevent Overflow
     -------------------------------------- */
  .input-group {
    flex-wrap: nowrap;
  }

  .input-group .form-floating {
    flex: 1 1 auto;
    min-width: 0;
  }

  .input-group .btn {
    flex-shrink: 0;
  }

  /* Reserve calculator dropdown - full width on mobile */
  .vp-reserve-calculator,
  .vp-increment-suggestions {
    margin-top: 0.5rem;
  }

  .vp-reserve-calculator .form-select,
  .vp-increment-suggestions .form-select {
    font-size: 0.85rem;
  }
}

/* ==========================================
   R2-P1: Pricing fields — auto-flowing equal-width (tablet + desktop)
   ==========================================
   The pricing rows (Purchase Price / Opening Bid / Bid Increment / Reserve /
   Minimum Offer / Quantity) are authored as fixed col-6 col-lg-3 (rigid 2-up /
   4-up). But the number of VISIBLE fields swings 1/4/5 with the Item Type +
   Purchase Option combo, so a fixed grid produced: a lone orphan on a new row
   (5-field case), 75%-empty rows (1-field Listing case), and ragged wrapping.

   Fix: above the mobile stack breakpoint, override the col-* sizing so each
   VISIBLE pricing row is an equal-width flex item that grows to fill the row and
   wraps evenly — N fields always share the width, no orphan-at-far-left, no
   quarter-width-lonely field. Applies to BOTH modes (Express #express-*-row and
   Full #*-row). Mobile (<=767/768px) keeps the full-width single-column stack
   from the blocks above — this only spans >=768px where the raggedness occurred.
   Hidden rows (display:none / soft-minimum) are out of flow, so the count adapts
   automatically. IDs unchanged, so the JS show/hide is unaffected.

   Breakpoint: min-width 768.02px (not 768px) so it does NOT dual-match the
   shared `@media (max-width: 768px)` mobile block above at exactly 768px — that
   block carries unrelated rules (tooltips, lot nav) so it's left untouched;
   scoping the reflow just above its edge avoids the 1px source-order overlap.
   min-width:150px on each row sets a shrink floor so 5 visible fields wrap
   rather than compress below usability at the narrow end of the tablet range. */
@media (min-width: 768.02px) {
  #purchase-price-row,
  #opening-bid-row,
  #minimum-offer-row,
  #bid-increment-row,
  #reserve-row,
  #quantity-row,
  #express-purchase-price-row,
  #express-opening-bid-row,
  #express-minimum-offer-row,
  #express-bid-increment-row,
  #express-reserve-row,
  #express-quantity-row {
    flex: 1 1 200px;
    min-width: 150px;
    max-width: 100%;
    width: auto;
    align-self: flex-start;
  }
}

/* ==========================================
   MOBILE TOOLTIP OVERRIDE (JavaScript Hook)
   ========================================== */

/* ==========================================
   LOT TITLE INPUT - EXPANDABLE HEIGHT
   ========================================== */

/* Allow lot title to expand and show full content */
.vplus-lot-title-input {
  min-height: 3.5rem; /* Match form-floating height */
  height: auto;
  resize: none;
  overflow: hidden; /* Hide scrollbar, JS will auto-expand */
  padding-right: 12px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Ensure form-floating works with auto-height textarea */
#lot-title-row .form-floating,
#express-lot-title-row .form-floating {
  height: auto;
}

/* Title variations wrapper styling */
.vplus-title-variations-wrapper {
  width: 100%;
}

/* ==========================================
   PHOTO PREVIEW MODAL
   ========================================== */

.vplus-preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vplus-preview-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  cursor: pointer;
}

.vplus-preview-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  z-index: 1;
}

.vplus-preview-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: transparent;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.vplus-preview-close:hover {
  opacity: 1;
}

.vplus-preview-image {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

/* ==========================================
   AI BUTTON STYLES (Mark for AI / AI Badge)
   ========================================== */

.vplus-media-option .ai-badge-link.loading,
.vplus-media-option .ai-link.loading {
  opacity: 0.6;
  pointer-events: none;
}

.vplus-media-option .ai-badge-link,
.vplus-media-option .ai-link {
  color: #6f42c1;
}

.vplus-media-option .ai-badge-link:hover,
.vplus-media-option .ai-link:hover {
  color: #5a2d9e;
  background: rgba(111, 66, 193, 0.1);
}

/* ==========================================
   MANAGE CONSIGNMENTS - SUBMISSIONS TABS
   ========================================== */

.vplus-submissions-manager {
  padding: 1rem 0;
}

/* Tab Navigation */
.vplus-submissions-tabs {
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.vplus-submissions-tabs .nav-link {
  border-radius: 0.5rem;
  padding: 0.625rem 1rem;
  font-weight: 500;
  color: #495057;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
}

.vplus-submissions-tabs .nav-link:hover {
  background: #e9ecef;
  border-color: #ced4da;
}

.vplus-submissions-tabs .nav-link.active {
  background: var(--bs-primary, #0d6efd);
  color: #fff;
  border-color: var(--bs-primary, #0d6efd);
}

.vplus-submissions-tabs .nav-link .badge {
  font-size: 0.75rem;
  padding: 0.35em 0.65em;
  font-weight: 600;
}

.vplus-submissions-tabs .nav-link.active .badge {
  background: rgba(255, 255, 255, 0.9) !important;
  color: var(--bs-primary, #0d6efd) !important;
}

/* Action Buttons */
.vplus-submissions-manager .btn-link {
  padding: 0.375rem 0.5rem;
  opacity: 1;
  transition:
    box-shadow 0.2s,
    transform 0.2s;
}

.vplus-submissions-manager .btn-link:hover {
  transform: scale(1.1);
  box-shadow: 0 0 8px rgba(var(--bs-primary-rgb, 13, 110, 253), 0.4);
  border-radius: 0.25rem;
}

.vplus-submissions-manager .btn-link.text-success:hover {
  color: #198754 !important;
}

.vplus-submissions-manager .btn-link.text-danger:hover {
  color: #dc3545 !important;
}

.vplus-submissions-manager .btn-link.text-muted:hover {
  color: #495057 !important;
}

/* Table Styling */
.vplus-submissions-manager .table {
  margin-bottom: 0;
}

.vplus-submissions-manager .table th {
  font-weight: 600;
  color: #495057;
  border-bottom-width: 2px;
}

.vplus-submissions-manager .table td {
  vertical-align: middle;
}

.vplus-submissions-manager .table td img {
  border-radius: 0.375rem;
}

/* Empty State */
.vplus-submissions-manager .tab-pane .d-flex.flex-column {
  padding: 2rem;
  background: #f8f9fa;
  border-radius: 0.5rem;
}

/* Submission Detail Modal — wider on desktop. Scoped to lg+ so it doesn't
   override the .modal-fullscreen-lg-down behaviour below 992px: the ID
   selector (specificity 1-1-0) was beating Bootstrap's fullscreen rule
   (0-1-0), pinning the modal to 80vw on mobile (e.g. 344px @ 430px) with
   margins instead of going edge-to-edge. */
@media (min-width: 992px) {
  #submissionDetailModal .modal-dialog {
    max-width: 80vw;
  }
}

/* Checkbox styling */
.vplus-submissions-manager .form-check-input {
  width: 1.125rem;
  height: 1.125rem;
  cursor: pointer;
}
