/* ========================================
   Business Directory Plugin - Business Card Centering
   Complete centering solution for all business card elements
   Version: 1.0.0 - Override any existing positioning
   ======================================== */

/* ==== COMPLETE BUSINESS CARD CENTERING ==== */

/* Main Business Card Container - Force Center Everything */
.business-directory-container .business-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    width: 100% !important;
    margin: 0 auto !important;
    justify-content: center !important;
}

/* Force center ALL elements within business card */
.business-directory-container .business-card * {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Override any existing text alignment */
.business-directory-container .business-card h1,
.business-directory-container .business-card h2,
.business-directory-container .business-card h3,
.business-directory-container .business-card h4,
.business-directory-container .business-card h5,
.business-directory-container .business-card h6,
.business-directory-container .business-card p,
.business-directory-container .business-card div,
.business-directory-container .business-card span,
.business-directory-container .business-card a,
.business-directory-container .business-card li,
.business-directory-container .business-card ul,
.business-directory-container .business-card ol {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* ==== CARD HEADER CENTERING ==== */

/* Card Header - Centered */
.business-directory-container .card-header {
    position: relative !important;
    height: 220px !important;
    overflow: hidden !important;
    background: transparent !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    text-align: center !important;
}

/* Card Header Content - Centered */
.business-directory-container .card-header-content {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
}

/* Card Image - Centered */
.business-directory-container .card-image {
    width: 100% !important;
    height: 100% !important;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
}

/* Business Image - Centered */
.business-directory-container .business-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    margin: 0 auto !important;
    text-align: center !important;
}

/* Card Image Placeholder - Centered */
.business-directory-container .card-image-placeholder {
    width: 100% !important;
    height: 100% !important;
    background: transparent !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: white !important;
    font-size: 64px !important;
    opacity: 0.9 !important;
    position: relative !important;
    text-align: center !important;
}

/* ==== STATUS BADGES CENTERING ==== */

/* Status Badges - Centered */
.business-directory-container .status-badges {
    position: absolute !important;
    top: 16px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    gap: 8px !important;
    z-index: 3 !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
}

/* Individual Badge - Centered */
.business-directory-container .badge {
    padding: 6px 14px !important;
    border-radius: 25px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.8px !important;
    color: white !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    text-align: center !important;
    display: inline-block !important;
    margin: 0 auto !important;
}

/* ==== FAVORITE BUTTON CENTERING ==== */

/* Favorite Button - Centered */
.business-directory-container .favorite-button {
    position: absolute !important;
    top: 16px !important;
    right: 16px !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.9) !important;
    border: none !important;
    color: #dc3545 !important;
    font-size: 18px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    backdrop-filter: blur(10px) !important;
    z-index: 3 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
}

/* ==== CARD CONTENT CENTERING ==== */

/* Card Content - Centered */
.business-directory-container .card-content {
    padding: 25px !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    width: 100% !important;
}

/* Card Content Inner - Centered */
.business-directory-container .card-content-inner {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 15px !important;
    width: 100% !important;
    justify-content: center !important;
}

/* ==== CATEGORY CENTERING ==== */

/* Business Category - Centered */
.business-directory-container .business-category {
    margin-bottom: 5px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    text-align: center !important;
}

/* Badges Container - Same Row with Dynamic Width Support */
.business-directory-container .business-badges-container {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 6px 0 !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    min-height: 28px !important;
}

/* Category Badge - Dynamic Width Based on Content */
.business-directory-container .bd-category-badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #ffffff !important;
    padding: 4px 12px !important;
    margin: 0 !important;
    border-radius: 12px !important;
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3) !important;
    border: 1px solid transparent !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    width: auto !important;
    min-width: fit-content !important;
    max-width: 200px !important;
    position: relative !important;
    z-index: 10 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
    animation: badgeFadeIn 0.4s ease-out !important;
    text-align: center !important;
}

/* ==== LOCATION CENTERING ==== */

/* Business Location - Centered */
.business-directory-container .business-location {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    text-align: center !important;
    margin: 8px 0 !important;
}

/* Location Badge - Dynamic Width Based on Content */
.business-directory-container .bd-location-badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
    color: #ffffff !important;
    padding: 4px 12px !important;
    margin: 0 !important;
    border-radius: 12px !important;
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
    text-decoration: none !important;
    box-shadow: 0 2px 8px rgba(79, 172, 254, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    position: relative !important;
    z-index: 10 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
    animation: badgeFadeIn 0.4s ease-out !important;
    text-align: center !important;
    white-space: nowrap !important;
    width: auto !important;
    min-width: fit-content !important;
    max-width: 200px !important;
}

/* Responsive Badge Behavior for Mobile */
@media (max-width: 768px) {
    .business-directory-container .bd-category-badge,
    .business-directory-container .bd-location-badge {
        max-width: 150px !important;
        font-size: 0.65rem !important;
        padding: 3px 10px !important;
    }
    
    .business-directory-container .business-badges-container {
        gap: 6px !important;
    }
}

