:root {
  --wpcsp-bar-height: 60px;
  --wpcsp-bg: #1e1e1e;
  --wpcsp-bg-hover: #2c2c2c;
  --wpcsp-border: #3c3c3c;
  --wpcsp-text: #fff;
  --wpcsp-text-light: #b4b9be;
  --wpcsp-bg-frame: #1e1e1e;
  --wpcsp-accent: #3858e9;
  --wpcsp-accent-hover: #2644c9;
  --wpcsp-dropdown-bg: #2c2c2c;
  --wpcsp-dropdown-hover: #3c3c3c;
  --wpcsp-button-bg: #3858e9;
  --wpcsp-button-hover-bg: #2644c9;
  --wpcsp-button-text: #fff;
  --wpcsp-button-text-hover: #fff;
  --wpcsp-radius-card: 4px;
  --wpcsp-radius-btn: 3px;
  --wpcsp-shadow-card: 0 1px 2px rgba(0, 0, 0, 0.05);
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
}

body.wpcsp-body {
  overflow: hidden;
  background-color: var(--wpcsp-bg-frame);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  -webkit-font-smoothing: antialiased;
}

.wpcsp-bar {
  height: var(--wpcsp-bar-height);
  background: var(--wpcsp-bg);
  border-bottom: 1px solid var(--wpcsp-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  box-sizing: border-box;
  position: relative;
  z-index: 1000;
  box-shadow: var(--wpcsp-shadow-card);
}

.wpcsp-col-left,
.wpcsp-col-center,
.wpcsp-col-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.wpcsp-col-center {
  justify-content: center;
}

.wpcsp-col-right {
  justify-content: flex-end;
}

.wpcsp-back-link {
  text-decoration: none;
  color: var(--wpcsp-text-light);
  font-size: 13px;
  font-weight: 500;
  transition: color 0.2s;
}
.wpcsp-back-link:hover {
  color: var(--wpcsp-text);
}

.wpcsp-separator {
  color: var(--wpcsp-border);
  font-size: 13px;
}

.wpcsp-dropdown-wrapper {
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.wpcsp-dropdown-wrapper::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 8px;
}
.wpcsp-dropdown-wrapper:hover .wpcsp-dropdown-list {
  display: block !important;
}

.wpcsp-current-site {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--wpcsp-text);
  font-size: 13px;
  font-weight: 600;
}

.wpcsp-dropdown-list {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--wpcsp-dropdown-bg);
  border: 1px solid var(--wpcsp-border);
  border-radius: var(--wpcsp-radius-card);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  min-width: 150px;
  padding: 4px;
  z-index: 1001;
}
.wpcsp-dropdown-list a {
  display: block;
  padding: 8px 12px;
  text-decoration: none;
  color: var(--wpcsp-text);
  font-size: 13px;
  border-radius: var(--wpcsp-radius-card);
  transition: background 0.1s;
}
.wpcsp-dropdown-list a:hover {
  background: var(--wpcsp-dropdown-hover);
}

.wpcsp-device-btn {
  background: transparent;
  border: none;
  color: var(--wpcsp-text-light);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--wpcsp-radius-btn);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wpcsp-device-btn svg {
  width: 20px;
  height: 20px;
}
.wpcsp-device-btn:hover {
  background-color: var(--wpcsp-bg-hover);
  color: var(--wpcsp-text);
}
.wpcsp-device-btn.active {
  background-color: var(--wpcsp-accent);
  color: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.wpcsp-visit-link {
  text-decoration: none;
  color: var(--wpcsp-text);
  font-size: 13px;
  font-weight: 500;
  margin-right: 8px;
}

.wpcsp-buy-btn {
  background-color: var(--wpcsp-button-bg);
  color: var(--wpcsp-button-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--wpcsp-radius-btn);
  transition: background-color 0.2s, border-color 0.2s;
}
.wpcsp-buy-btn:hover {
  background-color: var(--wpcsp-button-hover-bg);
}

.wpcsp-close-btn {
  margin-left: 8px;
  color: var(--wpcsp-text-light);
  display: flex;
  align-items: center;
}
.wpcsp-close-btn svg {
  width: 16px;
  height: 16px;
}

.wpcsp-iframe-container {
  height: calc(100vh - var(--wpcsp-bar-height));
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
  background: var(--wpcsp-bg-frame);
  padding-top: 0;
  position: relative;
  transition: background-color 0.3s;
}
.wpcsp-iframe-container.is-desktop #wpcsp-frame {
  width: var(--wpcsp-desktop-width, 100%);
  height: var(--wpcsp-desktop-height, 100%);
}
.wpcsp-iframe-container.is-tablet #wpcsp-frame {
  width: var(--wpcsp-tablet-width, 768px);
  height: var(--wpcsp-tablet-height, 1024px);
  margin-top: 20px;
  margin-bottom: 20px;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
}
.wpcsp-iframe-container.is-mobile #wpcsp-frame {
  width: var(--wpcsp-mobile-width, 375px);
  height: var(--wpcsp-mobile-height, 667px);
  margin-top: 20px;
  margin-bottom: 20px;
  border-radius: 30px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  border: 8px solid #1a1a1a;
}

#wpcsp-frame {
  width: 100%;
  height: 100%;
  background: #fff;
  transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), height 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s;
  border: none;
}

.wpcsp-iframe-status {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--wpcsp-bg-frame);
  z-index: 10;
  opacity: 1;
  transition: opacity 0.3s ease;
  padding: 20px;
  box-sizing: border-box;
}
.wpcsp-iframe-status.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.wpcsp-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--wpcsp-border);
  border-top-color: var(--wpcsp-accent);
  border-radius: 50%;
  animation: wpcsp-spin 0.8s linear infinite;
}

@keyframes wpcsp-spin {
  to {
    transform: rotate(360deg);
  }
}
.wpcsp-status-text {
  color: var(--wpcsp-text-light);
  font-size: 14px;
  text-align: center;
  max-width: 320px;
  margin: 0;
}

.wpcsp-status-action {
  display: inline-block;
  color: var(--wpcsp-accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
}

.wpcsp-status-action:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .wpcsp-col-left {
    flex: 1;
  }
  .wpcsp-back-link,
  .wpcsp-separator {
    display: none;
  }
  .wpcsp-dropdown-wrapper {
    display: flex;
  }
  .wpcsp-current-site {
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
  }
  .wpcsp-col-center {
    display: none;
  }
  .wpcsp-col-right {
    flex: 0 0 auto;
    justify-content: flex-end;
    gap: 8px;
  }
  .wpcsp-visit-link,
  .wpcsp-close-btn {
    display: none;
  }
  .wpcsp-bar {
    padding: 0 16px;
  }
}