/* CRAZY MASTER Ultimate Shop Designer */
body.cmusd-enabled.woocommerce .site-main,body.cmusd-enabled.woocommerce-page .site-main{padding-top:var(--cmusd-shop-top,28px);padding-bottom:var(--cmusd-shop-bottom,48px)}
body.cmusd-enabled.woocommerce ul.products,body.cmusd-enabled.woocommerce-page ul.products{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));gap:var(--cmusd-card-gap,22px)!important;margin:0!important;padding:0!important;align-items:stretch}
body.cmusd-enabled.woocommerce ul.products:before,body.cmusd-enabled.woocommerce ul.products:after{display:none!important}
body.cmusd-enabled.woocommerce ul.products li.product,body.cmusd-enabled.woocommerce-page ul.products li.product{float:none!important;width:auto!important;margin:0!important;min-width:0;background:var(--cmusd-card-bg);border:1px solid var(--cmusd-card-border);border-radius:var(--cmusd-card-radius);padding:14px;overflow:hidden;display:flex;flex-direction:column;box-sizing:border-box;transition:transform .25s ease,box-shadow .25s ease,border-color .25s ease}
body.cmusd-enabled.cmusd-card-modern ul.products li.product{box-shadow:0 5px 22px rgba(15,23,42,.06)}
body.cmusd-enabled.cmusd-card-flat ul.products li.product{box-shadow:none;border-color:transparent}
body.cmusd-enabled.cmusd-card-minimal ul.products li.product{box-shadow:none;border-color:transparent;padding:8px}
body.cmusd-enabled.cmusd-card-bordered ul.products li.product{box-shadow:none;border-width:1px}
body.cmusd-enabled.cmusd-card-modern ul.products li.product:hover,body.cmusd-enabled.cmusd-card-bordered ul.products li.product:hover{border-color:var(--cmusd-accent)}
body.cmusd-enabled.cmusd-card-modern ul.products li.product:hover,body.cmusd-enabled.cmusd-card-minimal ul.products li.product:hover,body.cmusd-enabled.cmusd-card-bordered ul.products li.product:hover{transform:translateY(-4px);box-shadow:0 12px 30px rgba(15,23,42,.11)}
body.cmusd-enabled ul.products li.product a img{width:100%;aspect-ratio:var(--cmusd-image-ratio,1/1);object-fit:var(--cmusd-image-fit,contain);background:var(--cmusd-image-bg);border-radius:var(--cmusd-image-radius);margin:0 0 14px;display:block}
body.cmusd-enabled ul.products li.product .woocommerce-loop-product__title{color:var(--cmusd-title-color);font-size:var(--cmusd-title-size);font-weight:var(--cmusd-title-weight);line-height:1.4;padding:0;margin:0 0 8px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
body.cmusd-enabled ul.products li.product .price{color:var(--cmusd-price-color);font-size:var(--cmusd-price-size);font-weight:700;margin:0 0 12px}
body.cmusd-enabled ul.products li.product .price del{opacity:.55;font-size:.85em}body.cmusd-enabled ul.products li.product .price ins{text-decoration:none}
body.cmusd-enabled ul.products li.product .button,body.cmusd-enabled .single_add_to_cart_button{background:var(--cmusd-button-bg)!important;color:var(--cmusd-button-text)!important;border:1px solid var(--cmusd-button-bg)!important;border-radius:var(--cmusd-button-radius)!important;padding:11px 16px!important;font-weight:700!important;text-align:center;line-height:1.3;transition:all .2s ease}
body.cmusd-enabled ul.products li.product .button{margin-top:auto!important;width:100%;}
body.cmusd-enabled ul.products li.product .button:hover,body.cmusd-enabled .single_add_to_cart_button:hover{filter:brightness(.92);transform:translateY(-1px)}
body.cmusd-enabled ul.products li.product .onsale{background:var(--cmusd-accent);color:#fff;border-radius:30px;min-height:0;min-width:0;padding:6px 11px;line-height:1.2;font-size:11px;font-weight:800;top:10px;left:10px;right:auto;margin:0}
body.cmusd-enabled .woocommerce-products-header{margin-bottom:22px}body.cmusd-enabled .woocommerce-products-header__title{font-weight:800;letter-spacing:-.03em}
body.cmusd-enabled.single-product div.product div.images img{border-radius:var(--cmusd-gallery-radius,16px)}
body.cmusd-enabled.single-product div.product .product_title{font-size:clamp(24px,3vw,30px);font-weight:800;line-height:1.2}
body.cmusd-enabled.single-product .related ul.products{grid-template-columns:repeat(var(--cmusd-related-columns,4),minmax(0,1fr))!important}
body.cmusd-enabled .cm-product-card{background:var(--cmusd-card-bg);border:1px solid var(--cmusd-card-border);border-radius:var(--cmusd-card-radius);padding:14px;overflow:hidden;transition:transform .25s ease,box-shadow .25s ease}
body.cmusd-enabled .cm-product-card:hover{transform:translateY(-4px);box-shadow:0 12px 30px rgba(15,23,42,.1)}
body.cmusd-enabled .cm-product-thumb-wrap{background:var(--cmusd-image-bg);border-radius:var(--cmusd-image-radius);overflow:hidden;aspect-ratio:var(--cmusd-image-ratio,1/1)}
body.cmusd-enabled .cm-product-thumb-wrap img{width:100%;height:100%;object-fit:var(--cmusd-image-fit,contain)}
body.cmusd-enabled .cm-product-title{font-size:var(--cmusd-title-size);font-weight:var(--cmusd-title-weight);color:var(--cmusd-title-color);line-height:1.4}
@media(max-width:767px){body.cmusd-enabled.woocommerce ul.products,body.cmusd-enabled.woocommerce-page ul.products{gap:14px!important}body.cmusd-enabled.woocommerce ul.products li.product{padding:10px}body.cmusd-enabled ul.products li.product .woocommerce-loop-product__title{font-size:14px}body.cmusd-enabled.single-product div.product{display:block}}

/* Infinite scroll loader: shown only during an active product request. */
.cmusd-infinite-spinner{display:inline-block;width:18px;height:18px;border:2px solid rgba(220,38,38,.22);border-top-color:#dc2626;border-radius:50%;animation:cmusd-spin .7s linear infinite;flex:0 0 18px}
@keyframes cmusd-spin{to{transform:rotate(360deg)}}

/* Responsive AdSense banner inserted after every 16 shop products. */
body.cmusd-enabled ul.products li.cmusd-adsense-item {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 8px 0 20px !important;
    padding: 0 !important;
    list-style: none !important;
    float: none !important;
    clear: both !important;
    box-sizing: border-box !important;
}
body.cmusd-enabled .cmusd-adsense-banner { width: 100%; min-height: 90px; margin-left: auto !important; margin-right: auto !important; text-align: center !important; overflow: hidden; }
body.cmusd-enabled .cmusd-ad-label { display: block; margin-bottom: 4px; color: #777; font-size: 10px; line-height: 1.3; text-align: center; }
body.cmusd-enabled .cmusd-adsense-banner ins.adsbygoogle { display: block !important; width: 100%; max-width: 100%; min-height: 60px; margin-left: auto !important; margin-right: auto !important; text-align: center !important; }

/* Modern AdSense banner in the single-product sidebar */
.cmusd-product-sidebar-ad{box-sizing:border-box;width:100%;max-width:100%;margin:24px auto!important;padding:14px;border:1px solid #e5e7eb;border-radius:18px;background:linear-gradient(145deg,#fff 0%,#f8fafc 100%);box-shadow:0 10px 28px rgba(15,23,42,.08);overflow:hidden;font-family:inherit;text-align:center!important}
.cmusd-sidebar-ad-head{display:flex;align-items:center;justify-content:center!important;gap:8px;margin:0 0 12px;color:#64748b;font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;text-align:center!important}
.cmusd-sidebar-ad-mark{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:8px;background:#111827;color:#fff;font-size:10px;letter-spacing:0}
.cmusd-sidebar-ad-inner{min-height:100px;overflow:hidden;border:1px solid #eef2f7;border-radius:12px;background:#fff;padding:8px;text-align:center!important;margin-left:auto!important;margin-right:auto!important}
.cmusd-sidebar-ad-label{display:block;margin:0 0 6px;color:#94a3b8;font-size:10px;text-align:center}
.cmusd-product-sidebar-ad ins.adsbygoogle{display:block!important;width:100%;min-width:0;max-width:100%;overflow:hidden;margin-left:auto!important;margin-right:auto!important;text-align:center!important}


/* When enabled for this product, reserve a real third column for the ad even if the theme has no widget sidebar. */
@media(min-width:1100px){
 body.cmusd-has-product-sidebar-ad.single-product div.product{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(240px,300px);column-gap:24px;row-gap:28px;align-items:start}
 body.cmusd-has-product-sidebar-ad.single-product div.product div.images{grid-column:1;grid-row:1;float:none!important;width:100%!important;margin:0!important}
 body.cmusd-has-product-sidebar-ad.single-product div.product div.summary{grid-column:2;grid-row:1;float:none!important;width:100%!important;margin:0!important}
 body.cmusd-has-product-sidebar-ad.single-product div.product .cmusd-product-sidebar-ad{grid-column:3;grid-row:1;align-self:start;position:sticky;top:24px}
 body.cmusd-has-product-sidebar-ad.single-product div.product .related,body.cmusd-has-product-sidebar-ad.single-product div.product .upsells,body.cmusd-has-product-sidebar-ad.single-product div.product .woocommerce-tabs{grid-column:1/-1}
}
@media(max-width:1099px){body.cmusd-has-product-sidebar-ad.single-product div.product .cmusd-product-sidebar-ad{width:100%;max-width:100%;margin:24px 0;position:static}}
.cmusd-product-sidebar-ad .adsbygoogle{display:block;max-width:100%;min-width:0}
.cmusd-product-sidebar-ad iframe{max-width:100%}


/* Mobile: show the product-specific AdSense banner immediately above the site footer.
   Keep the ad in normal document flow (not a floating overlay) and use a thin black border. */
@media(max-width:767px){
 body.cmusd-has-product-sidebar-ad.single-product .cmusd-product-sidebar-ad,
 .cmusd-product-sidebar-ad.cmusd-mobile-footer-ad{
   display:block!important;box-sizing:border-box!important;width:calc(100% - 20px)!important;max-width:100%!important;
   margin:20px 10px 0!important;padding:8px!important;border:1px solid #000!important;border-radius:8px!important;
   background:#fff!important;box-shadow:none!important;position:static!important;float:none!important;
 }
 .cmusd-product-sidebar-ad.cmusd-mobile-footer-ad .cmusd-sidebar-ad-inner{border:0!important;border-radius:0!important;padding:4px!important;background:#fff!important}
 .cmusd-product-sidebar-ad.cmusd-mobile-footer-ad .cmusd-sidebar-ad-head{margin-bottom:6px!important}
 .cmusd-product-sidebar-ad.cmusd-mobile-footer-ad .cmusd-sidebar-ad-mark{border-radius:4px!important}
 .cmusd-product-sidebar-ad.cmusd-mobile-footer-ad ins.adsbygoogle{max-width:100%!important;min-width:0!important}
}


/* Responsive product-page ad placement */
body.cmusd-enabled.single-product .cmusd-product-sidebar-ad.cmusd-desktop-title-ad,
body.cmusd-enabled.single-product .cmusd-product-sidebar-ad.cmusd-mobile-footer-ad {
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    margin: 24px auto;
    clear: both;
}
@media (min-width: 768px) {
    body.cmusd-enabled.single-product .cmusd-product-sidebar-ad.cmusd-desktop-title-ad {
        grid-column: 1 / -1;
    }
}
@media (max-width: 767px) {
    body.cmusd-enabled.single-product .cmusd-product-sidebar-ad.cmusd-mobile-footer-ad {
        margin: 20px auto;
    }
}


/* Two desktop product ad placements: below title and above footer */
body.cmusd-enabled.single-product .cmusd-product-sidebar-ad.cmusd-desktop-title-ad,
body.cmusd-enabled.single-product .cmusd-product-sidebar-ad.cmusd-desktop-footer-ad,
body.cmusd-enabled.single-product .cmusd-product-sidebar-ad.cmusd-mobile-footer-ad {
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    margin: 24px auto;
    clear: both;
}
@media (min-width: 768px) {
    body.cmusd-enabled.single-product .cmusd-product-ad-title,
    body.cmusd-enabled.single-product .cmusd-product-ad-footer {
        grid-column: 1 / -1;
    }
}
@media (max-width: 767px) {
    body.cmusd-enabled.single-product .cmusd-product-ad-title { display: none !important; }
    body.cmusd-enabled.single-product .cmusd-product-ad-footer { margin: 20px auto; }
}


/* Keep every ad placement horizontally centered on desktop and mobile. */
body.cmusd-enabled .cmusd-product-sidebar-ad,
body.cmusd-enabled .cmusd-product-sidebar-ad .cmusd-sidebar-ad-inner,
body.cmusd-enabled .cmusd-adsense-banner {
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
}
body.cmusd-enabled .cmusd-product-sidebar-ad ins.adsbygoogle,
body.cmusd-enabled .cmusd-adsense-banner ins.adsbygoogle {
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
}
body.cmusd-enabled .cmusd-product-sidebar-ad iframe,
body.cmusd-enabled .cmusd-adsense-banner iframe {
    margin-left: auto !important;
    margin-right: auto !important;
}
body.cmusd-enabled .cmusd-product-sidebar-ad .cmusd-sidebar-ad-head {
    justify-content: center !important;
}


/* ---------------------------------------------------------------------------
   Google Ads placements — full width, centred, overflow safe.
   The container fills the content area; the creative itself is never stretched.
   --------------------------------------------------------------------------- */
.cmusd-ad-slot {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: var(--cmusd-ad-space, 24px) auto;
    padding: 0;
    text-align: center;
    clear: both;
    box-sizing: border-box;
    overflow: hidden;
}

.cmusd-ad-slot__inner {
    display: block;
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    box-sizing: border-box;
}

.cmusd-ad-slot__label {
    display: block;
    margin: 0 0 6px;
    font-size: 10px;
    line-height: 1.3;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
    text-align: center;
}

.cmusd-ad-slot__code {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    text-align: center;
    overflow: hidden;
}

.cmusd-ad-slot__code > * {
    max-width: 100%;
}

.cmusd-ad-slot__code ins.adsbygoogle {
    display: block !important;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
}

.cmusd-ad-slot__code iframe,
.cmusd-ad-slot__code img,
.cmusd-ad-slot__code video {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

/* Keep ad slots out of the legacy three-column product grid. */
body.cmusd-has-product-sidebar-ad.single-product div.product > .cmusd-ad-slot,
body.cmusd-has-product-sidebar-ad.single-product div.product .cmusd-ad-slot {
    grid-column: 1 / -1;
}

@media (max-width: 767px) {
    .cmusd-ad-slot {
        margin-top: 18px;
        margin-bottom: 18px;
    }
}

/* ---------------------------------------------------------------------------
   Product media action buttons — rendered directly below the product image.
   --------------------------------------------------------------------------- */
.cmusd-product-media-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    margin: 14px 0 0;
    clear: both;
    box-sizing: border-box;
}

.cmusd-watch-youtube {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    flex: 1 1 220px;
    max-width: 100%;
    padding: 12px 20px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #ff0033 0%, #cc0000 100%);
    color: #fff !important;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.01em;
    text-align: center;
    text-decoration: none !important;
    box-shadow: 0 6px 18px rgba(204, 0, 0, 0.28);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.cmusd-watch-youtube:hover,
.cmusd-watch-youtube:focus-visible {
    color: #fff !important;
    transform: translateY(-1px);
    filter: brightness(1.06);
    box-shadow: 0 10px 24px rgba(204, 0, 0, 0.36);
    outline: none;
}

.cmusd-watch-youtube__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.cmusd-watch-youtube__label {
    white-space: nowrap;
}

.cmusd-video-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1 1 180px;
    max-width: 100%;
    margin: 0;
    padding: 11px 16px;
    border: 1px solid var(--cmusd-button-bg, #dc2626);
    border-radius: var(--cmusd-button-radius, 10px);
    background: transparent;
    color: var(--cmusd-button-bg, #dc2626);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
}

.cmusd-video-trigger:hover,
.cmusd-video-trigger:focus {
    background: var(--cmusd-button-bg, #dc2626);
    color: #fff;
    outline: none;
}

.cmusd-video-trigger__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 767px) {
    .cmusd-product-media-actions {
        gap: 8px;
        margin-top: 12px;
    }

    .cmusd-watch-youtube,
    .cmusd-video-trigger {
        flex: 1 1 100%;
        width: 100%;
        padding: 12px 14px;
        font-size: 13px;
    }
}

/* ---------------------------------------------------------------------------
   Desktop – Below Product Title Advertisement.
   --------------------------------------------------------------------------- */
.cmusd-title-ad {
    display: block;
    width: 100%;
    max-width: 100%;
    clear: both;
    box-sizing: border-box;
    overflow: hidden;
}

.cmusd-title-ad--full {
    width: 100%;
    max-width: 100%;
}

.cmusd-title-ad--center {
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center;
}

.cmusd-title-ad--center .cmusd-ad-slot__inner,
.cmusd-title-ad--center .cmusd-ad-slot__code {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.cmusd-title-ad--responsive .cmusd-ad-slot__code > *,
.cmusd-title-ad--responsive .cmusd-ad-slot__code iframe,
.cmusd-title-ad--responsive .cmusd-ad-slot__code img {
    max-width: 100%;
}

.cmusd-title-ad .cmusd-ad-slot__inner {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Keep the placement inside the product summary column, never over the gallery. */
.single-product div.product .summary > .cmusd-title-ad {
    float: none;
    clear: both;
}

/* ---------------------------------------------------------------------------
   Device visibility helpers shared by the title-below placement.
   --------------------------------------------------------------------------- */
@media (min-width: 1025px) {
    .cmusd-hide-desktop {
        display: none !important;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .cmusd-hide-tablet {
        display: none !important;
    }
}

@media (max-width: 767px) {
    .cmusd-hide-mobile {
        display: none !important;
    }
}

/* ---------------------------------------------------------------------------
   Placement 2 — Above Website Footer Advertisement.
   Full width, centred and overflow safe on every device.
   --------------------------------------------------------------------------- */
.cmusd-footer-ad {
    display: block;
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 16px;
    padding-right: 16px;
    box-sizing: border-box;
    clear: both;
    text-align: center;
    overflow: hidden;
}

.cmusd-footer-ad--full {
    width: 100%;
    max-width: 100%;
}

.cmusd-footer-ad--center {
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center;
}

.cmusd-footer-ad .cmusd-ad-slot__inner,
.cmusd-footer-ad .cmusd-ad-slot__code {
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    box-sizing: border-box;
}

.cmusd-footer-ad .cmusd-ad-slot__code > *,
.cmusd-footer-ad .cmusd-ad-slot__code iframe,
.cmusd-footer-ad .cmusd-ad-slot__code img,
.cmusd-footer-ad .cmusd-ad-slot__code ins.adsbygoogle {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 767px) {
    .cmusd-footer-ad {
        padding-left: 12px;
        padding-right: 12px;
    }
}
