/* =================================================================
   Stoke Reviews — Design System (Yotpo-style)
   All colours driven by CSS variables; override in admin settings.
================================================================= */

:root {
  --stk-accent:        #0f5ad6;
  --stk-accent-hover:  #0c47a8;
  --stk-accent-fg:     #ffffff;
  --stk-star:          #ffb100;
  --stk-star-empty:    #dcdfe4;
  --stk-verified:      #16a34a;
  --stk-verified-bg:   #f0fdf4;
  --stk-text:          #1f2733;
  --stk-text-muted:    #6b7280;
  --stk-border:        #e5e7eb;
  --stk-bg:            #ffffff;
  --stk-bg-subtle:     #f7f8fa;
  --stk-radius:        10px;
  --stk-radius-sm:     6px;
  --stk-font:          inherit;
  --stk-shadow:        0 1px 4px rgba(16,24,40,.07);
  --stk-shadow-hover:  0 4px 16px rgba(16,24,40,.10);
  --stk-transition:    150ms ease;
}

/* -----------------------------------------------------------------
   Theme interference reset — undo whatever the active theme does to
   bare <button> / <input> elements inside our widget & modal.
   Our component rules (prefixed .stk-widget) win via specificity.
----------------------------------------------------------------- */
.stk-widget button,
.stk-modal .stk-modal__box button {
  background:       transparent;
  color:            var(--stk-text);
  border-radius:    0;
  border:           none;
  box-shadow:       none;
  text-transform:   none;
  letter-spacing:   normal;
  font-family:      var(--stk-font);
  font-weight:      400;
  -webkit-appearance: none;
  appearance:       none;
  padding:          0;
  margin:           0;
}

/* -----------------------------------------------------------------
   Widget wrapper
----------------------------------------------------------------- */
.stk-widget {
  font-family: var(--stk-font);
  color: var(--stk-text);
  margin: 32px 0;
}
@media (min-width: 641px) {
  .stk-widget { padding: 0 95px; }
}

/* -----------------------------------------------------------------
   Summary bar
----------------------------------------------------------------- */
.stk-summary {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 28px;
  align-items: center;
  margin-bottom: 24px;
}
@media (max-width: 640px) {
  .stk-summary { grid-template-columns: 1fr; gap: 16px; }
}

.stk-summary__score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 90px;
}
.stk-summary__number {
  font-size: 56px;
  font-weight: 800;
  line-height: 1;
  color: var(--stk-text);
  letter-spacing: -2px;
}
.stk-summary__count {
  font-size: 12px;
  color: var(--stk-text-muted);
  text-align: center;
}
.stk-summary__count strong { color: var(--stk-text); }

/* Distribution bars */
.stk-summary__bars { display: flex; flex-direction: column; gap: 5px; }
.stk-distbar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.stk-distbar__label {
  width: 28px;
  text-align: right;
  color: var(--stk-text-muted);
  flex-shrink: 0;
}
.stk-distbar__track {
  flex: 1;
  height: 10px;
  background: var(--stk-border);
  border-radius: 99px;
  overflow: hidden;
  min-width: 80px;
}
.stk-distbar__fill {
  display: block;
  height: 100%;
  background: var(--stk-star);
  border-radius: 99px;
  transition: width 400ms ease;
}
.stk-distbar__count {
  width: 20px;
  font-size: 12px;
  color: var(--stk-text-muted);
  flex-shrink: 0;
}

.stk-summary__cta { flex-shrink: 0; }

/* -----------------------------------------------------------------
   Stars
----------------------------------------------------------------- */
.stk-stars { display: inline-flex; gap: 2px; }
.stk-star { font-size: 17px; line-height: 1; }
.stk-star--filled  { color: var(--stk-star); }
.stk-star--empty   { color: var(--stk-star-empty); }

/* -----------------------------------------------------------------
   Buttons
----------------------------------------------------------------- */
.stk-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: var(--stk-radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background var(--stk-transition), opacity var(--stk-transition);
  text-decoration: none;
}
.stk-btn--primary {
  background: var(--stk-accent);
  color: var(--stk-accent-fg) !important;
}
.stk-btn--primary:hover {
  background: var(--stk-accent-hover);
  color: var(--stk-accent-fg) !important;
}
.stk-widget .stk-btn--write-review,
.stk-btn--write-review {
  background:    transparent !important;
  color:         #404040 !important;
  border:        2px solid #404040 !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size:     12px;
  padding:       12px 28px;
}
.stk-widget .stk-btn--write-review:hover,
.stk-btn--write-review:hover {
  background: rgba(64,64,64,.07) !important;
  color:      #404040 !important;
}
.stk-btn--outline {
  background: transparent;
  color: var(--stk-accent) !important;
  border: 1.5px solid var(--stk-accent);
}
.stk-btn--outline:hover { background: var(--stk-bg-subtle); }
.stk-btn:disabled { opacity: .6; cursor: not-allowed; }

