/* Leo WhatsApp Chat Widget - PequeMonster */

/* ===== Floating Button ===== */
#leowhatsapp-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}
#leowhatsapp-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #25D366;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    z-index: 2;
}
#leowhatsapp-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
}
/* Pulse animation */
.leowhatsapp-pulse {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #25D366;
    opacity: 0;
    animation: leowhatsapp-pulse 3s ease-out infinite;
    pointer-events: none;
}
@keyframes leowhatsapp-pulse {
    0% {
        transform: scale(1);
        opacity: 0.4;
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}
/* ===== Tooltip ===== */
#leowhatsapp-tooltip {
    position: absolute;
    bottom: 70px;
    right: 0;
    background: #dcf8c6;
    color: #1a1a2e;
    padding: 10px 16px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
    z-index: 3;
}
#leowhatsapp-tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 24px;
    width: 12px;
    height: 12px;
    background: #dcf8c6;
    transform: rotate(45deg);
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.05);
}
#leowhatsapp-tooltip.leowhatsapp-show {
    opacity: 1;
    transform: translateY(0);
}
/* ===== Chat Popup ===== */
#leowhatsapp-popup {

    position: absolute;
    bottom: 76px;
    right: 0;
    width: 360px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transform-origin: bottom right;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    visibility: hidden;
    z-index: 10;
}
#leowhatsapp-popup.leowhatsapp-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    visibility: visible;
}
/* Header */
.leowhatsapp-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.leowhatsapp-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.leowhatsapp-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #dcf8c6;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}
.leowhatsapp-online-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 10px;
    height: 10px;
    background: #25D366;
    border-radius: 50%;
    border: 2px solid #1a1a2e;
}
.leowhatsapp-header-text {
    display: flex;
    flex-direction: column;
}
.leowhatsapp-title {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
}
.leowhatsapp-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    line-height: 1.3;
}
#leowhatsapp-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: color 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
#leowhatsapp-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}
/* Body */
.leowhatsapp-body {
    background: #e5ddd5;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23d4cdc4' fill-opacity='0.3'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    padding: 20px;
    min-height: 160px;
    max-height: 280px;
    overflow-y: auto;
}
.leowhatsapp-message {
    max-width: 85%;
}
.leowhatsapp-msg-sender {
    font-size: 12px;
    font-weight: 600;
    color: #25D366;
    margin-bottom: 4px;
}
.leowhatsapp-msg-bubble {
    background: #dcf8c6;
    padding: 10px 14px;
    border-radius: 0 12px 12px 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #303030;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    word-wrap: break-word;
}
.leowhatsapp-msg-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}
/* Footer / Input */
.leowhatsapp-footer {
    background: #dcf8c6;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-top: 1px solid #eee;
}
#leowhatsapp-input {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    color: #303030;
    background: #f8f9fa;
}
#leowhatsapp-input:focus {
    border-color: #25D366;
    background: #dcf8c6;
}
#leowhatsapp-input::placeholder {
    color: #aaa;
}
#leowhatsapp-send {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
    flex-shrink: 0;
}
#leowhatsapp-send:hover {
    background: #f0faf0;
}
/* ===== Mobile Responsive ===== */
@media (max-width: 480px) {
    #leowhatsapp-widget {
        bottom: 16px;
        right: 16px;
    }

    #leowhatsapp-button {
        width: 52px;
        height: 52px;
    }

    .leowhatsapp-pulse {
        width: 52px;
        height: 52px;
    }

    #leowhatsapp-button svg {
        width: 24px;
        height: 24px;
    }

    #leowhatsapp-popup {

        position: fixed;
        bottom: 76px;
        right: 0;
        left: 0;
        width: 100%;
        border-radius: 16px;
        max-height: 60vh;
    }

    .leowhatsapp-body {
        max-height: 30vh;
    }

    #leowhatsapp-tooltip {
        right: -8px;
        bottom: 62px;
        font-size: 12px;
    }
}

/* Notice */
.leowhatsapp-notice {
    text-align: center;
    font-size: 11px;
    color: #999;
    padding: 6px 0;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    border-radius: 0 0 16px 16px;
}

/* Permanent label */
#leowhatsapp-label {
    position: absolute;
    bottom: 10px;
    right: 72px;
    background: #dcf8c6;
    color: #1a1a2e;
    padding: 8px 14px;
    border-radius: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    z-index: 1;
    animation: leowhatsapp-label-in 0.5s ease-out 1s both;
}

#leowhatsapp-label::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #dcf8c6;
    border-radius: 2px;
    transform: translateY(-50%) rotate(45deg);
    box-shadow: 2px -2px 4px rgba(0, 0, 0, 0.05);
}

