* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
}

#resultVariantSelect
{
  width: 200px;
  border-radius: 16px;
}

/* Override Shopify theme's page width constraint */
.page-width-content,
#MainContent .page-width-content,
.shopify-section .page-width-content {
  --page-content-width: none !important;
  max-width: none !important;
  width: 100% !important;
}

.embed-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  /*background: white;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);*/
}

.embed-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 6px;
  text-align: center;
  color: #333;
}

.embed-description {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 24px;
  text-align: center;
  color: #737373;
}

.embed-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 600px;
  margin: 0 auto 32px;
}

.embed-input {
  width: 100%;
  padding: 16px;
  border: 2px solid #ddd;
  border-radius: 12px;
  font-size: 16px;
  transition: border-color 0.2s;
  font-family: inherit;
  resize: none;
  min-height: 56px;
  max-height: calc(56px + (24px * 3));
  overflow-y: auto;
}

.embed-input:focus {
  outline: none;
  border-color: #007bff;
}

.embed-warning {
  background: #fff3cd;
  color: #856404;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
  border: 1px solid #ffeeba;
}

.embed-select {
  width: 100%;
  padding: 16px;
  border: 2px solid #ddd;
  border-radius: 12px;
  font-size: 16px;
  background: white;
  cursor: pointer;
}

.embed-button {
  position: relative;
  width: 100%;
  padding: 18px;
  background-image: url('/apps/designer/embed-button-bg');
  background-size: cover;
  background-position: center;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s;
 
  text-shadow: 1px 1px 1px #00000057;
  box-shadow: 1px 1px 4px #00000057;
  overflow: hidden;
}

.embed-button-text {
  position: relative;
  z-index: 1;
}

.embed-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0);
  transition: background 0.2s;
  border-radius: 12px;
  z-index: 0;
  pointer-events: none;
}

.embed-button:hover:not(:disabled)::before {
  background: rgba(0,0,0,0.1);
}

.embed-button:hover:not(:disabled) {
  transform: translateY(-2px);
}

.embed-button:active:not(:disabled) {
  transform: translateY(0);
}

.embed-button:disabled {
  background-image: none;
  background-color: #ccc;
  cursor: not-allowed;
  transform: none;
}

.embed-button:disabled::before {
  display: none;
}

/* Cloudflare Turnstile widget */
.cf-turnstile {
  display: flex;
}

.embed-progress-container {
  text-align: center;
  padding: 40px 0;
}

.embed-progress-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 24px;
  color: #333;
}

.embed-progress-spinner {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 24px;
}

