/* ==========================================================================
   COSPTY Share — product sharing UI
   Scoped under .cospty-sh-root so the theme is never affected.
   Mobile is a bottom sheet, desktop is a centred modal. Same markup.
   ========================================================================== */

.cospty-sh-root { --sh-brand: #7C3AED; }
.cospty-sh-root .mono { font-family: "SFMono-Regular", Menlo, Consolas, monospace; }

/* ==========================================================================
   1. Inline bar (the main placement on the product page)
   ========================================================================== */
.cospty-sh-bar {
  margin: 18px 0 6px;
  padding: 14px 16px 13px;
  border: 1px solid #e6e9ee;
  border-radius: 14px;
  background: linear-gradient(180deg, #fdfcff 0%, #ffffff 100%);
}
.cospty-sh-bar__head { margin-bottom: 11px; }
.cospty-sh-bar__label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #1b1f24;
  letter-spacing: -.005em;
}
.cospty-sh-bar__lead {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  color: #7a828c;
}
.cospty-sh-bar__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cospty-sh-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px 0 8px;
  border: 1px solid #e2e6ec;
  border-radius: 999px;
  background: #fff;
  color: #2b3038;
  font-family: inherit;
  font-size: 13px;
  font-weight: 650;
  line-height: 1;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  -webkit-tap-highlight-color: transparent;
}
.cospty-sh-chip:hover {
  transform: translateY(-1px);
  border-color: #d3d9e2;
  box-shadow: 0 3px 10px rgba(16, 24, 40, .08);
}
.cospty-sh-chip:active { transform: translateY(1px); box-shadow: none; }
.cospty-sh-chip:focus-visible { outline: 3px solid rgba(124, 58, 237, .4); outline-offset: 2px; }

.cospty-sh-chip__ico {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--c, #6b7280);
  background-image: var(--g, none);
  overflow: hidden;
}
.cospty-sh-chip__ico svg { width: 15px; height: 15px; display: block; }
.cospty-sh-chip__txt { white-space: nowrap; }

.cospty-sh-chip--more {
  padding-right: 16px;
  border-style: dashed;
  color: #5b6371;
}
.cospty-sh-chip--more .cospty-sh-chip__ico { background: #374151; }

/* ==========================================================================
   2. Floating button
   ========================================================================== */
.cospty-sh-fab {
  position: fixed;
  z-index: 1030;
  left: 16px;
  top: 50%;
  transform: translateY(-50%) scale(.9);
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: var(--sh-brand);
  background-image: linear-gradient(135deg, var(--sh-brand) 0%, #E11D48 130%);
  box-shadow: 0 6px 18px rgba(124, 58, 237, .34);
  opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
  -webkit-tap-highlight-color: transparent;
}
.cospty-sh-fab.is-on { display: flex; opacity: 1; transform: translateY(-50%) scale(1); }
.cospty-sh-fab:hover { transform: translateY(-50%) scale(1.07); }
.cospty-sh-fab:active { transform: translateY(-50%) scale(.97); }
.cospty-sh-fab__ico svg { width: 22px; height: 22px; display: block; }
.cospty-sh-root[data-side="right"] .cospty-sh-fab { left: auto; right: 16px; }

/* keep clear of the mobile tab bar */
.cospty-sh-root.has-appbar .cospty-sh-fab { top: auto; bottom: 84px; transform: none; }
.cospty-sh-root.has-appbar .cospty-sh-fab.is-on { transform: none; }
.cospty-sh-root.has-appbar .cospty-sh-fab:hover { transform: scale(1.07); }

/* ==========================================================================
   3. Sticky mobile bar
   ========================================================================== */
.cospty-sh-sticky {
  position: fixed;
  z-index: 1030;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 9px 14px calc(9px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(160%) blur(10px);
  border-top: 1px solid #e9ecf1;
  box-shadow: 0 -4px 18px rgba(16, 24, 40, .07);
}
.cospty-sh-sticky.is-on { display: flex; }
.cospty-sh-root.has-appbar .cospty-sh-sticky { bottom: 60px; padding-bottom: 9px; }

.cospty-sh-sticky__btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--c, #6b7280);
  background-image: var(--g, none);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(16, 24, 40, .16);
  transition: transform .12s ease;
  -webkit-tap-highlight-color: transparent;
}
.cospty-sh-sticky__btn:active { transform: scale(.94); }
.cospty-sh-sticky__btn--more { background: #374151; background-image: none; }
.cospty-sh-sticky__ico svg { width: 20px; height: 20px; display: block; }

/* ==========================================================================
   4. Sheet / modal
   ========================================================================== */
.cospty-sh-sheet {
  position: fixed;
  z-index: 1050;
  inset: 0;
  display: none;
}
.cospty-sh-sheet.is-open { display: block; }

.cospty-sh-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 17, 23, .52);
  opacity: 0;
  transition: opacity .2s ease;
}
.cospty-sh-sheet.is-visible .cospty-sh-sheet__backdrop { opacity: 1; }

.cospty-sh-sheet__panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 88vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 10px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -10px 40px rgba(16, 24, 40, .22);
  transform: translateY(100%);
  transition: transform .26s cubic-bezier(.22, .68, .36, 1);
}
.cospty-sh-sheet.is-visible .cospty-sh-sheet__panel { transform: translateY(0); }

