﻿.theme-builder-section {
    padding: 24px;
    border: 1px solid #e4e7ec;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
}

.theme-builder-section + .theme-builder-section,
.theme-builder-grid {
    margin-top: 20px;
}

.theme-builder-section-heading {
    margin-bottom: 18px;
}

.theme-builder-section-heading h3,
.theme-live-preview-heading h3 {
    margin: 0;
    color: #101828;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.25;
}

.theme-builder-section-heading p {
    margin: 6px 0 0;
    color: #667085;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.template-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.template-section-heading > span {
    flex: 0 0 auto;
    color: #667085;
    font-size: 13px;
    font-weight: 700;
}

.template-choice-stage {
    padding: 28px;
    border: 1px solid #e7eaf0;
    border-radius: 12px;
    background: #f6f8fb;
}

.template-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 520px));
    justify-content: center;
    gap: 24px;
}

.template-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 18px;
    border: 2px solid transparent;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 12px 32px rgba(16, 24, 40, 0.08);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.template-card:hover {
    box-shadow: 0 16px 38px rgba(16, 24, 40, 0.12);
    transform: translateY(-2px);
}

.template-card.is-selected {
    border-color: #11194f;
    box-shadow: 0 16px 38px rgba(17, 25, 79, 0.14);
}

.template-card-visual {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border: 1px solid #e9ecf2;
    border-radius: 10px;
    background: #f5f7fa;
    box-shadow: 0 4px 16px rgba(16, 24, 40, 0.07);
}

.template-card-visual img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

.template-card-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #98a2b3;
    font-size: 13px;
    font-weight: 700;
}

.template-card-image-placeholder i {
    font-size: 30px;
}

.template-card-check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #ffffff;
    border-radius: 50%;
    background: #25b99a;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 185, 154, 0.3);
    font-size: 12px;
}

.template-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin: 18px 0 20px;
}

.template-card-heading h4 {
    margin: 0;
    color: #10164c;
    font-size: 18px;
    font-weight: 900;
    line-height: 1.2;
}

.template-card-heading p {
    max-width: 340px;
    margin: 6px 0 0;
    color: #667085;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
}

.template-card-preview-action {
    min-height: 38px;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    border: 1px solid #11194f;
    border-radius: 999px;
    background: #ffffff;
    color: #11194f;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease;
}

.template-card-preview-action:hover {
    background: #11194f;
    color: #ffffff;
}

.template-card-select-action {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-top: auto;
    border: 1px solid #11194f;
    border-radius: 9px;
    background: #ffffff;
    color: #11194f;
    font: inherit;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.template-card-select-action:not(:disabled):hover {
    background: #11194f;
    color: #ffffff;
}

.template-card-select-action:disabled {
    border-color: transparent;
    background: #dcf7f1;
    color: #15977f;
    cursor: default;
    opacity: 1;
}

.template-card-selected-icon {
    width: 23px;
    height: 23px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #25b99a;
    color: #ffffff;
    font-size: 10px;
}

.template-card-preview-action:focus-visible,
.template-card-select-action:focus-visible {
    outline: 3px solid rgba(37, 185, 154, 0.28);
    outline-offset: 2px;
}

.template-preview-dialog .rz-dialog-content {
    padding: 0;
}

.template-preview-carousel {
    position: relative;
    min-height: 260px;
    background: #f8fafc;
}

.template-preview-carousel > img {
    display: block;
    width: 100%;
    max-height: min(70vh, 720px);
    object-fit: contain;
}

.template-preview-carousel-action {
    position: absolute;
    top: 50%;
    z-index: 1;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.94);
    color: #101828;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
    transform: translateY(-50%);
}

.template-preview-carousel-action.previous {
    left: 16px;
}

.template-preview-carousel-action.next {
    right: 16px;
}

