:root {
    --gallery-thumbnail-size: 100px;
    --main-container-padding: 80px;
}

.ast-sticky-add-to-cart .mt-usp-list,
.ast-sticky-add-to-cart .mt-product-tags {
    display: none !important;
}

#content #main {
    padding-top: 0;
    padding-right: var(--main-container-padding);
    padding-left: var(--main-container-padding);
}

#content #main div.product {
    h1.product_title {
        margin-bottom: 40px;
        word-wrap: break-word;
        word-break: break-word;
        line-height: normal;
    }
    .upsells.products,
    .related.products,
    .woocommerce-tabs {
        clear: both;
        margin-top: 0;
        padding-top: 100px;
    }
}

#content #main .ast-woocommerce-container {
    padding-top: var(--site-header-height);
    .ast-breadcrumbs-wrapper {
        .ast-breadcrumbs {
            padding-top: 10px;
            padding-bottom: 10px;
        }

        .trail-items {
            width: 100%;
            white-space: nowrap;
            overflow: auto;
        }
        .trail-items::-webkit-scrollbar {
            display: none; /* Hide scrollbar for WebKit browsers */
            width: 0; /* For horizontal scrollbar */
            height: 0; /* For vertical scrollbar */
        }

        .trail-items li::after {
            content: url("../img/breadcrumb_chevron-black.svg");
            padding: 0 0.4em;
        }

        .trail-items,
        .trail-items a {
            color: black;
            font-size: 14px;
            font-weight: 400;
            text-decoration: none;
        }

        .trail-items.trail-end {
            font-weight: 500;
        }
    }

    .woocommerce-product-gallery {
        > .flex-viewport {
            /*margin-left: calc(20% + 16px);*/
        }

        .flex-direction-nav {
            list-style: none;
            margin: 0;
            padding: 0;
            position: absolute;
            top: 50%;
            width: 100%;
            z-index: 10;
            transform: translateY(-50%);
            pointer-events: none;

            li {
                margin: 0;
                padding: 0;
            }

            a {
                pointer-events: auto;
                position: absolute;
                display: flex;
                justify-content: center;
                align-items: center;
                width: 30px;
                height: 30px;
                background-color: transparent;
                border-radius: 50%;
                border: 1px solid transparent;
                color: #000;
                transition: all 0.3s ease;
                text-decoration: none;
                overflow: hidden;
                font-size: 0;
                box-shadow: none;
                outline: none;
            }

            a::after {
                display: block;
                position: absolute;
                top: 0;
                right: 0;
                bottom: 0;
                left: -4px;
                margin: auto;
                width: 10px;
                height: 10px;
                transform: rotate(135deg);
                border-color: black;
            }

            a:hover {
                border-color: black;
                color: #000;
            }

            a.flex-next {
                right: 10px;
            }

            a.flex-prev {
                left: calc(var(--gallery-thumbnail-size) + 16px + 10px);
            }

            a.flex-disabled {
                visibility: hidden !important;
            }

            a.flex-prev::after {
                transform: rotate(-45deg);
                left: 4px;
            }
        }
    }

    .woocommerce-product-gallery__wrapper {
        img {
            border-radius: 24px;
            height: 100% !important;
            object-fit: contain;
        }
    }

    .woocommerce-product-gallery__image {
        aspect-ratio: 1 / 1;
        background-color: white;
        border-radius: 24px;
    }

    .ast-woocommerce-product-gallery__image {
        border-top: 7px solid transparent;
        border-bottom: 7px solid transparent;

        img {
            border-radius: 8px;
        }

        &::after {
            border-radius: 8px;
            transition: all 0.3s ease;
        }

        &.flex-active-slide::after {
            border-color: black;
        }
    }

    #ast-gallery-thumbnails:has(.ast-vertical-navigation-wrapper) {
        width: var(--gallery-thumbnail-size);
    }

    #ast-gallery-thumbnails:has(.ast-vertical-navigation-wrapper) + .flex-viewport,
    #ast-gallery-thumbnails:has(.ast-vertical-navigation-wrapper) ~ .flex-viewport {
        margin-left: calc(var(--gallery-thumbnail-size) + 16px);
    }

    .onsale {
        visibility: hidden;
        display: inline-flex;
        height: 40px;
        min-height: 40px;
        line-height: 1;
        justify-content: center;
        align-items: center;
        gap: 8px;
        color: white;
        background: #D90000;
        padding: 0 12px !important;
        border-radius: 8px !important;
        top: 20px !important;
        right: 20px !important;
        left: auto !important;
        &.placed {
            visibility: visible;
        }
    }

    .wpcpv-item {
        width: 40px;
        height: 40px;
        line-height: 40px;
        top: 20px;
        left: 20px;
        &::before {
            font-size: 20px;
            width: 40px;
            height: 40px;
            line-height: 40px;
        }
    }

    .mt-product-specs {
        padding-top: 16px;
        .mt-product-specs-link {
            display: flex;
            align-items: center;
            gap: 16px;
            padding: 16px 24px;
            border-radius: 80px;
            color: black;
            background: rgba(253, 253, 253, 0.34);
            box-shadow: 0 5px 11px 0 rgba(0, 0, 0, 0.06);
            text-decoration: none;
        }
    }

    .summary.entry-summary {
        p:empty {display: none;}
        .mt-brand-image-wrapper {
            display: inline-block;
        }
        .woocommerce-product-details__short-description p:last-of-type {
            margin-bottom: 16px;
        }
        .product_meta {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 10px;
            margin-top: 0;
            margin-bottom: 16px;
            padding-top: 0;
            border: none;

            > *:not(.mt-sku-wrapper):not(.mt-brand-image-wrapper) {
                display: none;
            }

            * {
                font-size: 14px;
                font-weight: 400;
                line-height: normal;
            }

            .mt-brand-image-wrapper {
                margin: 0;
            }
        }
    }

    .mt-view-full-description,
    .mt-view-full-attributes {
        margin: 16px 0 40px 0;
    }

    .mt-view-full-description-link,
    .mt-view-full-attributes-link {
        color: black;
        font-weight: 400;
        text-decoration: underline;
        text-decoration-thickness: 1px;
        text-underline-offset: 5px;
    }

    .woocommerce-js div.product p.price del, .woocommerce-js div.product span.price del {
        opacity: 1;
    }

    .price {margin-bottom: 40px;}
    .price del {opacity: 1;}
    .price ins {}

    .price del ~ ins {
        margin-left: 18px;
    }

    .price del bdi {
        display: table-cell;
        color: #5C5C5C;
        font-size: 24px;
        font-style: normal;
        font-weight: 500;
        line-height: normal;
        text-decoration-thickness: 1px;
        text-decoration-color: #5C5C5C;
        opacity: 1;
    }

    .mt-product-title-container {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 20px;
    }

    .mt-wishlist-wrapper .woosw-btn-icon::before {
        font-size: 24px;
    }

    .mt-wishlist-wrapper .woosw-btn.woosw-btn-icon-only {
        margin: 0;
        padding: 7px 0 0 0;
        border: 0;
        box-shadow: none;
        outline: none;
        background: transparent;
        width: auto;
        height: auto;
    }

    .cart,
    .mt-view-only-contact,
    .mt-request-quote-contact,
    .mt-login-to-purchase {
        display: flex;
        gap: 32px;
        &::before,&::after {content:none;}
        button[name="add-to-cart"],
        .single_add_to_cart_button {
            flex-grow: 1;
            margin: 0;
            padding: 18px 5px;
            border-radius: 80px;
            border: none;
            text-align: center;
            color: white;
            background-color: black;
        }

        .quantity {
            margin: 0;
            padding: 0;

            border-radius: 80px;
            border: 1px solid #000;

            * {
                margin: 0;
                padding: 0;
                width: auto;
                min-width: 48px;
                height: auto;
                min-height: 54px;
                background: transparent;
                border: none;
                color: #000;
                font-size: 24px;
                font-style: normal;
                font-weight: normal;
                line-height: normal;
            }
            input[type="number"] {
                font-size: 24px;
                font-weight: 600;
                letter-spacing: -0.04em;
            }
        }

        .quantity:has(.screen-reader-text):has(input.qty[type="hidden"]) {
            display: none !important;
        }
    }

    .mt-availability {
        margin: 24px 0;
        display: inline-flex;
        gap: 8px;
        font-size: 16px;
        line-height: normal;
        word-break: break-word;
        color: black;
    }

    .mt-availability .mt-info-icon {
        width: 28px;
    }

    .mt-availability .mt-info-text {
        display: inline-block;
        padding: 4px 0;
    }

    .mt-availability--in-stock {}

    .mt-availability--on-order {}

    .mt-product-tags {
        .cpt-tags-container--inner {
            gap: 8px 12px;
        }
        .cpt-tag-item {
            align-items: center;
            column-gap: 6px;
            padding: 12px 14px;
            background: rgba(253, 253, 253, 0.34);
            box-shadow: 0 5px 11px 0 rgba(0, 0, 0, 0.06);
        }
    }

    .ast-woocommerce-distributed.ast-woocommerce-tabs {
        .ast-single-tab {
            flex-direction: column;
        }
        .ast-distributed-header,
        .ast-distributed-content {
            width: 100%;
            max-width: 100%;
        }
    }

    .dnag_groups,
    #mt-load-more-attributes {
        width: 100%;
        max-width: 980px;
    }

    .dnag_group_heading {
        font-size: 24px;
        font-weight: 600;
        margin-bottom: 16px;
        padding: 0;
        border: none;
        background-color: transparent;
        color: #000;
    }

    .dnag_group_attributes  {
        font-size: 14px;
        line-height: 1.2;
        word-break: break-word;
        table {
            border-collapse: collapse;
        }
        td, th {
            padding: 24px 0;
        }
        tr {
            border-bottom: 1px solid rgba(0, 0, 0, 0.20);
        }
        .woocommerce-product-attributes-item__value {
            font-weight: 600;
        }
    }

    .mt-load-more-btn {
        padding: 12px 24px;
        border: 1px solid #000;
        border-radius: 24px;
        background: transparent;
        font-size: 16px;
        font-weight: 400;
        line-height: normal;
    }

    .dnag-hidden-row {
        display: none !important;
    }

}

