/* ============================================
   Section Headers - Proper centering
   ============================================ */

/* Section headers use Bootstrap cols inside a non-row div.
   Add row-like behavior so the float-based grid works correctly. */
.tm-section-header {
    margin-left: -15px;
    margin-right: -15px;
}
.tm-section-header::after {
    content: "";
    display: table;
    clear: both;
}

/* ============================================
   Service Cards - Consistent height & alignment
   ============================================ */

/* Use flexbox ONLY on the service cards row for equal-height columns */
.service-cards-row {
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-flex-wrap: wrap;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
}

/* Each grid column stretches to match the tallest in its row */
.service-cards-row > [class*="col-"] {
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
}

/* Remove the restrictive max-width so cards fill their grid column */
.tm-home-box-2 {
    margin-bottom: 30px;
    max-width: none;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.tm-home-box-2 img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.tm-home-box-2 .service-header {
    min-height: 56px;
}

.tm-home-box-2 .service-listbox {
    flex: 1;
    min-height: 75px;
}

/* Keep the Agendar button at the bottom of each card using flex margin-top auto */
.tm-home-box-2 .tm-home-box-2-container {
    margin-top: auto;
    text-align: center;
    border-top: none;
}


/* ============================================
   Tips / Dicas Section - Side-by-side layout
   ============================================ */

/* Tips row also uses flexbox for equal-height cards */
.tips-cards-row {
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-flex-wrap: wrap;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
}

.tips-cards-row > [class*="col-"] {
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
}

/* Tip card - horizontal flexbox layout (image left, text right) */
.tm-home-box-3 {
    margin-bottom: 30px;
    max-width: none;
    width: 100%;
    background: #fff;
    display: flex;
    flex-direction: row;
    overflow: hidden;
}

/* Image takes 50% width on the left */
.tm-home-box-3-img-container {
    flex: 0 0 50%;
    width: 50%;
    min-height: 200px;
    overflow: hidden;
}

.tm-home-box-3-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Text/info area takes the other 50% */
.tm-home-box-3-info {
    flex: 1;
    width: 50%;
    max-width: none;
    height: auto;
    float: none;
    border: 1px solid #CCC;
    border-left: none;
    display: flex;
    flex-direction: column;
}

.tm-home-box-3-description {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 20px 25px;
    margin: 0;
    font-size: 14px;
    line-height: 1.42857143;
    color: #333;
    font-weight: 300;
}

/* "Ler mais" button at the bottom of the text area */
.tm-home-box-3 .tm-home-box-2-container {
    position: static;
    margin-top: 0;
    border-top: 1px solid #DDD;
}


/* ============================================
   Footer - Proper column spacing
   ============================================ */

footer.site-footer {
    clear: both;
    overflow: hidden;
    padding: 30px 0 0;
}

footer.site-footer .fbox {
    margin-bottom: 20px;
}


/* ============================================
   Responsive
   ============================================ */

/* On small screens, stack image on top of text */
@media screen and (max-width: 600px) {
    .tm-home-box-3 {
        flex-direction: column;
        max-width: 320px;
        margin-left: auto;
        margin-right: auto;
    }

    .tm-home-box-3-img-container {
        flex: 0 0 auto;
        width: 100%;
        min-height: 180px;
        height: 180px;
    }

    .tm-home-box-3-info {
        width: 100%;
        max-width: 100%;
        height: auto;
        min-height: 150px;
        border: 1px solid #CCC;
        border-top: none;
    }
}

/* On very small screens, disable flexbox on service rows to stack properly */
@media screen and (max-width: 480px) {
    .service-cards-row,
    .tips-cards-row {
        display: block;
    }
}
