/**
 * Documents Upsell Styles
 *
 * Styles for non-member upsell prompts:
 *  - Add-to-cart slide-in notice
 *  - Cart page banner
 *  - Checkout page prompt
 *
 * Uses the existing iHowz design tokens (--primary-green, etc.).
 *
 * @package iHowz
 * @subpackage Documents
 */

/* ==========================================================================
   Shared: Dismiss Button
   ========================================================================== */

.ihowz-upsell-dismiss {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.2s ease, background 0.2s ease;
    z-index: 2;
}

.ihowz-upsell-dismiss:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

.ihowz-upsell-cart-banner .ihowz-upsell-dismiss,
.ihowz-upsell-checkout-prompt .ihowz-upsell-dismiss {
    color: #666;
}

.ihowz-upsell-cart-banner .ihowz-upsell-dismiss:hover,
.ihowz-upsell-checkout-prompt .ihowz-upsell-dismiss:hover {
    color: #333;
    background: rgba(0, 0, 0, 0.06);
}

/* ==========================================================================
   Add-to-Cart Notice (Slide-in Toast)
   ========================================================================== */

.ihowz-upsell-notice {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    max-width: 420px;
    width: calc(100% - 40px);
    border-radius: 12px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
    color: #fff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: ihowz-upsell-slide-in 0.35s ease-out;
    overflow: hidden;
}

.ihowz-upsell-notice-inner {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 20px;
    position: relative;
}

.ihowz-upsell-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    margin-top: 2px;
}

.ihowz-upsell-content {
    flex: 1;
}

.ihowz-upsell-heading {
    margin: 0 0 6px;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
}

.ihowz-upsell-savings,
.ihowz-upsell-message {
    margin: 0 0 12px;
    font-size: 0.875rem;
    line-height: 1.5;
    opacity: 0.9;
}

.ihowz-upsell-savings strong {
    color: #9FC045;
    font-size: 1.05em;
}

/* Join button in the notice */
.ihowz-upsell-notice .ihowz-upsell-join-btn {
    display: inline-block;
    padding: 8px 18px;
    font-size: 0.8125rem;
    font-weight: 600;
    background: #fff;
    color: #1e3a5f;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s ease;
}

.ihowz-upsell-notice .ihowz-upsell-join-btn:hover {
    background: #f0f4f8;
    transform: translateY(-1px);
}

@keyframes ihowz-upsell-slide-in {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Mobile notice */
@media (max-width: 480px) {
    .ihowz-upsell-notice {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        width: auto;
    }
}

/* ==========================================================================
   Cart Page Banner
   ========================================================================== */

.ihowz-upsell-cart-banner {
    position: relative;
    margin: 24px 0;
    padding: 20px 24px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f0f7e6 0%, #e8f5e9 100%);
    border: 1px solid #c8e6c9;
    box-shadow: 0 2px 8px rgba(156, 204, 101, 0.18);
}

.ihowz-upsell-banner-content {
    display: flex;
    align-items: center;
    gap: 18px;
}

.ihowz-upsell-banner-icon {
    flex-shrink: 0;
    color: #5f8422;
}

.ihowz-upsell-banner-heading {
    margin: 0 0 6px;
    font-size: 1.0625rem;
    font-weight: 600;
    color: #1e3a5f;
    line-height: 1.35;
}

.ihowz-upsell-banner-text {
    margin: 0 0 12px;
    font-size: 0.9rem;
    color: #546e7a;
    line-height: 1.5;
}

.ihowz-upsell-banner-text strong {
    color: #1e3a5f;
}

/* Join button in cart banner */
.ihowz-upsell-cart-banner .ihowz-upsell-join-btn {
    display: inline-block;
    padding: 10px 24px;
}

@media (max-width: 600px) {
    .ihowz-upsell-banner-content {
        flex-direction: column;
        align-items: flex-start;
    }
    .ihowz-upsell-banner-icon {
        display: none;
    }
}

/* ==========================================================================
   Checkout Prompt
   ========================================================================== */

.ihowz-upsell-checkout-prompt {
    position: relative;
    margin: 20px 0;
    padding: 24px;
    border-radius: 10px;
    background: #fff;
    border: 2px solid #9FC045;
    box-shadow: 0 2px 16px rgba(159, 192, 69, 0.15);
}

.ihowz-upsell-checkout-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    color: #5f8422;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ihowz-upsell-checkout-header svg {
    flex-shrink: 0;
}

.ihowz-upsell-checkout-savings {
    margin: 0 0 8px;
    font-size: 1.0625rem;
    color: #1e3a5f;
    line-height: 1.4;
}

.ihowz-upsell-highlight {
    color: #5f8422;
    font-size: 1.15em;
}

.ihowz-upsell-checkout-detail {
    margin: 0 0 14px;
    font-size: 0.875rem;
    color: #546e7a;
    line-height: 1.4;
}

.ihowz-upsell-strikethrough {
    text-decoration: line-through;
    color: #999;
}

.ihowz-upsell-benefits {
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
}

.ihowz-upsell-benefits li {
    position: relative;
    padding-left: 22px;
    margin-bottom: 6px;
    font-size: 0.875rem;
    color: #546e7a;
    line-height: 1.45;
}

.ihowz-upsell-benefits li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 5px;
    width: 14px;
    height: 14px;
    background: #9FC045;
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
    background-size: 10px 10px;
    background-position: center;
    background-repeat: no-repeat;
}

.ihowz-upsell-checkout-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ihowz-upsell-or {
    font-size: 0.8125rem;
    color: #999;
}

.ihowz-upsell-continue-btn {
    background: none;
    border: none;
    padding: 10px 16px;
    font-size: 0.8125rem;
    color: #666;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.ihowz-upsell-continue-btn:hover {
    color: #333;
}

/* Fade-out animation for dismissed elements */
.ihowz-upsell-fade-out {
    animation: ihowz-upsell-fade-out 0.3s ease-in forwards;
}

@keyframes ihowz-upsell-fade-out {
    to {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        margin-top: 0;
        margin-bottom: 0;
        border-width: 0;
    }
}

@media (max-width: 600px) {
    .ihowz-upsell-checkout-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .ihowz-upsell-or {
        text-align: center;
    }
}
