/* Combup: ürün sayfası paylaşımı (share.js). seo.css tokenlarını kullanır. */

.price-row:has(.share) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  min-height: 38px; /* düğme betik yüklenince görünür; satır yüksekliği zıplamasın */
}
.share { position: relative; }

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 15px 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: 600 14px/1 var(--font-text);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.share-btn svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.share-btn:hover { background: var(--surface-2); }
.share-btn[aria-expanded="true"] { border-color: var(--ink-2); background: var(--surface-2); }
.share-btn:focus-visible,
.share-panel :focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.share-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: min(336px, calc(100vw - 32px));
  padding: 12px 14px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.share-panel[hidden], .share-backdrop[hidden] { display: none; }

.share-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.share-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.share-close {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-right: -6px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.share-close:hover { background: var(--surface-2); color: var(--ink); }
.share-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.share-link { display: flex; gap: 8px; }
.share-link input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font: 500 14px/1 var(--font-text);
}
.share-copy {
  min-width: 96px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--ink);
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  font: 600 14px/1 var(--font-text);
  white-space: nowrap;
  cursor: pointer;
}
.share-copy:hover { opacity: 0.9; }
.share-copy.done { background: var(--surface); color: var(--ink); opacity: 1; }

.share-targets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}
.share-targets li:last-child:nth-child(odd) { grid-column: 1 / -1; }
.share-targets a {
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 550;
  text-decoration: none;
}
.share-targets a:hover { background: var(--surface-2); }

.share-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.share-backdrop { display: none; }

@media (max-width: 560px) {
  .share-backdrop { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0.32); }
  .share-panel {
    position: fixed;
    inset: auto 0 0;
    z-index: 41;
    width: auto;
    padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
    border-width: 1px 0 0;
    border-radius: 16px 16px 0 0;
  }
  .share-link input, .share-copy, .share-targets a { height: 44px; }
}

@media (prefers-reduced-motion: no-preference) {
  .share-panel { animation: share-in 0.16s ease-out; }
  @keyframes share-in { from { opacity: 0; transform: translateY(-4px); } }
}
@media (prefers-reduced-motion: no-preference) and (max-width: 560px) {
  .share-panel { animation: share-up 0.2s ease-out; }
  @keyframes share-up { from { transform: translateY(24px); opacity: 0; } }
}
