.blocks-container {
    --image-width: 15rem;
    --image-width-big: 20rem;
    --card-height: 25rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-column-gap: 1rem;
    grid-row-gap: 1em;
}

.block-container-top {
    --card-height: 25rem;
}

.block-card {
    width: 100%;
    position: relative;
    overflow: visible;

}

.block-card-big {
    grid-column: 1 / span 2;

}

.block-card-content-wrapper {
    height: calc(var(--card-height) / 1.5);
    margin: -24px;
    display: flex;
    align-items: stretch;
    overflow: visible;
}

.block-card-big .block-card-content-wrapper {
    height: var(--card-height);
    flex-direction: row;
}

.block-card-big .block-card-content-wrapper .block-card-image {
    min-width: var(--image-width-big);
    max-width: var(--image-width-big);
}

.block-card-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.block-card-header {
    margin-bottom: 1rem;
}

.block-card-content-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.block-card-content-link {
    font-size: 1rem;
    align-self: flex-end;
}

.block-card-image {
    min-width: var(--image-width);
    max-width: var(--image-width);
}

.block-card-image {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

.stack {
    display: grid;
}

.stack > * {
    grid-area: 1 / 1;
}

.device-list {
    margin-top: 1rem;
}

.load-more-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.word-wrap-break {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

#loading-circle {
    display: none !important;
}

/* HTMX setzt .htmx-request auf das Element mit hx-indicator ODER auf den indicator selbst */
#device-grid.htmx-request #loading-circle,
#loading-circle.htmx-request {
    display: block !important;
}

.info-box {
    width: 54%;
    height: 40%;
    background-color: #e6007e;
    color: white;
    padding: 2rem;
    border-radius: 12px;
    -webkit-clip-path: polygon(0% 0%, 95% 0%, 100% 80%, 0% 100%);
    clip-path: polygon(0% 0%, 95% 0%, 100% 80%, 0% 100%);

}

@media screen and (max-width: 700px) {
    .blocks-container {
        --card-height: 25rem;
        --image-width: 100%;
        --image-width-big: 100%;
        display: flex;
        flex-direction: column;
        margin: 4rem;
    }

    .block-card {
        width: 100%;
    }

    .block-card-big {
        grid-column: unset;
    }

    .block-card-content-wrapper {
        height: calc(var(--card-height) / 1.5);
        margin: -24px;
        align-items: stretch;
        overflow: hidden;
    }

    .block-card-big .block-card-content-wrapper {
        height: var(--card-height);
        flex-direction: column;
    }

    .block-card-big .block-card-content-wrapper .block-card-image {
        width: 100%;
    }

    .block-card-content {
        height: 100%;
    }

    .block-card-header {
        margin-bottom: 1rem;
    }

    .block-card-content-body {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        height: 100%;
    }

    .block-card-content-link {
        align-self: flex-end;
    }

    .block-card-image {
        width: 100%;
        height: 40%;
    }

    .block-card-image {
        object-fit: cover;
        width: 100%;
    }

    .info-box {
        height: 75%;
    }
}

@media screen and (max-width: 550px) {
    .blocks-container {
        margin: auto;
    }
}


.block-card-content-body {
    padding: 12px 24px 20px 0;
    grid-area: content;
    display: flex;
    font-size: 1em;
    flex-direction: column;
    justify-content: space-between;
}

.block-card-content-link {
    font-size: 1.5em;
    align-self: flex-end;
}

.block-card-image {
    object-fit: cover;
    width: 100%;
    height: 100%;
    display: block;
}


.partners-page {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    margin-top: 1rem;
}

.partners-content {
    flex: 1 1 auto;
    margin-top: 1rem;
    min-width: 0;
}

.partners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 24px;
}

.partner-card {
    height: 180px;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
    background: #fff;
}

.partner-card .card-body {
    height: 100%;
    padding: 16px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
}

.partner-logo-slot {
    height: 80px;
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: center;
}