/* -----------------------------------------------------------------
   Filters / sort bar
----------------------------------------------------------------- */
.stk-filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.stk-filters__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.stk-widget .stk-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 99px;
  border: 1.5px solid var(--stk-border);
  background: var(--stk-bg);
  font-size: 13px;
  cursor: pointer;
  color: var(--stk-text);
  transition: all var(--stk-transition);
}
.stk-widget .stk-pill:hover,
.stk-widget .stk-pill--active  { background: var(--stk-accent); border-color: var(--stk-accent); color: #fff; }
.stk-pill__count   { font-size: 11px; opacity: .85; }

.stk-filters__right { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.stk-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.stk-search-icon { position: absolute; left: 10px; pointer-events: none; }
.stk-widget .stk-search {
  padding: 7px 12px 7px 32px;
  border: 1.5px solid var(--stk-border);
  border-radius: var(--stk-radius-sm);
  font-size: 13px;
  width: 180px;
  color: var(--stk-text);
  background: var(--stk-bg);
  transition: border-color var(--stk-transition);
}
.stk-widget .stk-search:focus { border-color: var(--stk-accent); outline: none; }
.stk-widget .stk-sort {
  padding: 7px 10px;
  border: 1.5px solid var(--stk-border);
  border-radius: var(--stk-radius-sm);
  font-size: 13px;
  color: var(--stk-text);
  background: var(--stk-bg);
  cursor: pointer;
}

/* -----------------------------------------------------------------
   Review cards
----------------------------------------------------------------- */
.stk-card {
  padding: 22px 4px;
  border-bottom: 1px solid var(--stk-border);
}
.stk-card:last-of-type { border-bottom: none; }

.stk-card__header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.stk-card__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.stk-card__meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.stk-card__name { font-weight: 600; font-size: 14px; }
.stk-card__verified {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--stk-verified);
  font-weight: 600;
  background: var(--stk-verified-bg);
  padding: 2px 7px;
  border-radius: 99px;
  width: fit-content;
}
.stk-card__reviewed-for {
  font-size: 11px;
  color: var(--stk-text-muted);
  width: fit-content;
}
.stk-card__rating-date {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.stk-card__date { font-size: 12px; color: var(--stk-text-muted); }

.stk-card__body { margin-bottom: 12px; }
.stk-card__title {
  font-weight: 700;
  font-size: 15px;
  margin: 0 0 6px;
  color: var(--stk-text);
  line-height: 1.3;
}
.stk-card__content {
  font-size: 14px;
  line-height: 1.7;
  color: var(--stk-text);
  margin: 0;
}

/* Media */
.stk-card__media { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.stk-card__media-thumb img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--stk-radius-sm);
  border: 1px solid var(--stk-border);
  cursor: zoom-in;
  transition: opacity var(--stk-transition);
}
.stk-card__media-thumb:hover img { opacity: .85; }

/* Footer / helpful */
.stk-card__footer {
  display: flex;
  align-items: center;
  gap: 10px;
}
.stk-card__helpful-label { font-size: 12px; color: var(--stk-text-muted); }
.stk-widget .stk-helpful-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  font-size: 13px;
  cursor: pointer;
  color: var(--stk-text-muted);
  padding: 2px 6px;
  border-radius: 4px;
  transition: color var(--stk-transition);
}
.stk-widget .stk-helpful-btn:hover        { color: var(--stk-text); }
.stk-widget .stk-helpful-btn--voted       { color: var(--stk-accent); pointer-events: none; }

/* -----------------------------------------------------------------
   Pagination
----------------------------------------------------------------- */
.stk-pagination { display: flex; gap: 6px; justify-content: center; padding: 20px 0 8px; }
.stk-widget .stk-pagination__btn {
  width: 36px; height: 36px;
  border-radius: 6px;
  border: 1.5px solid var(--stk-border);
  background: var(--stk-bg);
  font-size: 13px;
  cursor: pointer;
  color: var(--stk-text);
  transition: all var(--stk-transition);
}
.stk-widget .stk-pagination__btn:hover,
.stk-widget .stk-pagination__btn--active { background: var(--stk-accent); border-color: var(--stk-accent); color: #fff; }

/* Loading state */
#stk-reviews-list.stk-loading { opacity: .5; pointer-events: none; }

/* -----------------------------------------------------------------
   Write-review modal
----------------------------------------------------------------- */
.stk-modal {
  position: fixed; inset: 0; z-index: 99999;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.stk-modal[hidden] { display: none; }
.stk-modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(2px);
}
.stk-modal__box {
  position: relative;
  background: var(--stk-bg);
  border-radius: var(--stk-radius);
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  width: 100%; max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  z-index: 1;
}
.stk-modal__close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none;
  cursor: pointer; padding: 4px;
  border-radius: 4px;
  transition: background var(--stk-transition);
}
.stk-modal__close:hover { background: var(--stk-bg-subtle); }
.stk-modal__title { font-size: 20px; font-weight: 700; margin: 0 0 4px; }
.stk-modal__product { font-size: 13px; color: var(--stk-text-muted); margin: 0 0 24px; }