.cospty-sh-sheet__grab {
  display: block;
  width: 42px;
  height: 4px;
  margin: 2px auto 12px;
  border-radius: 99px;
  background: #dfe3e8;
}

.cospty-sh-sheet__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.cospty-sh-sheet__title { font-size: 17px; font-weight: 750; color: #12151b; letter-spacing: -.01em; }
.cospty-sh-sheet__sub { margin-top: 3px; font-size: 12.5px; color: #7a828c; line-height: 1.5; }
.cospty-sh-sheet__close {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #f2f4f7;
  color: #5b6371;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.cospty-sh-sheet__close:hover { background: #e8ebf0; }

.cospty-sh-sheet__product {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 16px;
  border: 1px solid #eef1f5;
  border-radius: 12px;
  background: #fafbfd;
}
.cospty-sh-sheet__thumb {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border-radius: 9px;
  overflow: hidden;
  background: #eceff3;
}
.cospty-sh-sheet__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cospty-sh-sheet__meta { min-width: 0; }
.cospty-sh-sheet__name {
  font-size: 13.5px;
  font-weight: 650;
  color: #1b1f24;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cospty-sh-sheet__price { margin-top: 3px; font-size: 13px; font-weight: 750; color: var(--sh-brand); }

/* channel grid */
.cospty-sh-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px 4px;
}
.cospty-sh-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 9px 4px 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  transition: background .14s ease, transform .12s ease;
  -webkit-tap-highlight-color: transparent;
}
.cospty-sh-item:hover { background: #f6f7fa; }
.cospty-sh-item:active { transform: scale(.95); }
.cospty-sh-item__ico {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--c, #6b7280);
  background-image: var(--g, none);
  box-shadow: 0 3px 9px rgba(16, 24, 40, .16);
}
.cospty-sh-item__ico svg { width: 24px; height: 24px; display: block; }
.cospty-sh-item__txt {
  font-size: 11.5px;
  font-weight: 600;
  color: #4b5563;
  line-height: 1.2;
  text-align: center;
}

/* url row */
.cospty-sh-url {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 9px 9px 9px 13px;
  border: 1px solid #e6e9ee;
  border-radius: 11px;
  background: #f8f9fb;
}
.cospty-sh-url__text {
  flex: 1;
  min-width: 0;
  font-size: 11.5px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cospty-sh-url__copy {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: var(--sh-brand);
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.cospty-sh-url__copy:active { transform: scale(.97); }

/* toast */
.cospty-sh-toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%) translateY(8px);
  max-width: min(88vw, 460px);
  padding: 11px 16px;
  border-radius: 12px;
  background: #14161c;
  color: #f2f4f7;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  box-shadow: 0 10px 30px rgba(16, 24, 40, .3);
  opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}
.cospty-sh-toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* monochrome variant */
.cospty-sh-root[data-style="mono"] .cospty-sh-item__ico,
.cospty-sh-root[data-style="mono"] .cospty-sh-chip__ico,
.cospty-sh-root[data-style="mono"] .cospty-sh-sticky__btn {
  background: #fff;
  background-image: none;
  border: 1.5px solid #d8dde3;
  box-shadow: none;
}
.cospty-sh-root[data-style="mono"] .cospty-sh-item__ico svg path,
.cospty-sh-root[data-style="mono"] .cospty-sh-item__ico svg rect,
.cospty-sh-root[data-style="mono"] .cospty-sh-item__ico svg circle,
.cospty-sh-root[data-style="mono"] .cospty-sh-chip__ico svg path,
.cospty-sh-root[data-style="mono"] .cospty-sh-sticky__btn svg path { fill: #374151 !important; stroke: #374151; }
.cospty-sh-root[data-style="mono"] .cospty-sh-sticky__btn { background: #fff; background-image: none; }

/* ==========================================================================
   5. Small icon on listing cards
   ========================================================================== */
.cospty-sh-mini {
  position: absolute;
  z-index: 4;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(20, 22, 28, .72);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity .16s ease, transform .12s ease;
  backdrop-filter: blur(3px);
  -webkit-tap-highlight-color: transparent;
}
.cospty-sh-mini svg { width: 15px; height: 15px; display: block; }
.product-miniature:hover .cospty-sh-mini,
.cospty-sh-mini:focus-visible { opacity: 1; }
.cospty-sh-mini:active { transform: scale(.92); }
@media (hover: none) {
  .cospty-sh-mini { opacity: 1; }
}

/* ==========================================================================
   6. Responsive
   ========================================================================== */
@media (min-width: 768px) {
  .cospty-sh-grid { grid-template-columns: repeat(6, 1fr); }

  .cospty-sh-sheet__panel {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    width: min(520px, calc(100vw - 40px));
    border-radius: 18px;
    padding: 18px 22px 20px;
    transform: translate(-50%, -46%) scale(.97);
    opacity: 0;
    transition: transform .22s cubic-bezier(.22, .68, .36, 1), opacity .18s ease;
  }
  .cospty-sh-sheet.is-visible .cospty-sh-sheet__panel {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  .cospty-sh-sheet__grab { display: none; }
}

@media (max-width: 575px) {
  .cospty-sh-bar { padding: 13px 14px 12px; border-radius: 12px; }
  .cospty-sh-bar__row { gap: 7px; }
  .cospty-sh-chip { height: 38px; font-size: 12.5px; padding: 0 12px 0 7px; }
  .cospty-sh-chip__ico { flex-basis: 24px; width: 24px; height: 24px; }
  .cospty-sh-sheet__panel { padding-left: 16px; padding-right: 16px; }
  .cospty-sh-grid { gap: 4px 2px; }
  .cospty-sh-item__ico { width: 44px; height: 44px; }
}

/* Dark storefronts */
@media (prefers-color-scheme: dark) {
  .cospty-sh-bar { background: #14161c; border-color: #262b33; }
  .cospty-sh-bar__label { color: #f2f4f7; }
  .cospty-sh-bar__lead { color: #98a0b0; }
  .cospty-sh-chip { background: #1a1d24; border-color: #2b3038; color: #e4e7ec; }
  .cospty-sh-sheet__panel { background: #14161c; }
  .cospty-sh-sheet__title { color: #f2f4f7; }
  .cospty-sh-sheet__product { background: #1a1d24; border-color: #262b33; }
  .cospty-sh-sheet__name { color: #e4e7ec; }
  .cospty-sh-item:hover { background: #1a1d24; }
  .cospty-sh-item__txt { color: #aeb6c2; }
  .cospty-sh-url { background: #1a1d24; border-color: #262b33; }
  .cospty-sh-url__text { color: #98a0b0; }
  .cospty-sh-sheet__close { background: #22262e; color: #aeb6c2; }
}
