/**
 * PRG Browse Page Styles
 *
 * Styles for the /products/ browse page system including:
 * - Grid layouts and product cards
 * - Filter UI and sidebar
 * - Product modals
 * - Mobile responsive design
 * - Gallery and image handling
 *
 * This file was extracted from prg-styles.css for better organization
 * and performance (conditionally loaded only on browse pages).
 *
 * @package ProductReviewGenerator
 * @since 3.9.0
 */

/* ==========================================================================
   BROWSE PAGE STYLES - Left Sidebar Layout
   ========================================================================== */

/* Main layout container */
.prg-browse-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

.prg-browse-header {
  text-align: center;
  margin-bottom: 30px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.prg-browse-header h1 {
  font-size: 2.5em;
  font-weight: 600;
  color: #1d1d23;
  margin-bottom: 10px;
}

.prg-browse-description {
  font-size: 1.1em;
  color: #666;
  margin-bottom: 0;
}

/* Two-column layout with sidebar */
.prg-browse-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 30px;
  align-items: start;
}

/* Left Sidebar Filters */
.prg-browse-sidebar {
  background: #f8f9fa;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 20px;
  position: sticky;
  top: 20px;
}

.prg-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e5e7eb;
}

.prg-sidebar-header h3 {
  margin: 0;
  font-size: 1.2em;
  color: #1f2937;
}

.prg-btn-small {
  padding: 6px 12px;
  font-size: 0.85em;
}

.prg-browse-filters .prg-filter-group {
  margin-bottom: 20px;
}

.prg-browse-filters .prg-filter-group:last-child {
  margin-bottom: 0;
}

.prg-filter-checkbox .prg-checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.prg-filter-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  border-radius: 4px;
}

.prg-filter-checkbox label {
  margin: 0;
  font-weight: 600;
  color: #374151;
  flex: 1;
  cursor: pointer;
  font-size: 0.8em !important;
  line-height: 1.3;
}

.prg-filter-checkbox .prg-filter-note {
  margin: 6px 0 0 28px;
  font-size: 0.75em;
  color: #6b7280;
  line-height: 1.3;
}

.prg-browse-filters label {
  display: block;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
  font-size: 0.9em;
}

.prg-browse-filters select,
.prg-browse-filters input[type="text"] {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  background: #ffffff;
  color: #374151;
  transition: border-color 0.2s ease;
}

.prg-browse-filters select:focus,
.prg-browse-filters input[type="text"]:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.prg-filter-actions {
  margin-top: 25px;
  padding-top: 15px;
  border-top: 1px solid #e5e7eb;
}

/* Main content area */
.prg-browse-main {
  min-height: 500px;
}

/* Controls above product grid */
.prg-browse-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding: 15px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}

.prg-browse-results-info {
  flex-grow: 1;
}

.prg-sort-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.prg-sort-controls label {
  font-weight: 500;
  color: #374151;
  white-space: nowrap;
}

.prg-sort-controls select {
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 14px;
  background: #ffffff;
  min-width: 160px;
}

/* Product grid styles */
.prg-product-grid {
  display: grid;
  grid-template-columns: repeat(
    var(--prg-grid-columns, auto-fill),
    minmax(280px, 1fr)
  );
  gap: 25px;
  margin-bottom: 30px;
}

.prg-product-card {
  background: #fdfdfd;
  border: 1px solid #dddddd;
  border-radius: 8px;
  padding: 20px;
  transition: all 0.3s ease;
  box-shadow: 0 6px 9px rgba(0, 0, 0, 0.1);
}

.prg-product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-color: #3b82f6;
}

/* Product image styles - enhanced for better display */

.prg-product-image {
  margin: -20px -20px 15px -20px;
  background: #f8f9fa;
  overflow: hidden;
  position: relative;
  border-radius: 8px 8px 0 0;
  aspect-ratio: 4 / 3;
  min-height: 200px;
}

.prg-product-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.3s ease;
  display: block;
}

.prg-product-card:hover .prg-product-image img {
  transform: scale(1.05);
}

.prg-product-card-has-gallery .prg-product-image {
  padding-bottom: 0;
}