@media (max-width: 480px) {
    .business-directory-container .bd-category-badge,
    .business-directory-container .bd-location-badge {
        max-width: 120px !important;
        font-size: 0.6rem !important;
        padding: 3px 8px !important;
    }
    
    .business-directory-container .business-badges-container {
        gap: 4px !important;
        flex-direction: column !important;
        align-items: center !important;
    }
}

/* ==== BUSINESS DESCRIPTION CENTERING ==== */

/* Business Description - Centered, Max 3 Lines */
.business-directory-container .business-description {
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    width: 100% !important;
    text-align: center !important;
    margin: 8px 0 !important;
    line-height: 1.6 !important;
    color: #64748b !important;
    font-size: 0.9rem !important;
    max-height: calc(1.6em * 3) !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
}

/* Fallback for browsers that don't support -webkit-line-clamp */
@supports not (-webkit-line-clamp: 3) {
    .business-directory-container .business-description {
        display: block !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-height: calc(1.6em * 3) !important;
        position: relative !important;
    }
    
    .business-directory-container .business-description::after {
        content: '...' !important;
        position: absolute !important;
        bottom: 0 !important;
        right: 0 !important;
        background: inherit !important;
        padding-left: 20px !important;
    }
}

/* ==== BUSINESS LOGO CENTERING ==== */

/* Business Logo - Centered */
.business-directory-container .business-logo {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    margin: 15px 0 !important;
    padding: 10px !important;
    text-align: center !important;
}

/* Business Logo Link - Centered */
.business-directory-container .business-logo a {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    text-decoration: none !important;
    text-align: center !important;
}

/* Business Logo Image - Centered */
.business-directory-container .business-logo-image {
    max-width: 120px !important;
    max-height: 120px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s ease !important;
    display: block !important;
    margin: 0 auto !important;
    text-align: center !important;
}

/* Logo Placeholder - Centered */
.business-directory-container .logo-placeholder {
    width: 120px !important;
    height: 120px !important;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%) !important;
    border-radius: 12px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    color: #94a3b8 !important;
    font-size: 48px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s ease !important;
    margin: 0 auto !important;
    text-align: center !important;
}

/* ==== BUSINESS TITLE CENTERING ==== */

/* Business Title - Centered */
.business-directory-container .business-title {
    font-size: 1.4rem !important;
    font-weight: 700 !important;
    margin: 0 auto !important;
    line-height: 1.3 !important;
    text-align: center !important;
    width: 100% !important;
    display: block !important;
}

/* Business Title Link - Centered */
.business-directory-container .business-title a {
    color: #2d3748 !important;
    text-decoration: none !important;
    transition: color 0.3s ease !important;
    text-align: center !important;
    display: block !important;
    width: 100% !important;
}

/* ==== BUSINESS TAGLINE CENTERING ==== */

/* Business Tagline - Centered */
.business-directory-container .business-tagline {
    color: #718096 !important;
    font-size: 0.95rem !important;
    line-height: 1.5 !important;
    margin: 0 auto !important;
    font-style: italic !important;
    text-align: center !important;
    width: 100% !important;
    display: block !important;
}

/* ==== RATING SECTION CENTERING ==== */

/* Rating Section - Centered */
.business-directory-container .rating-section {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    margin: 5px auto !important;
    width: 100% !important;
    text-align: center !important;
}

/* Rating Stars - Centered */
.business-directory-container .rating-stars {
    display: flex !important;
    gap: 2px !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
}

/* Rating Text - Centered */
.business-directory-container .rating-text {
    font-size: 0.9rem !important;
    color: #718096 !important;
    font-weight: 500 !important;
    text-align: center !important;
    margin: 0 auto !important;
}

/* ==== CONTACT INFORMATION CENTERING ==== */

/* Contact Information - Centered */
.business-directory-container .contact-info {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 10px auto !important;
    width: 100% !important;
    text-align: center !important;
}

/* Contact Item - Centered */
.business-directory-container .contact-item {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    font-size: 0.9rem !important;
    color: #4a5568 !important;
    text-align: center !important;
    width: 100% !important;
    margin: 0 auto !important;
}

/* Contact Item Icon - Centered */
.business-directory-container .contact-item i {
    width: 16px !important;
    color: #667eea !important;
    font-size: 14px !important;
    text-align: center !important;
}

/* ==== SOCIAL MEDIA LINKS CENTERING ==== */

/* Social Links - Centered */
.business-directory-container .social-links {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    margin: 10px auto !important;
    text-align: center !important;
}

/* Social Link - Centered */
.business-directory-container .social-link {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 2.5rem !important;
    height: 2.5rem !important;
    border-radius: var(--bd-radius-full) !important;
    background: var(--bd-gray-100) !important;
    color: var(--bd-gray-600) !important;
    text-decoration: none !important;
    transition: all var(--bd-transition-fast) !important;
    font-size: 1rem !important;
    text-align: center !important;
    margin: 0 auto !important;
}

/* ==== CARD FOOTER CENTERING ==== */

