/* WP Visual Builder - Component Preview Styles in Canvas */

/* ===== NAV COMPONENT ===== */
.wpvb-nav {
  display: flex;
  align-items: center;
  padding: 0 24px;
  height: 64px;
  position: relative;
  z-index: 10;
}
.wpvb-nav.style-logo { justify-content: space-between; }
.wpvb-nav-brand { display: flex; align-items: center; gap: 10px; }
.wpvb-nav-brand img { height: 40px; width: auto; object-fit: contain; }
.wpvb-nav-brand-name { font-weight: 700; font-size: 18px; }
.wpvb-nav-menu { display: flex; align-items: center; list-style: none; gap: 0; }
.wpvb-nav-menu li { position: relative; }
.wpvb-nav-menu > li > a {
  display: block;
  padding: 8px 16px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
  white-space: nowrap;
}
.wpvb-nav-menu li.has-children > a::after { content: ' ▾'; font-size: 10px; }
.wpvb-nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border-radius: 8px;
  min-width: 160px;
  list-style: none;
  padding: 6px 0;
  z-index: 100;
}
.wpvb-nav-menu li:hover > .wpvb-nav-dropdown { display: block; }
.wpvb-nav-dropdown li a {
  display: block;
  padding: 8px 16px;
  text-decoration: none;
  font-size: 13px;
  color: #374151;
  transition: background 0.2s;
}
.wpvb-nav-dropdown li a:hover { background: #f3f4f6; }

/* ===== BANNER COMPONENT ===== */
.wpvb-banner { position: relative; overflow: hidden; }
.wpvb-banner-slides { display: flex; transition: transform 0.5s ease; }
.wpvb-banner-slide {
  min-width: 100%;
  position: relative;
  overflow: hidden;
}
.wpvb-banner-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.wpvb-banner-mask {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.wpvb-banner-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}
.wpvb-banner-title { font-size: 36px; font-weight: 700; line-height: 1.2; margin-bottom: 12px; }
.wpvb-banner-subtitle { font-size: 18px; line-height: 1.5; margin-bottom: 20px; }
.wpvb-banner-btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s;
}
.wpvb-banner-btn:hover { opacity: 0.85; }
.wpvb-banner-arrows {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  padding: 0 16px;
}
.wpvb-banner-arrow {
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.8);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: all;
  transition: background 0.2s;
}
.wpvb-banner-arrow:hover { background: #fff; }
.wpvb-banner-dots {
  position: absolute;
  bottom: 16px;
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 8px;
}
.wpvb-banner-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}
.wpvb-banner-dot.active { background: #fff; }

/* ===== HEADING COMPONENT ===== */
.wpvb-heading { padding: 24px; }
.wpvb-heading-inner { position: relative; display: inline-block; }
.wpvb-heading-text { line-height: 1.3; }
.wpvb-heading-line {
  display: block;
  border: none;
  border-top-style: solid;
}

/* ===== TEXT COMPONENT ===== */
.wpvb-text { padding: 24px; }
.wpvb-text-content { line-height: 1.7; }

/* ===== IMAGE TEXT COMPONENT ===== */
.wpvb-image-text { padding: 40px 24px; }
.wpvb-image-text-inner {
  display: flex;
  align-items: center;
  gap: 40px;
}
.wpvb-image-text.layout-right .wpvb-image-text-inner { flex-direction: row-reverse; }
.wpvb-image-text.layout-top .wpvb-image-text-inner { flex-direction: column; }
.wpvb-image-text.layout-bottom .wpvb-image-text-inner { flex-direction: column-reverse; }
.wpvb-image-text-image { flex-shrink: 0; }
.wpvb-image-text-image img, .wpvb-image-text-image video {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}
.wpvb-image-text-content { flex: 1; }
.wpvb-image-text-title { font-size: 24px; font-weight: 700; margin-bottom: 12px; line-height: 1.3; }
.wpvb-image-text-desc { font-size: 15px; line-height: 1.7; margin-bottom: 16px; }
.wpvb-image-text-btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s;
}

