:root {
    --jac-gap: 20px;
    --jac-thumbnail-amount: 5;
}

@media screen and (480px < width <=560px) {
    :root {
        --jac-thumbnail-amount: 7;
    }
}

@media screen and (560px < width <=768px) {
    :root {
        --jac-thumbnail-amount: 9;
    }
}



/* Archive pages */

/* body.woocommerce-page .page-title-section,  */
/* body .woocommerce-products-header,  */
body .woocommerce-result-count,
body .woocommerce-ordering {
    display: block;
}

.shop-page-title {
    max-width: calc(100vw - var(--jac-gap) * 2);
    margin: 36px auto 0;
    width: var(--jac-max-width);
}

.shop-page-title .subtitle {
    font-size: 14px;
    color: var(--e-global-color-text);
    text-transform: uppercase;
    line-height: normal;
    margin: 0;
}

.shop-page-title .title {
    margin: 0;
    color: var(--e-global-color-secondary);
    line-height: 60px;
    font-weight: bold;
    font-size: 48px;
}

.shop-page-title .description {
    font-size: 16px;
    color: var(--e-global-color-text);
    line-height: normal;
    margin: 16px 0 0;
}

body.woocommerce main.aux-territory {
    max-width: calc(100vw - 40px);
    width: var(--jac-max-width);
    margin-top: 50px;
}

body.woocommerce main.aux-shop-archive .aux-wrapper .aux-container {
    padding: 0;
    display: grid;
    gap: calc(var(--jac-gap) * 2);
    flex-direction: column;
}

body.woocommerce main.aux-shop-archive .aux-wrapper .aux-container:after {
    content: none;
}

body.woocommerce main.aux-shop-archive .aux-wrapper .aux-primary {
    padding: 0;
}

body.woocommerce main aside.aux-sidebar.aux-sidebar-primary {
    margin: 0;
    height: unset !important;
}


@media screen and (width >=768px) {
    body.woocommerce main.aux-shop-archive .aux-wrapper .aux-primary {
        grid-column: 2;
        grid-row: 1;
    }

    body.woocommerce main aside.aux-sidebar.aux-sidebar-primary {
        grid-column: 1;
        grid-row: 1;
        margin-left: 0 !important;
    }
}

/* Results sorting */

body.woocommerce .woocommerce-result-count {
    padding: calc((48px - 1em) / 2) 0;
    margin: 0;
}

body.woocommerce .woocommerce-ordering {
    margin: 0;
}

body.woocommerce .woocommerce-ordering .orderby {
    max-width: calc(100vw - var(--jac-gap) * 2);
}

/* Product listings */

body .single-product .product,
body .aux-shop-archive .product,
body.woocommerce ul.products[class*=columns-] li.product,
body.woocommerce-page ul.products[class*=columns-] li.product {
    margin: 0 !important;
    width: 100% !important;
}

@media screen and (width >=768px) {

    body .single-product .product,
    body .aux-shop-archive .products .product {
        margin: 0 !important;
    }
}

body.woocommerce ul.products {
    display: grid;
    gap: var(--jac-gap, 20px);
    padding-top: var(--jac-gap);
}

body.woocommerce ul.products:before,
body.woocommerce ul.products:after {
    content: none;
}