.partner-logo-slot-without-text {
    height: 85%;
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: center;


}

.partner-logo-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.partner-info-text {
    margin-top: 8px;
    font-size: 0.85rem;
    color: #666
}

@media (max-width: 788px) {

    .partners-content {
        width: 100%;
        margin-top: 1rem;
    }
}

.filter-group {
    margin-top: 1rem;
    display: flex;
    gap: var(--scl-spacing-16);
    flex-flow: column;
}

.filter-group scale-dropdown-select {
    width: 100%;
}

.filter-actions {
    display: flex;
    margin-top: 1rem;
}

.filter-actions .clear-filters {
    margin-left: auto;
}

.left-section {
    flex: 1;
    width: 50%;
}

.category {
    color: #e91e63; /* Pink */
    font-size: 0.8rem;
    margin-top: 1rem;
    margin-left: 1rem;
}

.device-name {
    font-size: clamp(0.8rem, 1vw, 1.5rem);
    font-weight: bold;
    margin-left: 1rem;
}

.device-image {
    width: clamp(9rem, 20vw, 18rem);
    aspect-ratio: 15 / 9;
    margin-left: 1rem;
    margin-bottom: 1rem;
    object-fit: contain;
}

.right-section {
    flex: 1;
    text-align: center;
}

.company-image {
    max-width: 40%;
    width: clamp(6rem, 30vw, 12rem);
    aspect-ratio: 18 / 7;
    object-fit: contain;
    align-self: flex-end;
    margin-top: 1rem;
    margin-bottom: 1rem;
    margin-right: 1rem;
    margin-left: clamp(1rem, 11vw, 11rem);
}

