/*
 * ISC License
 *
 * Copyright (c) 2025 idnovate.com
 * idnovate is a Registered Trademark & Property of idnovate.com, innovación y desarrollo SCP
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
 * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 * PERFORMANCE OF THIS SOFTWARE.
 *
 * @author    idnovate
 * @copyright 2025 idnovate.com
 * @license   https://www.isc.org/licenses/ https://opensource.org/licenses/ISC ISC License
 */

/* Bootstrap compatibility */
.hidden-xs-up {
    display: none!important
}

@media (max-width: 575px) {
    .hidden-xs-down {
        display:none!important
    }
}

@media (min-width: 576px) {
    .hidden-sm-up {
        display:none!important
    }
}

@media (max-width: 767px) {
    .hidden-sm-down {
        display:none!important
    }
}

@media (min-width: 768px) {
    .hidden-md-up {
        display:none!important
    }
}

@media (max-width: 991px) {
    .hidden-md-down {
        display:none!important
    }
}

@media (min-width: 992px) {
    .hidden-lg-up {
        display:none!important
    }
}

@media (max-width: 1199px) {
    .hidden-lg-down {
        display:none!important
    }
}

@media (min-width: 1200px) {
    .hidden-xl-up {
        display:none!important
    }
}

.hidden-xl-down {
    display: none!important
}


/* ============================================
   BLOQUE DE FIDELIDAD - PÁGINA DE PRODUCTO
   Estilo Farmacia Tañá
   ============================================ */

