/* VexpoCMS — vex_front_newsletter */

/* ══ OVERLAY ══ */
.vxn-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.vxn-overlay.vxn-open { display: flex; }

/* ══ POPUP ══ */
.vxn-popup {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    width: 820px;
    max-width: 95vw;
    max-height: 90vh;
    position: relative;
    box-shadow: 0 24px 80px rgba(0,0,0,.25);
    display: flex;
    flex-direction: column;
}

[data-theme="dark"] .vxn-popup { background: #16171e; color: #e5e7eb; }

.vxn-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: rgba(0,0,0,.15);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: #fff;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}
.vxn-close:hover { background: rgba(0,0,0,.35); }

/* ══ CONTENT ══ */
.vxn-content {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Visual (sinistra) */
.vxn-visual {
    width: 340px;
    flex-shrink: 0;
    background: #f0f0f0;
    overflow: hidden;
}
.vxn-image-wrap { width: 100%; height: 100%; }
.vxn-image-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Prodotti */
.vxn-products-wrap { width: 100%; height: 100%; overflow-y: auto; padding: 16px; background: #f8f8f8; }
[data-theme="dark"] .vxn-products-wrap { background: #1e1f28; }

.vxn-products-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.vxn-product-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow .15s;
    display: block;
}
.vxn-product-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); }
[data-theme="dark"] .vxn-product-card { background: #16171e; }

.vxn-product-img {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f0f0f0;
}
.vxn-product-img img { width: 100%; height: 100%; object-fit: cover; }
.vxn-product-placeholder { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 28px; }

.vxn-product-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 99px;
}

.vxn-product-info { padding: 8px; }
.vxn-product-name {
    font-size: 11px;
    font-weight: 600;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 4px;
}
.vxn-product-prices { display: flex; align-items: center; gap: 4px; }
.vxn-price-old { font-size: 10px; text-decoration: line-through; opacity: .5; }
.vxn-price-cur { font-size: 12px; font-weight: 700; color: #ef4444; }

/* Form section (destra) */
.vxn-form-section {
    flex: 1;
    padding: 36px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
}

.vxn-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.3;
}

.vxn-subtitle {
    font-size: 14px;
    opacity: .65;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* Input email */
.vxn-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 12px;
    transition: border .15s;
}
.vxn-input-wrap:focus-within { border-color: #6366f1; }
[data-theme="dark"] .vxn-input-wrap { border-color: #2a2c38; background: #1e1f28; }

.vxn-input-wrap svg { flex-shrink: 0; opacity: .4; }
.vxn-input-wrap input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    background: transparent;
    color: inherit;
}

/* Submit */
.vxn-submit {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: #7cb342;
    cursor: pointer;
    transition: filter .15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}
.vxn-submit:hover    { filter: brightness(1.08); }
.vxn-submit:disabled { opacity: .7; cursor: not-allowed; }

/* Spinner */
.vxn-spinner {
    animation: vxnSpin 1s linear infinite;
    width: 18px;
    height: 18px;
}
@keyframes vxnSpin { to { transform: rotate(360deg); } }

/* Decline */
.vxn-decline {
    background: none;
    border: none;
    font-size: 12px;
    color: inherit;
    opacity: .45;
    cursor: pointer;
    text-decoration: underline;
    font-family: inherit;
    padding: 4px 0;
    transition: opacity .15s;
}
.vxn-decline:hover { opacity: .7; }

/* Privacy */
.vxn-privacy { margin-top: 12px; }
.vxn-privacy-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 11px;
    opacity: .65;
    cursor: pointer;
    line-height: 1.4;
}
.vxn-privacy-label input[type="checkbox"] { flex-shrink: 0; margin-top: 2px; accent-color: #6366f1; }
.vxn-privacy a { color: #6366f1; }

/* Success */
.vxn-success {
    text-align: center;
    padding: 20px;
}
.vxn-success svg { margin-bottom: 16px; }
.vxn-success h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.vxn-success p  { font-size: 14px; opacity: .65; }

/* ══ ANIMAZIONI ══ */
.vxn-anim-fade .vxn-popup         { animation: vxnFade .35s ease; }
.vxn-anim-slide-up .vxn-popup     { animation: vxnSlideUp .35s ease; }
.vxn-anim-slide-down .vxn-popup   { animation: vxnSlideDown .35s ease; }
.vxn-anim-zoom .vxn-popup         { animation: vxnZoom .35s ease; }
.vxn-anim-bounce .vxn-popup       { animation: vxnBounce .5s ease; }
.vxn-anim-flip .vxn-popup         { animation: vxnFlip .4s ease; }

@keyframes vxnFade      { from { opacity:0; }                            to { opacity:1; } }
@keyframes vxnSlideUp   { from { opacity:0; transform: translateY(40px);} to { opacity:1; transform:none; } }
@keyframes vxnSlideDown { from { opacity:0; transform: translateY(-40px);} to { opacity:1; transform:none; } }
@keyframes vxnZoom      { from { opacity:0; transform: scale(.85); }     to { opacity:1; transform:none; } }
@keyframes vxnBounce    { 0%{opacity:0;transform:scale(.3)} 50%{transform:scale(1.05)} 70%{transform:scale(.95)} 100%{opacity:1;transform:none} }
@keyframes vxnFlip      { from { opacity:0; transform: rotateY(-90deg);} to { opacity:1; transform:none; } }

/* ══ MOBILE ══ */
@media (max-width: 600px) {
    .vxn-content    { flex-direction: column; }
    .vxn-visual     { width: 100%; height: 200px; }
    .vxn-form-section { padding: 24px 20px; }
    .vxn-title      { font-size: 18px; }
}
