/**
 * VoxQ Core - Global Styles
 * Lightweight base styles (~2KB). No theme-specific styles.
 */

/* --- Swatches --- */
.vxq-swatches-wrap {
  margin-bottom: 1em;
}
.vxq-swatch-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 0.5em;
}
.vxq-swatch-group__label {
  font-weight: 600;
  margin-right: 4px;
}
.vxq-swatch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 2px 8px;
  border: 2px solid #ddd;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-size: 0.85em;
}
.vxq-swatch:hover {
  border-color: #999;
}
.vxq-swatch--active {
  border-color: #333;
  box-shadow: 0 0 0 1px #333;
}
.vxq-swatch--disabled {
  opacity: 0.35;
  cursor: not-allowed;
  text-decoration: line-through;
}
.vxq-swatch--color {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  padding: 0;
  background-size: cover;
  position: relative;
}
.vxq-swatch--color .vxq-swatch__label {
  font-size: 0.6em;
}

/* --- Product Card --- */
.vxq-product-card {
  position: relative;
  border: 1px solid #eee;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.2s;
}
.vxq-product-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.vxq-product-card__image-link {
  display: block;
  position: relative;
  overflow: hidden;
}
.vxq-product-card__image-link img {
  width: 100%;
  height: auto;
  display: block;
}
.vxq-product-card__body {
  padding: 0.75em;
}
.vxq-product-card__title {
  font-size: 1em;
  margin: 0 0 0.25em;
}
.vxq-product-card__title a {
  text-decoration: none;
  color: inherit;
}
.vxq-product-card__price {
  font-weight: 600;
  margin-bottom: 0.25em;
}
.vxq-product-card__rating {
  margin-bottom: 0.5em;
}
.vxq-product-card__actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.vxq-product-card--out-of-stock {
  opacity: 0.7;
}

/* --- Badges --- */
.vxq-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  padding: 2px 8px;
  font-size: 0.75em;
  font-weight: 600;
  border-radius: 3px;
  color: #fff;
  background: #e74c3c;
}
.vxq-badge--sale {
  background: #e74c3c;
}
.vxq-badge--out-of-stock {
  background: #888;
  top: auto;
  bottom: 8px;
}

/* --- Search --- */
.vxq-search {
  position: relative;
}
.vxq-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #fff;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  max-height: 400px;
  overflow-y: auto;
}
.vxq-search-results--hidden {
  display: none;
}
.vxq-search-results__section {
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}
.vxq-search-results__section:last-child {
  border-bottom: none;
}
.vxq-search-results__heading {
  margin: 0;
  padding: 4px 12px;
  font-size: 0.8em;
  text-transform: uppercase;
  color: #888;
  letter-spacing: 0.5px;
}
.vxq-search-results__item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}
.vxq-search-results__item:hover,
.vxq-search-results__item--active {
  background: #f5f5f5;
}
.vxq-search-results__image {
  width: 40px;
  height: 40px;
  margin-right: 10px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 3px;
}
.vxq-search-results__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.vxq-search-results__info {
  flex: 1;
  min-width: 0;
}
.vxq-search-results__title {
  display: block;
  font-size: 0.9em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vxq-search-results__price {
  display: block;
  font-size: 0.8em;
  color: #666;
}
.vxq-search-results__empty {
  padding: 16px 12px;
  text-align: center;
  color: #888;
  font-size: 0.9em;
}
.vxq-search-results__footer {
  padding: 8px 12px;
  border-top: 1px solid #eee;
}
.vxq-search-results__view-all {
  display: block;
  text-align: center;
  text-decoration: none;
  color: #333;
  font-weight: 600;
  font-size: 0.9em;
}
.vxq-search-loading--hidden {
  display: none;
}

/* --- Modal --- */
.vxq-modal--hidden {
  display: none !important;
}
.vxq-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vxq-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
}
.vxq-modal__container {
  position: relative;
  background: #fff;
  border-radius: 6px;
  max-width: 900px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}
.vxq-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  line-height: 1;
}
.vxq-modal__close:hover {
  color: #000;
}
.vxq-modal__loading {
  text-align: center;
  padding: 40px;
}
.vxq-modal--loading .vxq-modal__container {
  min-height: 200px;
}
body.vxq-modal-open {
  overflow: hidden;
}

/* --- Quick View --- */
.vxq-quick-view {
  display: flex;
  gap: 24px;
}
.vxq-quick-view__gallery {
  flex: 1;
  min-width: 0;
}
.vxq-quick-view__gallery img {
  width: 100%;
  height: auto;
  border-radius: 4px;
}
.vxq-quick-view__info {
  flex: 1;
  min-width: 0;
}
.vxq-quick-view__title {
  margin: 0 0 0.5em;
}
.vxq-quick-view__price {
  font-size: 1.25em;
  font-weight: 600;
  margin-bottom: 0.5em;
}
.vxq-quick-view__rating {
  margin-bottom: 0.5em;
}
.vxq-quick-view__rating-count {
  font-size: 0.85em;
  color: #888;
}
.vxq-quick-view__description {
  margin-bottom: 1em;
}
.vxq-quick-view__add-to-cart {
  margin-bottom: 1em;
}
.vxq-quick-view__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* --- Active Filters --- */
.vxq-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 1em;
}
.vxq-active-filter {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: #f0f0f0;
  border-radius: 3px;
  font-size: 0.85em;
}
.vxq-active-filter__remove {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  color: #666;
  padding: 0 2px;
  line-height: 1;
}
.vxq-active-filter__remove:hover {
  color: #e74c3c;
}

/* --- Grid Loading --- */
.vxq-grid-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}
.vxq-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.5);
  z-index: 10;
}

/* --- Spinner --- */
.vxq-spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid #ddd;
  border-top-color: #333;
  border-radius: 50%;
  animation: vxq-spin 0.6s linear infinite;
}
@keyframes vxq-spin {
  to { transform: rotate(360deg); }
}

/* --- Toast --- */
.vxq-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 99999;
  padding: 12px 20px;
  background: #333;
  color: #fff;
  border-radius: 4px;
  font-size: 0.9em;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}
.vxq-toast--visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Buttons --- */
.vxq-btn-wishlist,
.vxq-btn-compare,
.vxq-btn-quick-view {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid #ddd;
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  padding: 0;
}
.vxq-btn-wishlist:hover,
.vxq-btn-compare:hover,
.vxq-btn-quick-view:hover {
  background: #f5f5f5;
  border-color: #999;
}
.vxq-btn--loading {
  opacity: 0.5;
  pointer-events: none;
}
.vxq-btn-wishlist--active {
  border-color: #e74c3c;
  color: #e74c3c;
}
.vxq-icon-heart::before {
  content: "\2661";
  font-size: 16px;
}
.vxq-icon-heart--filled::before {
  content: "\2665";
}
.vxq-icon-compare::before {
  content: "\21C4";
  font-size: 14px;
}
.vxq-icon-eye::before {
  content: "\1F441";
  font-size: 14px;
}
