.shop-hero {
  padding: 64px 28px 12px;
  max-width: 640px;
}

.shop-hero h1 {
  font-size: clamp(2.2rem, 4.5vw, 3.2rem);
  margin: 12px 0 18px;
}

.shop-sub {
  color: var(--color-ink-soft);
  font-size: 1rem;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 32px;
  padding: 40px 0 96px;
}

@media (max-width: 480px) {
  .template-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 24px 0 64px;
  }
  .tpl-info {
    padding: 8px 8px 12px;
  }
  .tpl-info h3 {
    font-size: 0.72rem;
    line-height: 1.2;
    height: 1.2em;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .tpl-price {
    font-size: 0.66rem;
    margin: 0 0 6px;
  }
  .tpl-add {
    font-size: 0.68rem;
    padding: 8px 4px;
  }
}

.tpl-card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-line);
  overflow: hidden;
  transition: transform 0.15s ease;
}

.tpl-card:hover { border-color: var(--color-ink); }

.tpl-thumb {
  aspect-ratio: 3 / 4;
  background: var(--color-cream-dark);
  overflow: hidden;
}

.tpl-thumb canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tpl-info {
  padding: 16px 18px 20px;
}

.tpl-info h3 {
  font-size: 1.15rem;
  margin-bottom: 4px;
}

.tpl-price {
  color: var(--color-ink-soft);
  font-size: 0.88rem;
  margin: 0 0 14px;
}

.tpl-add {
  width: 100%;
}

/* ---------------- Modal ---------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}

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

.modal {
  position: relative;
  background: var(--color-cream);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-line);
  max-width: 780px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 700px) {
  .modal { grid-template-columns: 1fr; }
}

.modal-preview {
  background: var(--color-cream-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-preview canvas {
  max-width: 100%;
  max-height: 60vh;
  border-radius: var(--radius-sm);
}

.modal-body {
  padding: 32px;
}

.modal-price {
  color: var(--color-ink-soft);
  margin: 6px 0 20px;
}

.modal-label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 8px;
  font-weight: bold;
}

#modalCustomization {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  resize: vertical;
  background: var(--color-white);
}

.modal-hint {
  font-size: 0.8rem;
  color: var(--color-ink-soft);
  margin: 10px 0 22px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--color-ink-soft);
  z-index: 5;
}