.embed-spinner {
  width: 120px;
  height: 120px;
  border: 6px solid #f3f3f3;
  border-top: 6px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.embed-progress-percent {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 24px;
  font-weight: 700;
  color: #007bff;
}

.embed-loading-message {
  color: #666;
  font-size: 16px;
}

.embed-result {
  text-align: center;
  padding: 20px 0;
}

.embed-result-image {
  max-width: 500px;
  max-height: 700px;
  width: 100%;
  height: auto;
  border-radius: 16px;
  margin-bottom: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.embed-result-tagline {
  font-size: 14px;
  color: #666;
  margin-bottom: 20px;
}

.embed-result-title-link {
  text-decoration: none;
  display: block;
}

.embed-result-title-link:hover .embed-result-title {
  color: #6366f1;
}

.embed-result-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #333;
  transition: color 0.2s;
}

.embed-cart-button {
  display: inline-block;
  padding: 16px 48px;
  width: 200px;
  background: linear-gradient(141deg, #ffd54a, #ff87d2, #d088ff, #51b0ff);
  color: white;
  text-decoration: none;
  border-radius: 16px;
  font-size: 18px;
  font-weight: 600;
  transition: background 0.2s, transform 0.1s;
  text-shadow: 1px 1px 1px #00000057;
  box-shadow: 1px 1px 4px #00000057;
}

.embed-cart-button:hover {
  background: linear-gradient(141deg, #e9c346, #e77ebf, #bc7de6, #4aa2ea);
  transform: translateY(-2px);
}

.embed-cart-button:active {
  transform: translateY(0);
}

.embed-error {
  color: #dc3545;
  padding: 16px;
  background: #f8d7da;
  border-radius: 12px;
  margin-top: 16px;
}

.embed-rate-limit {
  text-align: center;
  color: #666;
  font-size: 14px;
  margin-top: 12px;
}

.embed-remaining {
  text-align: center;
  padding: 12px;
  background: #e7f3ff;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  color: #0066cc;
  font-weight: 600;
}

.embed-result-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
  flex-wrap: wrap;
}

.embed-variant-select {
  min-width: 180px;
  height: 54px;
}

.embed-result-secondary {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  margin-top: 20px;
}

.embed-result-remaining {
  font-size: 13px;
  color: #888;
}

.embed-secondary-button {
  display: inline-block;
  padding: 14px 32px;
  background: #6c757d;
  color: white;
  text-decoration: none;
  border: none;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  background: linear-gradient(145deg, #00e7ec, #4b4bff);
  text-shadow: 1px 1px 1px #00000057;
  box-shadow: 1px 1px 4px #00000057;
}

.embed-secondary-button:hover {
  background: linear-gradient(145deg, #01d1d4, #4343e1);
  transform: translateY(-2px);
}

.embed-secondary-button:active {
  transform: translateY(0);
}

.hidden {
  display: none;
}

/* Carousel styles */
.carousel-section {
  margin-top: 16px;
  padding-top: 32px;
  border-top: 2px solid #eee;
}

.carousel-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 20px;
  color: #333;
}

.carousel-container {
  position: relative;
}

.carousel-wrapper {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 8px 24px;
}

.carousel-wrapper::-webkit-scrollbar {
  display: none;
}

.carousel {
  display: flex;
  gap: 16px;
  padding: 8px 0;
}

.carousel-item {
  flex: 0 0 auto;
  width: 200px;
  background: white;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.carousel-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.carousel-item-image {
  width: 100%;
  height: 200px;
  object-fit: contain;
  border-radius: 8px;
  margin-bottom: 8px;
}

.carousel-item-title {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.carousel-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: white;
  border: 2px solid #ddd;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  color: #333;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  z-index: 10;
  transition: background 0.2s;
}

.carousel-button:hover {
  background: #f5f5f5;
}

.carousel-button-left {
  left: -20px;
}

.carousel-button-right {
  right: -20px;
}

/* ========================================
   SPARKLE CURSOR
   ======================================== */

/* Hide default cursor when sparkle cursor is active */
html.sparkle-cursor,
html.sparkle-cursor * {
  cursor: none !important;
}

/* Main sparkle cursor element */
.sparkle-cursor-element {
  position: fixed;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  pointer-events: none;
  z-index: 2147483647;
  transform: translate(-9999px, -9999px);
  filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.6));
}

.sparkle-cursor-element .core {
  width: 100%;
  height: 100%;
  transform-origin: 50% 50%;
  animation: sparklePulse 1800ms ease-in-out infinite;
}

/* Rotation on hover - disabled for now
.sparkle-cursor-element.hovering .core {
  animation: sparkleSpin 800ms linear infinite;
}

@keyframes sparkleSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
*/

@keyframes sparklePulse {
  0%, 100% { transform: scale(0.9); opacity: 0.9; }
  50% { transform: scale(1.1); opacity: 1; }
}

/* Trail particles */
.sparkle-particle {
  position: fixed;
  left: 0;
  top: 0;
  pointer-events: none;
  z-index: 2147483646;
  filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.5));
}

.sparkle-particle.large {
  animation: particlePopLarge 400ms ease-out forwards;
}

.sparkle-particle.small {
  animation: particlePopSmall 400ms ease-out forwards;
}

@keyframes particlePopLarge {
  0% {
    opacity: 0;
    transform: scale(1) rotate(0deg);
  }
  12% {
    opacity: 1;
    transform: scale(1) rotate(45deg);
  }
  100% {
    opacity: 0;
    transform: scale(0.2) rotate(360deg);
  }
}

@keyframes particlePopSmall {
  0% {
    opacity: 0;
    transform: scale(0.7) rotate(0deg);
  }
  15% {
    opacity: 0.85;
    transform: scale(0.7) rotate(30deg);
  }
  100% {
    opacity: 0;
    transform: scale(0.1) rotate(270deg);
  }
}
