:root {
    --zaicana-section-navy: #071d3d;
    --zaicana-section-blue: #0f4c92;
    --zaicana-section-gold: #d8aa3d;
    --zaicana-section-gold-light: #f2c766;
}

.zaicana-section-builder,
.zaicana-section-builder *,
.zaicana-section-modal,
.zaicana-section-modal * {
    box-sizing: border-box;
}

.zaicana-section-builder {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.zaicana-dynamic-sections {
    display: grid;
    width: 100%;
    min-width: 0;
}

.zaicana-dynamic-section {
    position: relative;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: clamp(42px, 7vw, 82px) max(20px, calc((100% - 1180px) / 2));
    background: #fff;
    color: #273a52;
}

.zaicana-dynamic-section:nth-child(even) {
    background: #f3f7fc;
}

.zaicana-dynamic-section-inner {
    position: relative;
    display: grid;
    gap: clamp(20px, 4vw, 42px);
    width: 100%;
    min-width: 0;
    max-width: 1180px;
    margin: 0 auto;
}

.zaicana-dynamic-section--image_text .zaicana-dynamic-section-inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
}

.zaicana-dynamic-section--image_text.is-image-left .zaicana-dynamic-image {
    order: -1;
}

.zaicana-dynamic-section--image_text.is-image-right .zaicana-dynamic-image {
    order: 2;
}

.zaicana-dynamic-section--image_text.is-image-right .zaicana-dynamic-copy {
    order: 1;
}

.zaicana-dynamic-section--image_text.is-image-top .zaicana-dynamic-section-inner {
    grid-template-columns: minmax(0, 1fr);
}

.zaicana-dynamic-section--image_text.is-image-top .zaicana-dynamic-image {
    order: -1;
}

.zaicana-dynamic-section--image_card .zaicana-dynamic-section-inner {
    max-width: 720px;
    border: 1px solid rgba(15, 76, 146, .12);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 18px 52px rgba(7, 29, 61, .11);
    overflow: hidden;
}

.zaicana-dynamic-section--image_card .zaicana-dynamic-copy {
    padding: 0 26px 28px;
}

.zaicana-dynamic-section--card .zaicana-dynamic-section-inner,
.zaicana-dynamic-section--cta .zaicana-dynamic-section-inner {
    padding: clamp(24px, 5vw, 46px);
    border: 1px solid rgba(15, 76, 146, .13);
    border-radius: 22px;
    background: linear-gradient(135deg, #fff, #f6f9fe);
    box-shadow: 0 16px 48px rgba(7, 29, 61, .09);
}

.zaicana-dynamic-section--cta .zaicana-dynamic-section-inner {
    background: linear-gradient(135deg, var(--zaicana-section-navy), var(--zaicana-section-blue));
    color: #fff;
}

.zaicana-dynamic-section--hero_image_section {
    isolation: isolate;
    min-height: 440px;
    display: grid;
    align-items: center;
    background-image: linear-gradient(90deg, rgba(4, 16, 42, .92), rgba(7, 30, 70, .62)), var(--zaicana-section-bg);
    background-position: center;
    background-size: cover;
    color: #fff;
}

.zaicana-dynamic-section--hero_image_section .zaicana-dynamic-copy {
    max-width: 720px;
}

.zaicana-dynamic-copy {
    min-width: 0;
}

.zaicana-dynamic-copy h2 {
    margin: 0;
    color: var(--zaicana-section-navy);
    font-size: clamp(27px, 4vw, 43px);
    line-height: 1.12;
    overflow-wrap: anywhere;
}

.zaicana-dynamic-section--cta h2,
.zaicana-dynamic-section--hero_image_section h2 {
    color: #fff;
}

.zaicana-dynamic-copy p {
    margin: 15px 0 0;
    color: inherit;
    font-size: clamp(15px, 2vw, 18px);
    line-height: 1.72;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.zaicana-dynamic-image {
    min-width: 0;
    margin: 0;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 18px 52px rgba(7, 29, 61, .14);
}

.zaicana-dynamic-image img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: clamp(260px, 40vw, 480px);
    object-fit: cover;
}

.zaicana-dynamic-image figcaption {
    padding: 11px 14px;
    background: #fff;
    color: #64748b;
    font-size: 12px;
}

.zaicana-dynamic-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    min-height: 45px;
    margin-top: 20px;
    padding: 11px 17px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--zaicana-section-gold), var(--zaicana-section-gold-light));
    color: #2a1c04;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
}

.zaicana-dynamic-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    min-width: 0;
}

.zaicana-dynamic-gallery-grid .zaicana-dynamic-image img {
    height: clamp(190px, 24vw, 300px);
}

.zaicana-section-controls {
    display: none;
    position: absolute;
    top: -27px;
    right: 0;
    z-index: 15;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 100%;
}

body.zaicana-edit-mode .zaicana-section-controls {
    display: flex;
}