.prg-product-gallery-preview {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 72px;
  height: 54px;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

.prg-product-gallery-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.prg-gallery-indicator {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(15, 23, 42, 0.8);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.prg-gallery-indicator::before {
  content: "\1F4F7";
  font-size: 14px;
}

.prg-image-placeholder-note {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(255, 255, 255, 0.92);
  color: #1f2937;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.1);
}

/* Multiple Vendors Badge */
.prg-multi-vendor-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: transform 0.2s ease;
}

.prg-multi-vendor-badge::before {
  content: "🏪";
  font-size: 12px;
}

.prg-product-card:hover .prg-multi-vendor-badge {
  transform: scale(1.05);
}

/* Better fallback for broken images */
.prg-product-image img[src=""],
.prg-product-image img:not([src]) {
  display: none;
}

.prg-gallery-placeholder {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.prg-gallery-mode-placeholder .prg-product-gallery-preview {
  display: none;
}

.prg-gallery-mode-placeholder .prg-gallery-placeholder.is-visible {
  display: block;
}

.prg-gallery-mode-placeholder .prg-main-image.is-hidden {
  display: none;
}

.prg-gallery-mode-placeholder
  .prg-image-show-placeholder
  .prg-gallery-placeholder {
  display: block;
}

/* Loading state for images */
.prg-product-image img[loading="lazy"] {
  background: #f3f4f6;
}

/* Enhanced affiliate button styling */
.prg-affiliate-btn {
  background: linear-gradient(135deg, #bf0909 0%, #f31111 100%) !important;
  color: white !important;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: none;
  box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
  transition: all 0.3s ease;
}

.prg-affiliate-btn:hover {
  background: linear-gradient(135deg, #ed2222 0%, #ff3c3c 100%) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
  text-decoration: none;
}

.prg-product-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.prg-product-actions .prg-btn {
  flex: 1;
  min-width: 140px;
  min-height: 40px;
}

.prg-product-header {
  margin-bottom: 15px;
}

.prg-product-name {
  font-size: 1.1em;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 1px 0;
  line-height: 1.3;
}

.prg-product-type .prg-type-label {
  font-size: 0.85em;
  color: #6b7280;
  margin-right: 5px;
}

.prg-product-type .prg-type-name {
  font-weight: 500;
  color: #374151;
  font-size: 0.85em;
}

.prg-product-brand {
  margin-bottom: 1px;
}

.prg-product-brand .prg-brand-label {
  font-size: 0.85em;
  color: #6b7280;
  margin-right: 5px;
}

.prg-product-brand .prg-brand-name {
  font-weight: 500;
  color: #374151;
  font-size: 0.85em;
}

.prg-product-vendor {
  margin-bottom: 1px;
}

.prg-product-vendor .prg-vendor-label {
  font-size: 0.85em;
  color: #6b7280;
  margin-right: 5px;
}

.prg-product-vendor .prg-vendor-name {
  font-weight: 500;
  color: #374151;
  font-size: 0.85em;
}

/* Vendor Logo Styles */
.prg-vendor-logo-small {
  height: 20px;
  width: auto;
  max-width: 60px;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
  margin: 0 4px;
  border-radius: 3px;
  background: #ffffff;
  padding: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}

.prg-vendor-logo-small:hover {
  transform: scale(1.1);
}

/* Single Vendor Logo - More Prominent */
.prg-vendor-logo-single {
  height: 26px;
  width: auto;
  max-width: 80px;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
  margin: 0 4px;
  border-radius: 4px;
  background: #ffffff;
  padding: 3px 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  transition: all 0.2s ease;
  cursor: default;
}

.prg-vendor-logo-single:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.prg-product-vendor-single {
  display: flex;
  align-items: center;
  gap: 4px;
}

.prg-vendor-logos {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-left: 2px;
}

.prg-product-vendor-multi {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.prg-vendor-name-text {
  font-size: 0.8em;
  font-weight: 500;
  color: #4b5563;
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 12px;
  white-space: nowrap;
}

.prg-vendor-more {
  font-size: 0.75em;
  font-weight: 600;
  color: #6b7280;
  background: #f9fafb;
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  white-space: nowrap;
}

.prg-product-offers {
  margin-top: 4px;
  font-size: 0.8em;
  font-weight: 500;
  color: #047857;
}

.prg-product-price {
  margin-bottom: 1px;
}

.prg-product-price .prg-price-label {
  font-size: 0.8em;
  color: #6b7280;
  margin-right: 5px;
  font-weight: 400;
}

.prg-product-price .prg-price-value {
  font-weight: 600;
  color: #e91e63;
  font-size: 1.05em;
}

.prg-product-description {
  color: #4b5563;
  font-size: 0.9em;
  line-height: 1.5;
  margin-bottom: 15px;
}

p.prg-hook-text {
  font-size: 0.8rem;
}

a.prg-hook-read-more {
  font-size: 0.8rem;
}

/* Compact specification tags for grid cards */

.prg-product-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  flex-direction: column;
}

.prg-product-meta {
  padding-top: 10px;
  border-top: 1px solid #f3f4f6;
  font-size: 0.75em;
  color: #9ca3af;
}

.prg-product-meta span {
  display: block;
  margin-bottom: 2px;
}

/* Button styles */
.prg-btn {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  .prg-product-compare-slot {
    margin-top: 12px;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    pointer-events: none;
  }

  font-weight: 500;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.prg-btn-primary {
  background: #3b82f6;
  color: #ffffff;
}

.prg-btn-primary:hover {
  background: #2563eb;
  color: #ffffff;
}

.prg-btn-secondary {
  background: #6b7280;
  color: #ffffff;
}

.prg-btn-secondary:hover {
  background: #4b5563;
  color: #ffffff;
}

.prg-btn-secondary.prg-btn-compare {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25);
}

.prg-btn-secondary.prg-btn-compare:hover,
.prg-btn-secondary.prg-btn-compare:focus {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(29, 78, 216, 0.35);
}

.prg-btn-secondary.prg-btn-compare:focus-visible {
  outline: 2px solid #1d4ed8;
  outline-offset: 2px;
}

.prg-btn-outline {
  background: #ffffff;
  color: #374151;
  border: 1px solid #d1d5db;
}

.prg-btn-outline:hover {
  background: #f9fafb;
  border-color: #9ca3af;
  color: #374151;
}

/* Pagination */
.prg-browse-pagination {
  text-align: center;
  margin: 30px 0;
}

/* Loading states */
.prg-browse-loading {
  text-align: center;
  padding: 40px;
  color: #6b7280;
}

.prg-loading-spinner {
  border: 3px solid #f3f4f6;
  border-top: 3px solid #3b82f6;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* No results */
.prg-no-results {
  text-align: center;
  padding: 60px 20px;
  color: #6b7280;
}

.prg-no-results p {
  font-size: 1.1em;
  margin: 0;
}

/* Active filters display */
.prg-active-filters {
  font-size: 0.85em;
  color: #6b7280;
  margin-left: 10px;
}

/* Mobile Filter Button - Sticky top bar on mobile */
.prg-mobile-filter-btn {
  display: none;
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: linear-gradient(135deg, #226adf 0%, #3b82f6 100%);
  color: white;
  border: none;
  border-radius: 0;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(191, 9, 9, 0.3);
  cursor: pointer;
  transition: all 0.2s ease;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 20px;
}

.prg-mobile-filter-btn:active {
  background: linear-gradient(135deg, #a00808 0%, #d30f0f 100%);
}

.prg-mobile-filter-btn .filter-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
}

/* Mobile Filter Overlay */
.prg-filter-overlay {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.prg-filter-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Mobile Filter Drawer */
.prg-filter-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  max-height: 85vh;
  background: white;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  z-index: 1001;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.prg-filter-drawer.active {
  transform: translateY(0);
}

.prg-filter-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.prg-filter-drawer-header h3 {
  margin: 0;
  font-size: 1.3em;
  color: #1f2937;
}

.prg-filter-close-btn {
  background: none;
  border: none;
  font-size: 28px;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.2s;
}

.prg-filter-close-btn:hover {
  background: #f3f4f6;
}

.prg-filter-drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  -webkit-overflow-scrolling: touch;
}

.prg-filter-drawer-footer {
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 12px;
  flex-shrink: 0;
  background: #f9fafb;
}

.prg-filter-drawer-footer .prg-btn {
  flex: 1;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.prg-filter-drawer-footer .prg-btn-secondary {
  background: white;
  color: #374151;
  border: 1px solid #d1d5db;
}

.prg-filter-drawer-footer .prg-btn-secondary:hover {
  background: #f9fafb;
}

.prg-filter-drawer-footer .prg-btn-primary {
  background: linear-gradient(135deg, #226adf 0%, #3b82f6 100%);
  color: white;
}

.prg-filter-drawer-footer .prg-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(191, 9, 9, 0.3);
}

/* Responsive design */
@media (max-width: 1024px) {
  .prg-browse-layout {
    grid-template-columns: 260px 1fr;
    gap: 20px;
  }

  .prg-product-grid {
    grid-template-columns: repeat(
      var(--prg-grid-columns, auto-fill),
      minmax(260px, 1fr)
    );
    gap: 16px;
  }
}

@media (max-width: 768px) {
  .prg-browse-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* Hide desktop sidebar on mobile */
  .prg-browse-sidebar {
    display: none;
  }

  /* Show mobile filter button */
  .prg-mobile-filter-btn {
    display: flex;
  }

  /* Ensure drawer layout is available on mobile */
  .prg-filter-drawer {
    display: flex;
  }

  .prg-browse-controls {
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
  }

  .prg-sort-controls {
    justify-content: center;
  }

  .prg-product-grid {
    grid-template-columns: repeat(
      var(--prg-grid-columns, auto-fill),
      minmax(240px, 1fr)
    );
    gap: 15px;
  }

  .prg-product-actions {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .prg-browse-container {
    padding: 15px;
  }

  .prg-browse-header h1 {
    font-size: 2em;
  }

  .prg-product-grid {
    grid-template-columns: repeat(var(--prg-grid-columns, 1), minmax(0, 1fr));
  }

  .prg-sidebar-header {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }
}

/* Sticky Widget Styles */
@media screen and (min-width: 768px) {
  .widget_prg_buy_options_widget {
    position: sticky !important;
    top: 0;
    margin-bottom: 64px;
  }
}
.widget_prg_buy_options_widget {
  position: sticky !important;
  top: 30px;
  margin-bottom: 64px;
}

/* Product Showcase */
.product__showcase {
  padding: 30px;
  margin-bottom: 45px;
  box-shadow: 0 4px 10px rgb(72 69 69 / 17%);
  border-radius: 10px;
}

/* Sticky CTA */
.product-review__wrapper {
  position: relative;
  padding-bottom: 60px; /* Space for sticky CTA */
}

.shopindoor-cta-block {
  position: relative;
}

.shopindoor-cta-block .cta-thumb {
  display: none;
  width: 43px;
  height: 43px;
  margin-right: 12px;
  flex-shrink: 0;
}

.shopindoor-cta-block .cta-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

.shopindoor-cta-block.is-sticky {
  position: fixed;
  padding-top: 10px;
  background: #fff;
  box-shadow: 0 4px 10px rgb(72 69 69 / 17%);
  border-radius: 0 0 10px 10px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: unset;
}

.shopindoor-cta-block.is-sticky .inner-container {
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 0 16px;
  align-items: flex-start;
}

.shopindoor-cta-block.is-sticky .cta-thumb {
  display: block;
}

.shopindoor-cta-block.is-sticky .gb-button {
  padding: 6px 16px !important;
  font-size: 14px !important;
  flex-grow: 1;
  justify-content: center;
  white-space: nowrap;
  min-height: 36px;
  max-width: 360px;
  margin-top: 0 !important;
}

.shopindoor-cta-block {
  position: relative;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: transform;
  transition: none; /* Remove transition when switching positions */
}

.shopindoor-cta-block.is-sticky {
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  perspective: 1000;
  -webkit-perspective: 1000;
}

/* Table disclaimer */
.prg-table-disclaimer {
  font-size: 0.9em;
  margin-top: 10px;
  background: #fff9e5;
  padding: 1rem 2rem;
}

/* Product content link styling */
.product-content-link {
  text-decoration: none;
  color: inherit;
  display: block;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.product-content-link:hover {
  opacity: 0.9;
}

.product-content-link:focus {
  outline: 2px solid #2271b1;
  outline-offset: 2px;
}

/* Ensure image is properly sized within link */
.product-content-link .product-review-table__product-content-wrapper img {
  display: block;
  margin: 0 auto;
}

/* Make the title look slightly more clickable */
.product-content-link .product-review-table__table-title {
  color: #222222;
  margin-top: 10px;
}

button,
input,
optgroup,
select,
textarea {
  font-family: inherit;
  font-size: 100%;
  margin: 0;
}

/* Product Navigation Styles */

/* ==========================================================================
   BROWSE PAGE ENHANCEMENTS - Fixed Issues
   ========================================================================== */

/* Search wrapper with button */
.prg-search-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

.prg-search-wrapper input {
  flex: 1;
}

.prg-search-wrapper .prg-btn-small {
  padding: 8px 12px;
  font-size: 13px;
  white-space: nowrap;
}

/* Product price in green */
.prg-product-price .prg-price-value {
  color: #28a745;
  font-weight: 600;
}

/* Duplicate definition removed - consolidated above */

/* Modal styles */
.prg-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.prg-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgb(0 0 0 / 78%);
  cursor: pointer;
}

.prg-modal-content {
  position: relative;
  background: white;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
  width: 95%;
  max-width: 1120px;
  max-height: 92vh;
  overflow: hidden;
  z-index: 10001;
}

.prg-modal-header {
  padding: 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.prg-modal-header h3 {
  margin: 0;
  font-size: 1.2em;
}

.prg-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.prg-modal-body {
  padding: 24px 28px;
  max-height: 72vh;
  overflow-y: auto;
}

/* Modal product details */
.prg-modal-product-header {
  margin-bottom: 20px;
  border-bottom: 1px solid #e5e7eb;
}

.prg-modal-product-title {
  font-size: 1.4em;
  margin-bottom: 10px;
  color: #333;
}

.prg-modal-product-brand {
  color: #666;
  margin-bottom: 10px;
}

.prg-modal-product-price {
  font-size: 1.2em;
  color: #28a745;
  font-weight: 600;
  margin-bottom: 20px;
}

/* Amazon Price Link */
.prg-modal-amazon-price {
  font-size: 0.9rem;
  font-weight: 600;
  color: #666;
}

/* Amazon price link - Inline text style for ToS compliance */
.prg-amazon-price-link {
  display: inline;
  padding: 0;
  background: none;
  text-decoration: underline;
  border: none;
  border-radius: 0;
  font-size: 0.9rem;
  transition: color 0.2s;
  font-weight: 600;
}

.prg-amazon-price-link:hover {
  color: #e88900; /* Darker orange on hover */
  text-decoration: none;
  background: none;
}

.prg-product-card .prg-product-header .prg-amazon-price-link {
  font-size: 0.8rem;
  font-weight: 500;
}

/* Grid card version - matches inline style */
.prg-card .prg-amazon-price-link {
  font-size: inherit;
  padding: 0;
}

.prg-modal-features-list {
  list-style: none;
  padding: 0;
}

.prg-modal-features-list li {
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}

.prg-modal-features-list li:last-child {
  border-bottom: none;
}

.prg-modal-tags {
  margin-top: 20px;
}

.prg-modal-product-container .product-review__container {
  padding-bottom: 0 !important;
  margin: 0;
}

.prg-modal-product-container .product-review__container:after {
  display: none !important;
}

/* Hide external product-review__wrapper divider line in modal */
.prg-modal-product-container .product-review__wrapper:after {
  display: none !important;
}

/* Enhanced modal content styles matching grid card design */
.prg-modal-product-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 24px;
  align-items: start;
}

.prg-modal-product-container.has-gallery {
  grid-template-columns: minmax(0, 400px) minmax(0, 1fr);
}

.prg-modal-gallery-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100%;
}

.prg-modal-gallery {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.prg-modal-gallery-main {
  background: #f8f9fa;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 340px;
  padding: 18px;
}

.prg-modal-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.3s ease-in-out;
}

.prg-modal-gallery-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.prg-modal-thumb {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  padding: 0;
  width: 88px;
  height: 88px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.prg-modal-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

.prg-modal-thumb.is-active {
  border-color: #1e63ff;
  box-shadow: 0 0 0 2px rgba(30, 99, 255, 0.12);
  transform: translateY(-1px);
}

/* Modal product details matching card styles */
.prg-modal-product-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.prg-modal-admin-tools {
  margin: 16px 0;
}

.prg-modal-admin-tools .prg-btn {
  margin-right: 8px;
}

.prg-affiliate-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

.prg-affiliate-btn .prg-vendor-inline-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
}

.prg-affiliate-btn .prg-vendor-logo-inline {
  height: 24px;
  width: auto;
  max-width: 90px;
  object-fit: contain;
  display: block;
}

.prg-modal-vendor-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #edf0f7;
  display: none;
  flex-direction: column;
  gap: 18px;
}

.prg-modal-vendor-section h4 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #1f2937;
}

.prg-modal-vendor-single {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border: 1px solid #e4ecfb;
  background: #f8fbff;
  border-radius: 12px;
  flex-wrap: wrap;
}

.prg-modal-vendor-comparison {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.prg-modal-vendor-comparison h4 {
  margin-bottom: 2px;
}

.prg-vendor-option,
.prg-modal-vendor-single {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.prg-vendor-option {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 20px;
  border: 1px solid #e7ecf5;
  background: #ffffff;
  border-radius: 12px;
}

.prg-vendor-option:hover,
.prg-modal-vendor-single:hover {
  border-color: #1e63ff;
  box-shadow: 0 6px 18px rgba(30, 99, 255, 0.08);
  transform: translateY(-1px);
}

.prg-vendor-option.prg-best-price {
  border-color: #1e63ff;
  background: #f3f7ff;
}

.prg-vendor-logo,
.prg-vendor-logo-inline {
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  padding: 6px 10px;
}

.prg-vendor-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.prg-vendor-logo-placeholder {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background: #e0e7ff;
  color: #4338ca;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
}

.prg-vendor-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.prg-vendor-name {
  font-weight: 600;
  color: #111827;
  font-size: 0.95rem;
}

.prg-vendor-price {
  font-size: 0.9rem;
  color: #047857;
  font-weight: 600;
}

.prg-vendor-price-hidden {
  font-size: 0.85rem;
  color: #4b5563;
  font-style: italic;
}

.prg-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #e8f5ff;
  color: #1e63ff;
}

.prg-badge-best {
  background: #d9f6e5;
  color: #047857;
}

.prg-modal-vendor-comparison .prg-btn {
  margin-left: auto;
}

@media (max-width: 640px) {
  .prg-modal-vendor-single,
  .prg-vendor-option {
    flex-direction: column;
    align-items: center;
  }

  .prg-modal-vendor-comparison .prg-btn {
    width: 100%;
  }
}

.prg-modal-product-title {
  font-size: 1.4em;
  font-weight: 600;
  color: #333;
  line-height: 1.3;
  margin: 0;
}

.prg-modal-product-type,
.prg-modal-product-brand,
.prg-modal-product-vendor,
.prg-modal-product-price span {
  font-size: 0.9rem;
  color: #666;
  margin: 8px 0;
  padding: 0;
}

.prg-modal-product-type span,
.prg-modal-product-brand span,
.prg-modal-product-vendor span,
.prg-modal-product-price span,
.prg-modal-space span {
  font-weight: 600 !important;
  color: #666;
}

.prg-modal-product-price {
  font-size: 0.9rem;
  font-weight: 600;
  color: #28a745;
  margin: 8px 0;
}

.prg-modal-summary {
  margin: 0;
  color: #444;
  line-height: 1.6;
  font-size: 0.9rem;
}

.prg-modal-summary .product-review__wrapper h4 {
  font-size: 1.3rem !important;
  text-transform: none;
}

/* Additional modal detail styles for clean layout */
.prg-modal-space {
  font-size: 0.9rem;
  color: #666;
  margin: 8px 0;
  padding: 0;
}

.prg-modal-source {
  font-size: 0.9rem;
  color: #666;
  font-style: normal;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 8px 0;
  padding: 0;
  font-weight: 500;
}

.prg-modal-meta-item {
  padding: 0;
}

.prg-modal-source .prg-source-text {
  font-weight: 600;
  color: #666;
}

.prg-modal-source .prg-source-link {
  color: #1e63ff;
  text-decoration: none;
  font-weight: 500;
}

.prg-modal-source .prg-source-link:hover,
.prg-modal-source .prg-source-link:focus {
  text-decoration: underline;
}

.prg-modal-ranking {
  font-size: 0.9rem;
  color: #666;
  font-weight: 600;
  margin: 8px 0;
}

.prg-modal-sticky-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 16px;
}

.prg-modal-sticky-actions .prg-btn {
  width: 100%;
  justify-content: center;
  text-align: center;
}

.prg-modal-sticky-actions .prg-btn + .prg-btn {
  margin-left: 0;
}

.prg-modal-compare-slot {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.prg-modal-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.prg-modal-fact {
  background: #f1f3f5;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.85rem;
  color: #333;
}

.prg-modal-tags h5 {
  margin-bottom: 8px;
}

.prg-modal-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.prg-modal-info-section {
  margin: 0;
}

.prg-modal-info-section h5 {
  margin: 0 0 10px 0;
  font-size: 1.05em;
  font-weight: 600;
  color: #333;
}

@media (max-width: 992px) {
  .prg-modal-product-container,
  .prg-modal-product-container.has-gallery {
    grid-template-columns: 1fr !important;
  }

  .prg-modal-gallery-main {
    min-height: 220px;
  }

  .prg-modal-sticky-actions {
    position: static;
  }
}

.prg-modal-features-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.prg-modal-features-list li {
  background: #e8f4f8;
  color: #2c5282;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  border: none;
}

.prg-modal-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0;
}

.prg-modal-tag,
.prg-tag {
  background: #f0f2f5;
  color: #495057;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.prg-modal-source .prg-source-link {
  color: #007cba;
  text-decoration: none;
}

.prg-modal-source .prg-source-link:hover {
  text-decoration: underline;
}

/* Modal actions matching card button styles */
.prg-modal-actions {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #eee;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.prg-modal-actions .prg-affiliate-btn {
  background: linear-gradient(135deg, #bf0909 0%, #f31111 100%) !important;
  color: white;
  padding: 12px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  border: none;
  transition: transform 0.2s ease;
}

.prg-modal-actions .prg-affiliate-btn:hover {
  transform: translateY(-1px);
  color: white;
}

/* @todo: Add rating/review information display when data becomes available */
/* @todo: Add product description display when data becomes available */

/* Responsive modal adjustments */
@media (max-width: 768px) {
  .prg-modal-content-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .prg-modal-product-image {
    height: 180px;
  }

  .prg-modal-content {
    width: 95%;
    margin: 10px;
    max-height: 95vh;
  }

  .prg-modal-actions {
    flex-direction: column;
  }

  .prg-modal-actions .prg-affiliate-btn {
    width: 100%;
    text-align: center;
  }

  /* Stack modal gallery and content vertically on mobile */
  .prg-modal-product-container.has-gallery {
    grid-template-columns: 1fr !important;
    gap: 20px;
  }

  .prg-modal-gallery-column {
    width: 100%;
  }

  .prg-modal-gallery-main {
    min-height: 250px;
    max-height: 300px;
  }

  .prg-modal-product-info {
    width: 100%;
  }

  /* Ensure sticky actions don't stick on mobile */
  .prg-modal-sticky-actions {
    position: static;
    margin-top: 16px;
  }
}

/* Lazy Loading Styles */
.prg-lazy-image {
  opacity: 0;
  transition: opacity 0.3s ease;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.prg-lazy-image.prg-loaded {
  opacity: 1;
  background: none;
  animation: none;
}

.prg-lazy-image.prg-error {
  opacity: 0.5;
  background: #f5f5f5;
  animation: none;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Product Image Optimization */
.prg-product-image {
  position: relative;
  overflow: hidden;
}

.prg-product-image img {
  width: 100%;
  height: auto;
  transition: transform 0.3s ease;
}

/* Skeleton loading for products */
.prg-product-card.loading {
  opacity: 0.7;
  pointer-events: none;
}

.prg-product-card.loading .prg-product-image {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  height: 200px;
}

/* Infinite scroll trigger */
#prg-scroll-trigger {
  height: 1px;
  background: transparent;
}

/* Performance optimizations */
.prg-product-grid {
  contain: layout style;
}

.prg-product-card {
  will-change: transform;
  contain: layout style;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .prg-lazy-image,
  .prg-product-image img {
    transition: none;
  }

  .prg-lazy-image,
  .prg-product-card.loading .prg-product-image {
    animation: none;
    background: #f0f0f0;
  }
}

/* High performance mode - simplify animations on large datasets */
.prg-performance-mode .prg-product-card {
  transition: none;
}

.prg-performance-mode .prg-lazy-image {
  animation-duration: 0.5s;
}
