/* IT Services theme store + theme detail */

.theme-store-layout {
  display: grid;
  gap: 2.5rem;
  align-items: start;
}

.theme-store-sidebar {
  min-width: 0;
}

.theme-store-main {
  min-width: 0;
}

.theme-store-filters {
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  background: var(--card);
}

.theme-store-filters__summary {
  display: flex;
  list-style: none;
  cursor: pointer;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--foreground);
}

.theme-store-filters__summary::-webkit-details-marker {
  display: none;
}

.theme-store-filters__chevron {
  transition: transform 0.2s ease;
}

.theme-store-filters[open] .theme-store-filters__chevron {
  transform: rotate(180deg);
}

.theme-store-filters__body {
  border-top: 1px solid var(--border);
  padding: 0.25rem 1rem 1rem;
}

.theme-store-filter-group {
  border-bottom: 1px solid var(--border);
  padding: 1.35rem 0;
}

.theme-store-filter-group:first-child {
  padding-top: 0.75rem;
}

.theme-store-filter-label {
  margin: 0 0 1rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.theme-store-filter-options {
  display: grid;
  gap: 0.9rem;
}

.theme-store-filters__reset {
  padding-top: 1.35rem;
}

.theme-store-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.theme-store-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 640px) {
  .theme-store-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .theme-store-layout {
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 3.5rem;
  }

  .theme-store-sidebar {
    position: sticky;
    top: 7rem;
  }

  .theme-store-filters {
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .theme-store-filters__summary {
    pointer-events: none;
    cursor: default;
    padding: 0;
  }

  .theme-store-filters__chevron {
    display: none;
  }

  .theme-store-filters__body {
    border-top: 0;
    padding: 1.5rem 0 0;
  }
}

@media (min-width: 1280px) {
  .theme-store-layout {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .theme-store-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.theme-store-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  color: var(--muted-foreground);
  transition: color 0.2s ease;
}

.theme-store-option:hover {
  color: var(--foreground);
}

.theme-store-option:has(:checked) {
  color: var(--foreground);
}

.theme-store-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.theme-store-mark {
  position: relative;
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  border: 1px solid var(--border);
  background: transparent;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.theme-store-mark--radio {
  border-radius: 999px;
}

.theme-store-mark--check {
  border-radius: 0.2rem;
}

.theme-store-option:hover .theme-store-mark {
  border-color: var(--line);
}

.theme-store-option input:focus-visible + .theme-store-mark {
  box-shadow: 0 0 0 1px var(--background), 0 0 0 2px var(--ring);
}

.theme-store-option input:checked + .theme-store-mark--radio {
  border-color: var(--foreground);
  background: var(--foreground);
  box-shadow: inset 0 0 0 3px var(--background);
}

.theme-store-option input:checked + .theme-store-mark--check {
  border-color: var(--foreground);
  background: var(--foreground);
}

.theme-store-mark--check::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background-color: var(--background);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 0.7rem no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 0.7rem no-repeat;
  transition: opacity 0.15s ease;
}

.theme-store-option input:checked + .theme-store-mark--check::after {
  opacity: 1;
}

.theme-store-card {
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.theme-store-card:hover {
  border-color: color-mix(in oklab, var(--foreground) 35%, var(--border));
  transform: translateY(-2px);
}

.theme-faq-item [data-faq-icon] {
  display: inline-flex;
  width: 1.25rem;
  height: 1.25rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.95rem;
  line-height: 1;
}

.theme-faq-item [data-faq-toggle][aria-expanded="true"] [data-faq-icon] {
  transform: rotate(45deg);
  border-color: var(--foreground);
  color: var(--foreground);
}

/* Locked → live preview loader (fade overlay, no spinner) */
.theme-preview-loader {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.55s ease;
}

.theme-preview-loader.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.theme-preview-loader.is-leaving {
  opacity: 0;
  pointer-events: none;
}

.theme-preview-loader__veil {
  position: absolute;
  inset: 0;
  background: color-mix(in oklab, var(--background) 88%, transparent);
  backdrop-filter: blur(2px);
}

.theme-preview-loader__veil::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 30%,
    color-mix(in oklab, var(--foreground) 8%, transparent) 50%,
    transparent 70%
  );
  background-size: 220% 100%;
  animation: theme-preview-sheen 1.6s ease-in-out infinite;
}

.theme-preview-loader__label {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--foreground);
  opacity: 0.85;
}

@keyframes theme-preview-sheen {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.theme-preview-stage {
  display: flex;
  align-items: stretch;
  justify-content: center;
  min-height: 420px;
  padding: 0;
  background: color-mix(in oklab, var(--secondary) 30%, transparent);
}

.theme-preview-frame {
  position: relative;
  width: 100%;
  height: 420px;
  overflow: hidden;
  background: var(--card);
  transition: max-width 0.3s ease;
}

.theme-preview-iframe {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.theme-preview-static {
  position: absolute;
  inset: 0;
  z-index: 5;
}

.theme-preview-poster {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.theme-preview-fallback-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(160deg, var(--secondary), var(--card), var(--background));
}

.theme-preview-unavailable {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.theme-preview-lock {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    180deg,
    color-mix(in oklab, var(--background) 8%, transparent) 0%,
    color-mix(in oklab, var(--background) 45%, transparent) 100%
  );
  transition: opacity 0.35s ease;
}

.theme-preview-embed-hint {
  position: absolute;
  inset-inline: 0;
  bottom: 1rem;
  z-index: 30;
  margin: 0 auto;
  max-width: 28rem;
  pointer-events: none;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  background: color-mix(in oklab, var(--card) 95%, transparent);
  padding: 0.75rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  backdrop-filter: blur(6px);
}

@media (min-width: 640px) {
  .theme-preview-stage {
    min-height: 520px;
    padding: 1rem;
  }

  .theme-preview-frame {
    height: 520px;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
  }
}

@media (min-width: 1024px) {
  .theme-preview-stage {
    min-height: 640px;
  }

  .theme-preview-frame {
    height: 640px;
  }
}

/* Locked: can see preview, cannot interact/scroll */
[data-theme-preview-mini][data-preview-locked="true"] .theme-preview-iframe {
  pointer-events: none;
}

[data-theme-preview-mini][data-preview-locked="true"] .theme-preview-poster {
  opacity: 1;
  transition: opacity 0.45s ease;
}

/* Prefer showing live iframe once ready, still locked + View demo on top */
[data-theme-preview-mini].is-preview-ready[data-preview-locked="true"] .theme-preview-poster {
  opacity: 0;
  pointer-events: none;
}

[data-theme-preview-mini].is-preview-ready[data-preview-locked="true"] .theme-preview-static {
  pointer-events: none;
}

/* Unlocked after View demo */
[data-theme-preview-mini][data-preview-locked="false"] .theme-preview-lock {
  opacity: 0;
  pointer-events: none;
}

[data-theme-preview-mini][data-preview-locked="false"] .theme-preview-static {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

[data-theme-preview-mini][data-preview-locked="false"] .theme-preview-iframe {
  pointer-events: auto;
}
