:root {
  --clw-button-bg: #7f54b3;
  --clw-button-text: #ffffff;
  --clw-button-radius: 8px;
  --clw-button-gap: 8px;
  --clw-single-button-spacing-top: 12px;
}

.clw-page {
  margin: 1.5rem 0;
}

.clw-page-header {
  margin-bottom: 1.25rem;
}

.clw-page-header h2,
.clw-page-header h3,
.clw-page-header p {
  margin-top: 0;
}

.clw-toolbar,
.clw-share-box,
.clw-empty-state {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1.25rem;
  background: #fff;
}

.clw-toolbar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.clw-toolbar-field {
  flex: 1 1 240px;
}

.clw-search-input,
.clw-category-filter,
.clw-share-url {
  width: 100%;
  min-height: 42px;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  box-sizing: border-box;
}

.clw-category-group {
  margin-bottom: 1.5rem;
}

.clw-category-heading {
  margin-bottom: 0.75rem;
}

.clw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.clw-card {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.clw-card-thumb {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #fafafa;
}

.clw-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.clw-card-content {
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1;
}

.clw-card-meta {
  font-size: 0.82rem;
  opacity: 0.78;
}

.clw-card-title {
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
}

.clw-card-actions,
.clw-share-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.clw-product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--clw-button-gap);
  align-items: stretch;
}

.clw-card-actions .button,
.clw-share-controls .button {
  flex: 1 1 auto;
}

.clw-context-single {
  width: 100%;
  flex-basis: 100%;
  clear: both;
  margin-top: var(--clw-single-button-spacing-top);
}

.clw-context-loop {
  margin-top: 0.85rem;
}

.clw-product-actions .button,
.clw-product-actions .clw-login-button {
  flex: 1 1 220px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
}

.clw-product-actions .clw-action-button,
.clw-product-actions .clw-login-button {
  background: var(--clw-button-bg) !important;
  color: var(--clw-button-text) !important;
  border: 1px solid var(--clw-button-bg) !important;
  border-radius: var(--clw-button-radius) !important;
  box-shadow: none;
  font-weight: 600;
}

.clw-product-actions .clw-action-button:hover,
.clw-product-actions .clw-action-button:focus,
.clw-product-actions .clw-login-button:hover,
.clw-product-actions .clw-login-button:focus {
  color: var(--clw-button-text) !important;
  filter: brightness(0.96);
}

.clw-product-actions .clw-action-button.is-active {
  box-shadow: inset 0 0 0 999px rgba(0, 0, 0, 0.08);
}

.clw-product-actions .clw-action-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.clw-button-content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  width: 100%;
}

.clw-button-text {
  line-height: 1.25;
}

.clw-button-icon {
  display: inline-flex;
  line-height: 0;
}

.clw-button-icon svg {
  width: 1em;
  height: 1em;
  fill: currentColor;
  display: block;
}

.clw-no-results {
  margin-top: 1rem;
  font-weight: 600;
}

.clw-share-box-header h3 {
  margin: 0 0 0.3rem;
}

.clw-share-status {
  margin: 0.75rem 0 0;
  font-size: 0.92rem;
}

.clw-empty-state {
  text-align: center;
}

.clw-notice-area {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 320px;
}

.clw-notice {
  color: #fff;
  padding: 0.8rem 0.95rem;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.16);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.clw-notice.is-hiding {
  opacity: 0;
  transform: translateY(8px);
}

.clw-notice-success {
  background: #1f7a1f;
}

.clw-notice-error {
  background: #b42318;
}

.clw-notice-info {
  background: #0f5ea8;
}

@media (max-width: 600px) {
  .clw-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .clw-card-actions .button,
  .clw-share-controls .button,
  .clw-product-actions .button,
  .clw-product-actions .clw-login-button {
    width: 100%;
    flex-basis: 100%;
  }
}