@media screen and (width >=440px) {

    .products.columns-3,
    .products.columns-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media screen and (width >=768px) {
    .products.columns-4 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media screen and (width >=992px) {
    .products.columns-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .products.columns-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

body.woocommerce ul.products li.product a.woocommerce-loop-product__link {
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 0 10px #0000000d;
}

body .aux-shop-archive .woocommerce-pagination {
    position: relative;
    margin-top: calc(var(--jac-gap) * 2);
    bottom: unset;
    left: unset;
    top: unset;
    right: unset;
}

body.woocommerce nav.woocommerce-pagination ul li a,
body.woocommerce nav.woocommerce-pagination ul li span {
    height: 40px;
    width: 40px;
    padding: 0 !important;
    display: flex;
    justify-content: center;
    align-items: center;
}

body .aux-shop-archive li .prev:after {
    left: 50%;
    transform: translateX(-50%);
}

body .aux-shop-archive li .next:after {
    left: 50%;
    transform: translateX(-50%);
}

/* Single product pages */

body.woocommerce .no-sidebar .aux-primary {
    padding-top: 0;
}

body.woocommerce .aux-fold {
    padding-right: 0;
    padding-left: 0;
}

body.aux-resp .left-sidebar>.aux-wrapper>.aux-fold {
    padding-right: var(--jac-gap);
    padding-left: var(--jac-gap);
    padding: 0;
}

body.woocommerce .aux-wrapper {
    margin-top: 0;
}

body.woocommerce div.product div.images .woocommerce-product-gallery__wrapper .zoomImg {
    width: auto !important;
}

body.woocommerce div.product form.cart {
    display: flex;
    flex-direction: column;
    padding: 0;
}

body.woocommerce div.product form.cart .variations {
    margin: var(--jac-gap) 0 0;
    padding: var(--jac-gap);
    display: block;
    background-color: #f9f9f9;
}

body.woocommerce div.product form.cart .variations tbody {
    display: flex;
    flex-direction: column;
    gap: var(--jac-gap);
}

body.woocommerce div.product form.cart .variations tr {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--jac-gap);
}

body.woocommerce div.product form.cart .variations th,
body.woocommerce div.product form.cart .variations td {
    padding: 0;
    margin: 0;
    line-height: normal;
    background-color: transparent;
}

body.woocommerce div.product form.cart .variations td.value {
    display: flex;
    gap: var(--jac-gap);
    align-items: center;
    width: 100%;
}

body.woocommerce div.product form.cart .variations label {
    margin: 0;
    font-weight: 600;
    font-size: 0.95em;
    font-style: italic;
}

body.woocommerce div.product form.cart .variations label::after {
    content: ':';
}

body.woocommerce div.product form.cart .variations select {
    margin: 0;
    width: calc(100% - 100px);
    padding: 8px 42px 8px 12px;
    background-color: white;
    border-color: #dcdcdc;
}

body.woocommerce div.product form.cart .reset_variations {
    font-size: 1em;
}

body.woocommerce .product_title,
body.woocommerce .price {
    padding: 0;
    margin: 0;
    margin-top: var(--jac-gap);
}

body.woocommerce.single-product .entry-summary .product_title {
    font-size: 24px;
    line-height: normal;
}

body.woocommerce.single-product .entry-summary .price {
    margin-top: calc(var(--jac-gap) * 0.5);
}

body.woocommerce.single-product .entry-summary .price .amount {
    font-size: 28px !important;
    color: var(--jac-color-primary-dark);
}

/* ( preus si van per variacions. inici) */

body.woocommerce.single-product .entry-summary .price:has(.amount:not(:only-child)) {
    gap: 5px;
    align-items: center;
    color: #7d6d6c;
    flex-direction: row;
    justify-content: start;
}

body.woocommerce.single-product .entry-summary .price .amount:not(:only-child) {
    font-size: 20px !important;
    line-height: normal;
    color: inherit;
}

/* ( preus si van per variacions. final) */

body.woocommerce div.product form.cart {
    border: none;
}

body.woocommerce div.product form.cart div.quantity {
    margin: 0 !important;
    float: none;
}

body.woocommerce .single_variation_wrap {
    width: 100%;
}

body.woocommerce .variations_button,
body.woocommerce div.product form.cart:not(.variations_button) {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: calc(var(--jac-gap) * 0.5);
    margin: var(--jac-gap) 0;
    flex-wrap: wrap;
}

body.woocommerce .variations_button {
    margin-top: calc(var(--jac-gap) * 2);
}

body.woocommerce div.product form.cart::after,
body.woocommerce div.product form.cart::before {
    content: none;
}

body.woocommerce .quantity {
    display: flex;
    align-items: center;
    gap: calc(var(--jac-gap) * 0.5);
}

body.woocommerce .single_variation:not(:empty) {
    margin-top: var(--jac-gap);
}

body.woocommerce ul.tabs.wc-tabs {
    display: flex;
    justify-content: center;
    flex-direction: column;
    border-bottom: 2px solid #242424;
    padding: 0 1em !important;
}

@media screen and (width >=768px) {
    body.woocommerce ul.tabs.wc-tabs {
        flex-direction: row;
    }
}

body.woocommerce ul.tabs.wc-tabs>li {
    padding: 0 !important;
    width: fit-content;
    margin: 0 !important;
    background-color: transparent !important;
    border: none !important;
}

@media screen and (width < 768px) {
    body.woocommerce ul.tabs.wc-tabs>li {
        width: auto;
    }
}

body.woocommerce ul.tabs.wc-tabs>li.active {
    background-color: #242424 !important;
}

body.woocommerce div.product .woocommerce-tabs ul.tabs li a {
    padding: .75em 1.25em !important;
    font-size: 1rem;
    font-weight: normal;
    line-height: normal;
    border: solid #242424 !important;
    border-width: 2px 2px 0 2px !important;
}

@media screen and (width < 768px) {
    body.woocommerce div.product .woocommerce-tabs ul.tabs li a {
        width: 100%;
        display: block;
    }
}

body.woocommerce div.product .woocommerce-tabs ul.tabs li.active a {
    color: white;
}

body.woocommerce div.product .woocommerce-tabs ul.tabs::before {
    content: none;
}

body.woocommerce .product_meta {
    display: flex;
    flex-direction: column;
    gap: calc(var(--jac-gap) * 0.5);
}

body.woocommerce.single-product .entry-summary .product_meta .posted_in,
body.woocommerce.single-product .entry-summary .product_meta .tagged_as,
body.woocommerce.single-product .entry-summary .product_meta .posted_in a,
body.woocommerce.single-product .entry-summary .product_meta .tagged_as a {
    font-size: 0.75rem !important;
    line-height: normal;
    padding-right: 0;
}

body.woocommerce.single-product .quantity::before {
    content: 'Quantitat';
    line-height: normal;
    font-size: 14px;
}

body.woocommerce .sku_wrapper {
    display: none;
}

body.woocommerce .woocommerce-Tabs-panel {
    width: 600px !important;
    margin: auto !important;
    max-width: 100%;
}

body.woocommerce .woocommerce-Tabs-panel p {
    max-width: 100%;
}

body.woocommerce table.shop_attributes td {
    padding: 8px;
}

body.single-product .flex-control-nav {
    width: 100%;
}

body.single-product .woocommerce-product-details__short-description {
    padding: 0;
    border: none;
    margin-top: var(--jac-gap);
    font-size: 16px;
    line-height: 1.5;
}

@media screen and (width <=768px) {
    body.woocommerce div.product div.images.woocommerce-product-gallery {
        flex-direction: column;
    }

    body.woocommerce div.product div.images .flex-control-thumbs {
        gap: calc(var(--jac-gap) * 0.5);
        display: grid;
        grid-template-columns: repeat(var(--jac-thumbnail-amount), minmax(0, 1fr));
        margin-top: calc(var(--jac-gap) * 0.5);
    }
}

body.single-product .flex-control-thumbs li {
    margin: 0 !important;
    width: 100% !important;
}

@media screen and (width > 768px) {
    body.single-product .flex-control-thumbs li {
        width: calc(100% - 0.5 * var(--jac-gap)) !important;
        margin-top: calc(0.5 * var(--jac-gap)) !important;
    }
}

body.single-product .woocommerce-review-link {
    font-size: 14px !important;
    color: var(--e-global-color-text);
}

body.single-product .woocommerce-Tabs-panel--description p {
    margin-top: 1.5em;
}

/* PRODUCTES RELACIONATS */

body.woocommerce ul.products li.product {
    display: flex;
    flex-direction: column;
}

body.woocommerce ul.products li.product .price {
    position: relative;
    transform: none;
    top: unset;
    bottom: unset !important;
    margin-top: calc(var(--jac-gap) * 0.5) !important;
    margin-bottom: 0 !important;
    line-height: 14px;
}

body.woocommerce ul.products li.product .price .amount {
    line-height: 14px;
}

body.woocommerce ul.products li.product .price bdi {
    color: #9f9f9f !important;
    font-size: 14px !important;
    font-weight: 700;
}


body.woocommerce ul.products li.product .add_to_cart_button {
    position: absolute;
    top: 0;
    left: 0;
    margin-top: 0;
    aspect-ratio: 1;
    display: flex;
    font-size: 16px;
    text-transform: unset;
    text-align: start;
}

body.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 16px !important;
    line-height: normal;
    position: relative;
    transform: none;
    bottom: 0;
    margin-top: calc(var(--jac-gap) * 0.5);
    font-weight: 400;
    color: #242424;
    padding: 0;
}

body.woocommerce ul.products li .price bdi {
    font-size: 18px;
}

body.woocommerce ul.products li.product a img {
    margin: 0;
}

body.single-product .content>.product {
    margin-bottom: 0 !important;
}

body.single-product .content .related.products {
    margin-top: calc(var(--jac-gap) * 2);
    padding: calc(var(--jac-gap) * 2) 0 calc(var(--jac-gap) * 3);
}

body.single-product .content .related.products .products {
    margin-top: calc(var(--jac-gap) * 2);
}

body.single-product .content .related:before {
    top: 0;
}

body .related.products h2 {
    padding: 0;
    margin: 0 auto;
}

body.single-product .related>h2:after {
    transform: translateX(-50%);
    bottom: 0;
    top: unset;
}

body .related.products .products.columns-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 0;
}