@keyframes leowhatsapp-label-in {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@media (max-width: 480px) {
    #leowhatsapp-label {
        right: 64px;
        font-size: 11px;
        padding: 6px 12px;
    }
}

/* Hide SeQura promotion widgets on product pages */
.sequra-promotion-widget { display: none !important; }

/* Leo WhatsApp banner on product page */
.leowhatsapp-banner {
    background: linear-gradient(135deg, #dcf8c6 0%, #e8f5e9 100%);
    border: 1px solid #a5d6a7;
    border-radius: 12px;
    padding: 16px 20px;
    margin: 12px 0;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
}

.leowhatsapp-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.2);
    text-decoration: none;
    color: inherit;
}

.leowhatsapp-banner-icon {
    width: 48px;
    height: 48px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.leowhatsapp-banner-text {
    flex: 1;
}

.leowhatsapp-banner-title {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 3px;
}

.leowhatsapp-banner-desc {
    font-size: 12px;
    color: #555;
    line-height: 1.4;
}

.leowhatsapp-banner-arrow {
    color: #25D366;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .leowhatsapp-banner {
        padding: 12px 14px;
        gap: 10px;
    }
    .leowhatsapp-banner-icon {
        width: 40px;
        height: 40px;
    }
    .leowhatsapp-banner-title { font-size: 13px; }
    .leowhatsapp-banner-desc { font-size: 11px; }
}

/* ===== Mobile Product Page - Buy Zone Stacking ===== */
@media (max-width: 768px) {
    /* Make center column full width on mobile */
    .pb-center-column {
        width: 100% !important;
        float: none !important;
    }

    /* Stack the buy zone vertically */
    .box-info-product {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    /* Price area full width */
    .box-info-product .content_prices {
        width: 100%;
        order: 1;
    }

    .box-info-product .content_prices .price {
        text-align: center;
        width: 100%;
    }

    /* Old price and discount info centered */
    .box-info-product #old_price,
    .box-info-product #reduction_percent,
    .box-info-product #reduction_amount {
        text-align: center;
    }

    /* Cart button area full width */
    .box-info-product .box-cart-bottom {
        width: 100%;
        order: 2;
        margin-top: 10px;
    }

    /* Add to cart button: full width and prominent */
    #add_to_cart {
        width: 100%;
        text-align: center;
    }

    #add_to_cart .btn.addcustom,
    #add_to_cart button[name="Submit"] {
        width: 100%;
        display: block;
        padding: 14px 20px;
        font-size: 16px;
        font-weight: 700;
        border-radius: 8px;
    }

    /* Visitordiscount coupon banner: full width below button */
    #visitor-discount-banner {
        width: 100% !important;
        box-sizing: border-box;
        order: 3;
        margin-top: 12px;
        text-align: center;
    }

    /* Leo WhatsApp banner: full width below coupon */
    .leowhatsapp-banner {
        width: 100%;
        box-sizing: border-box;
        margin-top: 12px;
    }
}

/* Mobile product page fixes */
@media (max-width: 768px) {
    /* 1. Add right padding to buy zone - match left side */
    .pb-center-column .box-info-product,
    .pb-center-column {
        padding-right: 16px !important;
    }

    /* 2. Price - more space from top */
    .content_prices {
        padding-top: 16px !important;
        margin-top: 8px !important;
    }

    /* Botón de compra: pendiente de ajustar (controlado por tema modez) */
}

/* === Anchoring overrides V3 (2026-04-28) === */
#leowhatsapp-widget{
  position:fixed !important;
  inset:auto 24px 24px auto !important;
  left:auto !important;
  top:auto !important;
  width:auto !important;
  direction:ltr !important;
  text-align:left !important;
  transform:none !important;
}
#leowhatsapp-widget #leowhatsapp-button{
  position:relative !important;
  margin-left:auto !important;
}
#leowhatsapp-widget #leowhatsapp-label{
  position:absolute !important;
  bottom:10px !important;
  right:72px !important;
  left:auto !important;
}
#leowhatsapp-widget #leowhatsapp-tooltip{
  position:absolute !important;
  bottom:70px !important;
  right:0 !important;
  left:auto !important;
}
#leowhatsapp-widget #leowhatsapp-popup{
  position:absolute !important;
  bottom:76px !important;
  right:0 !important;
  left:auto !important;
}
@media (max-width:480px){
  #leowhatsapp-widget{inset:auto 16px 16px auto !important;}
  #leowhatsapp-widget #leowhatsapp-label{right:64px !important;left:auto !important;}
}
