/* --- Global Color Variables --- */
:root {
    --primary-color: #fa5754;       /* Main brand color (Red/Coral) */
    --secondary-color: #ffe6e6;     /* Light background/highlight color (Light Pink) */
    --text-dark: #333333;           
    --text-highlight: #c94441;      /* Darker shade of primary for text hover */
    --card-bg: #ffffff;             
    --card-light-bg: #fcfcfc;       /* Icon area light background */
}

/* --- Grid Container for Responsiveness --- */
.services-grid {
    display: grid;
    /* Default: Forces 5 columns on wide screens, ideal for 10 fixed cards */
    grid-template-columns: repeat(5, 1fr); 
    gap: 25px; /* Spacing between cards */
    padding: 20px;
    margin: 0 auto;
}

/* --- Card Structure and Animation --- */
.service-card-container {
    height: 100%;
}
.service-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}
.service-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); 
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    height: 100%;
    position: relative; 
    
    /* Ensures uniform height (100px icon area + 50px text area) */
    min-height: 150px; 
    display: block; 
    
    border: 1px solid var(--secondary-color);
}
.service-card:hover {
    /* Lift effect */
    transform: translateY(-8px) scale(1.03); 
    /* Shadow using primary color */
    box-shadow: 0 15px 30px rgba(250, 87, 84, 0.3); 
}

/* --- Image Wrapper (Container for <img> tag) --- */
.card-image-wrapper {
    width: 100%;
    height: 100px; /* Fixed height for the icon area */
    padding: 20px; /* Padding for whitespace around the icon */
    
    background-color: var(--card-light-bg); 
    display: flex; 
    align-items: center;
    justify-content: center;
    flex-shrink: 0; 
}

/* --- Image Tag Styling (The actual icon) --- */
.service-icon {
    /* Critical: Ensures icon scales down to fit within the padded wrapper */
    max-width: 100%; 
    max-height: 100%;
    
    display: block; 
    object-fit: contain; 
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.service-card:hover .service-icon {
    transform: scale(1.05); /* Icon subtle zoom on hover */
}

/* --- Service Name Area (Text Wrapper) --- */
.card-name-wrapper {
    /* Fixed height ensures all text areas are uniform */
    height: 50px; 
    
    padding: 12px 10px; 
    text-align: center;
    background-color: var(--secondary-color); 
    border-top: 1px solid #f4d0d0; 
    transition: background-color 0.3s ease;
    
    /* Center the text vertically */
    display: flex; 
    align-items: center;
    justify-content: center;
    flex-grow: 0; 
}
.service-card:hover .card-name-wrapper {
    background-color: #f7dddd; 
}

/* --- Text Styling --- */
.card-name {
    margin: 0;
    font-size: 1em; 
    font-weight: 700; 
    color: var(--primary-color); 
    line-height: 1.3;
    transition: color 0.3s ease;
}
.service-card:hover .card-name {
    color: var(--text-highlight); 
}

/* --- Media Queries for Responsive Layout --- */

/* Tablet View (max-width 1199px): 4 cards per row */
@media (max-width: 1199px) {
    .services-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Large Phone/Portrait Tablet View (max-width 767px): 3 cards per row */
@media (max-width: 767px) {
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

/* Mobile View (max-width 575px): 2 cards per row */
@media (max-width: 575px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}