/** Shopify CDN: Minification failed

Line 856:14 Expected identifier but found whitespace
Line 856:16 Unexpected "{"
Line 856:23 Expected ":"
Line 856:66 Expected ":"
Line 861:16 Expected identifier but found whitespace
Line 861:18 Unexpected "{"
Line 861:25 Expected ":"
Line 861:69 Expected ":"
Line 1014:9 Unexpected "formatMoneyMXN("
Line 1015:9 Unexpected "`"
... and 44 more hidden warnings

**/
/*
    © 2023 EcomGraduates.com
    https://www.ecomgraduates.com
*/

/*
    Image badges
*/
.img-badge-sale {
    background-color: var(--bs-success);
}

.img-badge-sold-out {
    background-color: var(--bs-secondary);
}

.img-badge-custom {
    background-color: var(--bs-primary);
}
img.img-badge-custom {
    background: none !important;
}



/*
    Product gallery
*/
.product-gallery {
    position: relative;
}

.product-gallery .img-badge-custom {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 1;
}

.product-gallery .main-splide a {
    cursor: zoom-in;
    display: block;
    position: relative;
}

.product-gallery .main-splide a::after {
    content: "";
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    background-size: 60%;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 1;
    opacity: .5;
    background-color: rgba(0, 0, 0, .25);
    border-radius: 50rem;
    transition: all .2s ease-out;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3Cline x1='11' y1='8' x2='11' y2='14'%3E%3C/line%3E%3Cline x1='8' y1='11' x2='14' y2='11'%3E%3C/line%3E%3C/svg%3E");
}

.product-gallery .main-splide a:hover::after {
    background-color: rgba(0, 0, 0, .5);
}

.product-gallery .main-splide .ratio {
    display: flex;
    justify-content: center;
    height: 100%;
    object-fit: cover;
    background: black;
}

.product-gallery .main-spli::after {
    content: "​​‍​‍​‍‍‍‍‌​‍​‍⁠‌​​​‍​​‌‌‍​‌​‌‍​‌‌​‍​​‌​‍‌​​​‍​​​‌‍‌​​‌‍​‌​​‍​​‌​‍​​​​‍‌​​‌‍‌​​​﻿‌‍​‍‍‍‍​‍‍‍​‍‍‍​‍‌‌‍‍‍";
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    background-size: 60%;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 1;
    opacity: .5;
    background-color: rgba(0, 0, 0, .25);
    border-radius: 50rem;
    transition: all .2s ease-out;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3Cline x1='11' y1='8' x2='11' y2='14'%3E%3C/line%3E%3Cline x1='8' y1='11' x2='14' y2='11'%3E%3C/line%3E%3C/svg%3E");
}

.product-gallery .main-splide-adapt .splide__slide:not(.is-active) {
    height: 0;
}

.product-gallery .thumbs-splide .splide__slide.is-active {
    border: none;
}

.product-gallery .thumbs-splide img {
    transition: all .2s ease-out;
}

.product-gallery .thumbs-splide img:hover {
    opacity: .75;
}

.product-gallery .thumbs-splide .splide__slide.is-active img {
    border: 1px solid var(--bs-primary);
}

.product-gallery .thumbs-splide .splide__slide.is-video,
.product-gallery .thumbs-splide .splide__slide.is-model {
    position: relative;
}

.product-gallery .thumbs-splide .splide__slide.is-video::after,
.product-gallery .thumbs-splide .splide__slide.is-model::after {
    content: "";
    width: 32px;
    height: 32px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-repeat: no-repeat;
    background-position: center;
    background-color: rgba(0,0, 0, .5);
    border-radius: .25rem;
}

.product-gallery .thumbs-splide .splide__slide.is-video::after {
    background-size: 80%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-play-fill' viewBox='0 0 16 16'%3E%3Cpath d='m11.596 8.697-6.363 3.692c-.54.313-1.233-.066-1.233-.697V4.308c0-.63.692-1.01 1.233-.696l6.363 3.692a.802.802 0 0 1 0 1.393z'/%3E%3C/svg%3E");
}

