/* Shopify AI Search App Styles */

/* Progress bar */
.progress-bar {
  width: 100%;
  height: 8px;
  background: #e1e3e5;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #008060;
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}

/* Error message */
.error-message {
  color: #d72c0d;
  background: #fef7f6;
  border: 1px solid #fed3cc;
  border-radius: 6px;
  padding: 12px;
  margin-top: 16px;
  display: none;
}

/* Responsive search grid */
@media (max-width: 768px) {
  #search-container {
    grid-template-columns: 1fr !important;
  }
  
  #search-results-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 480px) {
  #search-results-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Search State Indicator Animation */
@keyframes pulse {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

#search-state-indicator {
  animation: pulse 0.5s ease-in-out infinite;
}

.product-card * {
  box-sizing: border-box;
}

/* Product card styling for search results */
.product-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #e1e3e5;
  border-radius: 8px;
  padding: 16px;
  max-width: 280px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.product-card:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.product-title {
  font-weight: normal;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-block: 0;
}

.product-price {
  font-weight: 600;
}

.product-vendor {
  font-size: 12px;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.product-description {
  margin: 0;
  line-height: 1.43;
  font-size: 0.9em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

/* Loading and error states */
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.no-results-state {
  text-align: center;
  padding: 40px;
}

/* Search result items styles */
.search-result-item {
  background: #ffffff;
  border: 1px solid #e1e3e5;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.search-result-item:hover {
  border-color: #c4cdd5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-result-content {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.search-result-image {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  border-radius: 4px;
  overflow: hidden;
}

.search-result-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.search-result-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-result-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search-result-title {
  font-size: 16px;
  font-weight: 600;
  color: #202223;
  margin: 0;
  line-height: 1.4;
}

.search-result-description {
  font-size: 14px;
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-result-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search-result-price {
  color: #008060;
  font-weight: 600;
  font-size: 16px;
}

.product-link {
  color: #2c6ecb;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
}

.product-link:hover {
  text-decoration: underline;
  color: #1a5aa8;
}

/* Enhanced product card styles to match the new structure */
.product-card-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-image {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 4px;
  margin-bottom: 12px;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-image-placeholder {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f6f6f7;
  border-radius: 4px;
  margin-bottom: 12px;
}

.product-no-image {
  font-size: 14px;
}

.product-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-grow: 1;
}

.product-info div,
.product-info h3 {
  font-size: inherit;
  margin: 0; 
}

/* Configuration UI Styles */
/* Sticky configuration header */
.config-header-sticky {
  position: sticky;
  top: 15px;
  z-index: 10;
}

/* Layout options */
.layout-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.layout-option {
  cursor: pointer;
  position: relative;
}

.layout-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.layout-preview {
  border: 2px solid #c9cccf;
  border-radius: 8px;
  padding: 16px;
  transition: all 0.2s ease;
  text-align: center;
}

.layout-option input[type="radio"]:checked + .layout-preview {
  border-color: #008060;
  background: #f1f8f5;
}

.layout-option:hover .layout-preview {
  border-color: #008060;
}

.layout-visual {
  height: 80px;
  margin-bottom: 12px;
  border-radius: 4px;
  overflow: hidden;
}

/* Layout visual representations */
.layout-1-3,
.layout-1-2 {
  display: grid;
  gap: 4px;
}

.layout-1-3 {
  grid-template-columns: 1fr 2fr;
}

.layout-1-2 {
  grid-template-columns: 1fr 1fr;
}

.layout-left,
.layout-right {
  background: #c9cccf;
  border-radius: 2px;
}

.layout-full {
  display: flex;
}

.layout-full-width {
  width: 100%;
  background: #c9cccf;
  border-radius: 2px;
}

/* Stats boxes */
.stats-heading {
  font-size: 24px;
  font-weight: 600;
  color: #202223;
  margin-bottom: 4px;
}

.stats-label {
  font-size: 13px;
  color: #6d7175;
}

/* Tabbed navigation for configuration sections */
.tab-container {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.tab-button {
  background: #E3E3E3;
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  padding-block-start: .2rem;
  padding-block-end: .25rem;
  padding-inline: .75rem;
  border-radius: .5rem;
}

.tab-button:hover {
  background-color: #D4D4D4;
}

.tab-button.is-active {
  color: #fff;
  background: #303030;
}

.tab-button:focus-visible {
  outline: 2px solid #2c6ecb;
  outline-offset: 2px;
}

.tab-panel[hidden] {
  display: none;
}

/* Featured collections table */
.featured-collections-table-wrapper {
  overflow-x: auto;
}

.config-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.config-table thead th {
  text-align: left;
  color: #6d7175;
  font-weight: 600;
  padding: 8px 12px;
  border-bottom: 1px solid #e1e3e5;
}

.config-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid #f0f1f2;
  vertical-align: middle;
}

.config-table tbody tr:last-child td {
  border-bottom: none;
}

.featured-collections-column-actions {
  text-align: right;
  width: 140px;
}

.featured-collections-row.is-selected {
  background-color: #f8fafc;
}

.featured-collections-row.is-inactive {
  opacity: 0.6;
}

.featured-collections-row.is-missing .featured-collection-title {
  color: #b98900;
}

.featured-collection-title {
  display: block;
  font-weight: 600;
  color: #202223;
}

.featured-collection-meta {
  font-size: 12px;
  color: #6d7175;
  margin-top: 2px;
}

.featured-collections-row[data-missing="true"] .featured-collection-meta {
  color: #9c6f19;
}

.featured-collection-visible-cell {
  text-align: center;
  width: 90px;
}

.featured-collection-checkbox {
  width: 16px;
  height: 16px;
}

.featured-collection-checkbox[disabled] {
  cursor: not-allowed;
}

.featured-collections-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.featured-collections-order-button {
  border: none;
  background: none;
  color: #2c6ecb;
  cursor: pointer;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.featured-collections-order-button:hover:not([disabled]) {
  background-color: rgba(44, 110, 203, 0.1);
}

.featured-collections-order-button:focus-visible {
  outline: 2px solid #2c6ecb;
  outline-offset: 2px;
}

.featured-collections-order-button[disabled] {
  color: #9c9ea4;
  cursor: not-allowed;
}

/* Quick setup modal */
.quick-setup-modal {
  position: fixed;
  inset: 0;
  background: #f6f6f7;
  padding: 32px 16px;
  overflow-y: auto;
  z-index: 1100;
  display: none;
}

.quick-setup-modal[data-open="true"] {
  display: block;
}

.quick-setup-modal__surface {
  max-width: 420px;
  margin: 0 auto;
  outline: none;
}

.quick-setup-modal__body {
  min-height: 240px;
}

.quick-setup-modal__error {
  display: none;
  color: #d72c0d;
  background: #fef7f6;
  border: 1px solid #fed3cc;
  border-radius: 8px;
  padding: 12px 16px;
}

.quick-setup-modal__footer {
  width: 100%;
}

.quick-setup-choice {
  border: 1px solid #d2d5d8;
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.quick-setup-choice.is-selected {
  border-color: #005bd3;
  box-shadow: 0 0 0 2px rgba(0, 91, 211, 0.12);
  transform: translateY(-1px);
}

.quick-setup-choice:focus-visible {
  outline: 3px solid rgba(0, 91, 211, 0.35);
  outline-offset: 2px;
}

body.quick-setup-open {
  overflow: hidden;
}

/* top trial banner */
.top-trial-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.9rem;
  background-color: #fff;
  outline: 3px dashed #92d0ff;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

#trial-banner-heading {
  color: #2b92de;
}

.top-trial-banner.is-critical #trial-banner-heading {
  color: #d72c0d;
}

.trial-message {
  display: flex;
  align-items: center;
  gap: 12px;
}
.trial-message svg {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
}

#trial-banner-description {
  display: flex;
  flex-direction: column;
  gap: 2px;
}


/* upgrade modal */
.plan-features-list {
  margin: 0;
  padding-left: 20px;
  line-height: 1.8;
  font-family: inherit;
  list-style-type: disc;
}

@media (max-width: 768px) {
  .quick-setup-modal__surface {
    padding: 24px;
    border-radius: 12px;
  }
}

@media (max-width: 480px) {
  .quick-setup-modal {
    padding: 16px 12px;
  }

  .quick-setup-modal__surface {
    padding: 20px;
    border-radius: 10px;
  }
}