/* Translator Engine Frontend Language Switcher */
.cohsar-lang-switcher-wrap {
    display: inline-block;
    position: relative;
    font-family: inherit;
    font-size: 14px;
    z-index: 9999;
}

.cohsar-lang-switcher-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #1e293b;
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
    user-select: none;
}

.cohsar-lang-switcher-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

.cohsar-lang-switcher-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    min-width: 160px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
    list-style: none;
    padding: 6px 0;
    margin-left: 0;
    z-index: 10000;
}

/* Invisible Hover Bridge: Prevents dropdown from disappearing while moving or dragging mouse over the gap */
.cohsar-lang-switcher-dropdown::before {
    content: '';
    position: absolute;
    top: -14px;
    left: 0;
    right: 0;
    height: 14px;
    background: transparent;
    pointer-events: auto;
}

/* Display dropdown on hover, focus-within, or active click toggle */
.cohsar-lang-switcher-wrap:hover .cohsar-lang-switcher-dropdown,
.cohsar-lang-switcher-wrap.active .cohsar-lang-switcher-dropdown,
.cohsar-lang-switcher-wrap:focus-within .cohsar-lang-switcher-dropdown {
    display: block;
}

.cohsar-lang-switcher-dropdown li {
    margin: 0;
    padding: 0;
}

.cohsar-lang-switcher-dropdown a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    color: #334155;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.15s ease, color 0.15s ease;
}

.cohsar-lang-switcher-dropdown a:hover {
    background: #f1f5f9;
    color: #0b2545;
}

.cohsar-lang-switcher-dropdown a.active {
    font-weight: 700;
    background: #eff6ff;
    color: #1d4ed8;
}

/* Floating Switcher Variant */
.cohsar-switcher-floating {
    position: fixed;
    z-index: 999999;
}
.cohsar-switcher-floating.cohsar-pos-bottom-right,
.cohsar-switcher-floating:not([class*="cohsar-pos-"]) {
    bottom: 24px;
    right: 24px;
}
.cohsar-switcher-floating.cohsar-pos-bottom-left {
    bottom: 24px;
    left: 24px;
}
.cohsar-switcher-floating.cohsar-pos-top-right {
    top: 24px;
    right: 24px;
}
.cohsar-switcher-floating.cohsar-pos-top-left {
    top: 24px;
    left: 24px;
}

/* Upward opening for bottom-positioned floating switchers so menu doesn't overflow viewport */
.cohsar-switcher-floating.cohsar-pos-bottom-right .cohsar-lang-switcher-dropdown,
.cohsar-switcher-floating.cohsar-pos-bottom-left .cohsar-lang-switcher-dropdown,
.cohsar-switcher-floating:not([class*="cohsar-pos-top"]) .cohsar-lang-switcher-dropdown {
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 6px;
}

.cohsar-switcher-floating:not([class*="cohsar-pos-top"]) .cohsar-lang-switcher-dropdown::before {
    top: auto;
    bottom: -14px;
    height: 14px;
}

/* Align right on right-positioned switchers to prevent horizontal overflow */
.cohsar-switcher-floating.cohsar-pos-bottom-right .cohsar-lang-switcher-dropdown,
.cohsar-switcher-floating.cohsar-pos-top-right .cohsar-lang-switcher-dropdown {
    left: auto;
    right: 0;
}

/* 1. Flags Only Horizontal Bar */
.cohsar-lang-flags-bar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    vertical-align: middle;
}
.cohsar-flag-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 18px;
    line-height: 1;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}
.cohsar-flag-link:hover {
    transform: scale(1.15);
    background: rgba(0, 0, 0, 0.04);
}
.cohsar-flag-link.active {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.2);
}

/* 2. Button Pills Bar */
.cohsar-lang-pills-bar {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.cohsar-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    color: #334155;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.cohsar-pill-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
    transform: translateY(-1px);
}
.cohsar-pill-btn.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
    font-weight: 600;
}

/* 3. Compact Codes Bar */
.cohsar-lang-compact-bar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.cohsar-compact-code {
    color: #64748b;
    text-decoration: none;
    padding: 2px 4px;
    border-radius: 3px;
    transition: color 0.15s ease;
}
.cohsar-compact-code:hover {
    color: #0f172a;
}
.cohsar-compact-code.active {
    color: #2563eb;
    text-decoration: underline;
    font-weight: 700;
}
.cohsar-sep {
    color: #cbd5e1;
    font-weight: normal;
}

/* ==========================================================================
   WooCommerce Single Product Page Layout Integrity
   Prevents tabs from floating side-by-side with product summary/gallery
   ========================================================================== */
.woocommerce div.product,
.woocommerce-page div.product,
article.product {
    position: relative;
    clear: both;
}

.woocommerce div.product .product-entry-wrapper,
.woocommerce-page div.product .product-entry-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    clear: both !important;
}

.woocommerce div.product .summary,
.woocommerce-page div.product .summary,
.woocommerce div.product .entry-summary {
    position: relative;
}

/* Ensure WooCommerce tabs always span full width and clear below gallery + summary */
.woocommerce div.product .woocommerce-tabs,
.woocommerce-page div.product .woocommerce-tabs,
.woocommerce div.product > .woocommerce-tabs,
.product-entry-wrapper + .woocommerce-tabs,
.woocommerce-tabs.wc-tabs-wrapper {
    clear: both !important;
    width: 100% !important;
    display: block !important;
    float: none !important;
}

/* Hide any residual browser extension junk */
.cp-dialog-popup,
#cfish-popup-message-dialog,
.ocrext-element,
.ocrext-wrapper,
#deepl_translate_button,
#popup_translate_button {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
}