.zaicana-section-controls button,
.zaicana-section-builder-add-wrap button {
    min-width: 34px;
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid rgba(216, 170, 61, .5);
    border-radius: 9px;
    background: rgba(7, 29, 61, .95);
    color: #fff;
    font: 800 11px/1.2 inherit;
    box-shadow: 0 8px 24px rgba(3, 15, 36, .23);
    cursor: pointer;
}

.zaicana-section-controls .is-danger {
    border-color: rgba(255, 176, 186, .42);
    color: #ffd7dc;
}

.zaicana-section-controls button:disabled,
.zaicana-section-builder-add-wrap button:disabled {
    cursor: wait;
    opacity: .58;
}

.zaicana-section-builder-add-wrap {
    display: none;
    justify-content: center;
    width: 100%;
    padding: 18px 20px;
    border-top: 1px dashed rgba(15, 76, 146, .22);
    background: #eef4fb;
}

body.zaicana-edit-mode .zaicana-section-builder-add-wrap {
    display: flex;
}

.zaicana-section-builder-add-wrap button {
    min-height: 43px;
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--zaicana-section-navy), var(--zaicana-section-blue));
}

.zaicana-section-modal {
    position: fixed;
    inset: 0;
    z-index: 100500;
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    padding: 18px;
    background: rgba(3, 15, 36, .74);
    opacity: 0;
    overflow: auto;
    backdrop-filter: blur(8px);
    transition: opacity .18s ease;
}

.zaicana-section-modal[hidden] {
    display: none !important;
}

.zaicana-section-modal.is-visible {
    opacity: 1;
}

.zaicana-section-dialog {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    width: min(780px, 100%);
    min-width: 0;
    max-width: 100%;
    max-height: calc(100vh - 36px);
    border-radius: 22px;
    background: #fff;
    color: #283b53;
    box-shadow: 0 30px 90px rgba(2, 12, 30, .45);
    overflow: hidden;
    transform: translateY(10px) scale(.985);
    transition: transform .2s ease;
}

.zaicana-section-modal.is-visible .zaicana-section-dialog {
    transform: none;
}

.zaicana-section-dialog > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(15, 76, 146, .11);
    background: linear-gradient(135deg, #f7faff, #fff);
}

.zaicana-section-dialog > header span {
    color: var(--zaicana-section-blue);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.zaicana-section-dialog h2 {
    margin: 4px 0 0;
    color: var(--zaicana-section-navy);
    font-size: 25px;
}

.zaicana-section-dialog > header button {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid rgba(15, 76, 146, .16);
    border-radius: 11px;
    background: #fff;
    color: var(--zaicana-section-navy);
    font: 400 27px/1 sans-serif;
    cursor: pointer;
}

.zaicana-section-dialog form {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    min-width: 0;
    min-height: 0;
    margin: 0;
}

.zaicana-section-form-body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
    min-width: 0;
    padding: 20px;
    overflow-y: auto;
}

.zaicana-section-form-body [hidden] {
    display: none !important;
}

.zaicana-section-form-body > label,
.zaicana-section-image-fields,
.zaicana-section-gallery-fields,
.zaicana-section-button-fields {
    display: grid;
    gap: 8px;
    min-width: 0;
    margin: 0;
}

.zaicana-section-form-body > label[data-section-field="text"],
.zaicana-section-image-fields,
.zaicana-section-gallery-fields,
.zaicana-section-button-fields {
    grid-column: 1 / -1;
}

.zaicana-section-image-fields,
.zaicana-section-button-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 15px;
    border: 1px solid rgba(15, 76, 146, .12);
    border-radius: 14px;
    background: #f7faff;
}

.zaicana-section-image-fields > label:first-of-type {
    grid-column: 1 / -1;
}

.zaicana-section-form-body label {
    display: grid;
    gap: 7px;
    min-width: 0;
    margin: 0;
}

.zaicana-section-form-body label > span,
.zaicana-section-gallery-head strong {
    color: #34475f;
    font-size: 12px;
    font-weight: 850;
}

.zaicana-section-form-body input,
.zaicana-section-form-body textarea,
.zaicana-section-form-body select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 11px 12px;
    border: 1px solid rgba(15, 76, 146, .2);
    border-radius: 11px;
    background: #fbfdff;
    color: #283b53;
    font: 500 14px/1.45 inherit;
}

.zaicana-section-form-body textarea {
    resize: vertical;
}

.zaicana-section-file-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    min-width: 0;
}

.zaicana-section-file-row button,
.zaicana-section-gallery-head button,
.zaicana-section-gallery-item-actions button {
    min-height: 40px;
    padding: 8px 11px;
    border: 1px solid rgba(15, 76, 146, .2);
    border-radius: 10px;
    background: #eaf2fb;
    color: var(--zaicana-section-blue);
    font: 800 12px/1.2 inherit;
    cursor: pointer;
}

