/* ==========================================================================
   UI KIT: BADGES (Глобални етикети, Промоции, Flatsome Overrides)
   ========================================================================== */

/* -------------------------------------------------------
   1. A-OPC BASE BADGES (Модерни React/UI компоненти)
------------------------------------------------------- */
.aopc-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    font-family: inherit;
    white-space: nowrap;
}

/* Размери */
.aopc-badge-sm { font-size: 10px; padding: 2px 6px; }
.aopc-badge-md { font-size: 12px; padding: 4px 10px; }
.aopc-badge-lg { font-size: 14px; padding: 6px 14px; }

/* Варианти */
.aopc-badge-promo {
    background-color: var(--fiptec-red, #ef4444);
    color: #ffffff;
}

.aopc-badge-hype {
    background-color: var(--fiptec-green, #10b981);
    color: #ffffff;
}
.aopc-badge-hype i, .aopc-badge-hype svg {
    color: var(--fiptec-yellow, #facc15);
}

.aopc-badge-neutral {
    background-color: var(--fiptec-slate-800, #1e293b);
    color: var(--fiptec-slate-300, #cbd5e1);
}

/* -------------------------------------------------------
   2. ТЕКСТОВИ И ЗАГЛАВНИ БАДЖОВЕ (Title Badges)
------------------------------------------------------- */
.fiptec-title-badges-wrapper {
    font-size: 12px; 
    font-weight: 800; 
    color: var(--fiptec-blue);
    margin-bottom: 0.75rem; 
    text-transform: uppercase; 
    letter-spacing: 0.05em;
    display: flex; 
    align-items: center; 
    gap: 0.5rem; 
    line-height: 1; 
    flex-wrap: wrap;
}

.fiptec-pill-badge {
    background-color: var(--fiptec-blue-light); 
    padding: 4px 10px;
    border-radius: 9999px; 
    color: var(--fiptec-blue-hover);
    display: inline-flex; 
    align-items: center;
}

/* Стилизиране на текста до синия бадж */
.fiptec-text-badge {
    text-transform: none !important;
    color: var(--fiptec-slate-500) !important;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: normal;
}

@media (max-width: 768px) {
    .fiptec-text-badge {
        font-size: 10px !important;
    }
}

/* -------------------------------------------------------
   3. ГЛОБАЛЕН КОНТЕЙНЕР ЗА БАДЖОВЕ (Flatsome Image Badges)
------------------------------------------------------- */
.badge-container { 
    margin: clamp(8px, 1.5vw, 15px) !important; 
    display: flex !important; 
    flex-direction: column !important; 
    align-items: flex-start !important; 
    gap: clamp(5px, 1vw, 8px) !important; 
    z-index: var(--z-dropdown) !important; 
    pointer-events: none !important; 
}

.badge-container .badge { 
    display: block !important; 
    position: static !important; 
    margin: 0 !important; 
    width: auto !important; 
    height: auto !important; 
    background: transparent !important; 
    pointer-events: auto !important; 
}

.badge-container .badge-inner { 
    display: inline-flex !important; 
    align-items: center !important; 
    justify-content: center !important; 
    padding: clamp(6px, 1vw, 6px) clamp(12px, 2vw, 14px) !important; 
    border-radius: var(--fiptec-radius-md) !important; 
    font-size: clamp(12px, 1.5vw, 13px) !important; 
    font-weight: 800 !important; 
    letter-spacing: 0.05em !important; 
    text-transform: uppercase !important; 
    line-height: 1 !important; 
    box-shadow: var(--fiptec-shadow-md) !important; 
    width: auto !important; 
    height: auto !important; 
}

.badge-container .badge-inner.on-sale { 
    background-color: var(--fiptec-red) !important; 
    color: var(--fiptec-white) !important; 
    border: 1px solid var(--fiptec-red-border) !important; 
}

/* -------------------------------------------------------
   4. ПОЗИЦИОНИРАНЕ НА БАДЖОВЕТЕ (FLATSOME CORE OVERRIDES)
------------------------------------------------------- */

/* Сценарий А: Каталог и Главна страница (Баджовете са ВЪТРЕ в .box-image) */
.product-small .box-image .badge-container {
    top: auto !important;
    bottom: 10px !important;
    left: 10px !important;
    z-index: 10 !important;
    flex-direction: column-reverse !important;
}

/* Сценарий Б: Related & Up-sells (Баджовете са ИЗВЪН кутията, директно в .col-inner) */
.col-inner > .badge-container {
    top: 0 !important;
    left: 10px !important;
    /* Трикът с 100% ширина (тъй като снимката е 1:1 квадрат) */
    margin-top: calc(100% - 10px) !important; 
    transform: translateY(-100%) !important;
    z-index: 10 !important;
    flex-direction: column-reverse !important; 
}


/* --- ГЛАВНА ГАЛЕРИЯ (SINGLE PRODUCT PAGE) --- */

/* ДЕСКТОП - Долу вляво */
.product-images .badge-container {
    top: auto !important;
    bottom: 10px !important;
    left: 15px !important;
    justify-content: flex-end !important;
    z-index: 99 !important; /* Винаги над zoom иконите */
}

/* МОБИЛЕН ТЕЛЕФОН - ХИРУРГИЧЕСКИ ФИКС */
@media (max-width: 849px) {
    /* Убиваме padding-а на Flatsome контейнера над снимката */
    .product-images > .absolute.left.right > .container {
        padding-left: 0 !important;
        padding-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .product-images .badge-container {
        bottom: 10px !important;
        left: 10px !important; 
        transform: none !important;
    }
}

/* ФИКС ЗА FLATSOME SLIDER WRAPPER (Осигурява правилното дъно) */
.product-images.slider-wrapper > .absolute.left.right {
    height: 100% !important;
    bottom: 0 !important;
    pointer-events: none !important; 
}
.product-images.slider-wrapper > .absolute.left.right > .container {
    height: 100% !important;
    position: relative !important;
    pointer-events: none !important;
}
.product-images.slider-wrapper > .absolute.left.right > .container .badge {
    pointer-events: auto !important;
}
/* -------------------------------------------------------
   5. СПЕЦИФИЧНИ БАДЖОВЕ И СКРИВАНИЯ
------------------------------------------------------- */

/* Бадж в FBT секцията (Често купувани заедно) */
.fiptec-fbt-badge { 
    position: absolute !important; 
    top: -8px !important; 
    left: -8px !important; 
    z-index: var(--z-base) !important; 
    background-color: var(--fiptec-red) !important; 
    color: var(--fiptec-white) !important; 
    border: 1px solid var(--fiptec-red-border) !important; 
    padding: 4px 8px !important; 
    border-radius: var(--fiptec-radius-md) !important; 
    font-size: 11px !important; 
    font-weight: 800 !important; 
    letter-spacing: 0.05em !important; 
    text-transform: uppercase !important; 
    line-height: 1 !important; 
    box-shadow: var(--fiptec-shadow-md) !important; 
}

/* Пълно скриване на Flatsome Custom Bubble ("Идеален за...") */
.badge-container .badge:has(.new-bubble),
.badge-container .badge-inner.new-bubble,
.new-bubble {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}