/*
 * Marrycene theme catalog
 * Page-scoped styles for /tema only. Keep preview rules here so they cannot
 * collide with the invitation renderer or the rest of the public website.
 */

.theme-public-page .theme-public-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(170px, 220px) minmax(150px, 190px) auto auto;
    align-items: stretch;
    gap: 10px;
    max-width: 780px;
    margin: 20px auto 28px;
}

.theme-public-page .theme-public-tools input,
.theme-public-page .theme-public-tools select {
    min-height: 52px;
    padding: 12px 14px;
    border: 1px solid #deded8;
    border-radius: 12px;
    background: #fff;
}

.theme-public-page .theme-filter-apply,
.theme-public-page .theme-filter-reset {
    min-height: 52px;
    padding: 0 18px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.theme-public-page .theme-filter-apply {
    border: 1px solid #1d4138;
    background: #1d4138;
    color: #fff;
}

.theme-public-page .theme-filter-reset {
    border: 1px solid #d9d9d3;
    background: #fff;
    color: #1d2a26;
}

.theme-public-page .theme-modern.is-filtered-out,
.theme-public-page .theme-modern[aria-hidden="true"] {
    display: none !important;
}

.theme-public-page .theme-filter-no-result {
    grid-column: 1 / -1;
    min-height: 220px;
    padding: 32px;
    border: 1px dashed #d9d9d3;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
}

.theme-public-page .theme-filter-no-result a {
    margin-top: 8px;
    color: #1d4138;
    font-weight: 700;
}

.theme-public-page .theme-empty {
    padding: 50px;
    color: #777;
    text-align: center;
}

.theme-public-page .theme-image-wrapper .theme-tier-badge {
    position: absolute;
    z-index: 4;
    top: 14px;
    left: 14px;
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 1.08rem;
    font-weight: 800;
    letter-spacing: .08em;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .14);
    backdrop-filter: blur(8px);
}

.theme-public-page .theme-tier-badge.silver {
    border: 1px solid rgba(73, 83, 84, .18);
    background: rgba(246, 247, 247, .94);
    color: #4d5658;
}

.theme-public-page .theme-tier-badge.gold {
    border: 1px solid rgba(166, 120, 35, .25);
    background: rgba(255, 244, 218, .95);
    color: #805a15;
}

.theme-public-page .theme-package .pill.silver {
    background: #f1f4f4;
    color: #536063;
}

.theme-public-page .theme-package .pill.gold {
    background: #fff2d5;
    color: #805a15;
}

/* Canonical live-preview component. There is intentionally only one preview
 * implementation: a real fixed viewport scaled as a unit inside the modal. */
.theme-public-page .theme-preview-modal.live {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    place-items: center;
    padding: 12px;
    background: rgba(10, 14, 13, .76);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.theme-public-page .theme-preview-modal.live.active {
    display: grid;
}

.theme-public-page .theme-preview-box.live {
    width: min(620px, calc(100vw - 24px));
    height: min(940px, calc(100dvh - 24px));
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 30px 100px rgba(0, 0, 0, .38);
}

.theme-public-page .theme-preview-box.live[data-device="desktop"] {
    width: min(1320px, calc(100vw - 24px));
}

.theme-public-page .theme-preview-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid #ecebe7;
    background: #fff;
}

.theme-public-page .theme-preview-title {
    margin: 0;
    color: #171917;
    font-size: 1.6rem;
    font-weight: 600;
}

.theme-public-page .theme-preview-device {
    display: flex;
    gap: 7px;
    align-items: center;
}

.theme-public-page .theme-preview-device button {
    min-height: 40px;
    padding: 8px 11px;
    border: 1px solid #ddd8cf;
    border-radius: 9px;
    background: #faf9f6;
    color: #202623;
    cursor: pointer;
}

.theme-public-page .theme-preview-device button.is-active {
    border-color: #1f2926;
    background: #1f2926;
    color: #fff;
}

.theme-public-page .theme-preview-close {
    width: 42px;
    height: 42px;
    padding: 0 !important;
    display: grid;
    place-items: center;
    border: 0 !important;
    border-radius: 50% !important;
    background: #f3f4f3 !important;
    color: #222 !important;
    font-size: 24px !important;
    line-height: 1;
}

.theme-public-page .theme-preview-close:hover {
    background: #e7e9e7 !important;
}

.theme-public-page .theme-preview-body.live {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: grid;
    place-items: center;
    padding: 12px;
    background: #eef0ee;
}

.theme-public-page .theme-preview-stage {
    position: relative;
    flex: none;
    overflow: hidden;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 36px rgba(0, 0, 0, .14);
}

.theme-public-page .theme-preview-stage iframe {
    position: absolute;
    inset: 0 auto auto 0;
    display: block;
    max-width: none;
    max-height: none;
    border: 0;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
    transform-origin: top left;
}

@media (max-width: 1000px) {
    .theme-public-page .theme-public-tools {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 700px) {
    .theme-public-page .theme-preview-modal.live {
        padding: 0;
    }

    .theme-public-page .theme-preview-box.live,
    .theme-public-page .theme-preview-box.live[data-device="desktop"] {
        width: 100vw;
        height: 100dvh;
        border-radius: 0;
    }

    .theme-public-page .theme-preview-device button:not(.theme-preview-close) {
        display: none;
    }

    .theme-public-page .theme-preview-body.live {
        padding: 8px;
    }

    .theme-public-page .theme-preview-stage {
        border-radius: 8px;
    }
}

@media (max-width: 620px) {
    .theme-public-page .theme-public-tools {
        grid-template-columns: 1fr;
    }
}
