/**
 * Nani Recent Sales Popup - Front-end Styles
 * Clean, lightweight, modern CSS
 */

:root {
    --nani-popup-bg: #ffffff;
    --nani-popup-text: #2c3e50;
    --nani-popup-muted: #7f8c8d;
    --nani-popup-accent: #27ae60;
    --nani-popup-price: #e74c3c;
    --nani-popup-border: rgba(0, 0, 0, 0.08);
    --nani-popup-shadow: 0 12px 32px rgba(0, 0, 0, 0.14), 0 2px 6px rgba(0, 0, 0, 0.06);
    --nani-popup-radius: 14px;
}

.nani-sales-popup {
    position: fixed;
    z-index: 99999;
    max-width: 380px;
    width: auto;
    min-width: 290px;
    background: var(--nani-popup-bg);
    border: 1px solid var(--nani-popup-border);
    border-radius: var(--nani-popup-radius);
    box-shadow: var(--nani-popup-shadow);
    padding: 12px 14px;
    box-sizing: border-box;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateY(30px);
    opacity: 0;
    pointer-events: none;
    font-family: inherit;
    line-height: 1.35;
}

/* Позициониране */
.nani-sales-popup.nani-pos-bottom-left {
    bottom: 24px;
    left: 24px;
}

.nani-sales-popup.nani-pos-bottom-right {
    bottom: 24px;
    right: 24px;
}

.nani-sales-popup.nani-pos-top-left {
    top: 24px;
    left: 24px;
}

.nani-sales-popup.nani-pos-top-right {
    top: 24px;
    right: 24px;
}

/* Активно състояние (Показване) */
.nani-sales-popup.nani-show {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.nani-popup-inner {
    position: relative;
    width: 100%;
}

/* Бутон за затваряне */
.nani-popup-close {
    position: absolute;
    top: -6px;
    right: -4px;
    background: transparent;
    border: none;
    font-size: 18px;
    line-height: 1;
    color: #95a5a6;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 50%;
    transition: color 0.2s, background 0.2s;
    z-index: 2;
}

.nani-popup-close:hover {
    color: #34495e;
    background: #f1f2f6;
}

/* Линк към продукта */
.nani-popup-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none !important;
    color: inherit !important;
}

/* Снимка на продукта */
.nani-popup-img-wrap {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
    background: #f8f9fa;
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nani-popup-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Текстово съдържание */
.nani-popup-content {
    flex-grow: 1;
    min-width: 0;
    padding-right: 14px;
}

.nani-popup-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.nani-popup-city {
    font-size: 12px;
    font-weight: 600;
    color: var(--nani-popup-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nani-popup-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--nani-popup-accent);
}

.nani-popup-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--nani-popup-text);
    margin: 2px 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 230px;
}

.nani-popup-link:hover .nani-popup-title {
    color: #2980b9;
    text-decoration: underline;
}

.nani-popup-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}

.nani-popup-price {
    font-weight: 700;
    color: var(--nani-popup-price);
}

.nani-popup-time {
    color: var(--nani-popup-muted);
    font-size: 11px;
}

/* Мобилна оптимизация */
@media (max-width: 767px) {
    .nani-sales-popup {
        max-width: calc(100% - 32px);
        min-width: 0;
        width: calc(100% - 32px);
        left: 16px !important;
        right: 16px !important;
        bottom: 16px !important;
        padding: 10px 12px;
    }

    .nani-popup-img-wrap {
        width: 54px;
        height: 54px;
    }

    .nani-popup-title {
        max-width: 200px;
        font-size: 12px;
    }

    .nani-popup-meta {
        font-size: 11px;
    }
}
