        html,
        body {
            height: 100%;
            margin: 0;
        }

        /* Desktop: force horizontal product layout so image is left and info sits to the right */
        @media (min-width: 601px) {
            .product {
                display: flex !important;
                flex-direction: row;
                gap: 1.5rem;
                padding: 1.5rem 1.75rem;
                align-items: flex-start;
                background: #DDD8C4;
                border-radius: 6px;
                max-height: none;
                overflow: visible;
            }

            .product-image {
                flex: 0 0 220px !important;
                max-width: 220px !important;
                padding: 0.4rem;
                margin: 0.5rem 0.75rem 0.5rem 0;
            }

            .product-image img {
                width: 100%;
                height: auto;
                display: block;
                max-height: none;
                object-fit: contain;
            }

            .product-info {
                flex: 1 1 auto;
            }

            .product-description p {
                margin-bottom: 0.6rem;
            }
        }

        body {
            background-color: #84B59F;
            font-family: Merriweather, serif;
        }

        .container {
            /* Ensure container fills viewport so footer can sit below main */
            min-height: 100vh;
            display: grid;
            grid-template-rows: auto 1fr auto;
            grid-template-areas:
                "header"
                "main"
                "footer";
        }
		
	.containerindex {
            /* Ensure container fills viewport so footer can sit below main */
            max-height: 100vh;
            display: grid;
            grid-template-rows: auto 1fr auto;
            grid-template-areas:
                "header"
                "main"
                "footer";
        }
		
	.containerbook {
            /* Ensure container fills viewport so footer can sit below main */
            min-height: 89vh;
            display: grid;
            grid-template-rows: auto 1fr auto;
            grid-template-areas:
                "header"
                "main"
                "footer";
        }

        header {
            grid-area: header;
            background-color: #84B59F;
        }

        header nav {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 2rem;
            padding: 1rem;
        }

        header nav a {
            color: #ffffff;
            text-decoration: none;
            font-weight: 700;
        }

        header nav a:hover {
            text-decoration: underline;
        }

        /* Dropdown styles (used by navigation "Böcker") */
        .dropdown {
            position: relative;
            display: inline-block;
        }

        .dropbtn {
            background: transparent;
            border: none;
            color: white;
            font: inherit;
            cursor: pointer;
            padding: 0.25rem 0.5rem;
        }

        .dropdown-menu {
            display: none;
            position: absolute;
            top: 100%;
            left: 0;
            background: #ffffff;
            box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
            list-style: none;
            margin: 0.5rem 0 0 0;
            padding: 0.25rem 0;
            min-width: 160px;
            z-index: 100;
        }

        .subbtn{
            background: transparent;
            border: none;
            color: black;
            font: inherit;
            cursor: pointer;
            padding: 0.25rem 0.5rem;
        }

        .dropdown-menu a {
            display: block;
            padding: 0.5rem 1rem;
            color: #333;
            text-decoration: none;
        }

        .dropdown-menu a:hover,
        .dropdown-menu a:focus {
            background: #f1f1f1;
        }

        /* show on hover for desktop and when focused (keyboard) */
        .dropdown:hover .dropdown-menu,
        .dropdown:focus-within .dropdown-menu {
            display: block;
        }

        /* Submenu (drops to the right) */
        .has-submenu {
            position: relative;
        }

        .submenu {
            display: none;
            position: absolute;
            top: 0;
            left: 100%;
            /* drop to the right of parent menu */
            background: #ffffff;
            box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
            list-style: none;
            margin: 0;
            padding: 0.25rem 0;
            min-width: 180px;
        }

        .submenu a {
            display: block;
            padding: 0.5rem 1rem;
            color: #333;
            text-decoration: none;
        }

        .has-submenu:hover>.submenu,
        .has-submenu:focus-within>.submenu {
            display: block;
        }

        main {
            display: flex;
            grid-area: main;
            background-color: #DDD8C4;
            flex-wrap: wrap;
            /* allow main to shrink inside the grid (important for scroll) */
            min-height: 0;
            overflow: visible;
        }

        main p {
            padding: 2rem;
            text-align: justify;
        }

        footer {
            grid-area: footer;
            background-color: #69A297;
            font-family: "Rouge Script", serif;
            display: flex;
            justify-content: end;
            padding: 10px;
        }

        /* Small images (book covers, author thumbnails) */
        img.small {
            margin: 2rem;
            max-width: 200px;
            height: auto;
        }

        /* Desktop: bild till vänster, text till höger */
        main .author {
            display: flex;
            align-items: flex-start;
            /* överkants-justera så texten börjar i samma höjd som bilden */
            gap: 2rem;
            /* avstånd mellan bild och text */
            flex-wrap: nowrap;
            /* förhindra wrap på desktop */
            padding: 1rem 2rem;
        }

        main .author img {
            display: block;
            /* tar bort inline-gap under bilden */
            flex: 0 0 200px;
            /* bildens bredd: 200px (ändra efter behov) */
            max-width: 100%;
            height: auto;
            margin: 0;
            /* kontrollera marginaler separat */
        }

        /* Texten tar resten av utrymmet */
        main .author .text {
            flex: 1 1 0;
        }

        /* Hero image (index) — full-width within the main area */
        .hero {
            display: block;
            width: 100%;
            height: auto;
            margin: 0;
        }



        @media (max-width: 600px) {

            img.small {
                margin: 1rem auto;
                max-height: 20vh;
            }

            main {
                flex-direction: column;
                align-items: center;
            }

            main p {
                padding: 1.5rem;
            }

            main .author {
                flex-direction: column;
                /* stacka vertikalt på mobil */
                align-items: center;
                /* centrera innehållet */
                gap: 1rem;
            }

            main .author img {
                flex: 0 0 auto;
                max-width: 200px;
                /* eller en mindre storlek */
                margin: 1rem auto;
            }

            main .author .text {
                width: 100%;
            }

            .dropdown-menu {
                position: absolute;
                right: 0;
                /* flyttar in mot skärmen */
                left: auto;
                /* tar bort vänsterankaret */
                max-width: 90vw;
                /* gör den LITE mindre än skärmen */
                box-sizing: border-box;

                .submenu {
                    left: auto;
                    /* stänger av standardplaceringen */
                    right: 100%;
                    /* lägger submenyn åt vänster */
                    top: 0;
                    /* bibehåller vertikal position */
                }

                /* För säkerhets skull: hindrar att den hamnar utanför toppen */
                .has-submenu {
                    position: relative;
                }
            }


            /* Product / shop layout for bok pages (if not present earlier) */
            .product {
                display: flex;
                gap: 2rem;
                padding: 2rem;
                align-items: flex-start;
                background: #DDD8C4;
                /* changed from white to match main bg */
                border-radius: 6px;
                /* ensure product doesn't overflow viewport and push footer away */
                max-height: calc(100vh - 160px);
                overflow-y: auto;
            }

            .product-image {
                flex: 0 0 360px;
                max-width: 360px;
                padding: 0.6rem;
                /* ge omslaget lite inre padding */
                margin: 0.4rem;
                /* och lite yttre avstånd */
            }

            .product-image img {
                width: 100%;
                height: auto;
                display: block;
                border-radius: 4px;
                /* prevent extremely tall images from pushing layout; scale with viewport */
                max-height: calc(100vh - 220px);
                object-fit: contain;
            }

            .product-info {
                flex: 1 1 auto;
            }

            /* Product description spacing */
            .product-description {
                margin-top: 1rem;
                line-height: 1.5;
                color: #333;
            }

            .product-description p {
                margin: 0 0 0.6rem 0;
                /* smaller bottom margin so content fits */
                padding: 0;
            }

            @media (max-width: 600px) {
                .product {
                    flex-direction: column;
                    align-items: center;
                }

                .product-image {
                    max-width: 80%;
                }

                .product {
                    padding: 1rem;
                }

                .product-description p {
                    margin-bottom: 0.4rem;
                }
            }
        }

        /* Override: make product cover smaller on desktop and ensure text stays to the right */
        .product {
            gap: 1.5rem;
            padding: 1.5rem 1.75rem;
        }

        .product-image {
            flex: 0 0 220px !important;
            max-width: 220px !important;
            padding: 0.4rem;
            margin: 0.5rem 0.75rem 0.5rem 0;
        }

        .product-image img {
            max-height: calc(100vh - 260px);
            object-fit: contain;
        }

        @media (max-width: 600px) {

            /* keep stacking on small screens */
            .product {
                gap: 1rem;
                padding: 1rem;
            }

            .product-image {
                flex: 0 0 auto !important;
                max-width: 80% !important;
                margin: 0.5rem auto;
            }
        }

        /* Buy buttons: display in a row with gap, wrap on small screens */
        .buy-buttons {
            display: flex;
            gap: 0.75rem;
            flex-wrap: wrap;
            margin-top: 1rem;
        }

        .buy-buttons .btn {
            display: inline-block;
            background: #69A297;
            color: #fff;
            padding: 0.5rem 0.9rem;
            border-radius: 6px;
            text-decoration: none;
            font-weight: 700;
        }

        .buy-buttons .btn:hover,
        .buy-buttons .btn:focus {
            opacity: 0.95;
        }

        @media (max-width: 420px) {
            .buy-buttons {
                justify-content: center;
            }

            .buy-buttons .btn {
                flex: 1 1 30%;
                text-align: center;
            }
        }

        /* Reduce paragraph spacing specifically for product descriptions across all viewports */
        .product-description p {
            margin: 0 0 0.35rem 0;
            /* smaller gap between paragraphs */
            padding: 0;
            /* remove extra padding coming from main p rule */
            line-height: 1.45;
            /* keep readable line-height */
        }