/* ============================================================
   Wesiva Popup Modulu v1.0
   Bagimlilik: Yok (saf CSS)
   ============================================================ */

/* ------------------------------------------------------------
   Overlay
   ------------------------------------------------------------ */
.wsv-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    z-index: 99998;
    cursor: pointer;
}

/* ------------------------------------------------------------
   Popup Container (temel)
   ------------------------------------------------------------ */
.wsv-popup {
    display: none;
    position: fixed;
    z-index: 99999;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25), 0 4px 16px rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    padding: 36px 32px 28px;
    box-sizing: border-box;
    font-family: inherit;
    line-height: 1.6;
    /* Varsayilan konum: merkez */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Gorunur hale gelince display:block + animasyon */
.wsv-popup.wsv-popup--visible {
    display: block;
}

/* Kapanirken hafif opacity gecisi */
.wsv-popup.wsv-popup--closing {
    animation: wsvFadeOut 0.35s ease forwards;
}

/* ------------------------------------------------------------
   Pozisyon Varyantlari
   ------------------------------------------------------------ */
.wsv-popup.center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.wsv-popup.top {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    bottom: auto;
}

.wsv-popup.bottom {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    top: auto;
}

.wsv-popup.bottom-left {
    bottom: 20px;
    left: 20px;
    top: auto;
    transform: none;
}

.wsv-popup.bottom-right {
    bottom: 20px;
    right: 20px;
    left: auto;
    top: auto;
    transform: none;
}

/* ------------------------------------------------------------
   Animasyon Keyframes
   ------------------------------------------------------------ */
@keyframes wsvFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes wsvFadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

