/**
 * CustomLoopCo — Create Your Own Gift
 * Production Scoped Styling
 */
.cyog {
  --cyog-ink: #193c36;
  --cyog-accent: #246b57;
  --cyog-accent-hover: #1c5444;
  --cyog-paper: #fffdf8;
  --cyog-card-bg: #f8faf8;
  --cyog-border: #d7e1db;
  --cyog-error-bg: #fff0eb;
  --cyog-error-border: #a63824;
  --cyog-focus: #a74d14;
  box-sizing: border-box;
  max-width: 1200px;
  margin: 28px auto;
  padding: clamp(16px, 3.5vw, 40px);
  background: var(--cyog-paper);
  color: var(--cyog-ink);
  font: 16px/1.6 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  border: 1px solid var(--cyog-border);
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.cyog * {
  box-sizing: border-box;
  min-width: 0;
}

.cyog [hidden] {
  display: none !important;
}

.cyog-badge {
  display: inline-block;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--cyog-accent);
  background: #e3ede8;
  border-radius: 20px;
}

.cyog-head h2 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.2;
  margin: 12px 0 8px;
  color: var(--cyog-ink);
}

.cyog-head p {
  font-size: 16px;
  color: #3b5c53;
  max-width: 760px;
  margin: 0 0 24px;
}

/* Progress Stepper */
.cyog-progress {
  display: flex;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  flex-wrap: wrap;
}

.cyog-progress li {
  flex: 1 1 auto;
}

.cyog-progress button {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--cyog-border);
  border-radius: 8px;
  background: white;
  color: var(--cyog-ink);
  cursor: pointer;
  min-height: 44px;
  transition: all 0.15s ease-in-out;
}

.cyog-progress button[aria-current="step"] {
  background: var(--cyog-accent);
  color: white;
  border-color: var(--cyog-accent);
}

.cyog-progress button:hover:not([aria-current="step"]) {
  background: #f0f5f2;
}

/* Layout Grid */
.cyog-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 36px;
  margin: 20px 0;
}

.cyog-editor h3 {
  font-size: 22px;
  margin: 0 0 6px;
  color: var(--cyog-ink);
}

.cyog-step-desc {
  font-size: 14px;
  color: #557268;
  margin: 0 0 16px;
}

/* Form Controls */
.cyog label {
  display: block;
  font-size: 15px;
  font-weight: 600;
  margin: 16px 0 6px;
  color: var(--cyog-ink);
}

.cyog-subtle {
  font-size: 13px;
  font-weight: 400;
  color: #6d847c;
}

.cyog input:not([type="checkbox"]):not([type="file"]),
.cyog select,
.cyog textarea {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #7c9b8f;
  border-radius: 8px;
  background: white;
  color: var(--cyog-ink);
  font: inherit;
  font-size: 15px;
  min-height: 44px;
}

.cyog input[type="checkbox"] {
  width: 22px;
  height: 22px;
  vertical-align: middle;
  cursor: pointer;
}

.cyog :focus-visible {
  outline: 3px solid var(--cyog-focus);
  outline-offset: 2px;
}

/* Product Cards */
.cyog-products {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.cyog-product-card {
  display: flex;
}

.cyog-product-button {
  flex: 1 1 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 16px;
  border: 2px solid var(--cyog-border);
  border-radius: 12px;
  background: white;
  cursor: pointer;
  min-height: 84px;
  transition: all 0.15s ease;
}

.cyog-product-button strong {
  font-size: 17px;
  margin-bottom: 4px;
  color: var(--cyog-ink);
}

.cyog-product-button span {
  font-size: 13px;
  color: #617c72;
  line-height: 1.4;
}

.cyog-product-button[aria-pressed="true"] {
  border-color: var(--cyog-accent);
  background: #edf5f1;
}

/* Upload Area */
.cyog-upload-zone {
  margin: 16px 0;
}

.cyog-file-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  border: 2px dashed #82a396;
  border-radius: 12px;
  background: #f7faf8;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s;
}

.cyog-file-button:hover {
  background: #edf5f1;
}

.cyog-upload-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.cyog-upload-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--cyog-accent);
}

.cyog-photo {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.cyog-photo-status {
  font-size: 14px;
  color: #3b5c53;
  margin: 8px 0;
}

/* Positioning Controls */
.cyog-editor-controls {
  padding: 14px;
  background: #f0f5f2;
  border-radius: 10px;
  margin: 16px 0;
}

.cyog-control-label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}

.cyog-button-group {
  display: flex;
  gap: 8px;
}

.cyog-button-group button {
  padding: 8px 16px;
  font-size: 15px;
  font-weight: 700;
  border: 1px solid #7c9b8f;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  min-height: 44px;
}

.cyog-control-hint {
  font-size: 12px;
  color: #617c72;
  margin: 8px 0 0;
}

/* Character Counter */
.cyog-count {
  margin: 4px 0 10px;
  font-size: 13px;
  color: #557268;
}