/* --- Quote Request Drawer (View Only products) --- */

.mt-quote-drawer-overlay {
    background: rgba(0, 0, 0, 0.4);
    inset: 0;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    transition: opacity 0.3s ease;
    z-index: 99998;
}

.mt-quote-drawer-overlay--visible {
    opacity: 1;
    pointer-events: auto;
}

.mt-quote-drawer {
    background: #fff;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 480px;
    overflow-y: auto;
    position: fixed;
    right: 0;
    top: 0;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    width: 100%;
    z-index: 99999;
}

.mt-quote-drawer--open {
    transform: translateX(0);
}

.mt-quote-drawer-header {
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    flex-shrink: 0;
    justify-content: space-between;
    padding: 20px 24px;
}

.mt-quote-drawer-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.mt-quote-drawer-close {
    align-items: center;
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    height: 36px;
    justify-content: center;
    width: 36px;
}

.mt-quote-drawer-close:hover {
    color: #1d2327;
}

.mt-quote-drawer-product {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 600;
    padding: 14px 24px;
}

.mt-quote-drawer-sku {
    color: #6b7280;
    font-weight: 400;
}

.mt-quote-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.mt-guest-b2c {
    display: block;
    clear: both;
    color: #000;
    font-size: 16px;
    font-style: italic;
    font-weight: 400;
    line-height: normal;
}