.zaicana-section-gallery-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

[data-section-gallery-list] {
    display: grid;
    gap: 10px;
}

.zaicana-section-gallery-item {
    display: grid;
    grid-template-columns: 100px minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
    min-width: 0;
    padding: 10px;
    border: 1px solid rgba(15, 76, 146, .12);
    border-radius: 13px;
    background: #f7faff;
}

.zaicana-section-gallery-item > img {
    width: 100px;
    height: 100px;
    border-radius: 10px;
    object-fit: cover;
}

.zaicana-section-gallery-item > div:nth-child(2) {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.zaicana-section-gallery-item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    max-width: 110px;
}

.zaicana-section-gallery-item-actions .is-danger {
    color: #a62a39;
}

.zaicana-section-gallery-empty {
    margin: 0;
    padding: 13px;
    border: 1px dashed rgba(15, 76, 146, .22);
    border-radius: 11px;
    color: #64748b;
    text-align: center;
}

.zaicana-section-dialog form > footer {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 9px;
    padding: 15px 20px;
    border-top: 1px solid rgba(15, 76, 146, .11);
    background: #f7faff;
}

.zaicana-section-dialog form > footer button {
    min-height: 42px;
    padding: 10px 15px;
    border: 1px solid rgba(15, 76, 146, .18);
    border-radius: 11px;
    background: #fff;
    color: #52647a;
    font: 850 13px/1.2 inherit;
    cursor: pointer;
}

.zaicana-section-dialog form > footer .is-primary {
    border-color: rgba(216, 170, 61, .5);
    background: linear-gradient(135deg, var(--zaicana-section-navy), var(--zaicana-section-blue));
    color: #fff;
}

.zaicana-section-dialog button:disabled {
    cursor: wait;
    opacity: .58;
}

body.zaicana-section-modal-open {
    overflow: hidden;
}

.zaicana-section-toast {
    position: fixed;
    right: 24px;
    bottom: 140px;
    z-index: 100600;
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(350px, calc(100vw - 32px));
    padding: 13px 15px;
    border-radius: 14px;
    background: rgba(7, 29, 61, .97);
    color: #fff;
    box-shadow: 0 18px 50px rgba(3, 15, 36, .3);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .2s ease, transform .2s ease;
}

.zaicana-section-toast.is-visible {
    opacity: 1;
    transform: none;
}

.zaicana-section-toast > span {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 25px;
    height: 25px;
    border-radius: 8px;
    background: var(--zaicana-section-gold-light);
    color: #2a1c04;
    font-weight: 900;
}

.zaicana-section-toast strong {
    min-width: 0;
    font-size: 13px;
    overflow-wrap: anywhere;
}

@media (max-width: 800px) {
    .zaicana-dynamic-section--image_text .zaicana-dynamic-section-inner {
        grid-template-columns: minmax(0, 1fr);
    }

    .zaicana-dynamic-section--image_text .zaicana-dynamic-image,
    .zaicana-dynamic-section--image_text.is-image-right .zaicana-dynamic-image {
        order: -1;
    }

    .zaicana-dynamic-section--image_text.is-image-right .zaicana-dynamic-copy {
        order: 0;
    }

    .zaicana-dynamic-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .zaicana-section-form-body {
        grid-template-columns: minmax(0, 1fr);
    }

    .zaicana-section-form-body > label[data-section-field="text"],
    .zaicana-section-image-fields,
    .zaicana-section-gallery-fields,
    .zaicana-section-button-fields {
        grid-column: auto;
    }
}

@media (max-width: 560px) {
    .zaicana-dynamic-gallery-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .zaicana-section-controls {
        top: -32px;
        left: 0;
        right: 0;
        justify-content: flex-start;
    }

    .zaicana-section-modal {
        align-items: end;
        padding: 12px;
    }

    .zaicana-section-dialog {
        width: 100%;
        max-height: calc(100dvh - 24px);
        border-radius: 18px;
    }

    .zaicana-section-form-body,
    .zaicana-section-dialog > header,
    .zaicana-section-dialog form > footer {
        padding-right: 16px;
        padding-left: 16px;
    }

    .zaicana-section-image-fields,
    .zaicana-section-button-fields {
        grid-template-columns: minmax(0, 1fr);
    }

    .zaicana-section-image-fields > label:first-of-type {
        grid-column: auto;
    }

    .zaicana-section-file-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .zaicana-section-gallery-item {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .zaicana-section-gallery-item > img {
        width: 72px;
        height: 72px;
    }

    .zaicana-section-gallery-item-actions {
        grid-column: 1 / -1;
        max-width: none;
    }

    .zaicana-section-dialog form > footer > button {
        flex: 1 1 140px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .zaicana-section-modal,
    .zaicana-section-dialog,
    .zaicana-section-toast {
        transition: none;
    }
}
