/**
 * Qualiphy Public Styles
 *
 * Minimal styles that work with WooCommerce default styling.
 * Most styling is inherited from the theme's WooCommerce styles.
 *
 * @package Qualiphy
 * @since 1.0.0
 */

/* ==========================================================================
   Add to Cart Notices (Classic Theme)
   ========================================================================== */

/**
 * Product loop notices for classic themes
 */
.qualiphy-loop-notice {
    display: block;
    font-size: 12px;
    margin-top: 5px;
    line-height: 1.4;
}

/* ==========================================================================
   Add to Cart State (Shared: Block + Classic Themes)
   ========================================================================== */

/**
 * State-based visibility for product buttons.
 * PHP sets data-qualiphy-state, JS updates it on cart changes.
 * States: available, in-cart, rx-limit
 *
 * Works for both:
 * - Block themes: .wp-block-button__link
 * - Classic themes: .button (inside .qualiphy-classic-button)
 */

/* Hide all notices by default */
.qualiphy-product-button .qualiphy-notice {
    display: none;
    font-size: 14px;
    color: #d46262;
    font-weight: bold;
    max-width: 280px;
    margin: 0 auto;
}

/* State: available - show button, hide notices (works for both themes) */
.qualiphy-product-button[data-qualiphy-state="available"] .wp-block-button__link,
.qualiphy-product-button[data-qualiphy-state="available"] > .button,
.qualiphy-product-button[data-qualiphy-state="available"] > a[class*="add_to_cart"] {
    display: inline-block;
}

/* State: in-cart - hide button, show in-cart notice */
.qualiphy-product-button[data-qualiphy-state="in-cart"] .wp-block-button__link,
.qualiphy-product-button[data-qualiphy-state="in-cart"] > .button,
.qualiphy-product-button[data-qualiphy-state="in-cart"] > a[class*="add_to_cart"] {
    display: none !important;
}
.qualiphy-product-button[data-qualiphy-state="in-cart"] .qualiphy-notice--in-cart {
    display: block;
}

/* State: rx-limit - hide button, show rx-limit notice */
.qualiphy-product-button[data-qualiphy-state="rx-limit"] .wp-block-button__link,
.qualiphy-product-button[data-qualiphy-state="rx-limit"] > .button,
.qualiphy-product-button[data-qualiphy-state="rx-limit"] > a[class*="add_to_cart"] {
    display: none !important;
}
.qualiphy-product-button[data-qualiphy-state="rx-limit"] .qualiphy-notice--rx-limit {
    display: block;
}

/* Hide WooCommerce default "View cart" button for Qualiphy products */
.qualiphy-product-button .added_to_cart,
.qualiphy-product-button [data-wp-bind--hidden] {
    display: none !important;
}

/* View cart link within notices */
.qualiphy-notice .qualiphy-view-cart-link {
    display: inline;
    margin-left: 0.25em;
    text-decoration: underline !important;
    font-size: inherit;
    color:inherit;
    font-weight: inherit;
    font-family: inherit;
}

/* Disabled state */
.qualiphy-disabled .qualiphy-notice--disabled {
    display: block;
    color: #666;
}

/* ==========================================================================
   Classic Theme Button Wrapper
   ========================================================================== */

/**
 * Wrapper for classic theme Qualiphy product buttons.
 * Provides consistent display context for state-based visibility.
 */
.qualiphy-classic-button {
    display: inline-block;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

/**
 * Hidden utility class - use instead of inline display:none
 * More theme-friendly and easier to override
 */
.qualiphy-hidden {
    display: none !important;
}

/* ==========================================================================
   Cart Item Exam Message
   ========================================================================== */

/**
 * Exam information in cart
 */
.woocommerce-cart .cart_item .product-name dl.variation dt {
    font-weight: 600;
}

.woocommerce-cart .cart_item .product-name dl.variation dd {
    margin-bottom: 0.5em;
}

/* ==========================================================================
   Exam Refund Message
   ========================================================================== */

/**
 * Refund policy message on cart and checkout pages
 */
.qualiphy-exam-refund-message {
    margin-top: 15px;
    font-size: small;
}

.qualiphy-exam-refund-message p {
    margin: 0;
}

.qualiphy-limit-notice {
    color:#d46262;
    font-weight:bold;
}

.wc-block-components-product-details__qualiphy-rx-exam .wc-block-components-product-details__name{
    display:none;
}
.wc-block-components-product-details__qualiphy-rx-exam .wc-block-components-product-details__value{
    color:#d46262;
    font-weight:bold;
}

.wc-block-components-product-details__qualiphy-non-rx-exam .wc-block-components-product-details__name{
    display:none;
}
.wc-block-components-product-details__qualiphy-non-rx-exam .wc-block-components-product-details__value{
    color:#d46262;
    font-weight:bold;
}

/* Single product page notices - display the notice (overrides hidden default) */
.qualiphy-single-notice .qualiphy-notice {
    display: block;
}

/* ==========================================================================
   Qualiphy Branding
   ========================================================================== */

/**
 * "Powered by Qualiphy" branding under add to cart buttons.
 * Uses IDs for unique identification per product.
 */
.qualiphy-branding {
    display: block;
    width: 100%;
    clear: both;
    font-size: 12px;
    color: #666;
    padding-top: 5px;
    margin-bottom: 0;
}

.qualiphy-branding a {
    color: #3d2b64;
    text-decoration: none;
    font-weight: bold;
    letter-spacing: -0.3px;
}

.qualiphy-branding a:hover {
    text-decoration: underline;
}

/**
 * Screen-reader only class for hidden branding (SEO-friendly).
 * Content remains in DOM for search engine crawling but is
 * visually hidden from users.
 */
.qualiphy-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   Exam Launch (Thank-You Page)
   ========================================================================== */

/**
 * Exam launch section displayed on the order-received page
 * after a Qualiphy exam invite is sent.
 */
.qualiphy-exam-launch {
    margin-bottom: 24px;
    padding: 20px 24px;
    background: #f0f0f1;
    border-left: 4px solid #3d2b64;
    border-radius: 4px;
}

.qualiphy-exam-launch__title {
    margin: 0 0 12px;
    font-size: 1.25em;
    line-height: 1.3;
}

.qualiphy-exam-launch__content {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.qualiphy-exam-launch__info {
    flex: 1 1 0%;
    min-width: 200px;
}

.qualiphy-exam-launch__description {
    margin: 0 0 8px;
    line-height: 1.5;
}

.qualiphy-exam-launch__countdown {
    margin: 0;
    font-size: 14px;
    color: #555;
}

.qualiphy-exam-launch__action {
    flex-shrink: 0;
}

.qualiphy-exam-launch__message {
    margin: 0;
    line-height: 1.5;
}