.product-gallery .thumbs-splide .splide__slide.is-model::after {
    background-size: 60%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' focusable='false' class='icon icon-3d-model' fill='none' viewBox='0 0 18 21'%3E%3Cpath d='M7.67998 20.629L1.28002 16.723C0.886205 16.4784 0.561675 16.1368 0.337572 15.731C0.113468 15.3251 -0.00274623 14.8686 -1.39464e-05 14.405V6.59497C-0.00238367 6.13167 0.113819 5.6755 0.33751 5.26978C0.561202 4.86405 0.884959 4.52227 1.278 4.27698L7.67796 0.377014C8.07524 0.131403 8.53292 0.000877102 8.99999 9.73346e-08C9.46678 -0.000129605 9.92446 0.129369 10.322 0.374024V0.374024L16.722 4.27399C17.1163 4.51985 17.4409 4.86287 17.6647 5.27014C17.8885 5.67742 18.0039 6.13529 18 6.59998V14.409C18.0026 14.8725 17.8864 15.3289 17.6625 15.7347C17.4386 16.1405 17.1145 16.4821 16.721 16.727L10.321 20.633C9.92264 20.8742 9.46565 21.0012 8.99999 21C8.53428 20.9998 8.07761 20.8714 7.67998 20.629V20.629ZM8.72398 2.078L2.32396 5.97803C2.22303 6.04453 2.14066 6.13551 2.08452 6.24255C2.02838 6.34959 2.00031 6.46919 2.00298 6.59003V14.4C2.00026 14.5205 2.02818 14.6396 2.08415 14.7463C2.14013 14.853 2.22233 14.9438 2.32298 15.01L7.99999 18.48V10.919C8.00113 10.5997 8.08851 10.2867 8.25292 10.0129C8.41732 9.73922 8.65267 9.51501 8.93401 9.36401L15.446 5.841L9.28001 2.08002C9.19614 2.02738 9.09901 1.99962 8.99999 2C8.90251 1.99972 8.8069 2.02674 8.72398 2.078V2.078Z' fill='white'%3E%3C/path%3E%3C/svg%3E");
}

.product-gallery .thumbs-splide .splide__arrow {
    width: 1.75rem;
    height: 1.75rem;
}

.product-gallery .thumbs-splide .splide__arrow--prev {
    left: -0.5rem;
}

.product-gallery .thumbs-splide .splide__arrow--next {
    right: -0.5rem;
}

@media (max-width: 575px) {
    .product-gallery .thumbs-splide .splide__slide.is-video::after {
        width: 24px;
        height: 24px;
    }
    .main-splide-mobile-full-width {
        margin: -1rem -1rem 0;
    }
    .main-splide-mobile-full-width img {
        border: none;
        padding: 0;
        border-radius: 0 !important;
    }
    .main-splide-mobile-full-width .splide__slide {
        padding-left: 0 !important;
    }
}

@media (max-width: 991px) {
    .product-gallery[data-show-thumbs-mobile="false"] .main-splide {
        margin-left: -1rem;
        margin-right: -1rem;
    }
    .product-gallery[data-show-thumbs-mobile="false"] .splide__slide {
        padding-left: 1rem;
    }
}


