/* CreaPlantillas — página pública de diseño compartido (ver.php). */

html.cp-ver-html,
html.cp-ver-html body.cp-ver-page {
  height: auto;
  max-height: none;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body.cp-ver-page {
  margin: 0;
  display: flex;
  flex-direction: column;
  color: var(--cp-ink);
  font-family: var(--cp-font);
  background:
    radial-gradient(1100px 520px at 8% -10%, rgba(36, 88, 245, 0.12), transparent 58%),
    radial-gradient(900px 480px at 92% 0%, rgba(233, 75, 90, 0.1), transparent 55%),
    linear-gradient(180deg, #FBF7F1 0%, var(--cp-bg) 42%, var(--cp-bg-deep) 100%);
  background-attachment: scroll;
}

.cp-ver-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: var(--cp-topbar-h);
  padding: 0.55rem 1.1rem;
  border-bottom: 1px solid var(--cp-line);
  background: rgba(255, 252, 248, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(17, 22, 30, 0.04);
}

.cp-ver-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.cp-ver-logo {
  display: block;
  height: 36px;
  width: auto;
}

.cp-ver-cta {
  flex: 0 0 auto;
  white-space: nowrap;
}

.cp-ver {
  box-sizing: border-box;
  flex: 1 0 auto;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.cp-ver-title {
  margin: 0;
  max-width: 36rem;
  font-family: var(--cp-display);
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  color: var(--cp-ink);
}

.cp-ver-frame {
  width: 100%;
  max-width: min(100%, 720px);
  padding: 0.65rem;
  border: 1px solid var(--cp-line);
  border-radius: var(--cp-radius);
  background: var(--cp-surface-solid);
  box-shadow: var(--cp-shadow);
}

.cp-ver-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: calc(var(--cp-radius-sm) - 2px);
  background: #E8E4DC;
}

.cp-ver-msg {
  margin: 2rem 0 0.35rem;
  text-align: center;
  color: var(--cp-muted);
  font-size: 1rem;
}

.cp-ver-foot {
  flex: 0 0 auto;
  padding: 1rem 1.1rem 1.4rem;
  border-top: 1px solid var(--cp-line);
  text-align: center;
  color: var(--cp-muted);
  font-size: 0.78rem;
}

.cp-ver-foot p {
  margin: 0;
}

.cp-ver-foot a {
  color: var(--cp-blue);
  text-decoration: none;
  font-weight: 600;
}

.cp-ver-foot a:hover {
  text-decoration: underline;
}

.cp-ver-share {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
}

.cp-ver-share .cp-share-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 7.5rem;
  margin: 0;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--cp-line);
  border-radius: 8px;
  background: #fff;
  color: var(--cp-ink);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}

/* Iconos de color en editor, catálogo y página pública */
button.cp-share-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cp-ver-share button.cp-share-item {
  display: inline-flex;
}

button.cp-share-item::before {
  content: "";
  flex: 0 0 1.1rem;
  width: 1.1rem;
  height: 1.1rem;
  background: center / contain no-repeat;
}

button.cp-share-item[data-share="facebook"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%231877F2' d='M24 12.073C24 5.405 18.627 0 12 0S0 5.405 0 12.073C0 18.1 4.388 23.094 10.125 24v-8.437H7.078v-3.49h3.047v-2.66c0-3.025 1.792-4.697 4.533-4.697 1.312 0 2.686.236 2.686.236v2.97h-1.513c-1.49 0-1.956.93-1.956 1.887v2.264h3.328l-.532 3.49h-2.796V24C19.612 23.094 24 18.1 24 12.073z'/%3E%3C/svg%3E");
}

button.cp-share-item[data-share="whatsapp"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%2325D366' d='M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.435 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z'/%3E%3C/svg%3E");
}

button.cp-share-item[data-share="x"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%230F1419' d='M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-4.714-6.231-5.401 6.231H2.744l7.727-8.835L1.254 2.25H8.08l4.253 5.622L18.244 2.25zm-1.161 17.52h1.833L7.084 4.126H5.117z'/%3E%3C/svg%3E");
}

button.cp-share-item[data-share="email"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23EA4335' d='M3.2 6.4A2.4 2.4 0 0 1 5.6 4h12.8a2.4 2.4 0 0 1 2.4 2.4v11.2a2.4 2.4 0 0 1-2.4 2.4H5.6a2.4 2.4 0 0 1-2.4-2.4z'/%3E%3Cpath fill='%23fff' d='M4.4 7.1 12 12.3l7.6-5.2v1.8L12 14.1 4.4 8.9z'/%3E%3C/svg%3E");
}

button.cp-share-item[data-share="copy"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='8' y='8' width='11' height='11' rx='2' fill='%232458F5'/%3E%3Cpath fill='%237BA3FF' d='M6 5.8A1.8 1.8 0 0 1 7.8 4h8.4A1.8 1.8 0 0 1 18 5.8V7H9.2A2.2 2.2 0 0 0 7 9.2V16H7.8A1.8 1.8 0 0 1 6 14.2z'/%3E%3C/svg%3E");
}

.cp-ver-share .cp-share-item:hover,
.cp-ver-share .cp-share-item:focus {
  background: #F3F6FB;
}

@media (max-width: 640px) {
  .cp-ver-topbar {
    padding: 0.45rem 0.75rem;
  }

  .cp-ver-logo {
    height: 30px;
  }

  .cp-ver {
    padding: 1rem 0.75rem 1.5rem;
  }

  .cp-ver-frame {
    padding: 0.4rem;
    border-radius: 14px;
  }
}
