.shopify-panel {
  position: relative;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--ink, #241f1c) 16%, transparent);
  background:
    radial-gradient(circle at 100% 0%, rgba(195, 157, 119, 0.14), transparent 32rem),
    linear-gradient(145deg, #fffdf9, #f7f1e9);
}

.shopify-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #312b27;
}

.shopify-heading-actions,
.shopify-actions,
.shopify-result__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.shopify-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(36, 31, 28, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: #61564f;
  font-size: 0.8rem;
  font-weight: 700;
}

.shopify-status::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #a59a92;
}

.shopify-status[data-state="ready"]::before,
.shopify-status[data-state="connected"]::before {
  background: #2f7a4a;
  box-shadow: 0 0 0 4px rgba(47, 122, 74, 0.1);
}

.shopify-status[data-state="not_configured"]::before,
.shopify-status[data-state="error"]::before {
  background: #a4573c;
  box-shadow: 0 0 0 4px rgba(164, 87, 60, 0.1);
}

.shopify-layout {
  display: grid;
  grid-template-columns: minmax(14rem, 0.82fr) minmax(0, 1.35fr);
  gap: 1rem;
  margin-top: 1rem;
}

.shopify-control,
.shopify-preview,
.shopify-result {
  border: 1px solid rgba(36, 31, 28, 0.12);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 28px rgba(57, 45, 36, 0.05);
}

.shopify-control {
  display: grid;
  align-content: start;
  gap: 0.9rem;
  padding: 1rem;
}

.shopify-control label {
  display: grid;
  gap: 0.45rem;
}

.shopify-control label > span {
  font-size: 0.82rem;
  font-weight: 750;
  color: #514842;
}

.shopify-control select {
  width: 100%;
}

.shopify-preview,
.shopify-result {
  padding: 1rem;
}

.shopify-preview__header,
.shopify-result__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.shopify-preview__header h4,
.shopify-result__header h4 {
  margin: 0.15rem 0 0;
}

.shopify-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.shopify-preview-card {
  min-width: 0;
  padding: 0.75rem;
  border-radius: 0.8rem;
  background: #f7f3ed;
}

.shopify-preview-card strong,
.shopify-preview-card span {
  display: block;
}

.shopify-preview-card strong {
  overflow-wrap: anywhere;
  font-size: 0.95rem;
}

.shopify-preview-card span {
  margin-top: 0.2rem;
  color: #776c65;
  font-size: 0.75rem;
}

.shopify-safety {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.shopify-safety span {
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(47, 122, 74, 0.15);
  border-radius: 0.8rem;
  background: rgba(47, 122, 74, 0.055);
  color: #315e40;
  font-size: 0.78rem;
  font-weight: 700;
}

.shopify-message {
  min-height: 1.35rem;
  margin: 0;
  color: #7d3f2f;
  font-size: 0.84rem;
}

.shopify-result {
  margin-top: 1rem;
  border-color: rgba(47, 122, 74, 0.22);
  background: rgba(244, 250, 246, 0.92);
}

.shopify-result code {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: #3d5345;
  font-size: 0.75rem;
}

.shopify-result a {
  text-decoration: none;
}

@media (max-width: 880px) {
  .shopify-layout {
    grid-template-columns: 1fr;
  }

  .shopify-preview-grid,
  .shopify-safety {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .shopify-heading-actions,
  .shopify-actions,
  .shopify-result__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .shopify-heading-actions .button,
  .shopify-actions .button,
  .shopify-result__actions .button {
    width: 100%;
  }

  .shopify-preview-grid,
  .shopify-safety {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shopify-panel *,
  .shopify-panel *::before,
  .shopify-panel *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
