/* Starwalk Supply Categories - isolated styling (never affects Elementor or other plugins). */
.starwalk-supply-categories,
.starwalk-supply-categories * {
    box-sizing: border-box;
}

.starwalk-supply-categories {
    display: block;
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0;
    font-family: inherit;
}

.starwalk-supply-categories .swpl-item {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
}

.starwalk-supply-categories .swpl-card {
    display: grid;
    grid-template-columns: minmax(0, 35%) minmax(0, 1fr);
    align-items: stretch;
    width: 100%;
    min-height: 165px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--swpl-card-border, #E2E6EB);
    border-radius: 6px;
    background: var(--swpl-card-background, #F3F5F7);
    overflow: hidden;
    box-shadow: none;
    position: relative;
}


/* Badge on the newest card only. On Mobile, the full-width image starts at
   the top of the card, so this same top-right position overlays the image. */
.starwalk-supply-categories .swpl-new-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    display: inline-block;
    margin: 0;
    padding: 4px 8px;
    border: 0;
    border-radius: 4px;
    background: #0F6B5C;
    color: #FFFFFF;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: normal;
    text-transform: uppercase;
    pointer-events: none;
}

.starwalk-supply-categories .swpl-media {
    display: block;
    min-width: 0;
    min-height: 165px;
    overflow: hidden;
}

.starwalk-supply-categories .swpl-image,
.starwalk-supply-categories .swpl-image-missing {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 165px;
    margin: 0;
    padding: 0;
    object-fit: cover;
    object-position: center;
    border: 0;
    border-radius: 0;
}

.starwalk-supply-categories .swpl-image-missing {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: #E2E6EB;
    color: #475569;
    font-size: 12px;
    text-align: center;
}

.starwalk-supply-categories .swpl-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 20px 24px;
    font-family: inherit;
}

.starwalk-supply-categories .swpl-heading-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    column-gap: 10px;
    row-gap: 6px;
    width: 100%;
    margin: 0 0 8px;
    padding: 0;
}

