@scope (.template-scope) {
  .templates-section-grid {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    padding-bottom: 12px;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .template-card {
    text-decoration: none;
    color: var(--text, #ffffff);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    min-width: 320px;
    /* width: 320px;
        flex-shrink: 0;
        scroll-snap-align: start; */
  }

  .template-card .resume-card-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
  }

  .template-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
  }

  .template-badge {
    font-size: 11px;
    padding: 4px 10px;
    background: rgba(143, 92, 255, 0.2);
    border: 1px solid rgba(143, 92, 255, 0.4);
    color: var(--purple, #8f5cff);
    border-radius: 20px;
  }

  .template-iframe-wrapper {
    position: relative;
    width: 100%;
    height: 260px;
    border-radius: 14px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    margin-bottom: 16px;
  }

  .template-iframe-wrapper iframe {
    width: 200%;
    height: 200%;
    border: none;
    transform: scale(0.5);
    transform-origin: top left;
    pointer-events: none;
  }

  .template-iframe-wrapper .iframe-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: transparent;
  }

  .btn-use-template {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--purple, #8f5cff);
    transition:
      transform 0.2s ease,
      color 0.2 ease;
  }

  .template-card:hover .template-iframe-wrapper {
    border-color: var(--purple, #8f5cff);
    box-shadow: 0 8px 20px rgba(143, 92, 255, 0.2);
  }

  .template-selected .template-iframe-wrapper {
    border: 2px solid var(--purple, #8f5cff);
    box-shadow:
      0 0 0 3px rgba(143, 92, 255, 0.15),
      0 8px 24px rgba(143, 92, 255, 0.35);

    transform: translateY(-2px);
    transition: all 0.2s ease;
  }

  .template-selected {
    position: relative;
  }

  .template-selected::after {
    content: "✓";

    position: absolute;
    top: 10px;
    right: 10px;

    width: 28px;
    height: 28px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: var(--purple, #8f5cff);
    color: #fff;

    font-size: 16px;
    font-weight: 700;

    box-shadow: 0 4px 12px rgba(143, 92, 255, 0.4);
  }
}
