/**
 * Widget Builder - Front CSS
 *
 * @author    WBShop.pl
 * @copyright 2024 WBShop.pl
 */

/* ==========================================================================
   Base Widget Styles
   ========================================================================== */

.wb-widget {
    margin-bottom: 1.5rem;
}

.wb-widget:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   HTML Widget
   ========================================================================== */

.wb-html-content {
    line-height: 1.6;
}

.wb-html-content img {
    max-width: 100%;
    height: auto;
}

/* ==========================================================================
   Icon List Widget
   ========================================================================== */

.wb-icon-list__item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.wb-icon-list__item:last-child {
    margin-bottom: 0;
}

.wb-icon-list__link {
    display: flex;
    align-items: flex-start;
    text-decoration: none;
    color: inherit;
    width: 100%;
}

.wb-icon-list__link:hover {
    text-decoration: none;
}

.wb-icon-list__icon {
    flex-shrink: 0;
    width: 48px;
    margin-right: 1rem;
}

.wb-icon-list__icon img {
    max-width: 100%;
    height: auto;
}

.wb-icon-list__content {
    flex: 1;
}

.wb-icon-list__title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.wb-icon-list__desc {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Icon position variants */
.wb-icon-list--icon-top .wb-icon-list__item,
.wb-icon-list--icon-top .wb-icon-list__link {
    flex-direction: column;
    text-align: center;
}

.wb-icon-list--icon-top .wb-icon-list__icon {
    margin-right: 0;
    margin-bottom: 0.75rem;
    width: 64px;
    margin-left: auto;
    margin-right: auto;
}

.wb-icon-list--icon-right .wb-icon-list__item,
.wb-icon-list--icon-right .wb-icon-list__link {
    flex-direction: row-reverse;
}

.wb-icon-list--icon-right .wb-icon-list__icon {
    margin-right: 0;
    margin-left: 1rem;
}

/* Horizontal layout (grid) */
.wb-icon-list__grid {
    display: grid;
    gap: 1.5rem;
}

.wb-icon-list__grid--2 { grid-template-columns: repeat(2, 1fr); }
.wb-icon-list__grid--3 { grid-template-columns: repeat(3, 1fr); }
.wb-icon-list__grid--4 { grid-template-columns: repeat(4, 1fr); }
.wb-icon-list__grid--5 { grid-template-columns: repeat(5, 1fr); }
.wb-icon-list__grid--6 { grid-template-columns: repeat(6, 1fr); }

@media (max-width: 992px) {
    .wb-icon-list__grid--4,
    .wb-icon-list__grid--5,
    .wb-icon-list__grid--6 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .wb-icon-list__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .wb-icon-list__grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Icons Widget
   ========================================================================== */

.wb-icons__grid {
    display: grid;
    gap: 1.5rem;
}

.wb-icons__grid--2 { grid-template-columns: repeat(2, 1fr); }
.wb-icons__grid--3 { grid-template-columns: repeat(3, 1fr); }
.wb-icons__grid--4 { grid-template-columns: repeat(4, 1fr); }
.wb-icons__grid--5 { grid-template-columns: repeat(5, 1fr); }
.wb-icons__grid--6 { grid-template-columns: repeat(6, 1fr); }

.wb-icons__item {
    text-align: center;
}

.wb-icons__link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.wb-icons__link:hover {
    text-decoration: none;
}

.wb-icons__icon {
    margin: 0 auto 0.75rem;
}

.wb-icons__icon img {
    max-width: 100%;
    height: auto;
    width: 100%;
}

.wb-icons__icon--small { width: 32px; height: 32px; }
.wb-icons__icon--medium { width: 48px; height: 48px; }
.wb-icons__icon--large { width: 64px; height: 64px; }
.wb-icons__icon--xlarge { width: 96px; height: 96px; }

.wb-icons__caption {
    font-size: 0.9rem;
}

/* Text align variants */
.wb-icons--left .wb-icons__item { text-align: left; }
.wb-icons--left .wb-icons__icon { margin-left: 0; }

.wb-icons--right .wb-icons__item { text-align: right; }
.wb-icons--right .wb-icons__icon { margin-right: 0; }

@media (max-width: 992px) {
    .wb-icons__grid--4,
    .wb-icons__grid--5,
    .wb-icons__grid--6 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .wb-icons__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================================================
   Image Widget
   ========================================================================== */

.wb-image {
    line-height: 0;
}

.wb-image__img {
    max-width: 100%;
    height: auto;
}

.wb-image--full-width .wb-image__img {
    width: 100%;
}

/* ==========================================================================
   Image Text Widget
   ========================================================================== */

.wb-image-text__row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.wb-image-text__image-col,
.wb-image-text__text-col {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0 15px;
}

.wb-image-text__img {
    max-width: 100%;
    height: auto;
}

.wb-image-text__title {
    margin-bottom: 1rem;
}

.wb-image-text__desc {
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Image position */
.wb-image-text--image-right .wb-image-text__image-col {
    order: 2;
}

.wb-image-text--image-right .wb-image-text__text-col {
    order: 1;
}

/* Vertical alignment */
.wb-image-text--align-top .wb-image-text__row {
    align-items: flex-start;
}

.wb-image-text--align-center .wb-image-text__row {
    align-items: center;
}

.wb-image-text--align-bottom .wb-image-text__row {
    align-items: flex-end;
}

@media (max-width: 768px) {
    .wb-image-text__image-col,
    .wb-image-text__text-col {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .wb-image-text__image-col {
        margin-bottom: 1.5rem;
        order: 1 !important;
    }
    
    .wb-image-text__text-col {
        order: 2 !important;
    }
}

/* ==========================================================================
   Carousel Widget
   ========================================================================== */

.wb-carousel__section-heading {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.wb-carousel__section-description {
    margin-bottom: 1.25rem;
    line-height: 1.6;
    color: #6c757d;
}

.wb-carousel {
    position: relative;
}

.wb-carousel__slide {
    line-height: 0;
    position: relative;
}

.wb-carousel__img {
    width: 100%;
    height: auto;
}
.wb-carousel__img--ratio {
    object-fit: cover;
}

.wb-carousel__link {
    display: block;
}

/* Splide customization */
.wb-carousel .splide__arrow {
    background: rgba(255, 255, 255, 0.9);
    opacity: 1;
}

.wb-carousel .splide__arrow:hover {
    background: #fff;
}

.wb-carousel .splide__pagination__page {
    background: #ccc;
}

.wb-carousel .splide__pagination__page.is-active {
    background: #333;
}

.wb-carousel__caption {
    position: absolute;
    z-index: 2;
    padding: 12px 16px;
    max-width: calc(100% - 24px);
    line-height: 1.3;
    box-sizing: border-box;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.wb-carousel__title {
    font-weight: 600;
    font-size: 0.9375rem;
    line-height: 1.3;
}

.wb-carousel__description {
    font-size: 0.8125rem;
    margin-top: 4px;
    line-height: 1.4;
}

/* Per-image button — base rule only. Themes/admins layer their own button
   classes (e.g. btn btn-primary) on top via the per-image button_class field. */
.wb-carousel__button {
    display: inline-block;
    margin-top: 8px;
    text-decoration: none;
}

/* 9-position grid for the caption block (top/middle/bottom × left/center/right) */
.wb-carousel__caption.position-top-left {
    top: 0;
    left: 0;
    text-align: left;
}
.wb-carousel__caption.position-top-center {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}
.wb-carousel__caption.position-top-right {
    top: 0;
    right: 0;
    text-align: right;
}
.wb-carousel__caption.position-middle-left {
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    text-align: left;
}
.wb-carousel__caption.position-middle-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}
.wb-carousel__caption.position-middle-right {
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    text-align: right;
}
.wb-carousel__caption.position-bottom-left {
    bottom: 0;
    left: 0;
    text-align: left;
}
.wb-carousel__caption.position-bottom-center {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}
.wb-carousel__caption.position-bottom-right {
    bottom: 0;
    right: 0;
    text-align: right;
}

@media (max-width: 992px) {
    .wb-carousel__caption {
        padding: 10px 12px;
    }
}

@media (max-width: 768px) {
    .wb-carousel__caption {
        padding: 8px 10px;
    }
    .wb-carousel__title {
        font-size: 0.9375rem;
    }
    .wb-carousel__description {
        font-size: 0.875rem;
    }
}

@media (max-width: 576px) {
    .wb-carousel__caption {
        padding: 6px 8px;
        max-width: calc(100% - 16px);
    }
    .wb-carousel__title {
        font-size: 0.9375rem;
    }
    .wb-carousel__description {
        font-size: 0.875rem;
    }
}

/* ==========================================================================
   Product List Widget
   ========================================================================== */

.wb-product-list {
    margin-bottom: 2rem;
}

.wb-product-list__title {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.wb-product-list__tabs {
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #dee2e6;
}

.wb-product-list__tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    padding: 0.75rem 1.25rem;
    font-weight: 500;
    color: #6c757d;
    transition: all 0.2s ease;
}

.wb-product-list__tabs .nav-link:hover {
    color: #333;
    border-bottom-color: #ccc;
}

.wb-product-list__tabs .nav-link.active {
    color: #333;
    border-bottom-color: #333;
    background: transparent;
}

.wb-product-list__tab-content {
    padding-top: 1rem;
}

.wb-product-list__empty {
    padding: 2rem;
    text-align: center;
    color: #6c757d;
    background: #f8f9fa;
    border-radius: 8px;
}

.wb-product-list__button-wrapper {
    text-align: center;
    margin-top: 2rem;
}

.wb-product-list__button {
    padding: 0.75rem 2rem;
}

/* Product Carousel */
.wb-product-carousel .splide__arrow {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    opacity: 1;
    width: 40px;
    height: 40px;
}

.wb-product-carousel .splide__arrow:hover {
    background: #fff;
}

.wb-product-carousel .splide__arrow--prev {
    left: -12px;
}

.wb-product-carousel .splide__arrow--next {
    right: -12px;
}

.wb-product-carousel .splide__pagination {
    bottom: -30px;
}

.wb-product-carousel .splide__pagination__page {
    width: 10px;
    height: 10px;
    background: #ccc;
    margin: 0 4px;
}

.wb-product-carousel .splide__pagination__page.is-active {
    background: #333;
    transform: scale(1.2);
}

@media (max-width: 768px) {
    .wb-product-list__tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .wb-product-list__tabs .nav-item {
        flex-shrink: 0;
    }

    .wb-product-carousel .splide__arrow--prev {
        left: 0;
    }

    .wb-product-carousel .splide__arrow--next {
        right: 0;
    }
}

/* ==========================================================================
   Module Embed Widget
   ========================================================================== */

.wb-module-embed {
    /* Wrapper — osadzony moduł używa własnych styli */
}

/* ==========================================================================
   Layout Widget (Bootstrap Grid)
   ========================================================================== */

/* Heading */
.wb-layout__heading {
    margin-top: 0;
}

/* Text */
.wb-layout__text {
    line-height: 1.6;
}

.wb-layout__text img {
    max-width: 100%;
    height: auto;
}

/* Image */
.wb-layout__image {
    line-height: 0;
}

.wb-layout__image a {
    display: block;
}

.wb-layout__img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Button */
.wb-layout__button a,
.wb-layout__button button {
    display: inline-block;
}

/* Icon + Text */
.wb-layout__icon-text {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.wb-layout__icon-text-icon {
    flex-shrink: 0;
    width: 48px;
}

.wb-layout__icon-text-icon img {
    max-width: 100%;
    height: auto;
}

.wb-layout__icon-text-content {
    flex: 1;
    min-width: 0;
}

.wb-layout__icon-text-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.wb-layout__icon-text-desc {
    font-size: 0.9em;
    color: #6c757d;
    line-height: 1.5;
}

/* Separator */
.wb-layout__separator {
    border: 0;
    border-top: 1px solid #dee2e6;
    margin: 1rem 0;
}

/* ==================== Featured Categories Widget ==================== */
.wb-featured-categories {
    margin-bottom: 2rem;
}
.wb-featured-categories__heading {
    margin: 0 0 .5rem;
}
.wb-featured-categories__description {
    margin: 0 0 1.25rem;
    color: #555;
}
.wb-featured-categories__grid.row {
    margin-left: -8px;
    margin-right: -8px;
}
.wb-featured-categories__col {
    padding-left: 8px;
    padding-right: 8px;
    margin-bottom: 16px;
    display: flex;
}
.wb-featured-categories__carousel .splide__slide {
    height: auto;
    display: flex;
}

/* Card */
.wb-fc-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    background: #fff;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform .25s ease, box-shadow .25s ease;
    position: relative;
}
.wb-fc-card:hover,
.wb-fc-card:focus {
    text-decoration: none;
    color: inherit;
}
.wb-fc-card__image-wrap {
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
    flex-shrink: 0;
}
.wb-fc-card__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}
.wb-fc-card__body {
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    flex-grow: 1;
}
.wb-fc-card__title {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
}
.wb-fc-card__description {
    font-size: .9rem;
    color: #555;
    line-height: 1.45;
}
.wb-fc-card__cta {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    font-weight: 600;
    color: #2275d7;
    padding-top: .35rem;
}
.wb-fc-card__cta .material-icons,
.wb-fc-card__cta-icon {
    font-size: 1rem;
    flex-shrink: 0;
    transition: transform .25s ease;
}

/* Per-category button (admin-toggled, admin-classed). The base class is
   intentionally minimal so the admin-supplied `button_class` (e.g.
   `btn btn-primary`) drives the actual look. Themes can also target this
   class for global tweaks. */
.wb-featured-category__button {
    display: inline-block;
    margin-top: .5rem;
    align-self: flex-start;
}

/* Layout: image-left */
.wb-fc-card--image-left {
    flex-direction: row;
}
.wb-fc-card--image-left .wb-fc-card__image-wrap {
    width: 40%;
    aspect-ratio: 1/1;
}
.wb-fc-card--image-left .wb-fc-card__body {
    flex: 1;
}

/* Layout: image-overlay */
.wb-fc-card--image-overlay {
    color: #fff;
}
.wb-fc-card--image-overlay .wb-fc-card__image-wrap {
    width: 100%;
}
.wb-fc-card--image-overlay .wb-fc-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.7) 100%);
    pointer-events: none;
}
.wb-fc-card--image-overlay .wb-fc-card__body {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    color: #fff;
    z-index: 1;
}
.wb-fc-card--image-overlay .wb-fc-card__title,
.wb-fc-card--image-overlay .wb-fc-card__description {
    color: #fff;
}
.wb-fc-card--image-overlay .wb-fc-card__cta {
    color: #fff;
}

/* Layout: text-only */
.wb-fc-card--text-only .wb-fc-card__body {
    padding: 1.5rem;
}
.wb-fc-card--no-image .wb-fc-card__image-wrap {
    display: none;
}

/* Text alignment modifiers */
.wb-featured-categories--align-center .wb-fc-card__body { text-align: center; align-items: center; }
.wb-featured-categories--align-right  .wb-fc-card__body { text-align: right;  align-items: flex-end; }

/* Hover effects */
.wb-featured-categories--hover-zoom .wb-fc-card:hover .wb-fc-card__image {
    transform: scale(1.06);
}
.wb-featured-categories--hover-lift .wb-fc-card {
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.wb-featured-categories--hover-lift .wb-fc-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(0,0,0,.10);
}
.wb-featured-categories--hover-overlay-fade.wb-featured-categories--layout-image-overlay .wb-fc-card .wb-fc-card__overlay {
    opacity: .65;
    transition: opacity .3s ease;
}
.wb-featured-categories--hover-overlay-fade.wb-featured-categories--layout-image-overlay .wb-fc-card:hover .wb-fc-card__overlay {
    opacity: 1;
}

.wb-featured-categories--hover-zoom .wb-fc-card:hover .wb-fc-card__cta .material-icons,
.wb-featured-categories--hover-lift .wb-fc-card:hover .wb-fc-card__cta .material-icons,
.wb-featured-categories--hover-zoom .wb-fc-card:hover .wb-fc-card__cta-icon,
.wb-featured-categories--hover-lift .wb-fc-card:hover .wb-fc-card__cta-icon {
    transform: translateX(3px);
}

/* Responsive: stack image-left on small screens */
@media (max-width: 576px) {
    .wb-fc-card--image-left {
        flex-direction: column;
    }
    .wb-fc-card--image-left .wb-fc-card__image-wrap {
        width: 100%;
        aspect-ratio: 16/9;
    }
}

/* =========================================================================
   Splide: reserve the carousel box BEFORE mount (CLS)

   Splide 4 keeps .splide invisible until it adds .is-initialized, but the
   element still occupies space. Pre-mount, .splide__list is a flex row and
   each li is auto-sized, so a 1920px slide image makes the box ~1080px
   tall; mount() then writes real slide widths and it collapses to ~160px.
   Everything below jumps. These rules give the un-mounted slide the same
   share of the track that Splide will give it, so the height barely moves.

   perPage arrives as a class (.wb-pp-N / .wb-pp-<bp>-N) rather than an
   inline style, because inline style attributes are forbidden in templates
   and blocked by a strict CSP. The gap is deliberately ignored here: a few
   px of error in an invisible box is not worth a second variable.
   ========================================================================= */
.splide:not(.is-initialized) .splide__list {
    display: flex;
    overflow: hidden;
    margin: 0;
    padding: 0;
    list-style: none;
}

.splide:not(.is-initialized) .splide__slide {
    flex: 0 0 calc(100% / var(--wb-pp, 1));
    max-width: calc(100% / var(--wb-pp, 1));
    min-width: 0;
}

.splide:not(.is-initialized) .splide__slide img {
    width: 100%;
    height: auto;
}

/* Base (desktop) perPage. */
.wb-pp-1 { --wb-pp: 1; }
.wb-pp-2 { --wb-pp: 2; }
.wb-pp-3 { --wb-pp: 3; }
.wb-pp-4 { --wb-pp: 4; }
.wb-pp-5 { --wb-pp: 5; }
.wb-pp-6 { --wb-pp: 6; }
.wb-pp-7 { --wb-pp: 7; }
.wb-pp-8 { --wb-pp: 8; }
.wb-pp-9 { --wb-pp: 9; }
.wb-pp-10 { --wb-pp: 10; }
.wb-pp-11 { --wb-pp: 11; }
.wb-pp-12 { --wb-pp: 12; }

@media (max-width: 1200px) {
    .wb-pp-lg-1 { --wb-pp: 1; }
    .wb-pp-lg-2 { --wb-pp: 2; }
    .wb-pp-lg-3 { --wb-pp: 3; }
    .wb-pp-lg-4 { --wb-pp: 4; }
    .wb-pp-lg-5 { --wb-pp: 5; }
    .wb-pp-lg-6 { --wb-pp: 6; }
    .wb-pp-lg-7 { --wb-pp: 7; }
    .wb-pp-lg-8 { --wb-pp: 8; }
    .wb-pp-lg-9 { --wb-pp: 9; }
    .wb-pp-lg-10 { --wb-pp: 10; }
    .wb-pp-lg-11 { --wb-pp: 11; }
    .wb-pp-lg-12 { --wb-pp: 12; }
}

@media (max-width: 992px) {
    .wb-pp-md-1 { --wb-pp: 1; }
    .wb-pp-md-2 { --wb-pp: 2; }
    .wb-pp-md-3 { --wb-pp: 3; }
    .wb-pp-md-4 { --wb-pp: 4; }
    .wb-pp-md-5 { --wb-pp: 5; }
    .wb-pp-md-6 { --wb-pp: 6; }
    .wb-pp-md-7 { --wb-pp: 7; }
    .wb-pp-md-8 { --wb-pp: 8; }
    .wb-pp-md-9 { --wb-pp: 9; }
    .wb-pp-md-10 { --wb-pp: 10; }
    .wb-pp-md-11 { --wb-pp: 11; }
    .wb-pp-md-12 { --wb-pp: 12; }
}

@media (max-width: 768px) {
    .wb-pp-sm-1 { --wb-pp: 1; }
    .wb-pp-sm-2 { --wb-pp: 2; }
    .wb-pp-sm-3 { --wb-pp: 3; }
    .wb-pp-sm-4 { --wb-pp: 4; }
    .wb-pp-sm-5 { --wb-pp: 5; }
    .wb-pp-sm-6 { --wb-pp: 6; }
    .wb-pp-sm-7 { --wb-pp: 7; }
    .wb-pp-sm-8 { --wb-pp: 8; }
    .wb-pp-sm-9 { --wb-pp: 9; }
    .wb-pp-sm-10 { --wb-pp: 10; }
    .wb-pp-sm-11 { --wb-pp: 11; }
    .wb-pp-sm-12 { --wb-pp: 12; }
}

@media (max-width: 576px) {
    .wb-pp-xs-1 { --wb-pp: 1; }
    .wb-pp-xs-2 { --wb-pp: 2; }
    .wb-pp-xs-3 { --wb-pp: 3; }
    .wb-pp-xs-4 { --wb-pp: 4; }
    .wb-pp-xs-5 { --wb-pp: 5; }
    .wb-pp-xs-6 { --wb-pp: 6; }
    .wb-pp-xs-7 { --wb-pp: 7; }
    .wb-pp-xs-8 { --wb-pp: 8; }
    .wb-pp-xs-9 { --wb-pp: 9; }
    .wb-pp-xs-10 { --wb-pp: 10; }
    .wb-pp-xs-11 { --wb-pp: 11; }
    .wb-pp-xs-12 { --wb-pp: 12; }
}


/* =========================================================================
   Aspect-ratio modifiers

   Replaces the inline `style="aspect-ratio: …"` that carousel.tpl and
   _featured_category_card.tpl used to emit. Inline styles are forbidden by
   the project rules and are blocked outright by a strict `style-src` CSP —
   and since those two inline rules were the ONLY thing reserving the box for
   a ratio-constrained image, losing them to a CSP meant losing the CLS fix
   too. The set matches the options offered in the admin form.
   ========================================================================= */
.wb-ratio-16-9 { aspect-ratio: 16 / 9; }
.wb-ratio-4-3  { aspect-ratio: 4 / 3; }
.wb-ratio-3-2  { aspect-ratio: 3 / 2; }
.wb-ratio-1-1  { aspect-ratio: 1 / 1; }
.wb-ratio-2-3  { aspect-ratio: 2 / 3; }
.wb-ratio-21-9 { aspect-ratio: 21 / 9; }

/* =========================================================================
   Accessibility fixes (WCAG 2.2 AA)
   ========================================================================= */

/* Visually-hidden text that stays available to screen readers. Themes usually
   ship .sr-only (BS4) or .visually-hidden (BS5), but the module cannot assume
   either is present. */
.wb-sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 2.5.8 Target Size (Minimum), new in WCAG 2.2: pagination dots were 8-10px
   with 3px margins, so even the 24px-spacing exception did not apply. Keep the
   dot small visually, grow the hit area with a transparent border.
   1.4.11 Non-text Contrast: #ccc on white is 1.60:1 against a 3:1 requirement
   — a low-vision user cannot see how many slides exist. #767676 is 4.54:1. */
.wb-carousel .splide__pagination__page,
.wb-product-carousel .splide__pagination__page,
.wb-fc-carousel .splide__pagination__page {
    width: 24px;
    height: 24px;
    margin: 0;
    border: 8px solid transparent;
    background-clip: content-box;
    box-sizing: border-box;
    background-color: #767676;
    opacity: 1;
}

.wb-carousel .splide__pagination__page.is-active,
.wb-product-carousel .splide__pagination__page.is-active,
.wb-fc-carousel .splide__pagination__page.is-active {
    background-color: #333;
    transform: none;
}

/* The autoplay pause control (WCAG 2.2.2). Splide's Autoplay component binds
   to .splide__toggle and swaps which child is shown, so the CSS only has to
   place it and hide the inactive label. */
.wb-carousel__toggle,
.wb-hero__video-toggle,
.splide__toggle {
    position: absolute;
    right: 8px;
    bottom: 8px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
    padding: 0 10px;
    border: 1px solid rgba(0, 0, 0, 0.25);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.92);
    color: #222;
    font-size: 0.8125rem;
    line-height: 1;
    cursor: pointer;
}

.splide__toggle.is-active .splide__toggle__play,
.splide__toggle:not(.is-active) .splide__toggle__pause {
    display: none;
}

/* 1.4.3 Contrast: captions are white text laid over an admin-uploaded image,
   so the ratio is unknowable and often below 2:1. A text-shadow is not an
   accepted contrast mechanism — give the caption its own scrim, the way the
   featured-category overlay already does. */
.wb-carousel__caption {
    background: rgba(0, 0, 0, 0.55);
    border-radius: 4px;
    text-shadow: none;
}

/* 1.4.3: #6c757d on #f8f9fa is 4.45:1, just under the 4.5:1 floor for normal
   text (this element inherits the theme's body size, so it is not "large"). */
.wb-product-list__empty {
    color: #5a6268;
}

/* 1.3.1: icon groups become real lists in the templates; strip the default
   list styling so the existing grid rules keep working unchanged. */
.wb-icons__grid,
.wb-icon-list__grid {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* 1.4.10 Reflow: .wb-icon-list__grid already collapses to one column at
   576px; .wb-icons__grid stayed at two columns all the way down to 320px. */
@media (max-width: 576px) {
    .wb-icons__grid {
        grid-template-columns: 1fr;
    }
}

/* Reserve the icon box. Both containers set a width but no height, so each
   icon is 48x0 until its lazily-loaded bitmap decodes and then jumps to full
   height — one shift per list item. The Icons widget already sets both
   dimensions (.wb-icons__icon--{size}) and needs nothing here. */
.wb-icon-list__icon,
.wb-layout__icon-text-icon {
    height: 48px;
}

.wb-icon-list--icon-top .wb-icon-list__icon {
    height: 64px;
}

.wb-icon-list__icon img,
.wb-layout__icon-text-icon img {
    height: 100%;
    object-fit: contain;
}

/* Absolutely-positioned dots sitting below the track overlap whatever follows
   the carousel. Reserving the space is shift-free: it applies identically
   before and after mount. */
.wb-product-carousel {
    padding-bottom: 30px;
}

/* 2.3.3 Animation from Interactions: the module had no reduced-motion block
   at all, so a visitor with a vestibular disorder got a zoom-and-lift on
   every card they passed over. (Splide handles its own transitions — it
   defaults reducedMotion to speed 0 + autoplay pause.) */
@media (prefers-reduced-motion: reduce) {
    .wb-fc-card,
    .wb-fc-card__image,
    .wb-fc-card__cta .material-icons,
    .wb-fc-card__cta-icon,
    .wb-icon-list__item,
    .wb-icons__item {
        transition: none !important;
        animation: none !important;
    }

    .wb-fc-card:hover,
    .wb-fc-card:hover .wb-fc-card__image,
    .wb-fc-card:focus-within .wb-fc-card__image {
        transform: none !important;
    }
}

/* Vertical icon-list wrapper. Kept separate from .wb-icon-list__grid, which
   is display:grid — the vertical layout must stay a plain block flow. */
.wb-icon-list__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ==========================================================================
   Hero Slider Widget

   The box is reserved by a class before anything loads — a height preset or an
   aspect ratio, never a measured value and never an inline style. That, plus
   width/height on the <img> and <video>, is what keeps CLS at zero while the
   poster and (much later) the video arrive.
   ========================================================================== */

.wb-hero {
    position: relative;
    overflow: hidden;
}

/* Height presets. The ratio variant gets its aspect-ratio from a wb-ratio-*
   class applied alongside, so nothing here hardcodes one. */
.wb-hero--h-viewport-full   { height: 100vh; }
.wb-hero--h-viewport-large  { height: 75vh; }
.wb-hero--h-viewport-medium { height: 60vh; }
.wb-hero--h-viewport-small  { height: 45vh; }

/* 100vh on a phone includes the browser chrome that disappears on scroll, so
   the hero jumps. dvh fixes it where supported and is ignored elsewhere. */
@supports (height: 100dvh) {
    .wb-hero--h-viewport-full { height: 100dvh; }
}

/* The track and its children must inherit the reserved height, otherwise the
   preset applies to the outer box only and the slide collapses to its image.
   Unconditional: with an aspect-ratio class the root has a height too, and in
   "auto" mode there is none to inherit so this resolves to auto and does
   nothing. */
.wb-hero .splide__track,
.wb-hero .splide__list,
.wb-hero .wb-hero__slide {
    height: 100%;
}

.wb-hero--full-bleed {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.wb-hero__slide {
    position: relative;
}

.wb-hero__media {
    position: relative;
    width: 100%;
    height: 100%;
}

.wb-hero__picture {
    display: block;
    width: 100%;
    height: 100%;
}

.wb-hero__img,
.wb-hero__video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* The video sits on top of its own poster image rather than replacing it, so
   the paint never flickers between the two. */
.wb-hero__video {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

/* Exactly one of the two videos is displayed; JS reads offsetParent to decide
   which one to play, so this media query is the single source of truth. */
.wb-hero__video--mobile { display: none; }

@media (max-width: 768px) {
    .wb-hero__video--desktop { display: none; }
    .wb-hero__video--mobile { display: block; }
}

/* Scrim behind the caption. Contrast over an admin-supplied image or video is
   otherwise unknowable — the same reason the carousel caption has one. */
.wb-hero--overlay .wb-hero__media::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    background: #000;
    pointer-events: none;
}

.wb-hero--overlay-20 .wb-hero__media::after { opacity: .2; }
.wb-hero--overlay-30 .wb-hero__media::after { opacity: .3; }
.wb-hero--overlay-40 .wb-hero__media::after { opacity: .4; }
.wb-hero--overlay-50 .wb-hero__media::after { opacity: .5; }
.wb-hero--overlay-60 .wb-hero__media::after { opacity: .6; }

.wb-hero__caption {
    position: absolute;
    z-index: 3;
    padding: 1rem 1.25rem;
    max-width: min(640px, calc(100% - 2rem));
    color: #fff;
    background: rgba(0, 0, 0, .45);
    border-radius: 4px;
}

.wb-hero__title {
    font-weight: 700;
    font-size: 1.75rem;
    line-height: 1.2;
}

.wb-hero__description {
    margin-top: .5rem;
    font-size: 1rem;
    line-height: 1.5;
}

.wb-hero__button {
    display: inline-block;
    margin-top: .75rem;
}

@media (max-width: 768px) {
    .wb-hero__title { font-size: 1.25rem; }
    .wb-hero__description { font-size: .9375rem; }
    .wb-hero__caption { padding: .75rem 1rem; }
}

/* Whole-slide link: covers the media but sits under the caption so the
   caption's own button stays clickable. */
.wb-hero__link {
    position: absolute;
    inset: 0;
    z-index: 2;
}

.wb-hero__toggle {
    z-index: 4;
}

/* The video's own play/pause. Sits above the slider's toggle when both are
   rendered, so the two controls never overlap. */
.wb-hero__video-toggle {
    z-index: 4;
}

.wb-hero .splide__toggle ~ .wb-hero__video-toggle {
    bottom: 48px;
}

/* The shared rule above sets display:inline-flex, which outranks the UA
   stylesheet — without this, front.js hiding the button would do nothing. */
.wb-hero__video-toggle[hidden] {
    display: none;
}

.wb-hero__video-toggle.is-playing .wb-hero__video-toggle__play,
.wb-hero__video-toggle:not(.is-playing) .wb-hero__video-toggle__pause {
    display: none;
}

/* Caption placement — mirrors the carousel's text_position values. */
.wb-hero__caption.position-top-left      { top: 1.5rem; left: 1.5rem; }
.wb-hero__caption.position-top-center    { top: 1.5rem; left: 50%; transform: translateX(-50%); text-align: center; }
.wb-hero__caption.position-top-right     { top: 1.5rem; right: 1.5rem; text-align: right; }
.wb-hero__caption.position-middle-left   { top: 50%; left: 1.5rem; transform: translateY(-50%); }
.wb-hero__caption.position-middle-center { top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; }
.wb-hero__caption.position-middle-right  { top: 50%; right: 1.5rem; transform: translateY(-50%); text-align: right; }
.wb-hero__caption.position-bottom-left   { bottom: 1.5rem; left: 1.5rem; }
.wb-hero__caption.position-bottom-center { bottom: 1.5rem; left: 50%; transform: translateX(-50%); text-align: center; }
.wb-hero__caption.position-bottom-right  { bottom: 1.5rem; right: 1.5rem; text-align: right; }

/* A visitor who asked for reduced motion gets the poster and nothing moving —
   enforced in front.js, which never autoplays for them. The <video> itself
   must stay displayed: a video slide has no <picture> underneath, so hiding it
   would leave an empty slide instead of a still poster. Its own play button
   still works, because an explicit press is not unrequested motion. */

/* ==========================================================================
   Link List Widget

   Groups collapse into native <details> below the md breakpoint. Native rather
   than a JS accordion: keyboard operation, screen-reader semantics and the
   open/closed state all come from the browser, and nothing shifts while a
   script boots.
   ========================================================================== */

.wb-links__group {
    margin-bottom: 1.5rem;
}

.wb-links__heading {
    margin: 0 0 .75rem;
    font-size: 1rem;
    font-weight: 600;
}

.wb-links__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wb-links__item + .wb-links__item {
    margin-top: .35rem;
}

.wb-links__link {
    color: inherit;
    text-decoration: none;
}

.wb-links__link:hover,
.wb-links__link:focus {
    text-decoration: underline;
}

/* Above the collapse breakpoint the disclosure is inert: no marker, default
   cursor, and the summary reads as the plain heading it looks like. */
.wb-links__summary {
    list-style: none;
    cursor: default;
}

.wb-links__summary::-webkit-details-marker {
    display: none;
}

.wb-links__summary::marker {
    content: "";
}

@media (max-width: 768px) {
    .wb-links--collapsible .wb-links__group {
        margin-bottom: 0;
        border-bottom: 1px solid rgba(0, 0, 0, .1);
    }

    .wb-links--collapsible .wb-links__summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        /* 2.5.8 Target Size: the whole row is the control, comfortably past
           the 24px minimum. */
        min-height: 44px;
        padding: .5rem 0;
        cursor: pointer;
    }

    .wb-links--collapsible .wb-links__summary .wb-links__heading {
        margin: 0;
    }

    /* CSS-drawn chevron rather than an icon font — the module ships no font
       and must not rent the theme's. */
    .wb-links--collapsible .wb-links__summary::after {
        content: "";
        flex: 0 0 auto;
        width: .5rem;
        height: .5rem;
        margin-left: .75rem;
        border-right: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
        transform: rotate(45deg) translate(-2px, -2px);
        transition: transform .15s ease;
    }

    .wb-links--collapsible .wb-links__group[open] > .wb-links__summary::after {
        transform: rotate(-135deg) translate(-2px, -2px);
    }

    .wb-links--collapsible .wb-links__list {
        padding-bottom: .75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wb-links--collapsible .wb-links__summary::after {
        transition: none;
    }
}
