/**
 * Module DifadiRelacionados - Related Product Management
 *
 * This module manages related products to be displayed in the product
 * sheet of the front catalog.
 *
 * @author Difadi.com <soporte@difadi.com>
 * @copyright 2026 Difadi.com
 * @license Commercial
 */
.related-products-title {
    margin: 20px 0 15px 0;
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

#related_products_table.related-products-list {
    margin: 0;
    padding: 0;
}

.list-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.related-product-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    border: 1px solid #b8b8b8;
    background: #fff;
    border-radius: 5px;
}

.product-image {
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    border-radius: 4px;
}

.product-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.product-image img.related_image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.product-info {
    flex: 1;
    min-width: 0;
}

.product-name {
    display: block;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-name:hover {
    color: #c11b1e;
}

.product-price {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-price .price-wrapper {
    order: 1;
}

.product-price .price {
    font-size: 16px;
    font-weight: bold;
    color: #c11b1e;
}

.product-price .original-price {
    order: 2;
    font-size: 12px;
    color: #999;
    text-decoration: line-through;
}

.product-price .discount-badge {
    order: 3;
    display: inline-block;
    background-color: #ff6b6b;
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
    width: fit-content;
}

.product-action {
    flex-shrink: 0;
}

.switch-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    margin: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: background-color 0.3s ease;
    border-radius: 28px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.slider::before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    top: 3px;
    background-color: white;
    transition: transform 0.3s ease;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked+.slider {
    background-color: #c11b1e;
}

.toggle-switch input:checked+.slider::before {
    transform: translateX(22px);
}

.toggle-switch input:disabled+.slider {
    background-color: #ddd;
    cursor: not-allowed;
    opacity: 0.5;
}

.toggle-switch input:disabled+.slider::before {
    background-color: #bbb;
}

.out-of-stock-notice {
    font-size: 12px;
    color: #999;
}

@media (max-width: 768px) {
    .related-product-item {
        gap: 12px;
        padding: 10px;
    }

    .product-image {

    }

    .product-name {
        font-size: 13px;
    }

    .product-price .price {
        font-size: 15px;
    }

    .product-price .original-price {
        font-size: 11px;
    }

    .product-price .discount-badge {
        font-size: 10px;
        padding: 2px 5px;
    }

    .toggle-switch {
        width: 45px;
        height: 22px;
    }

    .slider::before {
        height: 16px;
        width: 16px;
    }

    .toggle-switch input:checked+.slider::before {
        transform: translateX(19px);
    }
}

@media (max-width: 480px) {
    .related-product-item {
        flex-wrap: wrap;
    }

    .product-image {

    }

    .product-info {
        flex: 1 1 auto;
    }

    .product-action {
        flex-basis: 100%;
        margin-top: 8px;
    }

    .switch-container {
        width: 100%;
        justify-content: space-between;
    }
}

.toggle-switch--product-cart-icons {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.toggle-switch--product-cart-icons>input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch--product-cart-icons>.slider {
    position: absolute;
    inset: 0;
    background-color: #ccc;
    border-radius: 30px;
    transition: background-color 0.3s;
}

.toggle-switch--product-cart-icons>.slider::before {
    content: "";
    position: absolute;
    height: 26px;
    width: 26px;
    left: 2px;
    bottom: 2px;
    background-color: #fff;
    border-radius: 50%;
    transition: transform 0.3s;
}

.toggle-switch--product-cart-icons .thumb-icon {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: transform 0.3s;
}

.toggle-switch--product-cart-icons .thumb-icon .icon-on {
    display: none;
}

.toggle-switch--product-cart-icons .thumb-icon .icon-off {
    display: block;
}

.toggle-switch--product-cart-icons>input:checked+.slider {
    background-color: #c11b1e;
}

.toggle-switch--product-cart-icons>input:checked+.slider::before {
    transform: translateX(30px);
}

.toggle-switch--product-cart-icons>input:checked+.slider .thumb-icon {
    transform: translateX(30px);
}

.toggle-switch--product-cart-icons>input:checked+.slider .thumb-icon .icon-on {
    display: block;
}

.toggle-switch--product-cart-icons>input:checked+.slider .thumb-icon .icon-off {
    display: none;
}

.product-info a:hover {
    color: #c11b1e !important;
}

.line-product-price {
    font-size: 28px;
    color: #df692f;
    font-weight: bold;
    margin-right: .625rem;
    font-family: "Oswald";
}

.regular-price-line {
    font-weight: 400;
    line-height: 18px;
    margin-right: 0;
    color: #9b9b9b !important;
    font-size: 22px !important;
    text-decoration: line-through;
}

.related_products_table, .list-container{
    padding-bottom: 20px !important;
    margin-bottom: 20px !important;
}