/* Popup Şablonları CSS - Basit ve Etkili */

/* Bootstrap Modal Override - En Basit Yöntem */
/* Genel modal stilleri - sabit ölçü vermeyelim */
.modal-content {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    border-radius: 15px !important;
    overflow: hidden !important;
}

/* Popup Background Image */
.popup-bg-image {
    width: 800px !important;
    height: 500px !important;
    object-fit: contain !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 1 !important;
}

/* Tüm Popup Şablonları için Otomatik Resim Ayarlama */
.custom-modal .deal,
.popup-template-default .deal,
.popup-template-minimal .deal,
.popup-template-modern .deal,
.popup-template-classic .deal {
    position: relative !important;
    overflow: hidden !important;
    /* Arka plan resmini ezmemek için shorthand yerine sadece background-color kullanalım */
    background-color: #ffffff;
}

/* Popup içeriği için z-index */
.deal-top,
.deal-content,
.deal-bottom {
    position: relative !important;
    z-index: 2 !important;
}
.deal-bottom {
    position: relative !important;
    z-index: 2 !important;
}

/* Deal içeriği için z-index */
.deal-top,
.deal-content,
.deal-bottom {
    position: relative !important;
    z-index: 2 !important;
}

.modal-body {
    padding: 0 !important;
    overflow: hidden !important;
}

.modal-dialog {
    border: 0 !important;
    outline: 0 !important;
    margin: 0 auto !important;
}

.modal {
    border: 0 !important;
    outline: 0 !important;
}

/* Popup Özel Override */
.custom-modal .modal-content,
#onloadModal .modal-content {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
}

/* Varsayılan Şablon */
.popup-template-default .modal-content {
    border-radius: 15px;
    overflow: hidden;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
}

.popup-template-default .deal {
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: right center !important; /* görsel sağda */
    padding: 40px; /* iç boşluk */
    padding-right: 360px; /* sağda görsel alanı bırak */
    border-radius: 15px;
    position: relative;
    overflow: hidden;
}

/* İçerik alanlarını sınırla ki görselle çakışmasın */
.popup-template-default .deal-top,
.popup-template-default .deal-content,
.popup-template-default .deal-bottom {
    max-width: 460px;
}