.starwalk-supply-categories .swpl-title,
.elementor .starwalk-supply-categories .swpl-title {
    margin: 0;
    padding: 0;
    color: var(--swpl-card-title, #000000);
    font-family: inherit;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: normal;
    text-transform: none;
}

.starwalk-supply-categories .swpl-description,
.elementor .starwalk-supply-categories .swpl-description {
    margin: 0;
    padding: 0;
    color: var(--swpl-card-description, #475569);
    font-family: inherit;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: normal;
    text-transform: none;
}

/* Only between cards: 20px from card to divider, then 20px to next card. */
.starwalk-supply-categories .swpl-divider {
    display: block;
    width: 100%;
    height: 1px;
    padding: 0;
    margin: 20px 0;
    border: 0;
    background: #E2E6EB;
}

.swpl-admin-empty {
    padding: 12px 14px;
    border: 1px solid #E2E6EB;
    color: #475569;
    background: #F3F5F7;
}

/* Tablet: still exactly one full-width card per row. */
@media (min-width: 768px) and (max-width: 1024px) {
    .starwalk-supply-categories .swpl-card {
        grid-template-columns: minmax(0, 35%) minmax(0, 1fr);
        min-height: 150px;
    }
    .starwalk-supply-categories .swpl-media,
    .starwalk-supply-categories .swpl-image,
    .starwalk-supply-categories .swpl-image-missing {
        min-height: 150px;
    }
    .starwalk-supply-categories .swpl-copy {
        padding: 18px 20px;
    }
    .starwalk-supply-categories .swpl-title,
    .elementor .starwalk-supply-categories .swpl-title {
        font-size: 17px;
        font-weight: 700;
    }
    .starwalk-supply-categories .swpl-description,
    .elementor .starwalk-supply-categories .swpl-description {
        font-size: 14px;
        line-height: 1.6;
    }
}

/* Mobile: image above title/description; still one card per row. */
@media (max-width: 767px) {
    .starwalk-supply-categories .swpl-card {
        grid-template-columns: minmax(0, 1fr);
        min-height: 0;
    }
    .starwalk-supply-categories .swpl-media {
        width: 100%;
        min-height: 0;
        aspect-ratio: 16 / 9;
    }
    .starwalk-supply-categories .swpl-image,
    .starwalk-supply-categories .swpl-image-missing {
        width: 100%;
        height: 100%;
        min-height: 0;
    }
    .starwalk-supply-categories .swpl-copy {
        padding: 12px 13px;
    }
    .starwalk-supply-categories .swpl-title,
    .elementor .starwalk-supply-categories .swpl-title {
        font-size: 16px;
        font-weight: 700;
    }
    .starwalk-supply-categories .swpl-description,
    .elementor .starwalk-supply-categories .swpl-description {
        font-size: 14px;
        line-height: 1.6;
    }
}

/* Optional Read More text link at the bottom-right on every device. */
.starwalk-supply-categories .swpl-actions {
    display: flex;
    width: 100%;
    justify-content: flex-end;
    align-self: stretch;
    margin-top: auto;
    padding-top: 14px;
}

.starwalk-supply-categories a.swpl-read-more,
.starwalk-supply-categories a.swpl-read-more:link,
.starwalk-supply-categories a.swpl-read-more:visited {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0;
    min-height: 0;
    width: auto;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #D9861C;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    box-shadow: none;
    transform: none;
    transition: color 0.3s ease;
    cursor: pointer;
}

.starwalk-supply-categories a.swpl-read-more:hover,
.starwalk-supply-categories a.swpl-read-more:focus-visible,
.starwalk-supply-categories a.swpl-read-more:active {
    background: transparent;
    color: #B86F17;
    text-decoration: none;
    box-shadow: none;
    transform: none;
}

.starwalk-supply-categories a.swpl-read-more:focus-visible {
    outline: 2px solid #0A0F1A;
    outline-offset: 2px;
}

/* Only the newest published category receives this static mint-green treatment.
   No hover effect, movement, or changed dimensions. */
.starwalk-supply-categories .swpl-item--latest .swpl-card {
    background: var(--swpl-latest-background, #E3F2EE);
    border-color: var(--swpl-latest-border, #A9D5C6);
}
.starwalk-supply-categories .swpl-item--latest .swpl-title,
.elementor .starwalk-supply-categories .swpl-item--latest .swpl-title {
    color: var(--swpl-latest-title, #0F6B5C);
}
.starwalk-supply-categories .swpl-item--latest .swpl-description,
.elementor .starwalk-supply-categories .swpl-item--latest .swpl-description {
    color: var(--swpl-latest-description, #3B665C);
}

/* v1.2.2: shorter cards on Desktop only; Tablet and Mobile retain v1.2.1 styling. */
@media (min-width: 1025px) {
    .starwalk-supply-categories .swpl-card,
    .starwalk-supply-categories .swpl-media,
    .starwalk-supply-categories .swpl-image,
    .starwalk-supply-categories .swpl-image-missing {
        min-height: 135px;
    }
    .starwalk-supply-categories .swpl-copy {
        padding: 14px 24px;
    }
}

/* v1.2.6: Desktop only. Shorter cards with text starting at the top.
   The image is absolutely fitted into its grid cell, preventing natural image
   height from making otherwise short cards excessively tall. */
@media (min-width: 1025px) {
    .starwalk-supply-categories .swpl-card {
        min-height: 160px;
    }
    .starwalk-supply-categories .swpl-media {
        position: relative;
        min-height: 0;
    }
    .starwalk-supply-categories .swpl-image,
    .starwalk-supply-categories .swpl-image-missing {
        position: absolute;
        inset: 0;
        height: 100%;
        min-height: 0;
    }
    .starwalk-supply-categories .swpl-copy {
        justify-content: flex-start;
    }
}

/* Pagination is separate from the cards so their styles remain unchanged. */
.swpl-pagination {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin: 30px 0 0;
    padding: 0;
    font-family: inherit;
}
.swpl-pagination .swpl-pagination-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
}
.swpl-pagination .swpl-page-link,
.swpl-pagination a.swpl-page-link:link,
.swpl-pagination a.swpl-page-link:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    min-height: 38px;
    padding: 7px 12px;
    background: #FFFFFF;
    border: 1px solid #475569;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    color: #475569;
    text-decoration: none;
    box-shadow: none;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
.swpl-pagination a.swpl-page-link:hover {
    background: #F3F5F7;
    border-color: #475569;
    color: #475569;
    text-decoration: none;
}
.swpl-pagination a.swpl-page-link:focus-visible {
    outline: 2px solid #0F6B5C;
    outline-offset: 2px;
}
.swpl-pagination .swpl-page-link.swpl-page-current {
    color: #FFFFFF;
    background: #14213A;
    border-color: #14213A;
    cursor: default;
}
.swpl-pagination .swpl-page-ellipsis {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 18px;
    min-height: 38px;
    color: #64748B;
    font-size: 16px;
}

/* v1.2.7: No dividers between older categories; preserve their 20px gap. */
.starwalk-supply-categories .swpl-item:not(.swpl-item--latest) + .swpl-item {
    margin-top: 20px;
}

/* Align featured images to the top-center on Desktop and Tablet only. */
@media (min-width: 768px) {
    .starwalk-supply-categories .swpl-image {
        object-position: center top;
    }
}

/* Pagination starts 30px after the last card on Tablet and Mobile. */
@media (max-width: 1024px) {
    .swpl-pagination {
        margin-top: 30px;
    }
}