/* -----------------------------------------------------------------
   Form elements (shared: modal + submission page)
----------------------------------------------------------------- */
.stk-form { display: flex; flex-direction: column; gap: 18px; }
.stk-form__group { display: flex; flex-direction: column; gap: 5px; }
.stk-form__group--half { flex: 1 1 200px; }
.stk-form__row { display: flex; gap: 14px; flex-wrap: wrap; }

.stk-form__label { font-size: 13px; font-weight: 600; color: var(--stk-text); }
.stk-form__input,
.stk-form__textarea {
  padding: 9px 12px;
  border: 1.5px solid var(--stk-border);
  border-radius: var(--stk-radius-sm);
  font-size: 14px;
  color: var(--stk-text);
  background: var(--stk-bg);
  transition: border-color var(--stk-transition);
  font-family: var(--stk-font);
  width: 100%;
  box-sizing: border-box;
}
.stk-form__input:focus,
.stk-form__textarea:focus { border-color: var(--stk-accent); outline: none; box-shadow: 0 0 0 3px rgba(15,90,214,.12); }
.stk-form__textarea { resize: vertical; min-height: 100px; }
.stk-form__hint  { font-size: 11px; color: var(--stk-text-muted); margin: 0; }
.stk-form__charcount { font-size: 11px; color: var(--stk-text-muted); text-align: right; }
.stk-form__error { font-size: 12px; color: #dc2626; }
.stk-form__note  { font-size: 12px; color: var(--stk-text-muted); }
.stk-form__actions { display: flex; align-items: center; gap: 14px; }

/* Star picker */
.stk-star-picker { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
.stk-star-label {
  font-size: 36px;
  cursor: pointer;
  color: var(--stk-star-empty);
  line-height: 1;
  transition: color var(--stk-transition), transform var(--stk-transition);
}
.stk-star-input:checked ~ .stk-star-label,
.stk-star-picker:hover .stk-star-label:hover,
.stk-star-picker:hover .stk-star-label:hover ~ .stk-star-label {
  color: var(--stk-star);
}
.stk-star-label:hover { transform: scale(1.15); }
.stk-star-input:focus-visible + .stk-star-label { outline: 2px solid var(--stk-accent); outline-offset: 2px; border-radius: 2px; }

/* Upload zone */
.stk-upload-zone {
  border: 2px dashed var(--stk-border);
  border-radius: var(--stk-radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--stk-transition), background var(--stk-transition);
  position: relative;
}
.stk-upload-zone:hover,
.stk-upload-zone.stk-drag-over { border-color: var(--stk-accent); background: #f0f5ff; }
.stk-upload-zone p { font-size: 13px; color: var(--stk-text-muted); margin: 8px 0 0; }
.stk-upload-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.stk-upload-previews { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.stk-upload-preview {
  position: relative;
  width: 72px; height: 72px;
}
.stk-upload-preview img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--stk-border);
}
.stk-upload-preview__remove {
  position: absolute; top: -6px; right: -6px;
  width: 18px; height: 18px;
  background: #ef4444; color: #fff;
  border-radius: 50%; border: none;
  font-size: 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* -----------------------------------------------------------------
   Messages
----------------------------------------------------------------- */
.stk-message {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-radius: var(--stk-radius-sm);
  font-size: 14px;
}
.stk-message--success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.stk-message--error   { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.stk-message--large   { padding: 24px; gap: 16px; font-size: 15px; }
.stk-message--large h2 { margin: 0 0 6px; font-size: 20px; }
.stk-message--large p  { margin: 0 0 12px; }
.stk-message--large .stk-btn { margin-right: 10px; }

/* -----------------------------------------------------------------
   Submission page
----------------------------------------------------------------- */
.stk-submission-page { max-width: 600px; margin: 0 auto; padding: 40px 20px; }
.stk-submission-page__product {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 28px;
}
.stk-submission-page__img {
  width: 72px; height: 72px;
  object-fit: cover; border-radius: var(--stk-radius-sm);
  border: 1px solid var(--stk-border); flex-shrink: 0;
}
.stk-submission-page__label { font-size: 12px; color: var(--stk-text-muted); margin: 0 0 4px; }
.stk-submission-page__name  { font-size: 18px; font-weight: 700; margin: 0; }

/* -----------------------------------------------------------------
   Lightbox overlay
----------------------------------------------------------------- */
.stk-lightbox {
  position: fixed; inset: 0; z-index: 100000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.85);
}
.stk-lightbox img { max-width: 90vw; max-height: 90vh; border-radius: 4px; }
.stk-lightbox__close {
  position: absolute; top: 16px; right: 20px;
  background: none; border: none;
  font-size: 32px; color: #fff; cursor: pointer;
  line-height: 1;
}

/* -----------------------------------------------------------------
   Honeypot
----------------------------------------------------------------- */
.stk-honeypot { position: absolute; left: -9999px; opacity: 0; pointer-events: none; }

/* -----------------------------------------------------------------
   Screen-reader utilities
----------------------------------------------------------------- */
.screen-reader-text {
  position: absolute; left: -9999px; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap;
}