.template-preview-carousel-indicators {
    position: absolute;
    right: 0;
    bottom: 16px;
    left: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.template-preview-carousel-indicators button {
    width: 9px;
    height: 9px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    background: rgba(16, 24, 40, 0.45);
}

.template-preview-carousel-indicators button.is-active {
    background: #ffffff;
}

.theme-base-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.theme-base-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 12px;
    border: 1px solid #e4e7ec;
    border-radius: 12px;
    background: #ffffff;
    text-align: left;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.theme-base-card:hover {
    border-color: #25b99a;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.theme-base-card.is-selected {
    border-color: #25b99a;
    background: linear-gradient(180deg, #f8fffd 0%, #f0fbf8 100%);
    box-shadow: 0 10px 26px rgba(37, 185, 154, 0.18);
}

.theme-base-preview {
    overflow: hidden;
    min-height: 238px;
    display: flex;
    flex-direction: column;
    padding: 14px;
    border-radius: 10px;
    background: var(--theme-preview-background);
    color: var(--theme-preview-text);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.theme-base-preview-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.theme-base-preview-header strong {
    color: var(--theme-preview-text);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
}

.theme-base-preview-header span {
    display: inline-flex;
    gap: 8px;
    color: var(--theme-preview-muted);
    font-size: 12px;
}

.theme-base-preview-menu {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.theme-base-preview-menu span {
    min-height: 18px;
    display: inline-flex;
    align-items: center;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--theme-preview-primary);
    color: var(--theme-preview-button-text);
    font-size: 8px;
    font-weight: 800;
}

.theme-base-preview-content {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(118px, 0.7fr);
    gap: 12px;
    margin-top: auto;
}

.theme-base-preview-product-image,
.theme-live-preview-product-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(37, 185, 154, 0.14), rgba(47, 128, 237, 0.10));
}

.theme-base-preview-product-image img {
    width: 128px;
    height: 108px;
    object-fit: contain;
}

.theme-base-preview-product-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 12px;
    border-radius: 8px;
    background: var(--theme-preview-card);
    color: var(--theme-preview-text);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.theme-base-preview-product-card strong {
    color: var(--theme-preview-text);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
}

.theme-base-preview-product-card small {
    margin-top: 5px;
    color: var(--theme-preview-text);
    font-size: 9px;
    font-weight: 600;
    line-height: 1.3;
}

.theme-base-preview-order-button {
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: auto;
    border-radius: 6px;
    background: var(--theme-preview-primary);
    color: var(--theme-preview-button-text);
    font-size: 9px;
    font-weight: 800;
}

.theme-base-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
}

.theme-base-card-footer strong,
.theme-base-card-footer span {
    display: block;
}

.theme-base-card-footer strong {
    color: #101828;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.25;
}

.theme-base-card-footer span {
    margin-top: 3px;
    color: #667085;
    font-size: 12px;
    font-weight: 600;
}

.theme-base-selection-indicator {
    width: 22px;
    height: 22px;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border: 1px solid #d0d5dd;
    border-radius: 50%;
    background: #ffffff;
    color: #ffffff;
}

.theme-base-card.is-selected .theme-base-selection-indicator {
    border-color: #25b99a;
    background: #25b99a;
    text-align: center;
    justify-content: center;
}

.theme-base-selection-indicator i {
    font-size: 11px;
}

.theme-builder-grid {
    display: grid;
    grid-template-columns: minmax(300px, 0.72fr) minmax(500px, 1.28fr);
    gap: 20px;
    align-items: start;
}

.theme-color-picker-container {
    display: grid;
    gap: 12px;
    width: 100%;
}

.theme-color-picker-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    min-height: 58px;
}

.theme-color-picker-label {
    display: block;
    margin: 0;
    color: #101828;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.25;
}

.theme-color-picker-description {
    display: block;
    margin-top: 3px;
    color: #667085;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}

.theme-color-picker-item .rz-colorpicker {
    width: 112px;
}

.theme-contrast-note {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 10px;
    margin-top: 18px;
    padding: 14px;
    border: 1px solid #ffd8bf;
    border-radius: 8px;
    background: #fff7ed;
    color: #7a2e0e;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.theme-contrast-note i {
    color: #f97316;
    font-size: 16px;
}

.theme-live-preview-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.theme-readability-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.theme-readability-badge.is-valid {
    border: 1px solid #b8e8dd;
    background: #f0fbf8;
    color: #08745f;
}

.theme-readability-badge.is-invalid {
    border: 1px solid #ffd5cc;
    background: #fff6f3;
    color: #b42318;
}

.theme-live-preview {
    overflow: hidden;
    padding: 24px;
    border-radius: 12px;
    background: var(--theme-preview-background);
    color: var(--theme-preview-text);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.10);
}

