/* ============================================
   STRICT CARD SIZE STANDARDIZATION
   All cards uniform and consistent
   ============================================ */

/* ============================================
   GLOBAL CARD STRUCTURE
   ============================================ */
.card {
    display: flex !important;
    flex-direction: column !important;
    min-height: 380px !important;
    height: 100% !important;
    padding: 2.5rem !important;
    justify-content: flex-start !important;
    align-items: flex-start !important;
}

/* Card Icon - Fixed Size */
.card-icon {
    width: 80px !important;
    height: 80px !important;
    min-height: 80px !important;
    flex-shrink: 0 !important;
    margin-bottom: 1.5rem !important;
}

/* Card Heading - Fixed Height */
.card h3 {
    min-height: 60px !important;
    margin-bottom: 1rem !important;
    display: flex !important;
    align-items: center !important;
    line-height: 1.3 !important;
}

/* Card Description - Fixed Height with Overflow */
.card p {
    flex: 1 !important;
    margin-bottom: 0 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 4 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.7 !important;
}

/* ============================================
   GRID LAYOUTS - EQUAL HEIGHT ROWS
   ============================================ */
.grid-2,
.grid-3,
.grid-4,
.grid-5 {
    display: grid !important;
    align-items: stretch !important;
}

.grid-2>*,
.grid-3>*,
.grid-4>*,
.grid-5>* {
    height: 100% !important;
}

/* ============================================
   METRICS CARDS - STANDARDIZED
   ============================================ */
.metric-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 220px !important;
    height: 100% !important;
    padding: 3rem 2rem !important;
    text-align: center !important;
}

.metric-number {
    min-height: 80px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-bottom: 1rem !important;
}

.metric-label {
    min-height: 50px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
}

/* ============================================
   PRODUCT CARDS - STANDARDIZED
   ============================================ */
.product-card {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    min-height: 480px !important;
}

.product-image-wrapper {
    height: 280px !important;
    min-height: 280px !important;
    flex-shrink: 0 !important;
}

.product-info {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    padding: 2rem !important;
}

.product-info h3 {
    min-height: 60px !important;
    margin-bottom: 1rem !important;
    display: flex !important;
    align-items: center !important;
}

.product-info p {
    flex: 1 !important;
    margin-bottom: 1.5rem !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.product-contact-btn {
    margin-top: auto !important;
    flex-shrink: 0 !important;
}

/* ============================================
   TESTIMONIAL CARDS - STANDARDIZED
   ============================================ */
.testimonial-card {
    display: flex !important;
    flex-direction: column !important;
    min-height: 400px !important;
    padding: 3rem !important;
    justify-content: space-between !important;
}

.testimonial-stars {
    min-height: 40px !important;
    flex-shrink: 0 !important;
    margin-bottom: 1.5rem !important;
}

.testimonial-text {
    flex: 1 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 6 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin-bottom: 2rem !important;
}

.testimonial-author {
    min-height: 30px !important;
    margin-bottom: 0.5rem !important;
}

.testimonial-role {
    min-height: 25px !important;
}

/* ============================================
   VISION & MISSION CARDS - STANDARDIZED
   ============================================ */
.grid-2 .card {
    min-height: 320px !important;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 1024px) {
    .card {
        min-height: 360px !important;
    }

    .product-card {
        min-height: 460px !important;
    }
}

@media (max-width: 768px) {
    .card {
        min-height: 340px !important;
    }

    .card h3 {
        min-height: 50px !important;
    }

    .product-card {
        min-height: 440px !important;
    }

    .metric-item {
        min-height: 200px !important;
    }
}

@media (max-width: 640px) {

    /* Mobile: Cards can be more flexible but maintain proportions */
    .card {
        min-height: 300px !important;
    }

    .card h3 {
        min-height: auto !important;
    }

    .card p {
        -webkit-line-clamp: 5 !important;
    }

    .product-card {
        min-height: 420px !important;
    }

    .metric-item {
        min-height: 180px !important;
    }

    .testimonial-card {
        min-height: 350px !important;
    }
}

/* ============================================
   ENSURE GRID CHILDREN STRETCH
   ============================================ */
.metrics-grid,
.grid-2,
.grid-3,
.grid-4,
.grid-5 {
    align-items: stretch !important;
}

.metrics-grid>*,
.grid-2>*,
.grid-3>*,
.grid-4>*,
.grid-5>* {
    display: flex !important;
}

/* ============================================
   TEXT OVERFLOW HANDLING
   ============================================ */
.card h3,
.product-info h3,
.testimonial-author {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    word-wrap: break-word !important;
}

/* ============================================
   VERTICAL ALIGNMENT
   ============================================ */
.card-icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* ============================================
   PREVENT LAYOUT SHIFTS
   ============================================ */
.card,
.product-card,
.metric-item,
.testimonial-card {
    box-sizing: border-box !important;
}

* {
    box-sizing: border-box !important;
}