/* Başlık ve üst yazı renkleri ekran görüntüsüne yakın olsun */
.popup-template-default .deal-top h6 { color: #f39c12; }

/* Popup Alt Başlık için özel stil - daha büyük boyut */
.popup-alt-baslik {
    color: #253D4E;
    width: 500px;
    height: 150px;
    display: inline-block;
    overflow: visible;
    text-overflow: initial;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.4;
    padding: 5px;
    box-sizing: border-box;
}

.popup-template-default .deal-top h6 {
    color: #3bb77e;
    font-weight: 600;
    font-size: 16px;
    position: relative;
    z-index: 2;
}

.popup-template-default .product-title a {
    color: #253d4e;
    font-weight: 600;
    font-size: 18px;
    line-height: 1.4;
    position: relative;
    z-index: 2;
}

/* Başlık iki satır olarak sabitlensin (br ile bölünmüş) */
.custom-modal .product-title a {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popup-template-default .current-price {
    color: #3bb77e;
    font-size: 24px;
    font-weight: 700;
}

.popup-template-default .old-price {
    color: #adadad;
    text-decoration: line-through;
    font-size: 16px;
}

.popup-template-default .save-price {
    color: #f74b81;
    font-weight: 600;
    font-size: 14px;
}

.popup-template-default .deals-countdown {
    margin: 20px 0;
    text-align: left !important;
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
}

.popup-template-default .countdown-section {
    display: inline-block;
    margin-right: 15px;
    text-align: center;
    padding: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.popup-template-default .countdown-section .countdown-amount {
    display: inline-block;
    margin-right: 0;
}

.popup-template-default .countdown-section .countdown-period {
    display: inline-block;
    margin-left: 0;
}

.popup-template-default .countdown-amount {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #3bb77e;
    line-height: 1;
    margin: 0 !important;
    padding: 0 !important;
}

.popup-template-default .countdown-period {
    font-size: 12px;
    color: #7e7e7e;
    text-transform: uppercase;
    margin: 0 !important;
    padding: 0 !important;
}

.popup-template-default .btn {
    background: #3bb77e;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.popup-template-default .btn:hover {
    background: #2a9d68;
    transform: translateY(-2px);
}

/* Minimal Şablon */
.popup-template-minimal .modal-content {
    border-radius: 8px;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
}

.popup-template-minimal .deal {
    background: #ffffff;
    padding: 25px;
    border-radius: 8px;
    width: 100% !important;
}

.popup-template-minimal .deal-top h6 {
    color: #666;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.popup-template-minimal .product-title a {
    color: #333;
    font-size: 20px;
    font-weight: 500;
}

.popup-template-minimal .popup-alt-baslik {
    color: #333;
    width: 500px;
    height: 150px;
    display: inline-block;
    overflow: visible;
    text-overflow: initial;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.4;
    padding: 5px;
    box-sizing: border-box;
}

.popup-template-minimal .current-price {
    color: #e74c3c;
    font-size: 28px;
    font-weight: 700;
}

.popup-template-minimal .btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 5px;
    font-weight: 500;
}

.popup-template-minimal .btn:hover {
    background: #218838;
}

.popup-template-minimal .deals-countdown {
    margin: 20px 0;
    text-align: left !important;
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
}

.popup-template-minimal .countdown-section {
    display: inline-block;
    margin-right: 10px;
    text-align: center;
    padding: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.popup-template-minimal .countdown-section .countdown-amount {
    display: inline-block;
    margin-right: 0;
}

.popup-template-minimal .countdown-section .countdown-period {
    display: inline-block;
    margin-left: 0;
}

/* Modern Şablon */
.popup-template-modern .modal-content {
    border-radius: 20px;
    overflow: hidden;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
}

.popup-template-modern .deal {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 35px;
    border-radius: 20px;
    color: white;
    width: 100% !important;
}

.popup-template-modern .deal-top h6 {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.popup-template-modern .product-title a {
    color: white;
    font-size: 22px;
    font-weight: 600;
}

.popup-template-modern .popup-alt-baslik {
    color: white;
    width: 500px;
    height: 150px;
    display: inline-block;
    overflow: visible;
    text-overflow: initial;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.4;
    padding: 5px;
    box-sizing: border-box;
}

.popup-template-modern .current-price {
    color: #ffd700;
    font-size: 32px;
    font-weight: 700;
}

.popup-template-modern .countdown-amount {
    color: white;
    font-size: 28px;
}

.popup-template-modern .countdown-period {
    color: rgba(255, 255, 255, 0.8);
}

.popup-template-modern .deals-countdown {
    margin: 20px 0;
    text-align: left !important;
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
}

.popup-template-modern .countdown-section {
    display: inline-block;
    margin-right: 10px;
    text-align: center;
    padding: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.popup-template-modern .countdown-section .countdown-amount {
    display: inline-block;
    margin-right: 0;
}

.popup-template-modern .countdown-section .countdown-period {
    display: inline-block;
    margin-left: 0;
}

.popup-template-modern .btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.popup-template-modern .btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-3px);
}

/* Klasik Şablon */
.popup-template-classic .modal-content {
    border-radius: 0;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
}

.popup-template-classic .deal {
    background: linear-gradient(45deg, #f4e4bc 0%, #e6d3a3 100%);
    padding: 30px;
    border-radius: 0;
    width: 100% !important;
}

/* Masaüstü (>=992px): tam tasarım ölçüsü 888x601 */
@media (min-width: 992px) {
    #onloadModal .modal-dialog {
        max-width: 888px !important;
        width: 888px !important;
        height: 601px !important;
    }
    #onloadModal .modal-content,
    #onloadModal .modal-body,
    #onloadModal .custom-modal .deal,
    #onloadModal .popup-template-default .deal {
        width: 888px !important;
        height: 601px !important;
    }

    /* Başlık ve fiyat tipografisi (masaüstü - görseldeki gibi) */
    .custom-modal .deal-top h6 {
        font-size: 16px !important;
        font-weight: 700 !important;
        margin-bottom: 10px !important;
    }

    /* Başlık: 460x106 px kutuya sığdır */
    .custom-modal .product-title {
        width: 460px !important;
        height: auto !important; /* kesmeyi kaldır */
        overflow: visible !important;
    }
    .custom-modal .product-title a {
        display: block;
        max-width: 460px !important;
        font-size: 46px !important;
        line-height: 54px !important;
        font-weight: 700 !important;
        letter-spacing: -0.3px;
        white-space: normal;
        word-break: break-word;
    }

    .custom-modal .product-price .current-price,
    .custom-modal .current-price {
        font-size: 48px !important;
        line-height: 1.1 !important;
        font-weight: 800 !important;
    }

    .custom-modal .save-price {
        font-size: 16px !important;
        font-weight: 700 !important;
        color: #f39c12 !important;
    }

    .custom-modal .old-price {
        font-size: 24px !important;
        margin-left: 15px !important;
    }

    /* Yerleşim: sağda görsel alanı */
    .custom-modal .deal {
        background-position: 85% center !important; /* görseli biraz sola kaydır */
        background-repeat: no-repeat !important;
        background-size: contain !important;
        padding: 40px !important;
        padding-right: 340px !important; /* metne biraz daha yer aç */
    }

    .custom-modal .deal-top,
    .custom-modal .deal-content,
    .custom-modal .deal-bottom {
        max-width: 460px !important;
    }
}

/* Mobil uyumluluk */
@media (max-width: 575.98px) {
    /* Bootstrap xs breakpoint */
    .custom-modal .modal-dialog,
    #onloadModal .modal-dialog {
        max-width: calc(100% - 24px) !important;
        width: calc(100% - 24px) !important;
        margin: 12px auto !important;
        height: auto !important;
    }

    .custom-modal .modal-content,
    #onloadModal .modal-content {
        width: 100% !important;
        height: auto !important;
        max-height: 90vh !important;
        overflow: hidden !important;
        border-radius: 12px !important;
    }

    .custom-modal .modal-body,
    #onloadModal .modal-body,
    .custom-modal .deal,
    .popup-template-default .deal,
    .popup-template-minimal .deal,
    .popup-template-modern .deal,
    .popup-template-classic .deal {
        width: 100% !important;
        height: auto !important;
        padding: 16px !important;
        background-size: contain !important;
        background-position: center bottom !important;
    }

    /* İçerik taşmasında dikey kaydırma */
    #onloadModal .modal-body {
        max-height: calc(90vh - 24px) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .popup-template-default .deal {
        padding-right: 16px !important; /* sağ boşluğu mobilde kaldır */
        background-image: none !important; /* mobilde görseli kaldır, tek sütun içerik */
        background-color: #ffffff !important;
    }

    /* Metin boyutları küçültme */
    .popup-template-default .product-title a,
    .popup-template-minimal .product-title a,
    .popup-template-modern .product-title a,
    .popup-template-classic .product-title a {
        font-size: 16px !important;
    }

    .popup-template-default .deal-top h6 { font-size: 13px !important; margin-bottom: 6px !important; font-weight: 700 !important; }
    .popup-template-default .product-title a { font-size: 26px !important; line-height: 1.25 !important; font-weight: 700 !important; letter-spacing: -0.2px; }
    .mb-20 { margin-bottom: 12px !important; }

    .popup-template-default .current-price,
    .popup-template-minimal .current-price,
    .popup-template-modern .current-price,
    .popup-template-classic .current-price {
        font-size: 28px !important;
        font-weight: 800 !important;
    }

    .popup-template-default .save-price { font-size: 14px !important; font-weight: 700 !important; }
    .popup-template-default .old-price { font-size: 16px !important; }

    .popup-template-default .deals-countdown,
    .popup-template-minimal .deals-countdown,
    .popup-template-modern .deals-countdown,
    .popup-template-classic .deals-countdown {
        flex-wrap: wrap !important;
        gap: 8px !important;
        justify-content: flex-start !important;
    }

    .popup-template-default .countdown-section,
    .popup-template-minimal .countdown-section,
    .popup-template-modern .countdown-section,
    .popup-template-classic .countdown-section {
        min-width: 74px;
        flex: 0 0 auto;
    }

    .btn.hover-up {
        padding: 12px 16px !important;
        font-size: 14px !important;
        width: 100% !important;
    }

    /* iOS sağ scrollbar boşluğu fix */
    .modal { padding-right: 0 !important; }

    /* Kapat butonu görünür ve dokunulabilir kalsın */
    #onloadModal .btn-close {
        position: absolute;
        top: 10px;
        right: 10px;
        z-index: 3;
        background: #fff;
        border-radius: 50%;
        opacity: 1;
        width: 32px;
        height: 32px;
    }

    /* Mobile close button in top-left */
    #onloadModal .btn-close-mobile {
        position: absolute;
        top: 10px;
        left: 10px;
        z-index: 4;
        background: rgba(0, 0, 0, 0.7);
        border: none;
        border-radius: 50%;
        opacity: 1;
        width: 28px;
        height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        font-size: 12px;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    #onloadModal .btn-close-mobile:hover {
        background: rgba(0, 0, 0, 0.9);
        transform: scale(1.1);
    }

    #onloadModal .btn-close-mobile:active {
        transform: scale(0.95);
    }

    #onloadModal .btn-close-mobile i {
        font-size: 14px;
        line-height: 1;
    }

    /* Ensure mobile close button is always visible and accessible */
    @media (max-width: 575.98px) {
        #onloadModal .btn-close-mobile {
            width: 32px;
            height: 32px;
            top: 8px;
            left: 8px;
            z-index: 10;
            background: rgba(0, 0, 0, 0.8);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        }

        #onloadModal .btn-close-mobile i {
            font-size: 14px;
        }

        /* Hide the regular close button on very small screens */
        #onloadModal .btn-close {
            display: none;
        }
    }
}

