/**
 * Cerama Newsletter Block Styles
 * Scoped to .cerama-newsletter-wrap and .cerama-newsletter-modal
 */

.cerama-newsletter-wrap {
    box-sizing: border-box;
    width: 100%;
    margin-top: 0 !important;
    margin-bottom: 28px;
    margin-left: auto;
    margin-right: auto;
    font-family: inherit;
    scroll-margin-top: 100px;
    position: relative;
}

.cerama-newsletter-wrap * {
    box-sizing: border-box;
}

/* Background Variations */
.cerama-newsletter--bg-transparent {
    background: transparent;
}

.cerama-newsletter--bg-warm {
    background: #FBF9F5;
    border: 1px solid #E8DFD8;
    border-radius: 20px;
    padding: 36px 32px;
}

.cerama-newsletter--bg-subtle {
    background: #F8F9FA;
    border: 1px solid #ECECEC;
    border-radius: 20px;
    padding: 36px 32px;
}

.cerama-newsletter--bg-dark {
    background: #385D6B;
    border-radius: 20px;
    padding: 36px 32px;
    color: #FFFFFF;
}

/* ==========================================================================
   Full-Width Breakout Section
   ========================================================================== */
.cerama-newsletter--fullwidth {
    width: 100vw !important;
    position: relative !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100vw !important;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-top: 36px;
    padding-bottom: 36px;
    box-sizing: border-box !important;
    overflow-x: clip;
}

.cerama-newsletter--fullwidth .cerama-newsletter-inner {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
    width: 100%;
}

/* ==========================================================================
   Inner Layout (2-Column Grid / Flexbox)
   ========================================================================== */
.cerama-newsletter-inner {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 36px;
    align-items: center;
    width: 100%;
}

/* Content Left Column */
.cerama-newsletter-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.cerama-newsletter-badge-wrap {
    margin-bottom: 12px;
}

.cerama-newsletter-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #FFFFFF;
    color: #CB6843;
    border: 1px solid #E8DFD8;
    padding: 5px 16px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.cerama-newsletter-badge svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.5;
}

.cerama-newsletter--bg-dark .cerama-newsletter-badge {
    background: rgba(255, 255, 255, 0.15);
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, 0.25);
}

.cerama-newsletter-title {
    color: #385D6B;
    font-size: clamp(24px, 3.2vw, 34px);
    font-weight: 800;
    margin: 0 0 12px 0;
    line-height: 1.25;
}

.cerama-newsletter--bg-dark .cerama-newsletter-title {
    color: #FFFFFF;
}

.cerama-newsletter-desc {
    color: #555555;
    font-size: 15px;
    line-height: 1.6;
    margin: 0 0 20px 0;
    max-width: 580px;
}

.cerama-newsletter--bg-dark .cerama-newsletter-desc {
    color: #E2ECF0;
}

/* Perks List */
.cerama-newsletter-perks {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.cerama-newsletter-perk {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    font-weight: 600;
    color: #333333;
}

.cerama-newsletter--bg-dark .cerama-newsletter-perk {
    color: #F0F6F8;
}

.cerama-newsletter-perk svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    color: #CB6843;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.5;
}

.cerama-newsletter--bg-dark .cerama-newsletter-perk svg {
    color: #F7A384;
}

/* Action Box / Card on Right */
.cerama-newsletter-action-box {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.cerama-newsletter-card {
    background: #FFFFFF;
    border: 1px solid #E8DFD8;
    border-radius: 18px;
    padding: 28px 24px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.03);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cerama-newsletter--bg-dark .cerama-newsletter-card {
    background: #FFFFFF;
    border-color: transparent;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.cerama-newsletter-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: #FAF6F2;
    color: #CB6843;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.cerama-newsletter-card-icon svg {
    width: 26px;
    height: 26px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.cerama-newsletter-card-title {
    font-size: 19px;
    font-weight: 800;
    color: #385D6B;
    margin: 0 0 6px 0;
    line-height: 1.3;
}

.cerama-newsletter-card-sub {
    font-size: 13px;
    color: #777777;
    margin: 0 0 18px 0;
    line-height: 1.45;
}

/* Newsletter Main Button */
.cerama-newsletter-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 13px 22px;
    min-height: 48px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none !important;
    background: #CB6843;
    color: #FFFFFF !important;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(203, 104, 67, 0.28);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    line-height: 1.2;
}

.cerama-newsletter-btn:hover {
    background: #B35532;
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(203, 104, 67, 0.4);
    color: #FFFFFF !important;
}

.cerama-newsletter-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.5;
    transition: transform 0.2s ease;
}

