.single-product {
    .product-gallery-slider img {
        width: 62px !important;
        height: auto !important;
    }

    @media screen and (min-width: 550px) {
        .product-images {
            transform: translateX(27px) translateY(19px);
        }
    }
    .product-page-price bdi,
    .product-title,
    th label {
        font-weight: 400 !important;
    }
    .product-title {
        display: flex;
    }
    .variations {
        tr {
            display: flex;
            flex-direction: row;
            align-items: center;
            th {
                padding: 0 1rem 0 0;
                label {
                    transform: translateY(3px);
                }
            }
            .value {
                display: flex;
                flex-flow: row wrap;
                align-items: center;
                select {
                    border: none;
                    border-radius: 10px;
                    width: auto;
                }
            }
        }
        .reset_variations {
            margin-left: 1rem;
            position: relative;
            bottom: initial;
            right: initial;
            color: #000000;
        }
    }
    .single_add_to_cart_button {
        background-color: #68676b !important;
        border-radius: 10px;
        text-transform: initial;
    }
    .product_meta span a {
        text-decoration: underline;
    }
    .product_meta span {
        border-top: none;
        padding: 2px 0;
    }

    .product-container {
        width: 100%;
        display: flex;
        flex-flow: column wrap;
        align-items: center;
        gap: 8rem;
        padding-bottom: 425px;
        margin-bottom: 6rem;
        .product-main {
            display: flex !important;
            flex-flow: column wrap !important;
            background-image: url("../../images/icons/Blodsjekk_Pakke_boks_360x335px.svg") !important;
            background-size: cover;
            background-repeat: no-repeat;
            background-position: center;
            border-radius: 15px;
        }
    }
    @media screen and (min-width: 500px) {
        .product-container {
            padding-bottom: 450px;
        }
    }
    @media screen and (min-width: 850px) {
        .product-main,
        .product-footer {
            max-width: 900px;
        }
    }
    .large-6 {
        width: auto;
        max-width: initial;
        flex-basis: initial;
    }
    .is-divider {
        display: none;
    }
    #product-sidebar {
        display: none;
    }
    .image-tools {
        display: none;
    }
    .product-gallery {
        position: relative;
        z-index: 2;
        background: transparent;
        width: calc(80px + 2rem);
        padding: 0 0.7rem;
    }
    .row {
        display: flex !important;
        flex-flow: column wrap !important;
    }
    @media screen and (min-width: 550px) {
        .product-main {
            display: flex !important;
            flex-flow: row wrap !important;
        }
        .row {
            display: flex !important;
            flex-flow: row wrap !important;
        }
        .product-gallery {
            position: relative;
            z-index: 2;
            background: transparent;
            width: calc(90px + 3rem);
            padding: 0 2rem;
        }
    }
    .flickity-prev-next-button,
    .show-for-medium,
    .next-prev-thumbs,
    .social-icons {
        display: none !important;
    }
    .description_tab.active a::before {
        display: none !important;
    }

    .product-section-title {
        text-align: center;
        text-transform: initial;
        font-weight: 400;
        margin: 3rem 0;
    }

    .wc-tabs a {
        text-transform: initial;
        font-weight: 400;
        font-size: 1.2rem;
    }
    /* Add the red underline using the after pseudo-element */
    .description_tab.active a::after {
        content: ""; /* Required for the pseudo-element to render */
        display: block;
        position: absolute;
        left: 0;
        bottom: 6px;
        width: 100%;
        height: 2px;
        background-color: #9c1c20;
    }
    .product-footer .woocommerce-tabs {
        border-top: none;
    }
    .tabs.wc-tabs > li.active > a::before {
        display: none !important;
    }

    .tabs.wc-tabs > li.active > a::after {
        content: "";
        display: block;
        position: absolute;
        left: 0;
        bottom: 6px;
        width: 100%;
        height: 2px;
        background-color: #9c1c20;
    }
    .product-footer .woocommerce-tabs {
        border-top: none;
    }
    .related.related-products-wrapper {
        position: absolute;
        padding: 0 1rem;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1;
    }

    /* Fix for related products in Flickity slider - using !important to override other styles */
    .single-product
        .related.related-products-wrapper
        .row-slider
        .flickity-viewport {
        min-height: 300px !important;
    }

    /* Set consistent structure */
    .single-product .related.related-products-wrapper .product-small.col {
        height: auto !important;
        margin-bottom: 15px !important;
    }

    .single-product .related.related-products-wrapper .product-small.box {
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
    }

    /* Force proper image handling */
    .single-product .related.related-products-wrapper .box-image {
        flex-shrink: 0 !important;
        margin-bottom: 10px !important;
    }

    /* Override box-text styling */
    .single-product
        .related.related-products-wrapper
        .box-text.box-text-products {
        padding: 0 5px 15px 5px !important;
        display: flex !important;
        flex-direction: column !important;
        flex: 1 !important;
    }

    /* Fix the title area - match tallest title */
    .single-product .related.related-products-wrapper .title-wrapper {
        min-height: 80px !important; /* Increased height to accommodate two lines */
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        margin-bottom: 10px !important;
        order: -1 !important;
        padding: 0 !important;
    }

    /* Center titles and ensure consistent sizing */
    .single-product
        .related.related-products-wrapper
        .woocommerce-loop-product__title {
        text-align: center !important;
        font-size: 0.9em !important;
        line-height: 1.3 !important;
        margin: 0 auto !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: 100% !important;
    }

    /* Keep price-add-to-cart at the bottom with consistent spacing */
    .single-product .related.related-products-wrapper .price-and-add-to-cart {
        display: flex !important;
        flex-direction: column !important;
        order: 10 !important;
        position: relative !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        height: auto !important;
        margin-top: 0 !important;
    }

    /* Ensure price is consistently positioned */
    .single-product .related.related-products-wrapper .price-wrapper {
        text-align: center !important;
        margin-bottom: 5px !important;
    }

    /* Make buttons consistent */
    .single-product .related.related-products-wrapper .add-to-cart-button {
        text-align: center !important;
    }

    /* Additional responsive fixes */
    @media screen and (max-width: 549px) {
        .single-product
            .related.related-products-wrapper
            .woocommerce-loop-product__title {
            font-size: 0.8em !important;
        }
    }

    .related .flickity-slide {
        height: auto;
    }

    /* Responsive adjustments */
    @media (max-width: 849px) {
        .related .product {
            width: 50%;
        }
    }

    @media (max-width: 480px) {
        .related .product {
            width: 100%;
        }
    }
    @media screen and (min-width: 1040px) {
        .related.related-products-wrapper {
            max-width: 1370px;
            margin: 0 auto 0 auto;
        }
    }
}