.theme-live-preview-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.theme-live-preview-header h4 {
    margin: 0;
    color: var(--theme-preview-text);
    font-size: 24px;
    font-weight: 800;
    line-height: 1.1;
}

.theme-live-preview-header p,
.theme-live-preview-product-card p,
.theme-live-preview-caption {
    color: var(--theme-preview-muted);
}

.theme-live-preview-benefits span {
    color: var(--theme-preview-text);
}

.theme-live-preview-header p {
    margin: 6px 0 0;
    font-size: 12px;
    font-weight: 600;
}

.theme-live-preview-basket {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid var(--theme-preview-primary);
    border-radius: 7px;
    background: transparent;
    color: var(--theme-preview-primary);
    font-size: 13px;
    font-weight: 800;
}

.theme-live-preview-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0;
    padding-bottom: 13px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.theme-live-preview-nav span {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    border-radius: 999px;
    color: var(--theme-preview-text);
    font-size: 11px;
    font-weight: 800;
}

.theme-live-preview-nav span:first-child {
    background: var(--theme-preview-primary);
    color: var(--theme-preview-button-text);
}

.theme-live-preview-content {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(270px, 0.88fr);
    gap: 24px;
    align-items: stretch;
}

.theme-live-preview-product-visual {
    min-height: 248px;
}

.theme-live-preview-product-visual img {
    width: 190px;
    height: 180px;
    object-fit: contain;
}

.theme-live-preview-product-card {
    display: flex;
    flex-direction: column;
    padding: 24px;
    border-radius: 10px;
    background: var(--theme-preview-card);
    color: var(--theme-preview-text);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.10);
}

.theme-live-preview-product-card h5 {
    margin: 0;
    color: var(--theme-preview-text);
    font-size: 18px;
    font-weight: 800;
}

.theme-live-preview-product-card p {
    color: var(--theme-preview-text);
    margin: 10px 0 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
}

.theme-live-preview-product-card strong {
    margin-top: 14px;
    color: var(--theme-preview-text);
    font-size: 16px;
    font-weight: 900;
}

.theme-live-preview-product-card button {
    min-height: 42px;
    margin-top: auto;
    border: 0;
    border-radius: 7px;
    background: var(--theme-preview-primary);
    color: var(--theme-preview-button-text);
    font-size: 14px;
    font-weight: 800;
}

.theme-live-preview-benefits {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 22px;
}

.theme-live-preview-benefits span {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
}

.theme-live-preview-benefits i {
    color: var(--theme-preview-primary);
    font-size: 17px;
}

.theme-live-preview-caption {
    margin: 9px 0 0;
    font-size: 11px;
    font-weight: 600;
}

.theme-base-card:focus-visible,
.theme-live-preview button:focus-visible {
    outline: 3px solid rgba(37, 185, 154, 0.28);
    outline-offset: 2px;
}

.rz-switch .rz-switch-circle:before {
    border-radius: 50%;
}

.rz-switch .rz-switch-circle {
    border-radius: 30px;
}

@media (max-width: 1180px) {
    .theme-base-grid,
    .theme-builder-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .theme-builder-section {
        padding: 16px;
    }

    .template-section-heading {
        align-items: flex-start;
    }

    .template-choice-stage {
        padding: 14px;
    }

    .theme-live-preview-header,
    .theme-live-preview-heading {
        flex-direction: column;
        align-items: flex-start;
    }

    .theme-live-preview-content,
    .theme-live-preview-benefits {
        grid-template-columns: 1fr;
    }

    .theme-color-picker-item {
        grid-template-columns: 1fr;
    }

    .theme-color-picker-item .rz-colorpicker {
        width: 100%;
    }

    .template-choice-grid {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 480px) {
    .template-section-heading,
    .template-card-heading {
        flex-direction: column;
    }

    .template-card {
        padding: 12px;
    }

    .template-card-preview-action {
        width: 100%;
    }
}
