/* =====================================================
   WooCommerce Teklif & WhatsApp Butonları
   v2.1 – CSS değişkenli tam responsive tasarım
   Renkler wp_head'den --wtw-* değişkenleriyle gelir
   ===================================================== */

/* ── Buton Grubu ── */
.wtw-buttons-wrap {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 10px;
    margin: 14px 0 6px;
    width: 100%;
    box-sizing: border-box;
}

/* ── Ortak Buton ── */
.wtw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1 1 0;
    min-width: 0;
    padding: 0 18px;
    height: 50px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .25px;
    line-height: 1;
    cursor: pointer;
    text-decoration: none !important;
    transition: filter .18s ease, transform .14s ease, box-shadow .18s ease;
    white-space: nowrap;
    overflow: hidden;
    font-family: inherit;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

.wtw-btn svg {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
}

.wtw-btn span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wtw-btn:hover  { filter: brightness(1.08); transform: translateY(-1px); }
.wtw-btn:active { filter: brightness(.94);  transform: translateY(0); }

/* ── WhatsApp ── */
.wtw-btn-whatsapp {
    background-color: var(--wtw-wa, #25D366);
    color: var(--wtw-wa-text, #fff) !important;
    box-shadow: 0 3px 12px rgba(var(--wtw-wa-rgb, 37,211,102), .28);
}
.wtw-btn-whatsapp:hover {
    box-shadow: 0 5px 18px rgba(var(--wtw-wa-rgb, 37,211,102), .40);
    color: var(--wtw-wa-text, #fff) !important;
}

/* ── Teklif ── */
.wtw-btn-teklif {
    background-color: var(--wtw-teklif, #e8212b);
    color: var(--wtw-teklif-text, #fff) !important;
    box-shadow: 0 3px 12px rgba(var(--wtw-teklif-rgb, 232,33,43), .25);
}
.wtw-btn-teklif:hover {
    box-shadow: 0 5px 18px rgba(var(--wtw-teklif-rgb, 232,33,43), .38);
    color: var(--wtw-teklif-text, #fff) !important;
}

.wtw-btn-disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none !important;
    filter: none !important;
}

/* ── Tablet ── */
@media (max-width: 900px) and (min-width: 481px) {
    .wtw-btn { font-size: 13px; height: 46px; padding: 0 14px; }
    .wtw-btn svg { width: 17px; height: 17px; }
}

/* ── Mobil ── */
@media (max-width: 480px) {
    .wtw-buttons-wrap { flex-direction: column; gap: 9px; }
    .wtw-btn { flex: none; width: 100%; height: 48px; font-size: 14px; }
}

/* =====================================================
   POPUP OVERLAY
   ===================================================== */
.wtw-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0,0,0,.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: opacity .26s ease, visibility .26s ease;
}

.wtw-popup-overlay.wtw-open {
    opacity: 1;
    visibility: visible;
}

/* ── Popup Kutusu ── */
.wtw-popup-box {
    background: #fff;
    border-radius: 10px;
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 24px 64px rgba(0,0,0,.22), 0 4px 16px rgba(0,0,0,.12);
    transform: translateY(20px) scale(.97);
    transition: transform .28s cubic-bezier(.34,1.4,.64,1);
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: #ccc #f5f5f5;
}

.wtw-popup-overlay.wtw-open .wtw-popup-box {
    transform: translateY(0) scale(1);
}

.wtw-popup-box::-webkit-scrollbar       { width: 5px; }
.wtw-popup-box::-webkit-scrollbar-track { background: #f5f5f5; }
.wtw-popup-box::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }

/* ── Header ── */
.wtw-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px 14px;
    border-bottom: 1px solid #ebebeb;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
    border-radius: 10px 10px 0 0;
    box-sizing: border-box;
}

.wtw-popup-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #1a1a2e;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.3;
}

.wtw-popup-header h3 svg {
    width: 19px;
    height: 19px;
    color: var(--wtw-teklif, #e8212b);
    flex-shrink: 0;
}

.wtw-popup-close {
    background: #f2f2f2;
    border: none;
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .16s, color .16s;
    padding: 0;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}
.wtw-popup-close:hover { background: #e0e0e0; color: #111; }

/* ── Ürün Rozeti ── */
.wtw-popup-product-badge {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 14px 22px 2px;
    background: var(--wtw-badge-bg, #fff7f7);
    border: 1px solid var(--wtw-badge-border, #fcd3d5);
    border-radius: 7px;
    padding: 11px 15px;
    font-size: 13.5px;
    color: var(--wtw-badge-text, #c0192f);
    font-weight: 600;
    line-height: 1.5;
    box-sizing: border-box;
    word-break: break-word;
}

.wtw-popup-product-badge svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    margin-top: 2px;
}

/* ── Form Body ── */
.wtw-popup-body {
    padding: 14px 22px 22px;
    box-sizing: border-box;
}

.wtw-popup-body .wpcf7 { margin: 0; }

.wtw-popup-body .wpcf7-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wtw-popup-body p  { margin: 0 !important; padding: 0 !important; }
.wtw-popup-body br { display: none; }

.wtw-popup-body label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: #555;
    margin-bottom: 5px;
    line-height: 1.3;
}

.wtw-popup-body input[type="text"],
.wtw-popup-body input[type="email"],
.wtw-popup-body input[type="tel"],
.wtw-popup-body input[type="number"],
.wtw-popup-body input[type="url"],
.wtw-popup-body textarea,
.wtw-popup-body select {
    display: block !important;
    width: 100% !important;
    padding: 10px 13px !important;
    border: 1.5px solid #dde3ee !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    color: #2a2a2a !important;
    background: #fafafa !important;
    box-sizing: border-box !important;
    transition: border-color .16s, box-shadow .16s !important;
    outline: none !important;
    font-family: inherit !important;
    line-height: 1.5 !important;
    -webkit-appearance: none;
    appearance: none;
}

.wtw-popup-body input[type="text"]:focus,
.wtw-popup-body input[type="email"]:focus,
.wtw-popup-body input[type="tel"]:focus,
.wtw-popup-body textarea:focus {
    border-color: var(--wtw-teklif, #e8212b) !important;
    box-shadow: 0 0 0 3px rgba(var(--wtw-teklif-rgb, 232,33,43), .10) !important;
    background: #fff !important;
}

.wtw-popup-body textarea {
    resize: vertical !important;
    min-height: 80px !important;
}

/* Gönder butonu */
.wtw-popup-body .wpcf7-submit,
.wtw-popup-body input[type="submit"] {
    display: block !important;
    background: var(--wtw-teklif, #e8212b) !important;
    color: var(--wtw-teklif-text, #fff) !important;
    border: none !important;
    padding: 0 32px !important;
    height: 48px !important;
    border-radius: 6px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    width: 100% !important;
    transition: filter .18s, transform .14s !important;
    font-family: inherit !important;
    letter-spacing: .3px !important;
    box-sizing: border-box !important;
    -webkit-appearance: none;
}

.wtw-popup-body .wpcf7-submit:hover,
.wtw-popup-body input[type="submit"]:hover {
    filter: brightness(1.08) !important;
    transform: translateY(-1px) !important;
}

.wtw-popup-body .wpcf7-not-valid-tip {
    font-size: 11.5px !important;
    color: #e74c3c !important;
    margin-top: 3px !important;
    display: block !important;
}

.wtw-popup-body .wpcf7-response-output {
    border-radius: 6px !important;
    padding: 10px 14px !important;
    font-size: 13px !important;
    margin: 8px 0 0 !important;
    box-sizing: border-box !important;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

/* Tablet (481–768px) */
@media (max-width: 768px) {
    .wtw-popup-overlay { padding: 12px; align-items: flex-end; }
    .wtw-popup-box {
        border-radius: 14px 14px 10px 10px;
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
        max-width: 100%;
    }
    .wtw-popup-header { padding: 16px 18px 12px; }
    .wtw-popup-header h3 { font-size: 16px; }
    .wtw-popup-product-badge { margin: 12px 18px 2px; font-size: 13px; padding: 10px 13px; }
    .wtw-popup-body { padding: 12px 18px 20px; }
}

/* Mobil (≤480px) — bottom-sheet */
@media (max-width: 480px) {
    .wtw-popup-overlay { padding: 0; align-items: flex-end; }
    .wtw-popup-box {
        border-radius: 18px 18px 0 0;
        max-height: 92vh;
        max-height: 92dvh;
        width: 100%;
        transform: translateY(100%);
        transition: transform .3s cubic-bezier(.4,0,.2,1);
    }
    .wtw-popup-overlay.wtw-open .wtw-popup-box { transform: translateY(0); }
    .wtw-popup-box::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: #ddd;
        border-radius: 2px;
        margin: 10px auto 0;
    }
    .wtw-popup-header { padding: 10px 16px 12px; }
    .wtw-popup-header h3 { font-size: 15px; }
    .wtw-popup-product-badge { margin: 10px 16px 2px; font-size: 12.5px; padding: 9px 12px; }
    .wtw-popup-body { padding: 10px 16px 32px; }
    .wtw-popup-body input[type="text"],
    .wtw-popup-body input[type="email"],
    .wtw-popup-body input[type="tel"],
    .wtw-popup-body textarea {
        font-size: 16px !important; /* iOS zoom engelle */
        padding: 11px 13px !important;
    }
    .wtw-popup-body .wpcf7-submit,
    .wtw-popup-body input[type="submit"] { height: 50px !important; font-size: 15px !important; }
}

/* Çok küçük (≤360px) */
@media (max-width: 360px) {
    .wtw-popup-header h3 { font-size: 14px; }
    .wtw-popup-body { padding: 8px 12px 28px; }
    .wtw-popup-product-badge { margin-left: 12px; margin-right: 12px; }
}
