/* DIY-specific styles
   Bracelet builder workspace */

.diy-hero {
  padding: 5rem var(--gutter) 3rem;
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
}

.diy-hero .eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.diy-hero h1 {
  font-style: italic;
  margin-bottom: 1.5rem;
}

.diy-hero p {
  color: var(--muted);
  font-size: 1.0625rem;
}

/* Workspace */
.diy-workspace {
  padding: 2rem var(--gutter) 6rem;
}

.diy-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 3rem;
}

/* Canvas area */
.diy-canvas-area {
  position: sticky;
  top: 100px;
  align-self: start;
}

.canvas-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0 0.5rem;
}

.canvas-tools {
  display: flex;
  gap: 0.5rem;
}

.tool-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--ink);
}

.tool-btn:hover:not(:disabled) {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}

.tool-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.canvas-stats {
  font-size: 0.875rem;
  color: var(--muted);
  letter-spacing: 0.03em;
}

.canvas-stats strong {
  color: var(--ink);
  font-weight: 500;
}

.canvas-stats .divider {
  margin: 0 0.75rem;
  color: var(--line);
}

/* Bracelet canvas */
.bracelet-canvas {
  aspect-ratio: 1;
  max-width: 520px;
  margin: 0 auto;
  background: linear-gradient(135deg, var(--cream), #FFFFFF 60%);
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 60px rgba(200, 168, 154, 0.08);
}

.canvas-empty-state {
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.7;
}

.canvas-empty-state p {
  margin-top: 1rem;
  color: var(--muted);
}

.canvas-empty-state.hidden {
  display: none;
}

.bracelet-ring {
  position: absolute;
  inset: 12%;
  pointer-events: none;
}

.bead {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 6px rgba(44, 40, 38, 0.15), inset -3px -3px 6px rgba(0,0,0,0.15), inset 3px 3px 6px rgba(255,255,255,0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bead:hover {
  transform: translate(-50%, -50%) scale(1.15);
  box-shadow: 0 4px 12px rgba(44, 40, 38, 0.3), inset -3px -3px 6px rgba(0,0,0,0.2), inset 3px 3px 6px rgba(255,255,255,0.5);
  z-index: 10;
}

.bead::after {
  content: '×';
  color: white;
  font-size: 1.5rem;
  font-weight: 300;
  opacity: 0;
  transition: opacity 0.2s ease;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.bead:hover::after {
  opacity: 1;
}

.bead.entering {
  animation: beadEnter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes beadEnter {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

.canvas-hint {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--muted);
  margin-top: 1.5rem;
  font-style: italic;
}

/* Sidebar */
.diy-sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.palette-section h3 {
  font-style: italic;
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
}

.palette-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.palette-tab {
  padding: 0.5rem 1rem;
  border: 1px solid var(--line);
  background: white;
  font-size: 0.8125rem;
  cursor: pointer;
  border-radius: 20px;
  color: var(--ink);
  transition: all 0.2s ease;
  font-family: inherit;
}

.palette-tab:hover {
  border-color: var(--ink);
}

.palette-tab.active {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.75rem;
  padding: 1.25rem;
  background: var(--cream-light);
  border: 1px solid var(--line);
  border-radius: 4px;
  max-height: 380px;
  overflow-y: auto;
}

.palette-bead {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.5rem 0.25rem;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.palette-bead:hover {
  background: rgba(255,255,255,0.7);
}

.palette-bead-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(44, 40, 38, 0.15), inset -2px -2px 4px rgba(0,0,0,0.15), inset 2px 2px 4px rgba(255,255,255,0.4);
  transition: transform 0.2s ease;
}

.palette-bead:hover .palette-bead-circle {
  transform: scale(1.1);
}

.palette-bead-name {
  font-size: 0.65rem;
  color: var(--ink);
  text-align: center;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.palette-bead-price {
  font-size: 0.6rem;
  color: var(--muted);
}

/* Settings sections */
.diy-section {
  background: white;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.5rem;
}

.diy-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.diy-section h4 {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink);
}

.diy-help-link {
  font-size: 0.8125rem;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.size-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.size-btn {
  padding: 0.65rem 0.5rem;
  border: 1px solid var(--line);
  background: white;
  cursor: pointer;
  font-size: 0.8125rem;
  font-family: inherit;
  color: var(--ink);
  transition: all 0.2s ease;
}

.size-btn:hover {
  border-color: var(--ink);
}

.size-btn.active {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}

.size-btn.size-unknown {
  grid-column: 1 / -1;
  border-style: dashed;
  font-style: italic;
  color: var(--muted);
}

.size-btn.size-unknown.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  font-style: italic;
}

.diy-section-hint {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-top: 1rem;
  line-height: 1.5;
}

/* Summary */
.diy-summary {
  background: var(--cream);
  padding: 1.5rem;
  border-radius: 4px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.65rem 0;
  font-size: 0.9rem;
  color: var(--muted);
  border-bottom: 1px dotted var(--line);
}

.summary-row:last-of-type {
  border-bottom: none;
}

.summary-row > span:last-child {
  color: var(--ink);
  text-align: right;
}

.summary-row.price-row {
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 2px solid var(--line);
  border-bottom: none;
  font-size: 1rem;
}

.summary-row.price-row > span:last-child {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--ink);
}

.materials-list {
  max-width: 180px;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.summary-disclaimer {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 1rem;
  font-style: italic;
  line-height: 1.5;
}

/* Note */
.diy-note {
  background: white;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.25rem;
}

.diy-note-label {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.diy-note textarea {
  width: 100%;
  min-height: 80px;
  padding: 0.75rem;
  border: 1px solid var(--line);
  background: var(--cream-light);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--ink);
  resize: vertical;
  line-height: 1.5;
  border-radius: 0;
}

.diy-note textarea:focus {
  outline: none;
  border-color: var(--ink);
}

/* Actions */
.diy-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.diy-actions .btn {
  width: 100%;
}

.diy-actions .btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.diy-actions .btn-primary:disabled:hover {
  background: var(--ink);
}

.diy-promise {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  background: var(--cream);
  padding: 1rem;
  border-radius: 4px;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.5;
}

.diy-promise svg {
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
}

/* Size help modal */
.size-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(44, 40, 38, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.size-modal.open {
  display: flex;
}

.size-modal-content {
  background: white;
  border-radius: 4px;
  padding: 3rem 2.5rem;
  max-width: 560px;
  width: 100%;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.size-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.25rem;
  color: var(--ink);
  transition: all 0.2s ease;
}

.size-modal-close:hover {
  background: var(--ink);
  color: white;
}

.size-modal-content h3 {
  font-style: italic;
  margin-bottom: 0.5rem;
}

.size-method {
  display: flex;
  gap: 1.25rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
}

.size-method:last-of-type {
  border-bottom: none;
}

.size-method-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--cream);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.125rem;
}

.size-method h4 {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.size-method p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Responsive */
@media (max-width: 900px) {
  .diy-container {
    grid-template-columns: 1fr;
  }
  .diy-canvas-area {
    position: static;
  }
  .bracelet-canvas {
    max-width: 360px;
  }
  .size-buttons {
    grid-template-columns: repeat(2, 1fr);
  }
}
