/* YM Cookie Banner - Frontend */

#ymcb-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483640 !important;
    background: rgba(0, 0, 0, 0.5);
    pointer-events: auto;
    opacity: 1;
    transition: opacity 0.25s ease;
}
#ymcb-overlay.ymcb-hidden {
    display: none !important;
}
#ymcb-overlay.ymcb-closing {
    opacity: 0;
    pointer-events: none;
}

#ymcb-banner {
    position: fixed !important;
    z-index: 2147483641 !important;
    direction: rtl;
    font-family: inherit;
    box-sizing: border-box;
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.25s ease;
}
#ymcb-banner.ymcb-hidden {
    display: none !important;
}
#ymcb-banner.ymcb-closing {
    opacity: 0;
    pointer-events: none;
}
#ymcb-banner.ymcb-entering {
    animation: ymcb-fade-in 0.4s ease both;
}
#ymcb-banner *, #ymcb-banner *::before, #ymcb-banner *::after {
    box-sizing: border-box;
}

@keyframes ymcb-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Positions - centered */
#ymcb-banner.ymcb-pos-bottom {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}
#ymcb-banner.ymcb-pos-top {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
}
#ymcb-banner.ymcb-pos-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Positions - corners */
#ymcb-banner.ymcb-pos-bottom-right {
    bottom: 20px;
    right: 20px;
}
#ymcb-banner.ymcb-pos-bottom-right .ymcb-box { width: 380px !important; max-width: 95vw; }

#ymcb-banner.ymcb-pos-bottom-left {
    bottom: 20px;
    left: 20px;
}
#ymcb-banner.ymcb-pos-bottom-left .ymcb-box { width: 380px !important; max-width: 95vw; }

/* Box */
#ymcb-banner .ymcb-box {
    position: relative;
    background: #fff;
    color: #333;
    padding: 24px;
    border-radius: 12px;
    line-height: 1.5;
}

/* Close X */
#ymcb-banner .ymcb-close {
    position: absolute;
    top: 8px;
    left: 8px;
    background: transparent;
    border: 0;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.2s;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-family: Arial, sans-serif;
    z-index: 2;
}
#ymcb-banner .ymcb-close:hover {
    opacity: 1;
    transform: scale(1.08);
}

#ymcb-banner .ymcb-title {
    margin: 0 0 10px;
    line-height: 1.3;
}
#ymcb-banner .ymcb-message {
    line-height: 1.5;
}
#ymcb-banner .ymcb-message p { margin: 0 0 8px; }
#ymcb-banner .ymcb-message p:last-child { margin-bottom: 0; }
#ymcb-banner .ymcb-message a { color: inherit; text-decoration: underline; }

#ymcb-banner .ymcb-policy {
    margin: 10px 0 0;
    font-size: 13px;
}
#ymcb-banner .ymcb-policy a {
    color: inherit;
    text-decoration: underline;
    opacity: 0.85;
}

/* Buttons */
#ymcb-banner .ymcb-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}
#ymcb-banner .ymcb-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
    line-height: 1.3;
    font-family: inherit;
    white-space: nowrap;
}
#ymcb-banner .ymcb-btn:hover { transform: translateY(-1px); }
#ymcb-banner .ymcb-btn:active { transform: translateY(0); }

/* Settings view */
#ymcb-banner .ymcb-settings-title {
    margin: 0 0 16px;
    font-size: 18px;
    font-weight: 700;
    color: inherit;
}
#ymcb-banner .ymcb-category {
    padding: 14px 0;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}
#ymcb-banner .ymcb-category:last-of-type {
    border-bottom: 0;
    padding-bottom: 4px;
}
#ymcb-banner .ymcb-category-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
#ymcb-banner .ymcb-category-name {
    font-weight: 600;
    font-size: 15px;
}
#ymcb-banner .ymcb-category-desc {
    margin: 0;
    font-size: 13px;
    opacity: 0.85;
    line-height: 1.5;
}
#ymcb-banner .ymcb-always-on {
    font-size: 12px;
    padding: 3px 10px;
    background: rgba(22, 163, 74, 0.15);
    color: #15803d;
    border-radius: 12px;
    font-weight: 600;
}

/* Category toggle */
.ymcb-toggle {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 22px;
    flex-shrink: 0;
}
.ymcb-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.ymcb-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; right: 0; left: 0; bottom: 0;
    background: #cbd5e1;
    border-radius: 22px;
    transition: 0.3s;
}
.ymcb-toggle-slider:before {
    content: "";
    position: absolute;
    width: 16px; height: 16px;
    right: 3px; top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.ymcb-toggle input:checked + .ymcb-toggle-slider { background: #16a34a; }
.ymcb-toggle input:checked + .ymcb-toggle-slider:before { transform: translateX(-20px); }

/* Credit line */
#ymcb-banner .ymcb-credit {
    margin-top: 14px;
    padding-top: 10px;
    font-size: 11px;
    text-align: center;
    opacity: 0.6;
    border-top: 1px solid rgba(0,0,0,0.08);
}
#ymcb-banner .ymcb-credit a {
    color: inherit;
    text-decoration: none;
    font-weight: 600;
}
#ymcb-banner .ymcb-credit a:hover { text-decoration: underline; opacity: 1; }

/* Float button */
#ymcb-float-button {
    position: fixed !important;
    z-index: 2147483630 !important;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 0;
    cursor: pointer;
    line-height: 1;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    padding: 0;
    font-size: 50%;
}
#ymcb-float-button { font-size: 22px; }
#ymcb-float-button:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

/* Mobile */
@media (max-width: 640px) {
    #ymcb-banner.ymcb-pos-bottom,
    #ymcb-banner.ymcb-pos-top {
        left: 10px !important;
        right: 10px !important;
        transform: none !important;
    }
    #ymcb-banner.ymcb-pos-bottom .ymcb-box,
    #ymcb-banner.ymcb-pos-top .ymcb-box {
        width: 100% !important;
        max-width: 100% !important;
    }
    #ymcb-banner.ymcb-pos-bottom-left,
    #ymcb-banner.ymcb-pos-bottom-right {
        left: 10px !important;
        right: 10px !important;
    }
    #ymcb-banner.ymcb-pos-bottom-left .ymcb-box,
    #ymcb-banner.ymcb-pos-bottom-right .ymcb-box {
        width: 100% !important;
    }
    #ymcb-banner.ymcb-pos-center {
        width: calc(100vw - 20px) !important;
    }
    #ymcb-banner .ymcb-buttons { flex-direction: column; }
    #ymcb-banner .ymcb-btn { width: 100%; text-align: center; }
}