/*
    Product content
*/
.product-content .product-price {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.product-price-compare + .product-price-final {
    color: var(--bs-success);
}

.product-content .product-price .price-badge-sale {
    background-color: var(--bs-success);
    font-size: .75rem;
    margin-left: .75rem;
}

.product-content .product-price .price-badge-sold-out {
    background-color: var(--bs-secondary);
    font-size: .75rem;
    margin-left: .75rem;
}

.product-content shopify-payment-terms {
    display: block;
    margin: -1rem 0 1.5rem;
    font-size: .875rem;
}


/*
    Product Form
*/
.shopify-product-form ul.color-swatches {
    display: flex;
    flex-wrap: wrap;
}

.shopify-product-form ul.color-swatches input + label {
    display: block;
    border-radius: 50%;
    border: 1px solid var(--bs-border-color);
    padding: .125rem;
    cursor: pointer;
    transition: all .2s ease-out;
}

.shopify-product-form ul.color-swatches input + label img {
    border-radius: 50%;
}

.shopify-product-form ul.color-swatches input + label:hover {
    opacity: .75;
}

.shopify-product-form ul.color-swatches input:focus-visible + label {
    box-shadow: 0 0 0 0.125rem rgba(var(--bs-body-color-rgb), .5)
}

.shopify-product-form ul.color-swatches input:checked + label {
    border-color: var(--bs-body-color);
}

.shopify-product-form ul.color-swatches-new {
}

.shopify-product-form ul.color-swatches-new input + label {
}

.shopify-product-form ul.color-swatches-new input + label span {
    border-radius: 50rem;
    width: 26px;
    height: 26px;
    display: block;
}

.shopify-product-form ul.color-swatches-new input+label span img {
   
}

.shopify-product-form ul.size-buttons {
    display: flex;
    flex-wrap: wrap;
}

.shopify-product-form ul.size-buttons input + label {
    border: 1px solid var(--bs-body-color);
    padding: .25rem .75rem;
    cursor: pointer;
    transition: all .2s ease-out;
}

.shopify-product-form ul.size-buttons input + label:hover {
    background-color: rgba(0, 0, 0, .1);
}

.shopify-product-form ul.size-buttons input:focus-visible + label {
    box-shadow: 0 0 0 0.125rem rgba(var(--bs-body-color-rgb), .5)
}

.shopify-product-form ul.size-buttons input:checked + label {
    background-color: var(--bs-body-color);
    color: var(--bs-body-bg);
}

.shopify-product-form ul.size-buttons input + label.disabled {
    opacity: .5;
    text-decoration: line-through;
}

.shopify-product-form ul.size-buttons input + label.hidden {
    display: none;
}

.shopify-product-form .btn-wishlist-add-remove.is-wishlisted {
    border-color: var(--bs-primary);
    color: var(--bs-primary);
}

.shopify-product-form .btn-wishlist-add-remove.is-wishlisted:hover,
.shopify-product-form .btn-wishlist-add-remove.is-wishlisted:focus {
    background-color: transparent;
}

.shopify-product-form button[aria-disabled="true"] {
    display: none;
}

.shopify-product-form .quantity-wrapper {
    max-width: 100px;
}

.shopify-product-form .qty-position-inline {
    display: flex;
}

.shopify-product-form .qty-position-inline .quantity-wrapper {
    margin-right: .75rem;
}

.shopify-product-form .qty-position-above .quantity-wrapper {
    margin-bottom: .75rem;
}


/*
    Purchase options (selling/subscription plans)
*/
#product-purchase-options {
}

#product-purchase-options .form-check {
    position: relative;
    padding: .2rem 0;
    margin: 0;
}

#product-purchase-options .form-check-label {
    background-color: var(--bs-light);
    padding: .75rem 1rem .75rem 3rem;
    margin: 0;
    width: 100%;
    cursor: pointer;
    transition: all .2s ease-out;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#product-purchase-options .form-check-label:hover,
#product-purchase-options .form-check-label:focus {
    background-color: var(--bs-light-darken-5);
}

#product-purchase-options input:checked + .form-check-label {
    background-color: var(--bs-light-darken-5);
}

#product-purchase-options .form-check-input {
    position: absolute;
    top: 50%;
    left: 1.25rem;
    transform: translateY(-50%);
    margin: 0;
}

#product-purchase-options .subscription-benefits ul {

}

#product-purchase-options .subscription-benefits ul li {
    line-height: normal;
    font-size: .925rem;
    padding-top: .25rem;
    padding-bottom: .25rem;
}

