#deals-ajax-wrapper {
    max-width: 1320px;
    margin: 0 auto;
}

.grid-loop-wrapper {
    padding: 20px 0;
}


.grid-loop .search-result-card {
    /*border: 1px solid #ddd;*/
    padding: 0;
    /*background: #fff;*/
    height: 100%;
}

.grid-loop .thumbImg {
    margin-bottom: 10px;
}

.grid-loop .entry-title {
    font-size: 16px;
    margin: 8px 0;
    flex-grow: 0;
}

.grid-loop .post-content {
    flex-grow: 1;
}

.grid-loop .post-meta {
    font-size: 12px;
    color: #777;
    margin-top: auto;
}


#search_results {
    font-family: 'Poppins';
    padding: 0 0;
}
#deals-ajax-wrapper .search-result-image-container {
    position: relative;
    overflow: hidden;
    min-height: 230px;
    width: 100%;
}
#load-more-deals {
    margin-top: 30px;
}

.with-featured-label {
    background: #CFDBF4;
    border-radius: 14px;
    padding: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    flex-direction: column;
}

.featured-label-title {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    font-size: 14px;
}

.label-icon {
    height: 20px;
    width: 20px;
    display: block;
}

#deals-ajax-wrapper .with-featured-label .search-result-image {
    border-radius: 0 0 15px 15px;
}

#deals-ajax-wrapper .with-featured-label .search-result-image-container {
    min-height: 183px;
}
#deals-ajax-wrapper .with-featured-label .search-result-image {
    height: 183px;
}

.sr-cat {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #96FF03;
    color: #050745;
    padding: 6px 17px;
    border-radius: 18px;
    font-size: 12px;
    font-weight: 600;
}
.sr-cat a {
    text-decoration: none;
}

#deals-ajax-wrapper .search-result-card {
    position: relative;
    /* overflow: hidden; */
}


/*.search-result-image-container,*/
/*.ui-post-card,*/
/*.th-post-card*/
/*{*/
/* transition: transform 0.25s ease-in-out;*/
/* transform-origin: center;*/
/*}*/

/*.search-result-image-container:hover,*/
/*.ui-post-card:hover,*/
/*.th-post-card:hover {*/
/* transform: scale(1.05);*/
/*}*/

#deals-ajax-wrapper .search-result-card .post-content-start {
    font-size: 13px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;

}

#deals-ajax-wrapper .search-result-image {
    width: 100%;
    height: 230px;
    object-fit: cover;
    display: block;
    border-radius: 16px;
}

.load-more-btn-container {
    grid-column: 1 / -1;
    text-align: center;
    margin-top: 16px;

}
.load-more-btn {
    background: #050745;
    color: white;
    padding: 5px 10px 2px 10px;
    border-radius: 4px;
    cursor: pointer;
}

#deals-ajax-wrapper .search-result-price {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: #ffffff;
    padding: 8px 22px;
    border-radius: 22px;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.4px;
    color: #050745;
}

#deals-ajax-wrapper .search-result-content {
    padding: 10px 0 0 0;
}

#deals-ajax-wrapper .search-result-title {
    height: 48px;
}

#deals-ajax-wrapper .search-result-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 18px;
    margin: 0 0 10px 0;
    color: #050745;
    font-weight: 500;
    line-height: 20px;
}


#deals-ajax-wrapper .search-result-title a {
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    line-height: 24px;

    color: rgba(5, 7, 69, 0.9);
}

#deals-ajax-wrapper .search-result-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #050745B2;
    font-size: 12px;
    font-weight: 500;
}

.grid-loop {
    display: grid;
    grid-template-columns: 100%;
    column-gap: 0;
    row-gap: 20px;
    margin: 0;
}

.is-enlarged {
    grid-column: span 2;
}

.is-orphan {
    display: none !important;
}

@media (max-width: 1280px) {


    body.home #deals-ajax-wrapper {
        padding-right: 23px;
        padding-left: 23px;
    }
}


