/* Fix image container alignment */
.card-image-wrapper {
    position: relative;
    width: 100%;
    height: 260px;
    overflow: hidden;
    background: #f1f5f9;
    /* Remove flex properties */
    display: block !important;
}

/* Force image centering */
.card-image-wrapper img {
    position: absolute;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Improve card layout and spacing */
.service-card {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    min-height: 0 !important;
    margin-bottom: 1.5rem !important;
}

.service-card .card-body {
    display: flex !important;
    flex-direction: column !important;
    padding: 1.25rem !important;
    gap: 0.75rem !important;
    height: auto !important;
    flex: 1 1 auto !important;
}

.service-card .card-title {
    margin: 0 !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
}

.service-card .card-text {
    margin: 0 0 0.5rem 0 !important;
    flex-shrink: 0 !important;
    line-height: 1.4 !important;
}

.service-action {
    margin-top: auto !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
}

/* Fix card grid alignment */
.services-grid {
    display: flex;
    flex-wrap: wrap;
    margin: -0.5rem;
}

.services-grid > [class*='col-'] {
    padding: 0.5rem;
    display: flex;
}

.services-grid .col-12 {
    display: flex !important;
    flex-direction: column !important;
}

.services-grid .service-card {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100%;
    margin: 0;
}

/* Ensure consistent height and spacing */
.service-card .service-action {
    margin-top: auto !important;
    padding-top: 1rem !important;
}

/* Enhanced button styling */
.service-action .btn {
    border-radius: 8px !important;
    padding: 1rem 1.25rem !important;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Button hover effects */
.service-action .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* Status badge corrections */
.text-center.mt-2 {
    background: transparent !important;
    padding: 0.25rem 0 !important;
    margin-top: 0.5rem !important;
}

.text-center.mt-2 small {
    font-size: 0.7rem !important;
    letter-spacing: 0.02em;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
}

/* Mobile optimization */
@media (max-width: 768px) {
    .card-image-wrapper {
        height: 200px;
    }
    
    .service-card {
        height: auto;
        min-height: 480px;
    }
    
    .service-action .btn {
        padding: 0.875rem 1rem !important;
        font-size: 0.9rem;
    }
    
    .card-text {
        -webkit-line-clamp: 4;
    }
}

/* Ensure image dominance */
.service-card:hover .card-image-wrapper img {
    transform: translate(-50%, -50%) scale(1.05) !important;
}

/* Increase specificity for service cards */
.intake-services-container .service-card {
    background: white !important;
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1) !important;
    transition: all 0.3s ease !important;
    overflow: hidden !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Force button consistency */
.intake-services-container .service-action .btn {
    width: 100% !important;
    min-height: 48px !important;
    height: auto !important;
    white-space: normal !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 0.8rem 1rem !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    line-height: 1.2 !important;
    margin: 0 auto !important;
}

/* Ensure proper button sizing */
.intake-services-container .service-action {
    margin-top: auto !important;
    width: 100% !important;
}

.intake-services-container .service-action form {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Force proper card body layout */
.intake-services-container .service-card .card-body {
    display: flex !important;
    flex-direction: column !important;
    /* height: 100% !important; */
    padding: 1.8rem !important;
}

/* Reset any competing margins/padding */
.intake-services-container .card-title,
.intake-services-container .card-text {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
}

/* Ensure proper text wrapping */
.intake-services-container .service-card .btn {
    white-space: normal !important;
    word-wrap: break-word !important;
    height: auto !important;
    min-height: 48px !important;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .intake-services-container .service-card {
        margin-bottom: 1rem !important;
    }
    
    .intake-services-container .service-action .btn {
        font-size: 0.85rem !important;
        padding: 0.7rem 1rem !important;
    }
}

/* Force proper status badge alignment */
.intake-services-container .text-center.mt-2 {
    margin: 0.5rem 0 0 0 !important;
    padding: 0 !important;
    width: 100% !important;
    text-align: center !important;
}

/* Override any theme button-block styles */
.btn-block,
.service-action .btn-block,
.service-card .btn-block {
    height: auto !important;
    min-height: 52px !important;
    border-radius: 26px !important;
    width: 100% !important;
    padding: 0.8rem 2rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto !important;
    max-width: 320px !important;
    white-space: normal !important;
    line-height: 1.3 !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    text-transform: none !important;
    letter-spacing: 0.01em !important;
    transition: all 0.3s ease !important;
    margin: 0 !important;
}

/* Button variations */
.btn-primary.btn-block {
    background: linear-gradient(135deg, #3498db, #2980b9) !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.2) !important;
}

.btn-warning.btn-block {
    background: linear-gradient(135deg, #f1c40f, #f39c12) !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(241, 196, 15, 0.2) !important;
}

.btn-success.btn-block {
    background: linear-gradient(135deg, #2ecc71, #27ae60) !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.2) !important;
}

/* Hover states */
.btn-block:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15) !important;
}

/* Status badges adjustment */
.text-center.mt-2 {
    margin-top: 1rem !important;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .btn-block,
    .service-action .btn-block,
    .service-card .btn-block {
        min-height: 48px !important;
        font-size: 0.9rem !important;
        padding: 0.7rem 1.5rem !important;
    }
}

/* Force proper spacing between elements */
.card-body > * + * {
    margin-top: 1rem !important;
}