/* ===== GRID COMPONENT ===== */
.wpvb-grid { padding: 40px 24px; }
.wpvb-grid-inner { display: grid; }
.wpvb-grid-col { }
.wpvb-grid-col-image { position: relative; overflow: hidden; }
.wpvb-grid-col-image img { width: 100%; height: 200px; object-fit: cover; display: block; }
.wpvb-grid-col-mask {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.3s;
  text-align: center;
}
.wpvb-grid-col:hover .wpvb-grid-col-mask { opacity: 1; }
.wpvb-grid-col-body { padding: 14px; }
.wpvb-grid-col-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.wpvb-grid-col-desc { font-size: 13px; line-height: 1.6; margin-bottom: 10px; }
.wpvb-grid-col-price { font-size: 18px; font-weight: 700; color: #7c3aed; margin-bottom: 8px; }
.wpvb-grid-col-btn {
  display: inline-block;
  padding: 7px 16px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s;
}
.wpvb-grid-col-btn:hover { opacity: 0.85; }

/* ===== MASK COMPONENT ===== */
.wpvb-mask { }
.wpvb-mask-fullwidth {
  position: relative;
  overflow: hidden;
  min-height: 360px;
}
.wpvb-mask-fullwidth-bg {
  position: absolute;
  inset: 0;
  object-fit: cover;
  width: 100%;
  height: 100%;
}
.wpvb-mask-fullwidth-overlay {
  position: absolute;
  inset: 0;
}
.wpvb-mask-fullwidth-content {
  position: relative;
  padding: 60px 40px;
}
.wpvb-mask-fullwidth-title { font-size: 36px; font-weight: 700; margin-bottom: 16px; }
.wpvb-mask-fullwidth-desc { font-size: 18px; line-height: 1.6; }

.wpvb-mask-grid { padding: 40px 24px; }
.wpvb-mask-grid-inner { display: grid; }
.wpvb-mask-grid-item { position: relative; overflow: hidden; cursor: pointer; }
.wpvb-mask-grid-item img { width: 100%; height: 240px; object-fit: cover; display: block; transition: transform 0.4s; }
.wpvb-mask-grid-item:hover img { transform: scale(1.08); }
.wpvb-mask-grid-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s;
}
.wpvb-mask-grid-item:hover .wpvb-mask-grid-overlay { opacity: 1; }
.wpvb-mask-grid-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.wpvb-mask-grid-desc { font-size: 13px; line-height: 1.5; }

/* ===== TABLE COMPONENT ===== */
.wpvb-table { padding: 24px; overflow-x: auto; }
.wpvb-table table { width: 100%; border-collapse: collapse; font-size: 14px; }
.wpvb-table th {
  text-align: left;
  font-weight: 600;
  padding: 12px 16px;
}
.wpvb-table td { padding: 10px 16px; }
.wpvb-table tr:not(:last-child) td { border-bottom: 1px solid; }
.wpvb-table thead th:not(:last-child),
.wpvb-table td:not(:last-child) { border-right: 1px solid; }

/* ===== BUTTON COMPONENT ===== */
.wpvb-button-wrap { padding: 20px 24px; }
.wpvb-button {
  display: inline-block;
  text-decoration: none;
  font-weight: 600;
  border-radius: 6px;
  transition: all 0.2s;
  cursor: pointer;
}
.wpvb-button.size-sm { padding: 8px 16px; font-size: 13px; }
.wpvb-button.size-md { padding: 12px 24px; font-size: 15px; }
.wpvb-button.size-lg { padding: 16px 32px; font-size: 17px; }
.wpvb-button.style-solid { border: 2px solid transparent; }
.wpvb-button.style-outline { background: transparent !important; border: 2px solid; }
.wpvb-button.style-text { background: transparent !important; border: none; padding-left: 0; padding-right: 0; }

/* ===== SOCIAL COMPONENT ===== */
.wpvb-social { padding: 20px 24px; }
.wpvb-social-inner { display: flex; flex-wrap: wrap; }
.wpvb-social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.2s;
  font-weight: 700;
  font-size: 14px;
}
.wpvb-social-icon.shape-circle { border-radius: 50%; }
.wpvb-social-icon.shape-rounded { border-radius: 8px; }
.wpvb-social-icon.shape-square { border-radius: 0; }
.wpvb-social-icon svg { fill: currentColor; }

/* ===== FOOTER COMPONENT ===== */
.wpvb-footer {
  padding: 24px;
  text-align: center;
  font-size: 14px;
}
.wpvb-footer a { text-decoration: none; transition: color 0.2s; }

/* ===== ANIMATIONS ===== */
[data-animation] {
  opacity: 0;
  transition: none;
}
[data-animation].animated {
  opacity: 1;
}

/* 动画速度 */
[data-anim-speed="slow"]  { animation-duration: 1.2s !important; }
[data-anim-speed="normal"]{ animation-duration: 0.7s !important; }
[data-anim-speed="fast"]  { animation-duration: 0.35s !important; }