.cerama-newsletter-btn:hover svg {
    transform: translateX(4px);
}

.cerama-newsletter-privacy-note {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 11px;
    color: #888888;
    margin-top: 14px;
    line-height: 1.35;
}

.cerama-newsletter-privacy-note svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

/* ==========================================================================
   Modal Pop-Up Window Styles
   ========================================================================== */
.cerama-newsletter-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 16px;
    box-sizing: border-box;
}

.cerama-newsletter-modal.is-open {
    opacity: 1;
    visibility: visible;
}

/* Backdrop Overlay */
.cerama-newsletter-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(18, 30, 36, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    cursor: pointer;
}

/* Modal Dialog Box */
.cerama-newsletter-modal-dialog {
    position: relative;
    z-index: 2;
    background: #FFFFFF;
    border-radius: 20px;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cerama-newsletter-modal.is-open .cerama-newsletter-modal-dialog {
    transform: scale(1) translateY(0);
}

/* Modal Header */
.cerama-newsletter-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #ECECEC;
    background: #FBF9F5;
}

.cerama-newsletter-modal-title-box {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #385D6B;
}

.cerama-newsletter-modal-title-box svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    color: #CB6843;
}

.cerama-newsletter-modal-title {
    font-size: 16px;
    font-weight: 800;
    margin: 0;
    color: #385D6B;
}

.cerama-newsletter-modal-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 1px solid #E2DFD9;
    color: #666666;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
}

.cerama-newsletter-modal-close:hover {
    background: #385D6B;
    color: #FFFFFF;
    border-color: #385D6B;
    transform: rotate(90deg);
}

.cerama-newsletter-modal-close svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.5;
}

/* Modal Body & Iframe */
.cerama-newsletter-modal-body {
    position: relative;
    width: 100%;
    height: 640px;
    max-height: calc(90vh - 70px);
    overflow: hidden;
    background: #FFFFFF;
}

.cerama-newsletter-modal-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #FFFFFF;
    z-index: 1;
    color: #666666;
    font-size: 13px;
    transition: opacity 0.3s ease;
}

.cerama-newsletter-modal-loader.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.cerama-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #ECECEC;
    border-top-color: #CB6843;
    border-radius: 50%;
    animation: cerama-spin 0.8s linear infinite;
}

@keyframes cerama-spin {
    to { transform: rotate(360deg); }
}

.cerama-newsletter-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: #FFFFFF;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 900px) {
    .cerama-newsletter-inner {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .cerama-newsletter-content {
        text-align: left;
    }

    .cerama-newsletter-card {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .cerama-newsletter-wrap {
        margin-top: 0 !important;
        margin-bottom: 18px;
        margin-left: auto;
        margin-right: auto;
    }

    .cerama-newsletter--bg-warm,
    .cerama-newsletter--bg-subtle,
    .cerama-newsletter--bg-dark {
        padding: 24px 16px;
        border-radius: 14px;
    }

    /* Fullwidth su Mobile */
    .cerama-newsletter--fullwidth {
        padding-top: 24px !important;
        padding-bottom: 24px !important;
        border-radius: 0 !important;
    }

    .cerama-newsletter-inner,
    .cerama-newsletter--fullwidth .cerama-newsletter-inner {
        padding-left: 16px !important;
        padding-right: 16px !important;
        gap: 20px;
    }

    .cerama-newsletter-title {
        font-size: 21px !important;
    }

    .cerama-newsletter-desc {
        font-size: 13.5px !important;
        margin-bottom: 16px;
    }

    .cerama-newsletter-card {
        padding: 20px 16px;
        border-radius: 14px;
    }

    .cerama-newsletter-card-title {
        font-size: 17px;
    }

    .cerama-newsletter-modal {
        padding: 10px;
    }

    .cerama-newsletter-modal-dialog {
        max-height: 94vh;
        border-radius: 16px;
    }

    .cerama-newsletter-modal-body {
        height: 560px;
        max-height: calc(94vh - 60px);
    }
}