@media screen and (width >=440px) {
    body .related.products .products.columns-4 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media screen and (width >=768px) {
    body .related.products .products.columns-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

body.single-product .woocommerce-loop-product__link:after {
    aspect-ratio: 1;
    border-radius: 6px;
}

body.single-product .products .product:hover .button {
    opacity: 1;
}

/* Ressenyes */

body.woocommerce.single-product .comment-respond,
body.woocommerce #review_form #respond {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
}

body.woocommerce form#commentform {
    display: flex;
    flex-direction: column;
    gap: calc(var(--jac-gap) * 0.5);
    margin-top: var(--jac-gap);
}

body.woocommerce form#commentform * {
    margin: 0 !important;
    position: relative;
}

body.woocommerce .woocommerce-noreviews {
    padding: 1em;
    border: 2px solid var(--jac-color-primary-dark);
    color: var(--jac-color-primary-dark);
}

body.woocommerce .comments-title,
body.woocommerce .comment-reply-title {
    font-size: 16px;
    line-height: normal;
}

body.woocommerce form#commentform .stars {
    margin-top: calc(var(--jac-gap) * 0.5) !important;
    display: block;
}

body.woocommerce form#commentform textarea {
    padding: calc(var(--jac-gap) * 0.5);
    margin: var(--jac-gap) 0 calc(var(--jac-gap) * 0.5) !important;
    background-color: #f9f9f9;
    min-height: 5em !important;
    height: fit-content !important;
}