/* Fix desbordamiento movil */
.loyalty-block,
.loyalty-block-product,
.loyalty-block-product-free {
    max-width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

.alert-loyalty {
    padding: 0;
    margin: 0.75rem 0;
    border: 1px solid #f3e8f7;
    border-radius: 12px;
    clear: both;
    background: linear-gradient(135deg, #fef9fb, #f3e8f7);
    overflow: hidden;
    max-width: 100%;
    box-sizing: border-box;
    width: 100%;
}

.loyalty-block-product .alert-loyalty {
    margin-top: 1rem;
}

/* Layout interno */
.loyalty-inner {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    max-width: 100%;
    min-width: 0;
}

/* Icono circular morado */
.loyalty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    min-width: 2.5rem;
    height: 2.5rem;
    background: linear-gradient(135deg, #7b2d8e, #5e1f6e);
    border-radius: 50%;
    color: #ffffff;
    flex-shrink: 0;
}
.loyalty-icon .material-icons {
    font-size: 1.25rem;
}

/* Contenido de texto */
.loyalty-content {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
    overflow: hidden;
}

.loyalty-title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.3;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.loyalty-detail {
    font-size: 0.8125rem;
    color: #555770;
    line-height: 1.4;
    display: block;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.loyalty-detail strong {
    color: #7b2d8e;
    font-weight: 700;
}

/* Ocultar imagen de moneda original */
.loyalty-block img {
    display: none !important;
}

/* ============================================
   BLOQUE DE FIDELIDAD - PRODUCT FREE
   ============================================ */

.loyalty-block-product-free .alert-loyalty {
    background: linear-gradient(135deg, #eafaf1, #d5f5e3);
    border-color: #c8f0da;
    margin-top: 0.625rem;
}

.loyalty-block-product-free .loyalty-icon {
    background: linear-gradient(135deg, #27ae60, #1e8449);
}

.loyalty-block-product-free .alert-loyalty img {
    display: none;
}

/* ============================================
   PRODUCT LIST (miniaturas)
   ============================================ */

.loyalty-block-productlist {
    clear: both;
}

.loyalty-block-productlist .alert-loyalty {
    margin: 0.35rem 0 0;
    padding: 0.35rem 0.625rem;
    border-radius: 8px;
    background: #f3e8f7;
    border: 1px solid #e8d5f0;
}

.loyalty-block-productlist .loyalty-inner {
    padding: 0;
    gap: 0.5rem;
}

.loyalty-block-productlist .loyalty-icon {
    width: 1.5rem;
    min-width: 1.5rem;
    height: 1.5rem;
}

.loyalty-block-productlist .loyalty-icon .material-icons {
    font-size: 0.875rem;
}

.loyalty-block-productlist .loyalty-title {
    font-size: 0.6875rem;
}

.loyalty-block-productlist .loyalty-detail {
    font-size: 0.6875rem;
}

.owl-carousel .owl-item .loyalty-block-productlist .alert-loyalty img,
.loyalty-block-productlist .alert-loyalty img {
    display: none !important;
}

/* ============================================
   SHOPPING CART
   ============================================ */

.loyalty-block.loyalty-block-shopping-cart {
    padding: 1rem;
}

.loyalty-block-shopping-cart .alert-loyalty {
    border-radius: 12px;
}

.loyalty-block-shopping-cart-detail .alert-loyalty {
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    width: auto;
}

.loyalty-block-shopping-cart-detail img,
.cart-grid .product-image.media-middle .loyalty-block-shopping-cart-detail img {
    display: none !important;
}

/* ============================================
   CHECKOUT
   ============================================ */

.loyalty-block-checkout .alert-loyalty {
    border-radius: 12px;
}

.loyalty-block-checkout .loyalty-block-redeem-btn .btn {
    white-space: normal;
    background: linear-gradient(135deg, #7b2d8e, #5e1f6e);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.loyalty-block-checkout .loyalty-block-redeem-btn .btn:hover {
    background: linear-gradient(135deg, #5e1f6e, #4a1755);
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(123, 45, 142, 0.25);
}

/* ============================================
   ORDER CONFIRMATION
   ============================================ */

.loyalty-block-order-confirmation .alert-loyalty {
    border-radius: 12px;
}

/* ============================================
   PRODUCT IMAGE BADGE
   ============================================ */

.loyalty-block-product-image {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: #f3e8f7;
    color: #7b2d8e;
    border: 1px solid #e8d5f0;
    padding: 0.25rem 0.5rem;
    border-radius: 100px;
    z-index: 1;
    font-size: 0.6875rem;
    font-weight: 600;
}

.loyalty-block-product-image span {
    vertical-align: middle;
}

.loyalty-block-product-image img,
.main-product-details .product-cover .loyalty-block-product-image img {
    display: none !important;
}

/* ============================================
   SHOPPING CART MODAL
   ============================================ */

.loyalty-block-shopping-cart-modal .alert-loyalty {
    border-radius: 12px;
}

.alert-loyalty span,
#blockcart-modal .modal-body .divide-right span {
    vertical-align: middle;
    display: inline;
}

/* ============================================
   CUSTOMER ACCOUNT - PÁGINA DE PUNTOS
   ============================================ */

.loyalty-block-redeem-btn {
    text-align: center;
    margin-bottom: 2rem;
}

.loyalty-block-redeem-btn .btn {
    white-space: normal;
    background: linear-gradient(135deg, #7b2d8e, #5e1f6e);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.loyalty-block-redeem-btn .btn:hover {
    background: linear-gradient(135deg, #5e1f6e, #4a1755);
    box-shadow: 0 4px 14px rgba(123, 45, 142, 0.25);
}

#module-loyaltyeditpoints-points .box {
    box-shadow: 0 4px 16px rgba(123, 45, 142, 0.08);
    background: #fff;
    padding: 1.25rem;
    margin-bottom: 1rem;
    border-radius: 12px;
    border: 1px solid #e8e8ef;
}

#module-loyaltyeditpoints-points h3 {
    font-size: 1rem;
    font-weight: 700;
    text-transform: none;
    color: #1a1a2e;
    margin-bottom: 1rem;
}

#module-loyaltyeditpoints-points th {
    border-left: 1px solid #e8e8ef;
    padding: 0.75rem;
    background-color: #f3e8f7;
    color: #7b2d8e;
    font-weight: 600;
    font-size: 0.875rem;
}

#module-loyaltyeditpoints-points table {
    border-collapse: collapse;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
}

#module-loyaltyeditpoints-points td {
    padding: 0.75rem;
    border-bottom: 1px solid #e8e8ef;
    font-size: 0.875rem;
    color: #555770;
}

#module-loyaltyeditpoints-points thead, #module-loyaltyeditpoints-points tfoot {
    padding-right: 17px;
    flex: 0 0 auto;
}

#module-loyaltyeditpoints-points tbody {
    display: block;
}

#module-loyaltyeditpoints-points tr {
    width: 100%;
    display: table;
    table-layout: fixed;
}

/* ============================================
   MOBILE FIX - evitar desbordamiento
   ============================================ */

@media (max-width: 767px) {
    .loyalty-block,
    .loyalty-block-product,
    .loyalty-block-product-free,
    .loyalty-block-productlist {
        max-width: 100% !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
        width: auto !important;
    }

    .alert-loyalty {
        margin-left: 0 !important;
        margin-right: 0 !important;
        max-width: 100% !important;
        width: auto !important;
    }

    .loyalty-inner {
        padding: 0.625rem 0.75rem;
        gap: 0.5rem;
        flex-wrap: nowrap;
        max-width: 100%;
    }

    .loyalty-icon {
        width: 2rem;
        min-width: 2rem;
        height: 2rem;
        flex-shrink: 0;
    }

    .loyalty-icon .material-icons {
        font-size: 1rem;
    }

    .loyalty-content {
        min-width: 0;
        flex: 1;
        overflow: hidden;
    }

    .loyalty-title {
        font-size: 0.75rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .loyalty-detail {
        font-size: 0.6875rem;
        word-break: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
}