#product-purchase-options .subscription-benefits ul li svg {
    margin-right: .5rem;
}



/*
    Store availability (local pickup)
*/


/*
    Inventory bar
*/
#inventory-bar {
    transition: all .2s ease-out;
}

#inventory-bar .progress {
    height: .5rem;
}


/*
    Product accordion
*/
.product-accordion .accordion-button {
    background-color: var(--bs-light);
    box-shadow: none;
}

.product-accordion .accordion-button:focus-visible {
    box-shadow: 0 0 0 0.125rem rgba(var(--bs-dark-rgb), .5);
} 


/*
    Bought Togehter
*/
#product-bought-together {
    padding: .5rem 0 1rem;
}

#bought-together-title {
    border-bottom: 1px solid var(--bs-border-color);
    padding: 0 0 .5rem;
    margin: 0 0 .25rem;
}

#product-bought-together .product-item {
    transition: all .2s ease-out;
}

#product-bought-together .product-item-img-wrapper {
    overflow: hidden;
}

#product-bought-together .product-item:not(:last-child) .product-item-img-wrapper:after {
    content: "+";
    position: absolute;
    bottom: -1.8rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.25rem;
    font-weight: 300;
}

#product-bought-together .product-item select {
    max-width: fit-content;
}
 
@media (min-width: 1200px) {
    #product-bought-together .product-item .product-item-img-wrapper:after {
        display: none;
    }
}


/*
    Qty Breaks 
*/

#product-qty-breaks .form-check {
    position: relative;
    padding: 0.5rem 0;
    margin: 0;
}

#product-qty-breaks .form-check-input {
    position: absolute;
    top: 50%;
    left: 1.25rem;
    transform: translateY(-50%);
    margin: 0;
    z-index: 1;
}

#product-qty-breaks label {
    background-color: var(--bs-light);
    padding: .75rem 1rem .75rem 3rem;
    margin: 0;
    width: 100%;
    cursor: pointer;
    transition: all .2s ease-out;
}

#product-qty-breaks .form-check-label {
    border: 1px solid transparent;
    position: relative;
}

#product-qty-breaks .form-check-label:hover, 
#product-qty-breaks .form-check-label:focus {
    background-color: var(--bs-light-darken-5);
}

#product-qty-breaks input:checked + .form-check-label {
    background-color: var(--bs-light-darken-5);
    border-color: var(--bs-body-color);
}

#product-qty-breaks input:not(:checked) + label .product-qty-break-variants {
    display: none !important;
}

#product-qty-breaks .product-qty-break-variant-title {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75em;
    font-weight: 500;
    margin: 0 .5rem 0 0;
    background-color: var(--bs-dark);
    color: var(--bs-body-bg);
    flex-shrink: 0;
}

.product-qty-break-variant-sold-out {
    font-size: .875rem;
    margin-left: .5rem;
    opacity: .75;
}

#product-qty-breaks .badge-custom {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-45%);
}


/*
    Prev/Next Products (within collection)
*/
#product-prev-next-prev,
#product-prev-next-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    transition: all .2s ease-out;
    z-index: 9;
}

#product-prev-next-prev {
    left: -2rem;
}

#product-prev-next-next {
    right: -2rem;
}

#product-prev-next-prev img {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

#product-prev-next-next img {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

#product-prev-next-prev:hover,
#product-prev-next-prev:focus {
    left: 0;
}

#product-prev-next-next:hover,
#product-prev-next-next:focus {
    right: 0;
}

@media (max-width: 1599px) {
    #product-prev-next-prev {
        left: -1.5rem;
        transform: translateX(-100%);
        transition: all .2s ease-out;
    }
    #product-prev-next-next {
        right: -1.5rem;
        transform: translateX(100%);
        transition: all .2s ease-out;
    }
    .show #product-prev-next-prev {
        transform: translateX(0);
    }
    .show #product-prev-next-next {
        transform: translateX(0);
    }
    #product-prev-next img {
        max-width: 60px;
    }
}