.selling-points h2 {
    font-size: clamp(0.7rem, 1vw, 1rem);
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.selling-points .line {
    display: inline-block;
    width: 2rem;
    height: 1px;
    background-color: #000;
}

.selling-points ul {
    list-style: none;
    padding: 0;
    margin-top: 1rem;
    margin-right: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.selling-points li {
    font-size: clamp(0.8rem, 0.7rem + 0.4vw, 0.95rem);
}

.datasheet-btn {
    margin-right: 1rem;
    margin-bottom: 1rem;
    float: right;
}

/* Desktop - Popup on hover */
@media screen and (min-width: 1025px) {

    .block-card {
        overflow: visible;
    }

    .block-card-content-wrapper {
        overflow: visible;
    }

    .selling-points {
        position: relative;
        cursor: pointer;
        min-height: 120px;
    }

    .selling-points ul {
        list-style: none;
        padding: 0;
        margin-top: 1rem;
        margin-right: 1rem;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .selling-points:hover ul {
        display: block;
        position: fixed;
        background: white;
        border: 2px solid #e20074;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        z-index: 9999;
        min-width: 300px;
        max-width: 400px;
        padding: 1rem 1rem 1rem 2rem;
        list-style: disc;
        text-align: left;
        -webkit-line-clamp: unset;
        -webkit-box-orient: unset;
        overflow: visible;
        margin: 0;
    }

    .selling-points:hover ul::before {
        content: '';
        position: absolute;
        bottom: 100%;
        left: var(--arrow-offset, 50%);
        margin-left: -10px;
        border-width: 10px;
        border-style: solid;
        border-color: transparent transparent #e20074 transparent;
    }
}

@media only screen and (min-width: 786px) {
    .filter-group {
        flex-flow: row;
    }
}

/* Tablets/IPads */
@media screen and (min-width: 481px) and (max-width: 1024px) {

    .info-box h1 {
        font-size: 1.2rem;
        line-height: 1.25;
    }

    .info-box p {
        font-size: 0.8rem;
        line-height: 1.25;
    }

    .info-box p .ipad-break {
        display: block;
    }

    .device-image {
        width: 100%;
        max-width: 100%;
        aspect-ratio: 15 / 9;
        margin-left: 0;
        margin-right: 0;
        margin-top: auto;
        margin-bottom: auto;
        object-fit: contain;
    }

    .left-section {
        width: 100%;
        padding: 0 1rem;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .right-section {
        display: flex;
        flex-direction: column;
        min-height: 100%;
    }

    .block-card {
        cursor: pointer;
        overflow: visible;
    }

    .block-card-content-wrapper {
        overflow: visible;
    }

    .selling-points {
        position: relative;
        min-height: 120px;
        flex-grow: 1;
    }

    .selling-points ul {
        list-style: none;
        padding: 0;
        margin-top: 1rem;
        margin-right: 1rem;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .block-card.popup-active .selling-points ul {
        display: block;
        position: fixed;
        background: white;
        border: 2px solid #e20074;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        z-index: 9999;
        min-width: 300px;
        max-width: 400px;
        padding: 1rem 1rem 1rem 2rem;
        list-style: disc;
        text-align: left;
        -webkit-line-clamp: unset;
        -webkit-box-orient: unset;
        overflow: visible;
        margin: 0;
    }

    .block-card.popup-active .selling-points ul::before {
        content: '';
        position: absolute;
        bottom: 100%;
        left: var(--arrow-offset, 50%);
        margin-left: -10px;
        border-width: 10px;
        border-style: solid;
        border-color: transparent transparent #e20074 transparent;
    }

    .datasheet-btn {
        margin-top: auto;
        margin-bottom: 1rem;
        align-self: flex-end;
    }
}

/* Phone */
@media screen and (max-width: 480px) {

    .block-card {
        position: relative;
    }

    .block-card-content-wrapper {
        flex-direction: column;
        height: auto;
        min-height: auto;
        overflow: visible;
    }

    .left-section {
        width: 100%;
        order: 1;
        display: flex;
        flex-direction: column;
        padding-top: 0;
        align-items: flex-start;
    }

    .right-section {
        width: 100%;
        order: 2;
    }

    .device-image {
        order: 3;
        width: 100%;
        max-width: 25rem;
        aspect-ratio: 15 / 9;
        object-fit: contain;
        margin: 1rem auto;
    }

    .device-name {
        order: 2;
        margin-left: 0 !important;
        margin-top: 0.2rem;
        padding-left: 1rem;
        padding-right: calc(min(120px, 30vw) + 20px);
        text-align: left !important;
        font-size: 1.5rem;
        align-self: flex-start;
        max-width: calc(100% - min(120px, 30vw) - 30px);
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .category {
        order: 1;
        margin-left: 0 !important;
        margin-top: 1rem;
        padding-left: 1rem;
        padding-right: calc(min(120px, 30vw) + 20px);
        text-align: left !important;
        align-self: flex-start;
        max-width: calc(100% - min(120px, 30vw) - 30px);
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .company-image {
        position: absolute;
        top: 1rem;
        right: 1rem;
        margin: 0;
        max-width: min(110px, 30vw);
        width: auto;
        height: auto;
        max-height: 60px;
        object-fit: contain;
        z-index: 10;
    }

    .selling-points {
        text-align: center;
        padding: 0 1rem;
        cursor: pointer;
    }

    .selling-points h2 {
        cursor: pointer;
        user-select: none;
        font-size: 0.9rem;
    }

    .selling-points ul {
        margin-left: 0;
        margin-right: 0;
        padding: 0 1rem;
        text-align: left;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        transition: max-hight 0.3s ease;
    }

    .selling-points.expanded ul {
        display: block; !important;
        max-height: 500px;
    }
    .datasheet-btn {
    float: none;
    margin: 1rem 1rem 1rem auto;
    display: block;
    width: fit-content;
    position: relative;
    align-self: flex-end;
    }

    .info-box h1 {
        font-size: 1.2rem;
        line-height: 1.2;
    }

    .info-box p {
        font-size: 3.15vw; !important;
        line-height: 1.4; !important;
    }
}
