body {
    background-color: #f8f9fa;
}

.layout-wrapper {
    min-height: 100vh;
}


header {
    border-bottom: 1px solid #dee2e6;
    background-repeat: repeat;
    background-attachment: fixed;
    background-color: #ffffff;
    background-size: auto;
    opacity: 0.95;
}

footer {
    border-top: 1px solid #dee2e6;
}

/* Menu button hover effect - blue translucent */
nav .nav-link {
    transition: all 0.3s ease;
    color: #343a40 !important;
    border-radius: 0.5rem;
}

nav .nav-link:hover {
    background-color: rgba(13, 110, 253, 0.2);
    color: #0d6efd !important;
    box-shadow: inset 0 0 12px rgba(13, 110, 253, 0.3);
    transform: scale(1.05);
}

/* Card hover effect - responsive with larger bold text */
.card {
    transition: all 0.3s ease;
}

.card:not(.stack-card):hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15) !important;
}

.card:not(.stack-card):hover .card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #000 !important;
}

.card:not(.stack-card):hover .card-text {
    font-size: 1rem;
    font-weight: 600;
    color: #000 !important;
}

.card:not(.stack-card):hover .card-body li {
    font-size: 1.05rem;
    font-weight: 600;
    color: #000;
}

/* Responsive adjustment */
@media (max-width: 767.98px) {
    .sidebar.p-3 {
        min-width: 100%;
        border-right: none;
        border-bottom: 1px solid #dee2e6;
    }
}

.sidebar.p-3 {
    min-width: 220px;
    background-color: #e9ecef;
    border-right: 1px solid #dee2e6;

    /* Stretch to fill vertical space inside the flex container */
    align-self: stretch;
    height: 100%;
    overflow-y: auto;
}

@media (max-width: 767.98px) {
    .sidebar.p-3 {
        min-width: 100%;
        border-right: none;
        border-bottom: 1px solid #dee2e6;

        position: static; /* default behavior on mobile */
        height: auto; /* let content define height on small devices */
    }
}

.bonitet-banner {
    padding-inline: 1rem;
}

.bonitet-banner img {
    display: block;
    width: min(100%, 600px);
    height: auto;
    margin-inline: auto;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bonitet-banner img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

@media (max-width: 575.98px) {
    .bonitet-banner.my-5 {
        margin-top: 1.5rem !important;
        margin-bottom: 0 !important;
        padding-inline: 0.75rem;
    }

    .bonitet-banner img:hover {
        transform: none;
    }
}


/* Category cards stacked like a deck below the navbar (driven by js/categoryStack.js) */
.category-stack {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 3.5rem 3.25rem;
}

/* All cards share one grid cell, so the deck is as tall as the tallest card */
.stack-deck {
    display: grid;
    padding-bottom: 2rem; /* room for the cards peeking out below */
}

.stack-card {
    grid-area: 1 / 1;
    overflow: hidden;
    border-radius: 1rem;
    background-color: #fff;
    transform-origin: bottom center;
    transition: transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1),
                opacity 0.6s ease,
                filter 0.6s ease,
                box-shadow 0.6s ease;
    will-change: transform, opacity;
}

.stack-card[data-pos="0"] {
    z-index: 4;
    transform: none;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
}

.stack-card[data-pos="1"] {
    z-index: 3;
    transform: translateY(16px) scale(0.95);
    filter: brightness(0.93);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.stack-card[data-pos="2"] {
    z-index: 2;
    transform: translateY(32px) scale(0.9);
    filter: brightness(0.86);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.1);
}

.stack-card[data-pos="hidden"] {
    z-index: 1;
    transform: translateY(32px) scale(0.9);
    opacity: 0;
}

.stack-card:not([data-pos="0"]) {
    pointer-events: none;
}

/* Front card thrown off to the left ("next"), or coming in from the left ("previous") */
.stack-card.is-leaving {
    z-index: 5;
    transform: translateX(-115%) rotate(-8deg);
    opacity: 0;
}

.stack-card.no-transition {
    transition: none;
}

.category-stack .stack-card[data-pos="0"]:hover {
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.2);
}

.category-card-img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 260px;
    max-height: 320px;
    object-fit: cover;
}

.stack-arrow {
    position: absolute;
    top: calc(50% - 2.6rem);
    transform: translateY(-50%);
    z-index: 6;
    width: 2.75rem;
    height: 2.75rem;
    border: none;
    border-radius: 50%;
    background-color: #0d6efd;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.stack-arrow:hover,
.stack-arrow:focus-visible {
    background-color: #0b5ed7;
    transform: translateY(-50%) scale(1.1);
}

.stack-arrow .carousel-control-prev-icon,
.stack-arrow .carousel-control-next-icon {
    width: 1.25rem;
    height: 1.25rem;
}

.stack-prev { left: 0; }
.stack-next { right: 0; }

.stack-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0.75rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.stack-dot {
    width: 0.65rem;
    height: 0.65rem;
    padding: 0;
    border: none;
    border-radius: 999px;
    background-color: rgba(13, 110, 253, 0.3);
    transition: width 0.3s ease, background-color 0.3s ease;
}

.stack-dot.active {
    width: 1.75rem;
    background-color: #0d6efd;
}

@media (max-width: 767.98px) {
    .category-stack {
        padding: 0 0 3.25rem;
    }

    .category-card-img {
        min-height: 0;
        height: 180px;
    }

    /* On phones the arrows sit on the edges of the image */
    .stack-arrow {
        top: 90px;
        width: 2.25rem;
        height: 2.25rem;
    }

    .stack-prev { left: 0.5rem; }
    .stack-next { right: 0.5rem; }
}

@media (prefers-reduced-motion: reduce) {
    .stack-card {
        transition: opacity 0.3s ease;
    }
}
