/**
 * CJ Network Ads - Frontend CSS
 */

/* Base ad container styling */
.cj-network-ad {
    /*margin: 20px 0;*/
    display: block;
    max-width: 100%;
    position: relative;
    overflow: hidden;
    text-align: center;
}

/* Image styling */
.cj-network-ad img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
}

/* Responsive styling */
.cj-network-ad.responsive img {
    width: 100%;
    height: auto;
}

/* Shortcode alignment classes */
.cj-network-ad-shortcode.alignleft {
    float: left;
    margin-right: 20px;
    margin-bottom: 20px;
}

.cj-network-ad-shortcode.alignright {
    float: right;
    margin-left: 20px;
    margin-bottom: 20px;
}

.cj-network-ad-shortcode.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

/* Placeholder styling */
.ad-placeholder {
    background-color: #f9f9f9;
    border: 1px solid #e5e5e5;
    color: #777;
    padding: 15px;
    text-align: center;
    font-size: 14px;
    line-height: 1.5;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Block styling */
.cj-network-ad-block {
    margin: 20px 0;
}

/* Clearfix for floated ads */
.cj-network-ad-shortcode:after {
    content: "";
    display: table;
    clear: both;
}

/* Error message styling (only shown to admins) */
.cj-network-ad-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    margin: 10px 0;
    border-radius: 4px;
    font-size: 14px;
}

.cj-network-ad-error code {
    background-color: #fff;
    padding: 2px 4px;
    border-radius: 3px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .cj-network-ad-shortcode.alignleft,
    .cj-network-ad-shortcode.alignright {
        float: none;
        margin-left: auto;
        margin-right: auto;
        text-align: center;
    }
}

/* Animation for lazy-loaded ads */
.cj-network-ad.lazy-load {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.cj-network-ad.lazy-load.loaded {
    opacity: 1;
}

/**
 * Temu-Style Ad Display
 */

/* Main ad container */
.cj-network-ad-with-text {
    max-width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Content container */
.cj-ad-content-wrapper {
    padding: 1px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Product card with white background */
.cj-ad-product-card {
    width: 100%;
}

/* Image container */
.cj-ad-image-container {
    width: 100%;
    padding: 10px;
    display: flex;
    justify-content: center;
    background-color: #fff;
}

.cj-ad-image-container img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Product info section */
.cj-ad-product-info {
    padding: 0 15px 15px;
    background-color: #fff;
}

/* Product title styling */
.cj-ad-product-title {
    font-size: 15px;
    line-height: 1.1;
    color: #333;
    font-weight: 500;
    margin: 1px 0;
    text-align: center;
}

/* Product features styling */
.cj-ad-product-features {
    font-size: 16px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 15px;
    text-align: center;
    display: none;
}

/* Price section */
.cj-ad-price-section {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 15px;
    margin-bottom: -20px;
    background-color: #ffffff;
    /*padding: 10px;*/
    border-radius: 8px;
}

.cj-ad-price {
    color: #057aa8;
    font-size: 24px;
    font-weight: bold;
}

.cj-ad-price-arrow {
    width: 80px;
    height: 60px;
}

/* Styling for disclaimers */
.cj-ad-disclaimer {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
    margin: 10px 0;
    text-align: center;
}

/* Item link styling */
.cj-ad-item-link {
    color: #0066CC;
    text-decoration: none;
    font-weight: 500;
}

.cj-ad-item-link:hover {
    text-decoration: underline;
}

/* Call to action button */
.cj-ad-cta-button {
    background-color: #4CAF50;
    color: white;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    text-align: center;
    display: block;
    margin: 0px auto 0;
    font-size: 16px;
    transition: background-color 0.2s ease;
    width: 80%;
    max-width: 250px;
}

.cj-ad-cta-button:hover {
    background-color: #3d8b40;
    color: white;
    text-decoration: none;
}

/* Emoji styling */
.cj-ad-emoji {
    font-size: 1.2em;
    vertical-align: middle;
}

/* Special offer badge */
.cj-ad-special-offer {
    background-color: #fff;
    border: 2px dashed #F5222D;
    color: #F5222D;
    font-weight: 700;
    font-size: 14px;
    padding: 5px 10px;
    border-radius: 20px;
    display: inline-block;
    margin: 0 auto 10px;
}

/* Free shipping badge */
.cj-ad-free-shipping {
    background-color: #E6F7E6;
    color: #4CAF50;
    font-weight: 500;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 4px;
    display: inline-block;
    margin-right: 10px;
}

/* Units sold badge */
.cj-ad-units-sold {
    font-size: 14px;
    color: #666;
    display: block;
    margin: 5px 0;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .cj-ad-product-title {
        font-size: 16px;
    }

    .cj-ad-price {
        font-size: 20px;
    }

    .cj-ad-cta-button {
        width: 100%;
    }
}

/* --- PROFESSIONAL STYLING OVERRIDES --- */

/* 3) Hide or shrink the .temu-logo */
.temu-logo {
    display: none !important; /* or put "width: 24px;" if you prefer a small box */
}

/* 5) Tweak the CTA button to be less "jarring" */
.cj-ad-cta-button {
    background-color: #0073aa !important; /* WP Admin blue */
    color: #fff !important;
    border: none;
    border-radius: 4px !important;
    padding: 10px 20px !important;
    font-size: 14px !important;
    display: inline-block;
    text-decoration: none !important;
    cursor: pointer;
    margin: 15px auto 0 !important;
    transition: background-color 0.2s ease;
}

.cj-ad-cta-button:hover {
    background-color: #005177 !important;
}

/* 6) Optional: remove or soften "Free shipping" badge, etc. */
.cj-ad-free-shipping {
    background-color: #e0f5e0 !important;
    color: #3c763d !important;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 12px;
    margin-right: 6px;
}