@media (min-width: 1600px) {
}


/*
    Limited Offer
*/
ul.countdown-timer li {
    color: currentColor;
    border-color: currentColor;
}


/*
    testimonial
*/
.product-block-testimonial {
    position: relative;
    padding: .5rem 1rem;
    line-height: normal;
}

.product-block-testimonial.has-testimonial-img {
    display: flex;
    align-items: center;
}

.product-block-testimonial img {
}

.product-block-testimonial-verified-icon {
    color: var(--bs-primary);
}

.product-block-testimonial-carousel .carousel-indicators {
    position: relative;
    top: auto;
    bottom: auto;
    margin: -.75rem 0 0;
}

.product-block-testimonial-carousel .carousel-indicators [data-bs-target] {
    opacity: .25;
    background-color: var(--bs-body-color);
}

.product-block-testimonial-carousel .carousel-indicators [data-bs-target].active {
    opacity: .75;
}


/*
    Product switcher
*/

#product-block-product-switcher ul.product-switcher-buttons {
}

#product-block-product-switcher ul.product-switcher-buttons input + label {
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    line-height: normal;
    font-size: .9rem
}

#product-block-product-switcher ul.product-switcher-buttons input + label img {
    border: 1px solid transparent;
    padding: .125rem;
    cursor: pointer;
    transition: all .2s ease-out;
}

#product-block-product-switcher ul.product-switcher-buttons input + label:hover img {
    opacity: .75;
}

#product-block-product-switcher ul.product-switcher-buttons input:focus-visible + label img {
    border-color: var(--bs-body-color);
}

#product-block-product-switcher ul.product-switcher-buttons input:checked + label img {
    border-color: var(--bs-body-color);
}

/*
    Product Promo Text (PDP - Image gallery)
*/
.product-gallery-promo-text {
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--product-promo-bg-color, #ee1882); /* Fallback color */
    padding: .4rem 1rem;
    color: white;
    border-radius: 0 0 var(--bs-border-radius) var(--bs-border-radius);
    text-decoration: underline;
    font-size: smaller;
}

.product-gallery-promo-text-tooltip {
    text-align: center;
    width: 460px;
    max-width: 90vw;
    background: rgba(var(--bs-body-bg-rgb), .75);
    backdrop-filter: blur(10px);
}

@media (max-width: 575px) {
    [data-show-thumbs-mobile="true"] .product-gallery-promo-text {
    }
    [data-show-thumbs-mobile="false"] .product-gallery-promo-text {
        left: 1rem;
        width: calc(100% - 1rem);
        border-bottom-left-radius: var(--bs-border-radius);
        border-bottom-right-radius: var(--bs-border-radius);
    }
    .main-splide-mobile-full-width .product-gallery-promo-text {
        border-radius: 0;
        left: 0;
        width: 100%;
    }
}

