

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: #334155;
    font-size: 0.86rem;
    letter-spacing: 0.01em;
}

#templates-modal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

#templates-modal-grid .template-gallery-card {
    appearance: none;
    width: 100%;
    max-height: 24rem;
    border: 1px solid rgba(148, 163, 184, 0.26);
    background: #ffffff;
    border-radius: 1.25rem;
    overflow: hidden;
    padding: 0;
    text-align: left;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    min-width: 0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

#templates-modal-grid .template-gallery-card:hover {
    transform: translateY(-1px);
    border-color: rgba(59, 130, 246, 0.25);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.12);
}

#templates-modal-grid .template-gallery-card:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.16), 0 14px 34px rgba(15, 23, 42, 0.12);
}

#templates-modal-grid .template-gallery-card__preview {
    position: relative;
    aspect-ratio: var(--template-preview-ratio, 4 / 3);
    min-height: 11rem;
    max-height: 18rem;
    background: #f8fafc;
    overflow: hidden;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

#templates-modal-grid .template-gallery-card__preview-surface {
    position: relative;
    width: 100%;
    height: 100%;
    display: block;
    --design-preview-radius: 0;
}

#templates-modal-grid .template-gallery-card__preview-surface--blank {
    background-image: none;
}

#templates-modal-grid .template-gallery-card__preview-frame {
    width: 100%;
    height: 100%;
    --design-preview-radius: 0;
    --design-preview-inset: 0.7rem;
}

#templates-modal-grid .template-gallery-card__preview-content {
    position: relative;
    inset: auto;
    display: flex;
    width: 100%;
    height: 100%;
    max-width: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
}

#templates-modal-grid .template-gallery-card__preview-image {
    position: relative;
    width: 100%;
    height: 100%;
    margin: 0;
    background: transparent;
}

#templates-modal-grid .template-gallery-card__preview-content svg {
    display: block;
    width: auto !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100%;
    pointer-events: none;
}

#templates-modal-grid .template-gallery-card__blank-stage {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.9rem;
}

#templates-modal-grid .template-gallery-card__blank-fallback {
    width: 100%;
    height: 100%;
    background: #ffffff;
}

#templates-modal-grid .template-gallery-card__blank-sheet {
    width: min(76%, 180px);
    height: min(76%, 180px);
    border-radius: 1.1rem;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 1rem;
}

#templates-modal-grid .template-gallery-card__blank-dot {
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 999px;
    background: linear-gradient(180deg, #dbeafe 0%, #bfdbfe 100%);
    position: relative;
}

#templates-modal-grid .template-gallery-card__blank-dot::before {
    content: '';
    position: absolute;
    inset: 0.55rem;
    border-radius: 999px;
    border: 2px solid rgba(59, 130, 246, 0.55);
}

#templates-modal-grid .template-gallery-card__blank-line {
    display: block;
    width: 100%;
    height: 0.55rem;
    border-radius: 999px;
    background: #e2e8f0;
}

#templates-modal-grid .template-gallery-card__blank-line--short {
    width: 55%;
}

#templates-modal-grid .template-gallery-card__blank-line--wide {
    width: 82%;
}

#templates-modal-grid .template-gallery-card__info {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    padding: 0.78rem 0.85rem 0.9rem;
    min-width: 0;
}

#templates-modal-grid .template-gallery-card__title {
    color: #0f172a;
    font-size: 0.84rem;
    line-height: 1.15;
    font-weight: 700;
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

#templates-modal-grid .template-gallery-card__meta {
    color: #64748b;
    font-size: 0.8125rem;
    line-height: 1.1;
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

#templates-modal-grid .template-gallery-card--loading {
    pointer-events: none;
}

#templates-modal-grid .template-gallery-card__skeleton {
    border-radius: 0.95rem;
    background: linear-gradient(90deg, #e2e8f0 25%, #f8fafc 37%, #e2e8f0 63%);
    background-size: 400% 100%;
    animation: templateGalleryShimmer 1.35s ease infinite;
}

#templates-modal-grid .template-gallery-card__skeleton--preview {
    width: 100%;
    height: 100%;
    border-radius: 0;
}

#templates-modal-grid .template-gallery-card__skeleton--title {
    height: 0.9rem;
    width: 72%;
    margin: 0 auto;
}

#templates-modal-grid .template-gallery-card__skeleton--meta {
    height: 0.58rem;
    width: 44%;
    margin: 0 auto;
}

@keyframes templateGalleryShimmer {
    0% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0 50%;
    }
}

@media (min-width: 640px) {
    #templates-modal-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    #templates-modal-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

#product-templates-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

#product-templates-grid .template-toggle-preview {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    --design-preview-radius: 0.75rem;
}

#product-templates-grid .template-toggle-preview-frame {
    width: 100%;
    height: 100%;
    --design-preview-radius: 0.75rem;
    --design-preview-inset: 8px;
}

#product-templates-grid .template-toggle-preview img {
    width: 100% !important;
    height: 100% !important;
}

#product-templates-grid .template-preview-img {
    width: 100%;
    height: 100%;
}

.template-preview-svg-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.template-preview-svg-wrap svg {
    display: block;
    width: auto !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
}