/* B2BKing form overrides inside drawer */
.mt-quote-drawer-body .b2bking_custom_quote_field_container {
    margin-bottom: 12px;
}

.mt-quote-drawer-body textarea,
.mt-quote-drawer-body input[type="text"],
.mt-quote-drawer-body input[type="email"],
.mt-quote-drawer-body input[type="number"],
.mt-quote-drawer-body input[type="tel"],
.mt-quote-drawer-body input[type="date"],
.mt-quote-drawer-body select {
    border: 1px solid #d0d5dd;
    border-radius: 4px;
    font-size: 14px;
    padding: 10px 12px;
    width: 100% !important;
}

.mt-quote-drawer-body textarea {
    min-height: 100px;
    resize: vertical;
}

@media (min-width: 1280px) {
    #content #main .ast-woocommerce-container {
        .woocommerce-product-attributes-item__label {
            min-width: 200px;
        }
    }
}

@media (max-width: 1279px) {
    :root {
        --main-container-padding: 20px;
    }
    #content #main .ast-woocommerce-container {
        .summary.entry-summary {
            .product_meta {
                margin-top: 12px;
            }
        }
        .mt-availability {
            margin-top: 16px;
            font-size: 12px;
        }
        .mt-availability .mt-info-icon {
            width: 18px;
        }
        .mt-availability .mt-info-text {
            padding: 2px 0;
        }
    }
}

