/* Business Card Elementor Widget Styles */

.business-card-wrapper * {
    font-family: 'DM Sans', sans-serif !important;
    box-sizing: border-box !important;
}

.business-card-wrapper {
    width: 100% !important;
    font-family: 'DM Sans', sans-serif !important;
    margin: 0 !important;
    padding: 0 !important;
}

.business-card-wrapper .business-card {
    position: relative !important;
    background: #ffffff !important;
    border-radius: 12px !important;
    border: 1px solid #eef1f5 !important;
    overflow: hidden !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    font-family: 'DM Sans', sans-serif !important;
    margin: 0 !important;
}

.business-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.accent-line {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 100%;
    background: #16766f;
    z-index: 1;
}

.card-content {
    padding: 16px 20px;
}

.rpme-card-header {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.company-logo-section {
    flex-shrink: 0;
}

.logo-container {
    position: relative;
    width: 116px;
    height: 116px;
    background: #ebecef;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.company-logo {
    max-width: 80px;
    max-height: 80px;
    object-fit: contain;
}

.canton-image {
    max-width: 60px;
    max-height: 72px;
    object-fit: contain;
}

#rpme-cancel-redirect:hover {
    color: #333333;
}

.canton-badge {
    position: absolute;
    bottom: 4px;
    left: 4px;
    right: 4px;
    background: #ffffff;
    padding: 4px 0;
    border-radius: 6px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 12px;
    line-height: 16px;
    color: #1f1f1f;
    text-align: center;
    box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.buyer-type-badge {
    position: absolute;
    bottom: 4px;
    left: 4px;
    right: 4px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 8px;
}

.buyer-type-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    flex-shrink: 0;
}

.buyer-type-label {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 12px;
    line-height: 16px;
    white-space: nowrap;
}

/* New Buyer Card Design - Figma Match */
.buyer-logo-container {
    position: relative;
}