@media (min-width: 576px) and (max-width: 991.98px) {
    /* sm - md arası tablet */
    .custom-modal .modal-dialog,
    #onloadModal .modal-dialog {
        max-width: 520px !important;
        width: 90% !important;
        height: auto !important;
    }

    .custom-modal .modal-content,
    #onloadModal .modal-content {
        width: 100% !important;
        height: auto !important;
    }

    .custom-modal .deal,
    .popup-template-default .deal,
    .popup-template-minimal .deal,
    .popup-template-modern .deal,
    .popup-template-classic .deal {
        width: 100% !important;
        height: auto !important;
        padding: 20px !important;
        background-position: center right !important;
    }
}

.popup-template-classic .deal-top h6 {
    color: #8b4513;
    font-size: 16px;
    font-weight: 600;
}

.popup-template-classic .product-title a {
    color: #654321;
    font-size: 20px;
    font-weight: 600;
}

.popup-template-classic .popup-alt-baslik {
    color: #654321;
}


.popup-template-classic .current-price {
    color: #8b4513;
    font-size: 26px;
    font-weight: 700;
}

.popup-template-classic .btn {
    background: #8b4513;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.popup-template-classic .btn:hover {
    background: #a0522d;
    transform: translateY(-2px);
}

.popup-template-classic .deals-countdown {
    margin: 20px 0;
    text-align: left !important;
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
}

.popup-template-classic .countdown-section {
    display: inline-block;
    margin-right: 10px;
    text-align: center;
    padding: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.popup-template-classic .countdown-section .countdown-amount {
    display: inline-block;
    margin-right: 0;
}

.popup-template-classic .countdown-section .countdown-period {
    display: inline-block;
    margin-left: 0;
}