@media (max-width: 630px) {

  #deals-ajax-wrapper .search-result-image-container {
    min-height: 200px;
  }

  #deals-ajax-wrapper .search-result-image {
    height: 200px;
  }

  #deals-ajax-wrapper .with-featured-label .search-result-image-container {
    min-height: 153px;
  }
  #deals-ajax-wrapper .with-featured-label .search-result-image {
    height: 153px;
  }

  .with-featured-label {
    max-height: 200px;
  }

  .post-content-start {
    -webkit-line-clamp: 2 !important;
  }

  .grid-loop {
    display: block;
  }

  .grid-loop .search-result-card {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
  }

  body.archive #deals-ajax-wrapper {
    padding-left: 0;
    padding-right: 0;
  }

  #deals-ajax-wrapper .search-result-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding-top: 15px;
  }

  .grid-loop .post-content {
    flex-grow: 1;
  }

  #deals-ajax-wrapper .search-result-card .post-content-start {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #deals-ajax-wrapper .search-result-title {
    height: auto;
  }

  #deals-ajax-wrapper .search-result-meta {
    margin-top: auto;
  }

  .is-enlarged {
    grid-column: auto;
  }
}


/* --- Responsive Grid Breakpoints --- */
@media (min-width: 630px) {
    .grid-loop {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px; /* Re-introduces both horizontal and vertical gaps */
    }
}


@media (min-width: 780px) {
    .grid-loop {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (min-width: 1024px) {
    .grid-loop {
        grid-template-columns: repeat(4, 1fr);
        gap: 30px;
    }
}

@media (min-width: 1280px) {
    .grid-loop {
        grid-template-columns: repeat(5, 1fr);
    }
}

.is-enlarged {
    grid-column: span 2;
}


/*@media (min-width: 1600px) {*/
/* .grid-loop {*/
/* grid-template-columns: repeat(6, 1fr);*/
/* }*/
/*}*/

/*@media (min-width: 1920px) {*/
/* .grid-loop {*/
/* grid-template-columns: repeat(7, 1fr);*/
/* }*/
/*}*/


.load-more-container {
    text-align: center;
    padding: 20px 0;
    width: 100%;
}


.entry-summary a,
.search-result-date a,
.search-result-right a {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}


/* =================================================================
   Grid Ad Integration (Final Version, Targeting Real DOM)
   ================================================================= */

/* --- 1. Common Container & Label Styles --- */
div[id^="ad_in_grid"] {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

div[id^="ad_in_grid"]::before {
    content: 'Anzeige';
    display: block;
    width: 100%;
    text-align: right;
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    font-family: 'Poppins', sans-serif;
    margin-bottom: 5px;
    flex-shrink: 0;
    margin-top: -20px;
}

/* --- 2. THE CRITICAL FIX --- */
div[id^="ad_in_grid"] > .search-result-card {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 0;
}

/* --- 3. Prepare the Parent Card --- */
.search-result-card:has(div[id^="ad_in_grid"]) {
    padding: 0;
}

/* --- 4. Common AdSense Unit Styles --- */
div[id^="ad_in_grid"] .adsbygoogle {
    display: block !important;
}


/* =================================================================
   Ad-Specific Sizing
   ================================================================= */

/* --- Single Ad: #ad_in_gird_feed_top --- */

/* Parent card sets a fixed height */
.search-result-card:has(#ad_in_grid_feed_top) {
    height: 390px;
}

/* Its container fills that height */
#ad_in_grid_feed_top {
    height: 390px;
}

/* Ad unit inside fills its container */
#ad_in_grid_feed_top .adsbygoogle {
    width: 100% !important;
    height: 100% !important;
}

/* Width override for larger screens */
@media(min-width: 630px) {
    #ad_in_grid_feed_top .adsbygoogle {
        width: 232px !important;
    }
}


/* --- Wide Ad: #ad_in_grid_feed_enlarged --- */
#ad_in_grid_feed_enlarged .adsbygoogle {
    width: 100% !important;
    height: 390px !important;
}

@media(min-width: 500px) {
    #ad_in_grid_feed_enlarged .adsbygoogle {
        /* Height remains 400px as per your last request */
        height: 390px !important;
    }
}

@media(min-width: 800px) {
    #ad_in_grid_feed_enlarged .adsbygoogle {
        width: 480px !important;
        height: 390px !important;
    }
}
