.template-container {
    margin: 120px 0px;
}

.template-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.template-header span {
    font-size: 18px;
    font-weight: 600;
    color: #b8892f;
}

.template-header h2 {
    font-size: 40px;
    font-weight: 700;
    color: #222;
    margin-top: 8px;
}

.template-container {
    max-width: 1120px;
    margin: 120px auto 60px;
    padding: 0 20px;
}

.template-header {
    margin-bottom: 28px;
}

.template-header span {
    color: #b8892f;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.template-header h2 {
    margin: 10px 0 0;
    color: #222;
    font-size: 34px;
    line-height: 1.2;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    align-items: stretch;
}

.template-card {
    display: flex;
    height: 100%;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #eee;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 24px #0d2e4514;

}

.template-preview {
    position: relative;
    flex: 0 0 180px;
    min-height: 180px;
    padding: 22px;
    color: #fff;
    display: flex;
    align-items: flex-end;
    background: #222;
}

.template-preview img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.template-preview strong {
    display: block;
    font-size: 24px;
    line-height: 1.2;
}

.template-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 18px;
}

.template-body h3 {
    margin: 0 0 8px;
    font-size: 20px;
    color: #222;
}

.template-body p {
    min-height: 4.5em;
    margin: 0 0 14px;
    color: #666;
    line-height: 1.5;
}

.template-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    color: #333;
    font-weight: 700;
}

.template-color-options {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: auto 0 16px;
}

.template-color-options input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.template-color-options label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 2px solid transparent;
    border-radius: 999px;
    background: #ddd;
    box-shadow: inset 0 0 0 4px #fff, 0 0 0 1px rgba(0, 0, 0, .12);
    cursor: pointer;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.template-color-options label span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.template-color-options label:hover {
    transform: translateY(-2px);
}

.template-color-options input:focus-visible+label,
.template-color-options input:checked+label {
    border-color: #080808;
}

.template-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    margin-top: 0;
    width: 100%;
    border-radius: 6px;
    background: #222;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.template-button:hover {
    color: #fff;
    opacity: .9;
}

@media (max-width: 900px) {
    .template-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .template-container {
        margin-top: 90px;
    }

    .template-header h2 {
        font-size: 26px;
    }

    .template-grid {
        grid-template-columns: 1fr;
    }

    .template-body p {
        min-height: 0;
    }

    .template-color-options {
        margin-top: 0;
    }
}