.buyer-icon-badge {
    position: absolute;
    top: 24px;
    left: 34px;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.buyer-icon-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.buyer-canton-badge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: #ffffff;
    padding: 4px 0;
    width: 108px;
    border-radius: 7.805px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.buyer-canton-badge span {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 12px;
    line-height: 16px;
    color: #1f1f1f;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

/* Legacy support - keep for backwards compatibility */
.business-type-badge {
    position: absolute;
    bottom: 4px;
    left: 4px;
    right: 4px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 8px;
}

.business-type-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.company-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.company-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.company-title {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 1.5;
    color: #1f1f1f;
    margin: 0;
    max-width: 700px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.company-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.sector-info {
    display: flex;
    align-items: center;
    gap: 4px;
}

.meta-label {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 20px;
    color: #585d69;
}

.sectors-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sector-tag {
    background: #ebecef;
    padding: 4px 8px;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 12px;
    line-height: 16px;
    color: #585d69;
}

.seller-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 28px;
    padding: 4px 12px;
    border: 1px solid;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 20px;
}

.seller-type-badge svg {
    width: 16px;
    height: 16px;
    color: currentColor;
    flex-shrink: 0;
}

.divider {
    width: 2px;
    height: 24px;
    background: #eef1f5;
}

.revenue-info {
    display: flex;
    align-items: center;
    gap: 4px;
}

.revenue-amount {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 14px;
    line-height: 20px;
    color: #1f1f1f;
}

.rpme-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.listing-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.listing-number {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 24px;
    color: #8b919f;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #f3f8f7;
    border: 1px solid #0a8363;
    border-radius: 16px;
    padding: 2px 8px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 12px;
    line-height: 18px;
    color: #0a8363;
}

.status-badge svg {
    width: 16px;
    height: 16px;
    color: #0a8363;
}

.creation-date {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 20px;
    color: #8b919f;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.action-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-buttons button:focus {
    background-color: #f8f9fa;
}

.action-btn {
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.action-btn:hover {
    background: #f8f9fa;
}

.action-btn svg {
    width: 20px;
    height: 20px;
    color: #1f1f1f;
}

.details-button .btn,
.card-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 160px;
    height: 40px;
    padding: 10px 24px;
    background: #FCCE75 !important;
    border: 1px solid #FCCE75 !important;
    border-radius: 10px !important;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 20px;
    color: #1F1F1F !important;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
    cursor: pointer;
}

.details-button .btn:hover,
.card-button:hover {
    background: #FBBC4B !important;
    border-color: #FBBC4B !important;
    color: #1F1F1F !important;
    transform: translateY(-1px);
}

.details-button .btn:active,
.card-button:active {
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 768px) {
    .rpme-card-header {
        gap: 12px;
    }

    .logo-container {
        width: 100px;
        height: 100px;
    }

    .company-logo {
        max-width: 70px;
        max-height: 70px;
    }

    .company-meta {
        flex-wrap: wrap;
        gap: 8px;
    }

    .divider {
        display: none;
    }

    /* Hide seller type badge on mobile */
    .seller-type-badge {
        display: none !important;
    }

    .rpme-card-footer {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .footer-left {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }

    .listing-info {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }

    .footer-right {
        width: 100%;
        justify-content: space-between;
        gap: 12px;
    }

    .action-buttons {
        flex: 0 0 auto;
    }

    .card-button,
    .details-button .btn {
        flex: 1;
        min-width: 120px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .card-content {
        padding: 12px 16px;
    }

    .rpme-card-header {
        gap: 12px;
    }

    .logo-container {
        width: 88px;
        height: 88px;
    }

    .company-logo {
        max-width: 60px;
        max-height: 60px;
    }

    .buyer-icon-badge {
        width: 40px;
        height: 40px;
        top: 20px;
        left: 28px;
    }

    .buyer-icon-img {
        width: 24px;
        height: 24px;
    }

    .canton-badge,
    .buyer-canton-badge {
        font-size: 10px;
        padding: 2px 0;
    }

    .accent-line {
        height: 100%;
    }

    .company-title {
        font-size: 14px;
        line-height: 1.4;
    }

    .meta-label,
    .revenue-amount {
        font-size: 12px;
    }

    .sector-tag {
        font-size: 11px;
        padding: 3px 6px;
    }

    .status-badge {
        font-size: 11px;
        padding: 2px 6px;
    }

    .listing-number,
    .creation-date {
        font-size: 12px;
    }

    .action-btn {
        width: 36px;
        height: 36px;
    }

    .action-btn svg {
        width: 18px;
        height: 18px;
    }

    .card-button,
    .details-button .btn {
        min-width: 100px;
        padding: 8px 16px;
        font-size: 13px;
        height: 36px;
    }
}

/* Animation intentionally supprimée pour le badge d'annonce complétée */

/* Loading state */
.business-card.loading {
    opacity: 0.7;
    pointer-events: none;
}

.business-card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #16766f;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   RPME Redirect Popup Styles
   ======================================== */

.rpme-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.rpme-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.rpme-popup-container {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    margin: 20px;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.rpme-popup-overlay.active .rpme-popup-container {
    transform: scale(1);
}

.rpme-popup-content {
    padding: 40px 32px;
    text-align: center;
}

.rpme-popup-icon {
    margin: 0 auto 24px;
    width: 48px;
    height: 48px;
}

.rpme-popup-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 24px;
    font-weight: 700;
    line-height: 32px;
    color: #1f1f1f;
    margin: 0 0 16px 0;
}

.rpme-popup-message {
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    color: #585d69;
    margin: 0 0 24px 0;
}

.rpme-popup-countdown {
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    color: #16766f;
    background: #e8f1f1;
    padding: 12px 20px;
    border-radius: 8px;
    margin: 0 0 24px 0;
}

.rpme-popup-countdown span {
    font-weight: 700;
    font-size: 16px;
}

.rpme-popup-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rpme-btn {
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.rpme-btn-primary {
    background: #c21346;
    color: #ffffff;
}

.rpme-btn-primary:hover {
    background: #a10f3a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(194, 19, 70, 0.3);
}

.rpme-btn-secondary {
    background: transparent;
    color: #585d69;
    border: 1px solid #e0e3e8;
}

.rpme-btn-secondary:hover {
    background: #f6f7f8;
    border-color: #d1d5db;
}

body.rpme-popup-open {
    overflow: hidden;
}

/* Responsive */
@media (max-width: 576px) {
    .rpme-popup-content {
        padding: 32px 24px;
    }

    .rpme-popup-title {
        font-size: 20px;
        line-height: 28px;
    }

    .rpme-popup-message {
        font-size: 14px;
        line-height: 20px;
    }
}