/* 动画延迟 */
[data-anim-delay="100"]  { animation-delay: 0.1s !important; }
[data-anim-delay="200"]  { animation-delay: 0.2s !important; }
[data-anim-delay="300"]  { animation-delay: 0.3s !important; }
[data-anim-delay="400"]  { animation-delay: 0.4s !important; }
[data-anim-delay="600"]  { animation-delay: 0.6s !important; }
[data-anim-delay="800"]  { animation-delay: 0.8s !important; }
[data-anim-delay="1000"] { animation-delay: 1s !important; }

/* ── 各动画类型 ── */
[data-animation="fadeIn"]      { animation: wpvbFadeIn 0.7s ease both; }
[data-animation="fadeInUp"]    { animation: wpvbFadeInUp 0.7s ease both; }
[data-animation="fadeInDown"]  { animation: wpvbFadeInDown 0.7s ease both; }
[data-animation="fadeInLeft"]  { animation: wpvbFadeInLeft 0.7s ease both; }
[data-animation="fadeInRight"] { animation: wpvbFadeInRight 0.7s ease both; }
[data-animation="zoomIn"]      { animation: wpvbZoomIn 0.7s ease both; }
[data-animation="zoomOut"]     { animation: wpvbZoomOut 0.7s ease both; }
[data-animation="bounceIn"]    { animation: wpvbBounceIn 0.8s cubic-bezier(.36,.07,.19,.97) both; }
[data-animation="flipInX"]     { animation: wpvbFlipInX 0.7s ease both; }
[data-animation="flipInY"]     { animation: wpvbFlipInY 0.7s ease both; }
[data-animation="rotateIn"]    { animation: wpvbRotateIn 0.7s ease both; }
[data-animation="slideUp"]     { animation: wpvbFadeInUp 0.7s ease both; }
[data-animation="slideDown"]   { animation: wpvbFadeInDown 0.7s ease both; }

