/* ========================================
   GOOGLE TRANSLATE — MODERN CUSTOM WIDGET
   ======================================== */

/* Hide Google's default bar completely */
.goog-te-banner-frame,
.skiptranslate > iframe {
    display: none !important;
}
body {
    top: 0 !important;
}

/* Hide the original Google widget element */
#google_translate_element {
    display: none !important;
}

/* Inline container to mount inside navbar sections */
.tb-translate-inline {
    position: relative;
    margin-left: 16px;
    z-index: 99990;
    display: inline-flex;
    align-items: center;
}
@media (max-width: 1200px) {
    .tb-translate-inline {
        margin-top: 32px;
    }
}
.navbar-mobile-icons .tb-translate-inline {
    margin-left: 12px;
}

/* ── Floating Trigger Button (inline) ── */
#tb-translate-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #e5e7eb;
    box-shadow: 0 4px 20px rgba(0,0,0,.14), 0 1px 6px rgba(0,0,0,.08);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow .2s, transform .2s, border-color .2s;
    padding: 0;
    font-size: 13px;
    font-weight: 700;
    color: #374151;
    letter-spacing: .03em;
    font-family: inherit;
    line-height: 1;
}
#tb-translate-btn:hover {
    box-shadow: 0 6px 28px rgba(0,0,0,.18);
    transform: scale(1.05);
    border-color: #2563eb;
    color: #2563eb;
}

/* ── Dropdown Panel (relative to wrapper) ── */
#tb-translate-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 260px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 36px rgba(0,0,0,.13), 0 2px 8px rgba(0,0,0,.07);
    padding: 8px 0;
    transform: translateY(-6px) scale(.97);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease, transform .22s ease;
    z-index: 99991;
}
#tb-translate-panel.tb-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

@media (max-width: 1200px) {
    .tb-translate-inline {
        margin-left: 12px;
    }
}

@media (max-width: 992px) {
    #tb-translate-btn {
        width: 38px;
        height: 38px;
        font-size: 12px;
    }

    #tb-translate-panel {
        width: 240px;
    }
}

@media (max-width: 768px) {
    .tb-translate-inline {
        margin-left: 10px;
    }

    #tb-translate-panel {
        position: fixed;
        top: calc(var(--navbar-top-height, 32px) + var(--navbar-middle-height, 64px) + 16px);
        right: 12px;
        width: min(280px, calc(100vw - 24px));
        transform: translateY(0) scale(.97);
    }
}

@media (max-width: 576px) {
    .tb-translate-inline {
        margin-left: 8px;
    }

    #tb-translate-btn {
        width: 36px;
        height: 36px;
        font-size: 11px;
    }

    #tb-translate-panel {
        width: min(260px, calc(100vw - 24px));
        right: 12px;
    }
}

/* ── Panel Header ── */
.tb-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px 8px;
    border-bottom: 1px solid #f1f3f5;
    margin-bottom: 4px;
}
.tb-panel-title {
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.tb-panel-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    color: #9ca3af;
    line-height: 1;
    font-size: 18px;
    transition: color .15s;
}
.tb-panel-close:hover { color: #374151; }

/* ── Language List ── */
.tb-lang-list {
    max-height: 320px;
    overflow-y: auto;
    padding: 0 6px;
    scrollbar-width: thin;
    scrollbar-color: #e5e7eb transparent;
}
.tb-lang-list::-webkit-scrollbar { width: 4px; }
.tb-lang-list::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 4px; }

.tb-lang-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13.5px;
    color: #1f2937;
    font-weight: 500;
    transition: background .14s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}
.tb-lang-item:hover {
    background: #f3f4f6;
}
.tb-lang-item.tb-active {
    background: #eff6ff;
    color: #2563eb;
}
.tb-lang-item .tb-flag {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
}
.tb-lang-item .tb-check {
    margin-left: auto;
    color: #2563eb;
    font-size: 14px;
    display: none;
}
.tb-lang-item.tb-active .tb-check {
    display: block;
}

/* ── Powered by footer ── */
.tb-panel-footer {
    padding: 8px 16px 4px;
    border-top: 1px solid #f1f3f5;
    margin-top: 4px;
    text-align: center;
    font-size: 11px;
    color: #9ca3af;
}

/* ========================================
   TRANSLATION OVERFLOW FIXES
   Product cards & common text elements
   ======================================== */

/* Card body — prevent grid blowout */
.urun-karti-body {
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Card title — most common overflow point */
.urun-karti-baslik {
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

/* Price text */
.urun-karti-fiyat,
.urun-karti-eski-fiyat,
.urun-karti-fiyat-wrapper {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Minimum order text */
.urun-karti-min-siparis {
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Store name */
.urun-magaza-adi {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Badges on cards */
.urun-badge {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 120px;
}

/* Star rating row */
.urun-karti-puan {
    white-space: nowrap;
    overflow: hidden;
}

/* Store row */
.urun-karti-magaza-row {
    overflow: hidden;
}

/* Generic translated font elements — Google wraps in <font> tags */
.urun-karti font,
.urun-karti-body font,
.urun-karti-baslik font {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
}

/* Navbar & announcement bar overflow safety */
.announcement-text,
.top-link,
.category-link,
.category-dropdown-link,
.mega-card span,
.navbar-action-link span {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Footer text overflow safety */
footer,
.footer-link,
.footer-text {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ── Mobile adjustment ── */
@media (max-width: 576px) {
    #tb-translate-btn { bottom: 18px; left: 16px; }
    #tb-translate-panel { bottom: 72px; left: 16px; width: calc(100vw - 32px); }
}