/* Card Footer - Centered */
.business-directory-container .card-footer {
    padding: 20px 25px !important;
    border-top: 1px solid #e2e8f0 !important;
    background: #f8fafc !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    width: 100% !important;
}

/* Card Footer Content - Centered */
.business-directory-container .card-footer-content {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    text-align: center !important;
}

/* View Details Button - Centered */
.business-directory-container .view-details-button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 100% !important;
    padding: 12px 20px !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    text-decoration: none !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    font-size: 14px !important;
    text-align: center !important;
    margin: 0 auto !important;
}

/* ==== RESPONSIVE CENTERING ==== */

/* Mobile Centering */
@media (max-width: 768px) {
    /* Ensure all mobile elements stay centered */
    .business-directory-container .business-card * {
        text-align: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    /* Mobile Business Logo */
    .business-directory-container .business-logo {
        margin: 12px auto !important;
        padding: 8px !important;
        text-align: center !important;
    }
    
    .business-directory-container .business-logo-image {
        max-width: 100px !important;
        max-height: 100px !important;
        margin: 0 auto !important;
        text-align: center !important;
    }
    
    .business-directory-container .logo-placeholder {
        width: 100px !important;
        height: 100px !important;
        font-size: 40px !important;
        margin: 0 auto !important;
        text-align: center !important;
    }
    
    /* Mobile Status Badges Centering */
    .business-directory-container .status-badges {
        left: 50% !important;
        transform: translateX(-50%) !important;
        justify-content: center !important;
        text-align: center !important;
    }
    
    /* Mobile Card Content */
    .business-directory-container .card-content-inner {
        gap: 12px !important;
        text-align: center !important;
    }
    
    .business-directory-container .business-title {
        font-size: 1.2rem !important;
        text-align: center !important;
    }
    
    .business-directory-container .business-tagline {
        font-size: 0.9rem !important;
        text-align: center !important;
    }
    
    .business-directory-container .contact-item {
        font-size: 0.85rem !important;
        text-align: center !important;
    }
    
    .business-directory-container .social-links {
        gap: 8px !important;
        justify-content: center !important;
        text-align: center !important;
    }
}

/* Small Mobile Centering */
@media (max-width: 480px) {
    /* Ensure all small mobile elements stay centered */
    .business-directory-container .business-card * {
        text-align: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    /* Small Mobile Business Logo */
    .business-directory-container .business-logo {
        margin: 10px auto !important;
        padding: 6px !important;
        text-align: center !important;
    }
    
    .business-directory-container .business-logo-image {
        max-width: 80px !important;
        max-height: 80px !important;
        margin: 0 auto !important;
        text-align: center !important;
    }
    
    .business-directory-container .logo-placeholder {
        width: 80px !important;
        height: 80px !important;
        font-size: 32px !important;
        margin: 0 auto !important;
        text-align: center !important;
    }
    
    /* Small Mobile Status Badges Centering */
    .business-directory-container .status-badges {
        left: 50% !important;
        transform: translateX(-50%) !important;
        justify-content: center !important;
        text-align: center !important;
    }
    
    /* Small Mobile Card Content */
    .business-directory-container .card-content {
        padding: 20px !important;
        text-align: center !important;
    }
    
    .business-directory-container .card-content-inner {
        gap: 10px !important;
        text-align: center !important;
    }
    
    .business-directory-container .business-title {
        font-size: 1.1rem !important;
        text-align: center !important;
    }
    
    .business-directory-container .business-tagline {
        font-size: 0.85rem !important;
        text-align: center !important;
    }
    
    .business-directory-container .contact-item {
        font-size: 0.8rem !important;
        gap: 8px !important;
        text-align: center !important;
    }
    
    .business-directory-container .social-links {
        gap: 6px !important;
        justify-content: center !important;
        text-align: center !important;
    }
    
    .business-directory-container .card-footer {
        padding: 15px 20px !important;
        text-align: center !important;
    }
}

/* ==== ANIMATION FOR BADGES ==== */

@keyframes badgeFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ==== OVERRIDE ANY EXISTING POSITIONING ==== */

/* Force override any existing positioning that might interfere */
.business-directory-container .business-card .business-category,
.business-directory-container .business-card .business-location,
.business-directory-container .business-card .business-logo,
.business-directory-container .business-card .business-title,
.business-directory-container .business-card .business-tagline,
.business-directory-container .business-card .rating-section,
.business-directory-container .business-card .contact-info,
.business-directory-container .business-card .social-links {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    transform: none !important;
    float: none !important;
    clear: both !important;
}

/* ==== UTILITY CLASSES FOR CENTERING ==== */

.bd-center-all {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.bd-center-flex {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
}

.bd-center-block {
    display: block !important;
    margin: 0 auto !important;
    text-align: center !important;
}

/* ==== FINAL OVERRIDE RULES ==== */

/* These rules have the highest specificity to ensure centering */
.business-directory-container .business-card .card-content-inner > * {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.business-directory-container .business-card .card-header-content > * {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.business-directory-container .business-card .card-footer-content > * {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
}