/* product block notice */
.eg-notification {
    position: relative;
    padding: 1rem;
    margin-bottom: 1rem;
    border-width: 2px;
    border-style: var(--eg-notice-border-style, solid);
    background-color: var(--eg-notice-bg-color, #ffffff);
    color: var(--eg-notice-text-color, #000000);
    border-color: var(--eg-notice-border-color, #000000);
  }
  
  .eg-notification.rounded {
    border-radius: 8px;
  }
  
  .eg-notification-content {
    display: flex;
    align-items: flex-start;
  }
  
  .eg-notification-icon {
    flex-shrink: 0;
    margin-right: 1rem;
    color: var(--eg-notice-border-color, #000000);
  }
  
  .eg-notification-text p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.5;
  }
  
  .eg-notification-subtitle {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    opacity: 0.8;
  }
  
  .eg-notification-close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s ease-in-out;
    color: var(--eg-notice-text-color, #000000);
  }
  
  .eg-notification-close:hover {
    opacity: 1;
  }
  
  .eg-fade-in {
    animation: egFadeIn 0.5s ease-out;
  }
  
  @keyframes egFadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
  }



  /* product-progress-block */

.product-progress-block .progress-circle-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-start;
  }
  
  .product-progress-block .product-progress-circle {
    width: var(--circle-size);
    height: var(--circle-size);
    border-radius: 50%;
    position: relative;
    background: conic-gradient(from 0deg at 50% 50%, var(--progress-border-color) 0%, var(--progress-border-color) var(--percentage, 0%), #fff var(--percentage, 0%), #fff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
  }
  
  .product-progress-block .product-progress-circle::after {
    content: "";
    position: absolute;
    top: var(--border-thickness);
    bottom: var(--border-thickness);
    left: var(--border-thickness);
    right: var(--border-thickness);
    background: #fff;
    border-radius: 50%;
  }
  
  .product-progress-block .progress-value {
    position: relative;
    z-index: 2;
    font-size: calc(var(--circle-size) * 0.23);
    color: var(--progress-border-color);
  }
  
  .product-progress-block .progress-circle-text {
    flex: 1;
    margin: 0;
    font-size: {{ block.settings.description_font_size_mobile }}px;
  }
  
  @media (min-width: 768px) {
    .product-progress-block .progress-circle-text {
      font-size: {{ block.settings.description_font_size_desktop }}px;
    }
  }

 /* =========================================================
   Downpay placement under Add to Cart, with classic radios
   ========================================================= */

/* CTA row layout */
.product-buy-buttons-inner.qty-position-inline {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: stretch !important;
  gap: 12px !important;
}

/* Quantity box */
.product-buy-buttons-inner.qty-position-inline .quantity-wrapper {
  flex: 0 0 140px !important;
  max-width: 140px !important;
}

/* Add to cart button */
.product-buy-buttons-inner.qty-position-inline .btn-atc {
  flex: 1 1 0 !important;
  min-width: 0 !important;
}

/* Force Downpay onto its own full row under the CTA */
.product-buy-buttons-inner.qty-position-inline #downpay-block,
.product-buy-buttons-inner.qty-position-inline #downpay-product-wrapper,
.product-buy-buttons-inner.qty-position-inline .downpay-block {
  flex: 0 0 100% !important;
  width: 100% !important;
  order: 3 !important;
  margin-top: 10px !important;
}

/* =========================================================
   Downpay classic radio style
   ========================================================= */

#downpay-block,
#downpay-product-wrapper {
  width: 100% !important;
}

/* Fieldset box */
#downpay-block fieldset,
#downpay-product-wrapper fieldset {
  display: block !important;
  border: 1px solid #a9a9a9 !important;
  padding: 16px !important;
  margin: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  min-width: 0 !important;
}

/* Title */
#downpay-block legend,
#downpay-product-wrapper legend {
  display: block !important;
  float: none !important;
  width: auto !important;
  max-width: 100% !important;
  margin: 0 0 10px 0 !important;
  padding: 0 !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
  text-align: left !important;
  color: inherit !important;
}

/* Option wrappers */
#downpay-block .purchase-option,
#downpay-block .purchase-option-full-wrapper,
#downpay-block .purchase-option-deposit-wrapper,
#downpay-product-wrapper .purchase-option,
#downpay-product-wrapper .purchase-option-full-wrapper,
#downpay-product-wrapper .purchase-option-deposit-wrapper {
  display: block !important;
  width: 100% !important;
  margin: 0 0 10px 0 !important;
  padding: 0 !important;
}

/* Last option spacing */
#downpay-block .purchase-option:last-child,
#downpay-block .purchase-option-deposit-wrapper:last-child,
#downpay-product-wrapper .purchase-option:last-child,
#downpay-product-wrapper .purchase-option-deposit-wrapper:last-child {
  margin-bottom: 0 !important;
}

