/**
 * WooCommerce Blocks Integration CSS
 * 
 * Intervall-Anzeige für WooCommerce Blocks basierend auf offizieller Dokumentation
 */

/* Intervall-Anzeige für WooCommerce Blocks */
.wc-block-components-totals-item__value .fivered-interval,
.wc-block-components-totals-footer-item__value .fivered-interval,
.wc-block-cart__totals-price .fivered-interval,
.wc-block-checkout__totals-price .fivered-interval {
    font-size: 0.675em;
    font-weight: normal;
    color: #666;
    margin-left: 4px;
    display: inline-block;
    line-height: 1.15;
}

/* Spezifische Anpassungen für verschiedene Block-Typen */
.wc-block-components-totals-item__value .amount {
    position: relative;
}

.wc-block-components-totals-item__value .amount::after {
    content: attr(data-interval);
    font-size: 0.675em;
    font-weight: normal;
    color: #666;
    margin-left: 4px;
    display: inline-block;
}

/* Intervall-Anzeige für normalen WooCommerce Checkout */
.woocommerce-checkout .fivered-interval,
.woocommerce-cart .fivered-interval,
.woocommerce .fivered-interval {
    font-size: 0.675em;
    font-weight: normal;
    color: #666;
    margin-left: 4px;
    display: inline-block;
    line-height: 1.15;
}

/* Normale WooCommerce Preise - Nur wenn kein JavaScript-Intervall vorhanden */
.woocommerce .amount:not([data-js-interval="true"])::after {
    content: attr(data-interval);
    font-size: 0.675em;
    font-weight: normal;
    color: #666;
    margin-left: 4px;
    display: inline-block;
}

/* Hinweistext für Abonnement-Produkte */
.fivered-subscription-notice {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    margin-top: 1vw;
    margin-left: 16px;
    margin-right: 16px;
    margin-bottom: 6px;
    /*background-color: #fff3cd;*/
    border: 1px solid #cc6600;
    border-radius: 6px;
    color: #cc6600;
    font-size: 0.675em;
    line-height: 1.15;
    max-width: 100%;
    box-sizing: border-box;
}

/* Spezifische Positionierung wenn unter Gesamtsumme */
.wc-block-components-totals-wrapper .fivered-subscription-notice,
.wc-block-checkout .fivered-subscription-notice {
    margin-top: 20px;
    margin-bottom: 8px;
}

/* Integration in normalen WooCommerce Checkout - Gleiches Design wie Blocks */
.woocommerce:not(.wc-block-checkout):not(.wc-block-cart) .fivered-subscription-notice,
.woocommerce:not(.wc-block-checkout):not(.wc-block-cart) .fivered-subscription-notice {
    margin-top: 1vw;
    margin-left: 16px;
    margin-right: 16px;
    margin-bottom: 6px;
    clear: both;
}

.woocommerce:not(.wc-block-checkout):not(.wc-block-cart) .fivered-checkout-notice,
.woocommerce:not(.wc-block-checkout):not(.wc-block-cart) .fivered-cart-notice {
    margin-top: 1vw;
    margin-left: 16px;
    margin-right: 16px;
    margin-bottom: 6px;
    border-top: 1px solid #cc6600;
    border-radius: 8 8 8px 8px;
}

/* Position unterhalb der Gesamtsumme im normalen Checkout */
.woocommerce-checkout-review-order:not(.wc-block-checkout) .fivered-subscription-notice {
    margin-top: 1vw;
    margin-left: 16px;
    margin-right: 16px;
    margin-bottom: 6px;
    border-top: 1px solid #cc6600;
    border-radius: 8 8 8px 8px;
}

/* Wenn am Ende des Checkout-Blocks */
.wc-block-checkout > .fivered-subscription-notice:last-child {
    margin-top: 20px;
    margin-bottom: 20px;
}

.fivered-subscription-notice__icon {
    margin-right: 12px;
    flex-shrink: 0;
}

.fivered-subscription-notice__icon img {
    width: 18px;
    height: 18px;
}

.fivered-subscription-notice__text {
    margin: 0;
    flex: 1;
}

/* Dark Theme Support */
@media (prefers-color-scheme: dark) {
    .wc-block-components-totals-item__value .fivered-interval,
    .wc-block-components-totals-footer-item__value .fivered-interval,
    .wc-block-cart__totals-price .fivered-interval,
    .wc-block-checkout__totals-price .fivered-interval,
    .wc-block-components-totals-item__value .amount::after {
        color: #cc6600;
    }
    
    .fivered-subscription-notice {
        /*background-color: #2c3e50;*/
        border-color: #cc6600;
        color: #cc6600;
    }
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    .wc-block-components-totals-item__value .fivered-interval,
    .wc-block-components-totals-footer-item__value .fivered-interval,
    .wc-block-cart__totals-price .fivered-interval,
    .wc-block-checkout__totals-price .fivered-interval,
    .wc-block-components-totals-item__value .amount::after {
        font-size: 0.75em;
        margin-left: 2px;
    }
    
    .fivered-subscription-notice {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .fivered-subscription-notice__icon {
        margin-right: 10px;
    }
    
    .fivered-subscription-notice__icon img {
        width: 20px;
        height: 20px;
    }
}

/* Fallback für ältere Browser */
.wc-block-formatted-money-amount .fivered-interval {
    font-size: 0.8em;
    font-weight: normal;
    color: var(--wp--preset--color--body);
    margin-left: 4px;
    display: inline-block;
}

/* Animation für smoothe Übergänge */
.wc-block-components-totals-item__value .amount::after {
    transition: all 0.3s ease;
}

/* Hover-Effekte */
.wc-block-components-totals-item:hover .amount::after {
    color: #333;
}

@media (prefers-color-scheme: dark) {
    .wc-block-components-totals-item:hover .amount::after {
        color: #fff;
    }
}
