/*
 * Product share button + dialog, YouTube style (inc/product-share-button.php).
 * Dialog: centred card on computers, bottom sheet on phones. Colours from the design tokens.
 */
.product-share {
  margin-top: var(--space-3);
}

.product-share__open {
  display: inline-flex;
  gap: var(--space-2);
  align-items: center;
  min-height: var(--control-height);
  padding: 0 var(--space-4);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
}

.product-share__open:hover {
  background: var(--color-primary-soft);
}

.product-share__dialog {
  box-sizing: border-box;
  width: min(520px, 92vw);
  padding: var(--space-5);
  border: 0;
  border-radius: var(--radius-lg, 16px);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 16px 48px rgb(40 30 24 / 0.25);
}

.product-share__dialog::backdrop {
  background: rgb(40 30 24 / 0.45);
}

.product-share__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.product-share__title {
  margin: 0;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
}

.product-share__close {
  width: var(--control-height);
  height: var(--control-height);
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 1.1rem;
  cursor: pointer;
}

.product-share__close:hover {
  background: var(--color-primary-soft);
}

.product-share__targets {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin: var(--space-4) 0;
  padding: 0;
  list-style: none;
}

.product-share__target {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  align-items: center;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-text);
  font: inherit;
  font-size: var(--font-size-sm);
  text-decoration: none;
  cursor: pointer;
}

.product-share__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-surface-muted);
  color: var(--color-text);
  font-size: 1.4rem;
  transition: transform var(--transition-fast);
}

.product-share__target:hover .product-share__icon {
  transform: scale(1.06);
}

.product-share__target--facebook .product-share__icon {
  background: #1877f2;
  color: #fff;
}

.product-share__target--x .product-share__icon {
  background: #111;
  color: #fff;
}

.product-share__copy {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 10px);
  background: var(--color-bg);
}

.product-share__copy input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--color-text);
  font: inherit;
}

.product-share__copy-button {
  flex: none;
  border-radius: var(--radius-pill);
}

@media (max-width: 600px) {
  .product-share__dialog {
    inset: auto 0 0 0;
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: 16px 16px 0 0;
  }
}