/* BREADCRUMBS */

body.single-product .shop-breadcrumb {
    display: flex;
    gap: calc(var(--jac-gap) * 0.5);
    align-items: center;
    line-height: normal;
    justify-content: start;
    max-width: calc(100vw - 40px);
    width: 1140px;
    margin: calc(var(--jac-gap) * 2) auto 0;
    font-size: 0.95em;
}

body.single-product .shop-breadcrumb .auxicon {
    height: 1em;
}

body.single-product .shop-breadcrumb a,
body.single-product .shop-breadcrumb i {
    color: var(--e-global-color-text);
}

body.single-product .shop-breadcrumb a:hover {
    color: var(--e-global-color-secondary);
}

/* Carret */

body:where(body:not(.woocommerce-block-theme-has-button-styles)):where(:not(.edit-post-visual-editor)) .woocommerce a.button.alt,
body:where(body:not(.woocommerce-block-theme-has-button-styles)):where(:not(.edit-post-visual-editor)) .woocommerce button.button.alt {
    background-color: var(--jac-color-primary);
}

body:where(body:not(.woocommerce-block-theme-has-button-styles)):where(:not(.edit-post-visual-editor)) .woocommerce a.button.alt:hover,
body:where(body:not(.woocommerce-block-theme-has-button-styles)):where(:not(.edit-post-visual-editor)) .woocommerce button.button.alt:hover {
    background-color: var(--jac-color-primary-hover);
}

body.woocommerce-cart .coupon .input-text {
    width: unset !important;
}

/* Checkout */

body .select2-container .select2-selection--single {
    height: fit-content;
}

body .woocommerce form .form-row .input-text,
body .woocommerce form .form-row select {
    max-width: none;
}

body.woocommerce-checkout .woocommerce-checkout-review-order {
    margin-bottom: calc(var(--jac-gap) * 2);
}

body.woocommerce-checkout .form-row label {
    margin-top: calc(var(--jac-gap) * 0.5);
    margin-bottom: 0;
}

body.woocommerce-checkout #add_payment_method #payment,
body.woocommerce-cart #payment,
body.woocommerce-checkout #payment {
    background: rgb(243 36 47 / 14%);
}

body.woocommerce-checkout #payment div.payment_box {
    background-color: var(--jac-color-primary-light);
}

body #add_payment_method #payment div.payment_box::before,
body.woocommerce-cart #payment div.payment_box::before,
body.woocommerce-checkout #payment div.payment_box::before {
    border-bottom-color: var(--jac-color-primary-light);
}

body.woocommerce-checkout #payment div.payment_box fieldset {
    border: none;
}

/* Order received */

body.woocommerce-order-received p.woocommerce-notice.woocommerce-notice--success.woocommerce-thankyou-order-received {
    font-size: 2em;
    margin-bottom: calc(var(--jac-gap) * 3);
    font-weight: 600;
    color: forestgreen;
}