@media (max-width: 1023px) {
    .mt-quote-drawer {
        max-width: 100%;
    }
}

@media (max-width: 767px) {
    :root {
        --gallery-thumbnail-size: 100%;
        --main-container-padding: 16px;
    }
    .lg-outer .lg .lg-actions button {
        background-color: rgba(0,0,0,.45);
    }
    #content #main div.product {
        h1.product_title {
            margin-bottom: 32px;
        }
        .upsells.products,
        .related.products,
        .woocommerce-tabs {
            padding-top: 48px;
        }
    }
    #content #main {
        padding-top: 0;
    }
    #content #main .ast-woocommerce-container {
        .woocommerce-product-gallery {
            position: relative !important;
            top: 0 !important;
            margin-left: calc(-1 * var(--main-container-padding));
            margin-right: calc(-1 * var(--main-container-padding));
            margin-bottom: 0 !important;
            width: 100vw;
            max-width: 100dvw;
            .ast-vertical-navigation-wrapper,
            .flex-direction-nav,
            .mt-gallery-footer {
                display: none !important;
            }
            #ast-gallery-thumbnails {
                z-index: 10;
                left: auto;
                right: auto;
                bottom: 4px;
                #ast-vertical-thumbnail-wrapper {
                    height: 6px !important;
                }
                .woocommerce-product-gallery-thumbnails__wrapper {
                    display: inline-flex;
                    justify-content: center;
                    gap: 4px;
                    height: 6px !important;
                    img {display: none !important;}
                    * {outline: none !important;}
                    > div {
                        width: 18px;
                        height: 6px;
                        margin: 0;
                        padding: 0;
                        border-radius: 32px;
                        border: 1px solid #000;
                        background: white;
                        transition: all 0.3s ease;
                    }
                    .flex-active-slide {
                        width: 28px;
                        background: black;
                    }
                }
            }
            .flex-viewport {
                margin: 0 !important;
                img {border-radius: 0;}
            }
        }
        h1.product_title {margin-bottom: 32px;}
        .mt-featured-attributes-container {
            margin-right: calc(-1 * var(--main-container-padding));
            .mt-featured-attributes-list {
                flex-direction: row;
                flex-wrap: nowrap;
                white-space: nowrap;
                overflow: auto;
                .mt-attr-label {font-size: 14px;}
                .mt-attr-value {font-size: 16px;}
            }
            .mt-featured-attributes-list::-webkit-scrollbar {
                display: none; /* Hide scrollbar for WebKit browsers */
                width: 0; /* For horizontal scrollbar */
                height: 0; /* For vertical scrollbar */
            }
        }
        .related.products {
            margin-right: calc(-1 * var(--main-container-padding));
            ul.products::-webkit-scrollbar {
                display: none; /* Hide scrollbar for WebKit browsers */
                width: 0; /* For horizontal scrollbar */
                height: 0; /* For vertical scrollbar */
            }
            ul.products {
                display: flex;
                flex-direction: row;
                overflow: auto;
                gap: 16px;
                margin-right: calc(-1 * var(--main-container-padding));
                margin-left: calc(-1 * var(--main-container-padding));
                > li {
                    min-width: calc(100vw - (var(--main-container-padding) * 3));
                    max-width: calc(100vw - var(--main-container-padding));
                    margin: 0;
                }
                > li:first-child {
                    margin-left: var(--main-container-padding);
                }
                > li:last-child:not(:only-child) {
                    margin-right: var(--main-container-padding);
                }
            }
        }
    }
    .mt-guest-b2c {
        font-size: 14px;
    }
}

@media (max-width: 479px) {
    #content #main .ast-woocommerce-container {
        .cart {
            gap: 16px;
            button[name="add-to-cart"],
            .single_add_to_cart_button {
                flex-grow: 1;
                flex-basis: 50%;
                font-size: 12px;
                padding: 12px 4px;
            }

            .quantity {
                flex-basis: 110px;
                justify-content: space-between;

                * {
                    min-width: 25px;
                    min-height: 40px;
                    font-size: 16px;
                }
                input[type="number"] {
                    font-size: 16px;
                }
            }

        }
    }
}