@media (min-width: 640px) {
    #product-templates-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    #product-templates-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    #product-templates-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

/* ===== CHECKOUT PAGE ===== */

.checkout-page {
    background: #f6f7f9;
    color: var(--text-main);
}

.checkout-nav {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    box-shadow: none;
}

.checkout-security {
    color: var(--text-muted);
    font-weight: 600;
}

.checkout-security i {
    color: var(--success);
}

.checkout-steps-wrap {
    background: #ffffff;
    border-bottom: 1px solid var(--line);
}

.checkout-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.875rem;
}

.checkout-step {
    appearance: none;
    border: 0;
    background: transparent;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 600;
    padding: 0;
    cursor: pointer;
    transition: color 0.18s ease;
}

.checkout-step:hover {
    transform: none !important;
    box-shadow: none !important;
    color: #475569;
}

.checkout-step-number {
    background: #e2e8f0;
    color: #64748b;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    font-weight: 700;
    line-height: 1;
}

.checkout-step-text {
    font-size: 0.92rem;
    white-space: nowrap;
}

.checkout-step-active {
    color: #0f172a;
}

.checkout-step-active .checkout-step-number,
.checkout-step-complete .checkout-step-number {
    background: var(--primary);
    color: #ffffff;
}

.checkout-step-complete {
    color: #0f172a;
}

.checkout-step-line {
    background: #d1d5db;
    display: block;
    height: 1px;
    width: 4rem;
}

.checkout-step-line-active {
    background: var(--primary);
}

.checkout-surface-card {
    border-radius: var(--radius-lg);
    box-shadow: none;
    border-color: #e2e8f0;
}

.checkout-main-card {
    background: #ffffff;
    position: relative;
}

.checkout-step-panel {
    padding: 1.5rem;
}

.checkout-step-panel[hidden] {
    display: none !important;
}

.checkout-feedback {
    position: fixed;
    top: 5.25rem;
    left: 50%;
    width: min(calc(100% - 2rem), 34rem);
    margin: 0;
    transform: translateX(-50%);
    z-index: 80;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.16);
}

.checkout-panel-heading {
    margin-bottom: 1.15rem;
}

.checkout-panel-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.checkout-step-badge {
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 999px;
    background: #0f172a;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    line-height: 1;
}

.checkout-payment-option {
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: #ffffff;
    transition: border-color 0.18s ease, background 0.18s ease;
}

.checkout-payment-option:hover {
    border-color: rgba(15, 23, 42, 0.22);
    background: #f8fafc;
}

.checkout-embed-shell {
    border-top: 1px solid #e2e8f0;
    padding-top: 1.25rem;
    margin-top: 1.25rem;
    position: relative;
}

.checkout-embed-loader {
    display: flex;
    min-height: 4rem;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: #475569;
    font-size: 0.95rem;
    font-weight: 500;
}

.checkout-embed-loader.hidden {
    display: none !important;
}

.checkout-embed-container {
    min-height: 0;
    overflow: hidden;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    background: #ffffff;
}

.checkout-embed-container-ready {
    min-height: 32rem;
}

.checkout-page.checkout-payment-active .checkout-main-card .form-input:disabled,
.checkout-page.checkout-payment-active .checkout-main-card select:disabled,
.checkout-page.checkout-payment-active .checkout-main-card textarea:disabled {
    cursor: not-allowed;
    background: #f8fafc;
    color: #475569;
}

.checkout-page[data-checkout-step="payment"] [data-checkout-panel="confirm"] > .checkout-panel-heading,
.checkout-page[data-checkout-step="payment"] [data-checkout-panel="confirm"] > .checkout-form-section,
.checkout-page[data-checkout-step="payment"] [data-checkout-panel="confirm"] > .checkout-consent-stack,
.checkout-page[data-checkout-step="payment"] [data-checkout-panel="confirm"] > .checkout-panel-actions,
.checkout-page[data-checkout-step="payment"] .checkout-summary-column {
    display: none !important;
}

.checkout-page[data-checkout-step="payment"] .checkout-main-column {
    grid-column: 1 / -1;
}

.checkout-page[data-checkout-step="payment"] > section {
    padding-top: 0 !important;
}

.checkout-page[data-checkout-step="payment"] > section > .max-w-7xl {
    max-width: none;
    padding-left: 0;
    padding-right: 0;
}

.checkout-page[data-checkout-step="payment"] .checkout-main-card {
    max-width: 100%;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0;
    box-shadow: none;
    margin-inline: auto;
}

.checkout-page[data-checkout-step="payment"] .checkout-step-panel[data-checkout-panel="confirm"] {
    padding: 0;
}

.checkout-page[data-checkout-step="payment"] .checkout-step-panel[data-checkout-panel="confirm"] > .checkout-embed-shell {
    border-top: 0;
    padding-top: 0;
    margin-top: 0;
}

.checkout-page[data-checkout-step="payment"] .checkout-embed-actions,
.checkout-page[data-checkout-step="payment"] .checkout-embed-container {
    width: min(100%, 36rem);
    margin-inline: auto;
}

.checkout-page[data-checkout-step="payment"] .checkout-embed-actions,
.checkout-page[data-checkout-step="payment"] .checkout-embed-shell > .mb-4 {
    display: none !important;
}

.checkout-page[data-checkout-step="payment"] .checkout-embed-shell {
    border-top: 0;
    margin-top: 0;
    padding-top: 0;
}

.checkout-page[data-checkout-step="payment"] .checkout-embed-container {
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.checkout-main-card .app-section-title,
.checkout-surface-card .app-section-title {
    font-size: 1.1rem;
    letter-spacing: 0;
    line-height: 1.3;
}