/* Show native radio buttons again */
#downpay-block input[type="radio"],
#downpay-product-wrapper input[type="radio"] {
  position: static !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  appearance: auto !important;
  -webkit-appearance: radio !important;
  display: inline-block !important;
  width: auto !important;
  height: auto !important;
  margin: 0 8px 0 0 !important;
  vertical-align: middle !important;
  transform: none !important;
}

/* Labels as normal inline text */
#downpay-block label,
#downpay-product-wrapper label {
  display: inline !important;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: inherit !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 1.4 !important;
  text-align: left !important;
  box-shadow: none !important;
  cursor: pointer !important;
  vertical-align: middle !important;
}

/* Remove button/card styles from previous customizations */
#downpay-block input[type="radio"]:checked + label,
#downpay-product-wrapper input[type="radio"]:checked + label {
  background: transparent !important;
  color: inherit !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* Prevent weird theme overrides */
#downpay-block *,
#downpay-product-wrapper * {
  box-sizing: border-box !important;
}

/* Optional small spacing tune */
#downpay-block .deposit-option-label,
#downpay-product-wrapper .deposit-option-label {
  display: inline !important;
}

function formatMoneyMXN(cents) {
  return `$ ${Number(cents / 100).toFixed(2)} MXN`;
}

function getCurrentVariantFromForm(form) {
  if (!form) return null;

  const variantInput = form.querySelector('input[name="id"]');
  const variantsJson = form.getAttribute('data-variants');

  if (!variantInput || !variantsJson) return null;

  try {
    const variants = JSON.parse(variantsJson);
    const currentId = Number(variantInput.value);
    return variants.find(v => Number(v.id) === currentId) || null;
  } catch (err) {
    console.error('Could not parse product variants JSON', err);
    return null;
  }
}

function updateAtcAmountFromDownpay() {
  const form = document.querySelector('form[action="/cart/add"]');
  const btn = form?.querySelector('.btn-atc');
  const btnText = btn?.querySelector('.btn-atc-text');
  const btnPrice = btn?.querySelector('.btn-atc-price');

  if (!form || !btn || !btnText || !btnPrice) return;

  const variant = getCurrentVariantFromForm(form);
  if (!variant || typeof variant.price === 'undefined') return;

  const fullPrice = Number(variant.price);

  const depositRadio =
    document.querySelector('#purchase-option-deposit-input') ||
    document.querySelector('input[value="purchase_option_pay_deposit"]');

  const fullRadio =
    document.querySelector('#purchase-option-full') ||
    document.querySelector('input[value="purchase_option_pay_in_full"]');

  let displayPrice = fullPrice;
  let displayText = 'Añadir al carrito';

  if (depositRadio?.checked) {
    const depositLabel =
      document.querySelector('.deposit-option-label') ||
      document.querySelector('label[for="purchase-option-deposit-input"]');

    let depositPercent = 25;
    if (depositLabel) {
      const match = depositLabel.textContent.match(/(\d+)%/);
      if (match) depositPercent = Number(match[1]);
    }

    displayPrice = Math.round(fullPrice * (depositPercent / 100));
    displayText = 'Reservar con depósito';
  } else if (fullRadio?.checked) {
    displayPrice = fullPrice;
    displayText = 'Añadir al carrito';
  }

  btnText.textContent = displayText;
  btnPrice.textContent = formatMoneyMXN(displayPrice);
}

function initDownpayAtcSync() {
  updateAtcAmountFromDownpay();

  document.addEventListener('change', (event) => {
    const target = event.target;

    if (
      target.matches('input[name="id"]') ||
      target.matches('#purchase-option-deposit-input') ||
      target.matches('#purchase-option-full') ||
      target.matches('input[value="purchase_option_pay_deposit"]') ||
      target.matches('input[value="purchase_option_pay_in_full"]')
    ) {
      updateAtcAmountFromDownpay();
    }
  });

  // Re-apply if Downpay re-renders
  setInterval(updateAtcAmountFromDownpay, 500);
}

document.addEventListener('DOMContentLoaded', initDownpayAtcSync);