.cyog-count-limit {
  color: #a63824;
  font-weight: 700;
}

/* Review Table */
.cyog-review {
  margin: 16px 0;
  background: white;
  border: 1px solid var(--cyog-border);
  border-radius: 10px;
  padding: 16px 20px;
}

.cyog-review dt {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #617c72;
  margin-top: 10px;
}

.cyog-review dt:first-child {
  margin-top: 0;
}

.cyog-review dd {
  margin: 2px 0 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--cyog-ink);
}

/* Consent & Add to Cart */
.cyog-consent-label {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 20px 0;
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
}

.cyog-consent-label span {
  font-weight: 500;
  color: #2b4940;
}

.cyog-add {
  display: block;
  width: 100%;
  padding: 16px 24px;
  font-size: 18px;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  background: var(--cyog-accent);
  color: white;
  cursor: pointer;
  min-height: 52px;
  transition: background 0.15s;
}

.cyog-add:hover:not(:disabled) {
  background: var(--cyog-accent-hover);
}

.cyog-add:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cyog-cart-status {
  font-size: 15px;
  font-weight: 600;
  color: var(--cyog-accent);
  margin-top: 12px;
}

.cyog-view-cart {
  display: inline-block;
  margin-left: 8px;
  color: #0f5132;
  text-decoration: underline;
}

/* Action Buttons */
.cyog-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.cyog-actions button {
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid #7c9b8f;
  background: white;
  cursor: pointer;
  min-height: 44px;
}

.cyog-next {
  background: var(--cyog-accent) !important;
  color: white !important;
  border-color: var(--cyog-accent) !important;
}

.cyog-remove {
  margin-top: 10px;
  padding: 6px 14px;
  font-size: 13px;
  border: 1px solid #c97f70;
  color: #a63824;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  min-height: 44px;
}

/* Errors & Alerts */
.cyog-error {
  padding: 14px 18px;
  border: 2px solid var(--cyog-error-border);
  background: var(--cyog-error-bg);
  color: #7a1f10;
  border-radius: 10px;
  margin-bottom: 20px;
  font-weight: 600;
}

.cyog-clipping {
  font-size: 12px;
  font-weight: 600;
  color: #a74d14;
  margin: 8px 0;
}

/* Interactive Preview Panel */
.cyog-preview {
  position: sticky;
  top: 24px;
  align-self: start;
}

.cyog-preview-card {
  background: #edf3f0;
  border: 1px solid var(--cyog-border);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
}

.cyog-preview-card h3 {
  font-size: 18px;
  margin: 0 0 16px;
  color: var(--cyog-ink);
}

.cyog-object {
  width: 100%;
  max-width: 320px;
  height: 320px;
  margin: 0 auto 16px;
  background: white;
  border: 3px solid #8ba095;
  border-radius: 20px 20px 48px 48px;
  padding: 30px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  position: relative;
  overflow: hidden;
}

.cyog-object[data-product="shirt"] {
  clip-path: polygon(15% 0, 35% 0, 50% 8%, 65% 0, 85% 0, 100% 25%, 85% 40%, 85% 100%, 15% 100%, 15% 40%, 0 25%);
  border-radius: 0;
}

.cyog-object[data-product="tote"] {
  border-radius: 36px 36px 8px 8px;
  border-top: 24px solid #b7a78a;
}

.cyog-object[data-product="keepsake"] {
  border-radius: 50%;
  height: 300px;
}

.cyog-object[data-shape="Square"] {
  border-radius: 12px !important;
}

.cyog-object[data-color="Black"] {
  background: #25372e;
  color: white;
}

.cyog-object[data-color="Natural"] {
  background: #e8dcc4;
}

.cyog-print {
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 58fr) minmax(0, 14fr) minmax(0, 28fr);
  gap: 6px;
  overflow: hidden;
  position: relative;
}

.cyog-print[data-layout="photo"] {
  grid-template-rows: minmax(0, 1fr);
}

.cyog-print[data-layout="photo"] .cyog-preview-name,
.cyog-print[data-layout="photo"] .cyog-preview-message {
  display: none;
}

.cyog-preview-photo {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  cursor: grab;
  user-select: none;
}

.cyog-preview-photo:active {
  cursor: grabbing;
}

.cyog-preview-name {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  font-weight: 700;
  font-size: 15px;
}

.cyog-preview-message {
  overflow: hidden;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.35;
}

.cyog-msg-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cyog-preview-note {
  font-size: 12px;
  color: #68857a;
  margin: 12px 0 0;
}

.cyog-foot {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--cyog-border);
  text-align: center;
  font-size: 13px;
  color: #557268;
}

.cyog-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Responsive adjustments */
@media (max-width: 820px) {
  .cyog-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .cyog-preview {
    position: static;
  }
}

@media (max-width: 480px) {
  .cyog-products {
    grid-template-columns: 1fr;
  }
  .cyog-actions button {
    flex: 1 1 100%;
  }
}