@keyframes wsvSlideUp {
    from {
        opacity: 0;
        transform: translate(-50%, calc(-50% + 40px));
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@keyframes wsvSlideUpFixed {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes wsvZoomIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.85);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* ------------------------------------------------------------
   Animasyon Sinif Eslestirmeleri
   ------------------------------------------------------------ */
.wsv-popup.fade.wsv-popup--visible {
    animation: wsvFadeIn 0.3s ease both;
}

.wsv-popup.slide-up.wsv-popup--visible.center {
    animation: wsvSlideUp 0.4s ease both;
}

.wsv-popup.slide-up.wsv-popup--visible.bottom,
.wsv-popup.slide-up.wsv-popup--visible.bottom-left,
.wsv-popup.slide-up.wsv-popup--visible.bottom-right {
    animation: wsvSlideUpFixed 0.4s ease both;
}

.wsv-popup.zoom.wsv-popup--visible {
    animation: wsvZoomIn 0.3s ease both;
}

/* ------------------------------------------------------------
   Kapatma Butonu
   ------------------------------------------------------------ */
.wsv-popup-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: color 0.2s, background 0.2s;
    z-index: 100;
}

.wsv-popup-close:hover {
    color: #333;
    background: rgba(0, 0, 0, 0.07);
}

/* ------------------------------------------------------------
   Resim Layout Varyantlari
   ------------------------------------------------------------ */

/* Resim layout olduğunda popup padding'i sıfırla */
.wsv-popup.wsv-img-top,
.wsv-popup.wsv-img-split-left,
.wsv-popup.wsv-img-split-right,
.wsv-popup.wsv-img-background {
    padding: 0;
}

/* --- Layout: top (resim üstte) --- */
.wsv-img-top .wsv-img-top__img {
    display: block;
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 12px 12px 0 0;
}
.wsv-img-top .wsv-popup-body-wrap {
    padding: 24px 28px 22px;
}

/* --- Layout: split-left / split-right --- */
.wsv-img-split-left  .wsv-split,
.wsv-img-split-right .wsv-split {
    display: flex;
    min-height: 260px;
}
.wsv-split__img {
    width: 44%;
    flex-shrink: 0;
    object-fit: cover;
    display: block;
}
.wsv-img-split-left  .wsv-split__img { border-radius: 12px 0 0 12px; }
.wsv-img-split-right .wsv-split__img { order: 1; border-radius: 0 12px 12px 0; }
.wsv-img-split-right .wsv-split__content { order: 0; }
.wsv-split__content {
    flex: 1;
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* --- Layout: background (resim arka plan) --- */
.wsv-img-background .wsv-bg-wrap {
    position: relative;
    min-height: 280px;
    border-radius: 12px;
    overflow: hidden;
}
.wsv-img-background .wsv-bg-img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 280px;
    object-fit: cover;
    position: absolute;
    inset: 0;
}
.wsv-img-background .wsv-bg-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.48);
    z-index: 1;
}
.wsv-img-background .wsv-bg-content {
    position: relative;
    z-index: 2;
    padding: 36px 32px 28px;
    color: #fff;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.wsv-img-background .wsv-popup-title,
.wsv-img-background .wsv-popup-body { color: #fff; }
.wsv-img-background .wsv-popup-close { color: rgba(255,255,255,.75); }
.wsv-img-background .wsv-popup-close:hover { color: #fff; background: rgba(255,255,255,.15); }

/* Responsive split → dikey */
@media (max-width: 480px) {
    .wsv-img-split-left  .wsv-split,
    .wsv-img-split-right .wsv-split { flex-direction: column; }
    .wsv-split__img { width: 100%; height: 160px; border-radius: 12px 12px 0 0 !important; order: 0 !important; }
    .wsv-split__content { order: 1 !important; }
}

/* ------------------------------------------------------------
   Popup Baslik & Govde
   ------------------------------------------------------------ */
.wsv-popup-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 12px;
    line-height: 1.3;
    padding-right: 28px; /* kapatma butonunun alti */
}

.wsv-popup-body {
    font-size: 0.95rem;
    margin-bottom: 18px;
    line-height: 1.65;
}

/* ------------------------------------------------------------
   Indirim Kodu Kutusu
   ------------------------------------------------------------ */
.wsv-discount-box {
    display: flex;
    align-items: center;
    gap: 0;
    background: #f5f5f5;
    border: 2px dashed #ccc;
    border-radius: 8px;
    overflow: hidden;
    margin: 18px 0 12px;
}

.wsv-discount-code {
    flex: 1;
    padding: 12px 16px;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: #222;
    text-align: center;
    background: transparent;
    user-select: all;
    cursor: text;
}

.wsv-discount-rate {
    font-size: 1rem;
    margin: 8px 0 4px;
    color: inherit;
}

.wsv-copy-btn {
    padding: 12px 20px;
    background: #f9ae3e;
    color: #fff;
    border: none;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.wsv-copy-btn:hover {
    background: #e09a2c;
}

.wsv-copy-btn.wsv-copy-btn--success {
    background: #28a745;
}

/* ------------------------------------------------------------
   Form Elemanlari
   ------------------------------------------------------------ */
.wsv-popup-form {
    margin-top: 10px;
}

.wsv-form-group {
    margin-bottom: 14px;
}

.wsv-form-group label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: inherit;
}

.wsv-popup-form input[type="text"],
.wsv-popup-form input[type="email"],
.wsv-popup-form input[type="tel"],
.wsv-popup-form input[type="number"],
.wsv-popup-form textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #ddd;
    border-radius: 7px;
    font-size: 0.9rem;
    box-sizing: border-box;
    background: #fff;
    color: #333;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    font-family: inherit;
    resize: vertical;
}

.wsv-popup-form input:focus,
.wsv-popup-form textarea:focus {
    border-color: #f9ae3e;
    box-shadow: 0 0 0 3px rgba(249, 174, 62, 0.18);
}

.wsv-submit-btn {
    width: 100%;
    padding: 13px;
    background: #f9ae3e;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: inherit;
}

.wsv-submit-btn:hover {
    background: #e09a2c;
}

.wsv-submit-btn:active {
    transform: scale(0.98);
}

.wsv-submit-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* ------------------------------------------------------------
   Form Mesajlari
   ------------------------------------------------------------ */
.wsv-form-message {
    display: none;
    padding: 10px 14px;
    border-radius: 7px;
    font-size: 0.88rem;
    margin-top: 10px;
    font-weight: 500;
}

.wsv-form-error {
    background: #fff2f2;
    color: #c0392b;
    border: 1px solid #f5c6cb;
}

.wsv-form-success {
    background: #f0fff4;
    color: #1e7e34;
    border: 1px solid #c3e6cb;
}

/* ------------------------------------------------------------
   Loading Spinner
   ------------------------------------------------------------ */
.wsv-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: wsvSpin 0.7s linear infinite;
    vertical-align: middle;
}

@keyframes wsvSpin {
    to { transform: rotate(360deg); }
}

/* ------------------------------------------------------------
   Popup Aksiyon Butonu (announcement/custom)
   ------------------------------------------------------------ */
.wsv-popup-actions {
    margin-top: 20px;
    text-align: center;
}

.wsv-popup-btn {
    display: inline-block;
    padding: 12px 28px;
    background: #f9ae3e;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    transition: background 0.2s, transform 0.1s;
    letter-spacing: 0.2px;
}

.wsv-popup-btn:hover {
    background: #e09a2c;
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 576px) {
    .wsv-popup {
        width: 95% !important;
        padding: 28px 18px 22px;
        border-radius: 10px;
    }

    .wsv-popup.bottom-left,
    .wsv-popup.bottom-right {
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        bottom: 12px !important;
    }

    .wsv-discount-code {
        font-size: 1rem;
        letter-spacing: 2px;
    }

    .wsv-popup-title {
        font-size: 1.15rem;
    }
}

@media (max-width: 380px) {
    .wsv-discount-box {
        flex-direction: column;
    }

    .wsv-copy-btn {
        width: 100%;
        text-align: center;
    }
}
