/* Gimle kategoribannere — plakater i produktgriddet + video-popup */

/* Radene strekkes så banneret dekker HELE produktfeltet. Flex m/ gap
   erstatter temaets margin-left + nth-child(3n+1)-rytme — den bryter
   sammen når bannere skyter inn ekstra elementer i tellingen. Samme
   visuelle resultat: 3 kolonner à 32 % med 2 % mellomrom. */
html body.page-products .products-grid ol.products.list {
    align-items: stretch;
    column-gap: 2%;
    display: flex;
    flex-wrap: wrap;
}

html body.page-products .products-grid ol.products.list .product-item {
    margin-left: 0;
    width: 32%;
}

/* Banneret fyller feltet med absolutt posisjonering — det ARVER radhøyden
   fra produktkortene i stedet for å definere den (blir aldri for langt). */
.gimle-cbanner {
    background: #ffffff;
    box-sizing: border-box;
    min-height: 320px;
    position: relative;
}

.gimle-cbanner__trigger {
    background: none;
    border: 0;
    cursor: pointer;
    display: block;
    inset: 0;
    padding: 0;
    position: absolute;
    width: 100%;
}

a.gimle-cbanner__trigger {
    text-decoration: none;
}

.gimle-cbanner__img {
    display: block;
    height: 100%;
    left: 0;
    object-fit: cover;
    position: absolute;
    top: 0;
    width: 100%;
}

.gimle-cbanner__play {
    align-items: center;
    background: rgba(34, 48, 62, 0.82);
    border-radius: 50%;
    color: #fff;
    display: flex;
    font-size: 18px;
    height: 52px;
    justify-content: center;
    left: 50%;
    padding-left: 4px;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    transition: background 0.15s ease;
    width: 52px;
}

.gimle-cbanner__trigger:hover .gimle-cbanner__play {
    background: #b08c5a;
}

/* 2 felt = to kolonner + mellomrommet (32 + 2 + 32), full bredde på mobil */
@media only screen and (min-width: 640px) {
    html body.page-products .products-grid ol.products.list .product-item.gimle-cbanner--wide {
        width: 66%;
    }
}

@media only screen and (max-width: 639px) {
    html body.page-products .products-grid ol.products.list .product-item.gimle-cbanner--wide {
        width: 100%;
    }
}

/* Video-popup */
.gimle-cbanner-overlay {
    align-items: center;
    background: rgba(15, 22, 30, 0.78);
    display: flex;
    inset: 0;
    justify-content: center;
    position: fixed;
    z-index: 1000;
}

.gimle-cbanner-dialog {
    background: #000;
    max-width: 860px;
    position: relative;
    width: calc(100% - 40px);
}

.gimle-cbanner-dialog video {
    display: block;
    max-height: calc(100vh - 120px);
    width: 100%;
}

.gimle-cbanner-close {
    background: #2c3a4d;
    border: 0;
    color: #fff;
    cursor: pointer;
    font-size: 22px;
    height: 40px;
    line-height: 1;
    position: absolute;
    right: 0;
    top: -40px;
    width: 40px;
}

.gimle-cbanner-close:hover {
    background: #b08c5a;
}