/* ── @keyframes ── */
@keyframes wpvbFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes wpvbFadeInUp {
  from { opacity: 0; transform: translateY(50px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes wpvbFadeInDown {
  from { opacity: 0; transform: translateY(-50px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes wpvbFadeInLeft {
  from { opacity: 0; transform: translateX(-60px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes wpvbFadeInRight {
  from { opacity: 0; transform: translateX(60px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes wpvbZoomIn {
  from { opacity: 0; transform: scale(0.75); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes wpvbZoomOut {
  from { opacity: 0; transform: scale(1.25); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes wpvbBounceIn {
  0%   { opacity: 0; transform: scale(0.6); }
  60%  { opacity: 1; transform: scale(1.08); }
  80%  { transform: scale(0.95); }
  100% { transform: scale(1); }
}
@keyframes wpvbFlipInX {
  from { opacity: 0; transform: perspective(600px) rotateX(-80deg); }
  to   { opacity: 1; transform: perspective(600px) rotateX(0); }
}
@keyframes wpvbFlipInY {
  from { opacity: 0; transform: perspective(600px) rotateY(-80deg); }
  to   { opacity: 1; transform: perspective(600px) rotateY(0); }
}
@keyframes wpvbRotateIn {
  from { opacity: 0; transform: rotate(-120deg) scale(0.8); }
  to   { opacity: 1; transform: rotate(0deg) scale(1); }
}

/* ===== CODE COMPONENT ===== */
.wpvb-code-block {
  position: relative;
  overflow: hidden;
}
.wpvb-code-block iframe {
  display: block;
  width: 100%;
  border: none;
}
.wpvb-code-preview-label {
  position: absolute;
  top: 6px; right: 8px;
  font-size: 11px;
  background: rgba(0,0,0,0.4);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  pointer-events: none;
}

/* ===== PLACEHOLDER IMAGES ===== */
.wpvb-placeholder-img {
  background: linear-gradient(135deg, #e5e7eb 25%, #f3f4f6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 40px;
}

/* ===== FORM COMPONENT ===== */
.wpvb-form-wrap { box-sizing: border-box; }
.wpvb-form-shadow { box-shadow: 0 4px 24px rgba(0,0,0,.10); }
.wpvb-form-header { margin-bottom: 20px; }
.wpvb-form-title { margin: 0 0 6px; font-size: 24px; font-weight: 700; }
.wpvb-form-subtitle { margin: 0; font-size: 14px; color: #6b7280; }
.wpvb-form-fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 20px; }
.wpvb-form-field { min-width: 0; }
.wpvb-form-field-full { grid-column: 1 / -1; }
.wpvb-form-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.wpvb-required { color: #ef4444; margin-left: 2px; }
.wpvb-form-input {
  width: 100%; padding: 10px 12px; border: 1.5px solid #d1d5db;
  border-radius: 6px; font-size: 14px; outline: none; box-sizing: border-box;
  transition: border-color .2s, box-shadow .2s; background: #fff;
  font-family: inherit;
}
.wpvb-form-input:focus { border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124,58,237,.12); }
.wpvb-form-footer { margin-top: 20px; }
.wpvb-form-submit {
  border: none; padding: 12px 36px; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: opacity .2s, transform .15s; font-family: inherit;
}
.wpvb-form-submit:hover { opacity: .87; transform: translateY(-1px); }
.wpvb-form-submit:active { transform: translateY(0); }
.wpvb-form-msg {
  margin-top: 14px; padding: 12px 16px; border-radius: 8px; font-size: 14px; font-weight: 500;
}
.wpvb-form-msg.success { background: #d1fae5; color: #065f46; }
.wpvb-form-msg.error   { background: #fee2e2; color: #991b1b; }

/* ===== FLOAT CONTACT ===== */
.wpvb-float-contact {
  position: fixed;
  right: 20px;
  bottom: var(--fc-bottom, 80px);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--fc-gap, 12px);
}
.wpvb-fc-pos-left { right: auto; left: 20px; align-items: flex-start; }

/* bubble 样式 */
.wpvb-fc-style-bubble .wpvb-fc-btn {
  display: flex; align-items: center; gap: 8px;
  background: var(--fc-bg, #7c3aed); color: var(--fc-color, #fff);
  text-decoration: none; border-radius: 99px;
  height: var(--fc-size, 52px); padding: 0 18px;
  font-size: 14px; font-weight: 600; white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,.22); transition: all .25s;
}
.wpvb-fc-style-bubble .wpvb-fc-btn:hover {
  transform: translateX(-4px) scale(1.05);
  box-shadow: 0 6px 24px rgba(0,0,0,.28);
}
.wpvb-fc-icon { font-size: 20px; line-height: 1; }

/* minimal 样式 */
.wpvb-fc-style-minimal .wpvb-fc-btn {
  display: flex; align-items: center; justify-content: center;
  background: var(--fc-bg, #7c3aed); color: var(--fc-color, #fff);
  text-decoration: none; border-radius: 50%;
  width: var(--fc-size, 52px); height: var(--fc-size, 52px);
  font-size: 22px; box-shadow: 0 4px 16px rgba(0,0,0,.22); transition: all .25s;
}
.wpvb-fc-style-minimal .wpvb-fc-btn:hover { transform: scale(1.12); }
.wpvb-fc-style-minimal .wpvb-fc-label { display: none; }

/* bar 样式 */
.wpvb-fc-style-bar { right: 0; bottom: auto; top: 50%; transform: translateY(-50%); }
.wpvb-fc-style-bar .wpvb-fc-btn {
  display: flex; align-items: center; gap: 10px;
  background: var(--fc-bg, #7c3aed); color: var(--fc-color, #fff);
  text-decoration: none; padding: 14px 16px; border-radius: 10px 0 0 10px;
  font-size: 13px; font-weight: 600; width: 52px; overflow: hidden;
  box-shadow: -3px 0 12px rgba(0,0,0,.18); transition: width .3s ease;
}
.wpvb-fc-style-bar .wpvb-fc-btn:hover { width: 140px; }
.wpvb-fc-style-bar .wpvb-fc-icon { flex-shrink: 0; font-size: 18px; }

/* QR 弹窗 */
.wpvb-fc-item { position: relative; }
.wpvb-fc-popup {
  display: none; position: absolute; right: calc(100% + 12px); top: 50%;
  transform: translateY(-50%);
  background: #fff; border-radius: 12px; padding: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,.2); min-width: 160px; text-align: center;
  pointer-events: none;
}
.wpvb-fc-item:hover .wpvb-fc-popup,
.wpvb-fc-popup.show { display: block; pointer-events: auto; }
.wpvb-fc-popup img { width: 120px; height: 120px; object-fit: contain; margin-bottom: 8px; }
.wpvb-fc-popup p { margin: 0; font-size: 13px; font-weight: 600; color: #111; }
.wpvb-fc-popup small { color: #6b7280; font-size: 11px; }

/* 编辑器预览占位 */
.wpvb-float-preview-box {
  padding: 20px; background: #f8f5ff; border: 2px dashed #c4b5fd; border-radius: 10px;
  text-align: center;
}
