.sekcija {
    margin-top: 25px;
}

/*
 * `!important` ovdje nije lijenost. Dodatni CSS u Prilagodbi nosi mrežu za
 * članke prenesene sa starog SmartStore shopa i cilja
 * `.wpcontent .sekcija:has(> .third)` te `.wpcontent .sekcija > .third` —
 * svim stupcima nameće trećinu širine i `align-items: flex-start`, s
 * vlastitim prijelomima na 768 i 530 px. Ti su selektori specifičniji od
 * ovih ispod, pa bez `!important` pobjeđuju: zato 2 ili 4 u redu nikad nisu
 * davali 2 ni 4, a kartice u istom redu nisu bile jednake visine.
 *
 * Blok proizvoda mora ostati na klasama `.sekcija` i `.third` jer se tema u
 * `_shop-single.scss` na njih oslanja. Blok vijesti ne mora, pa ih i ne
 * koristi — vidi njegov odjeljak niže, koji je zato bez `!important`.
 */

.sekcija.proizvodi,
.looka-product-block {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: stretch !important;
}

.looka-product-block .third {
    display: flex;
}

.looka-products--1 .third {
    width: 100% !important;
}

.looka-products--2 .third {
    width: calc((100% - 20px) / 2) !important;
}

.looka-products--3 .third {
    width: calc((100% - 40px) / 3) !important;
}

.looka-products--4 .third {
    width: calc((100% - 60px) / 4) !important;
}

.looka-product-block .third .woocommerce,
.looka-product-block .third .shortcode-product-single,
.looka-product-block .third .products,
.looka-product-block .third .products li.product {
    height: 100%;
}

/* `.third` je flex kontejner, pa se omotač shortcodea bez ove širine skupi
   na širinu sadržaja i ostavi prazninu s desne strane stupca. */
.looka-product-block .third .woocommerce,
.looka-product-block .third .shortcode-product-single {
    width: 100%;
    min-width: 0;
}

.looka-product-block .third .products {
    margin: 0;
    width: 100%;
}

.looka-product-block .third .products li.product {
    width: 100% !important;
    margin: 0 !important;
    float: none !important;
    display: flex;
    flex-direction: column;
}

.looka-product-block .third .products li.product .button {
    margin-top: auto;
}

/* ==========================================================================
   Kartice vijesti — isti izgled kao na naslovnici
   ========================================================================== */

.looka-post-block {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: stretch;
    margin-top: 40px;
    margin-bottom: 40px;
}

.looka-post-block__item {
    display: flex;
}

.looka-posts--1 .looka-post-block__item {
    width: 100%;
}

.looka-posts--2 .looka-post-block__item {
    width: calc((100% - 20px) / 2);
}

.looka-posts--3 .looka-post-block__item {
    width: calc((100% - 40px) / 3);
}

.looka-posts--4 .looka-post-block__item {
    width: calc((100% - 60px) / 4);
}

.looka-post-block--bg {
    background: #f3f3f3;
    padding: 20px;
}

.looka-post-card {
    min-width: 0;
    text-decoration: none;
}

/* Sadržaj objave podcrtava poveznice narančastom crtom, podebljava ih i dodaje
   razmak ispod slika (.wpcontent--single u temi). Selektori su namjerno
   dvorazinski jer `.wpcontent--single a` inače pobjeđuje po specifičnosti. */
.looka-post-block .looka-post-card,
.looka-post-block .looka-post-card:hover,
.looka-post-block .looka-post-card:focus {
    box-shadow: none !important;
    font-weight: 400;
}

.looka-post-block .looka-post-card img {
    width: 100%;
    margin-bottom: 0;
}

.looka-post-block .looka-post-card h3 {
    margin-bottom: 8px;
}

.looka-post-block .looka-post-card p {
    margin-bottom: 16px;
}

.looka-post-block .looka-post-card .read-more {
    font-weight: 400;
}

.compact-product-card {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 14px;
    border: 1px solid #e5e5e5;
    background: #fff;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.compact-product-card:hover {
    border-color: #cfcfcf;
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.06);
    text-decoration: none;
    color: inherit;
}

.compact-product-card__image {
    width: 33%;
    max-width: 120px;
    min-width: 90px;
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.compact-product-card__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.compact-product-card__content {
    flex: 1;
    min-width: 0;
}

.compact-product-card__title {
    display: block;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
}

.looka-product-block-editor {
    border: 1px dashed #d0d0d0;
    padding: 16px;
    background: #fff;
}

.looka-product-editor-preview {
    display: grid;
    gap: 16px;
}

.looka-product-editor-card {
    border: 1px solid #e2e2e2;
    padding: 12px;
    background: #fff;
}

.looka-product-editor-card img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    margin-bottom: 10px;
}

.looka-product-editor-card strong {
    display: block;
    font-size: 14px;
    line-height: 1.35;
}

.looka-product-editor-card__meta {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #757575;
}

.looka-product-editor-card--compact {
    display: flex;
    align-items: center;
    gap: 12px;
}

.looka-product-editor-card--compact img {
    width: 33%;
    max-width: 110px;
    min-width: 70px;
    margin-bottom: 0;
    flex-shrink: 0;
}

.looka-product-search-result {
    display: grid;
    grid-template-columns: 45px 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #ddd;
}

.looka-product-search-result img {
    width: 45px;
    height: 45px;
    object-fit: contain;
}

.looka-product-selected-list {
    margin-top: 16px;
}

.looka-product-selected-item {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    margin-top: 8px;
}

@media (max-width: 768px) {
    .looka-product-block .third,
    .looka-products--1 .third,
    .looka-products--2 .third,
    .looka-products--3 .third,
    .looka-products--4 .third {
        width: 100% !important;
    }

    /* Vijesti prate naslovnicu: `col-md-4` ispod 768 px daje jednu u redu.
       Klase se moraju nabrojati jer bi inače pravila iznad, s dvije klase,
       nadjačala ovo unatoč media upitu. */
    .looka-posts--1 .looka-post-block__item,
    .looka-posts--2 .looka-post-block__item,
    .looka-posts--3 .looka-post-block__item,
    .looka-posts--4 .looka-post-block__item {
        width: 100%;
    }

    .looka-post-block {
        margin-top: 30px;
        margin-bottom: 30px;
    }

    .looka-post-block--bg {
        padding: 16px;
    }

    .looka-product-editor-preview {
        grid-template-columns: 1fr !important;
    }
}

/*
 * Proizvodi na tabletima ostaju dva u redu, kako su i dosad izgledali —
 * to je dotad dolazilo iz mreže za stari sadržaj, koju gornji `!important`
 * više ne propušta.
 */
@media (min-width: 530px) and (max-width: 768px) {
    .looka-products--2 .third,
    .looka-products--3 .third,
    .looka-products--4 .third {
        width: calc((100% - 20px) / 2) !important;
    }
}
