/* Clever Public Styles */

/* --- Strikethrough (original price) — increase line thickness for visibility --- */
.woocommerce ul.products li.product .price del,
.woocommerce ul.products li.product .price del span,
.woocommerce div.product p.price del,
.woocommerce div.product span.price del,
del.woocommerce-Price-amount {
    text-decoration-line: line-through;
    text-decoration-thickness: 2px;
}

/* --- Access prompt --- */
.clever-teaser {
    color: #555;
    margin-bottom: 20px;
}

.clever-access-prompt {
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-left: 4px solid #7f54b3;
    border-radius: 4px;
    padding: 24px;
    margin: 20px 0;
}

.clever-prompt-message {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #333;
}

.clever-available-plans {
    margin: 16px 0;
}

.clever-plan-option {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.clever-buy-once {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

/* --- Status badge --- */
.clever-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.clever-status-active    { background: #d4edda; color: #155724; }
.clever-status-cancelled { background: #f8d7da; color: #721c24; }
.clever-status-suspended { background: #fff3cd; color: #856404; }

/* --- My subscriptions table --- */
.clever-my-subscriptions .woocommerce-orders-table {
    width: 100%;
}

/* --- Divi: Add To Cart module — zero out all default spacing --- */
.et_pb_module.clever_add_to_cart,
.et_pb_module.clever_add_to_cart .clever-add-to-cart,
.et_pb_module.clever_add_to_cart .clever-already-purchased,
.et_pb_module.clever_add_to_cart .clever-already-purchased p,
.et_pb_module.clever_add_to_cart .cart,
.et_pb_module.clever_add_to_cart form.cart {
    margin: 0 !important;
    padding: 0 !important;
}

.et_pb_module.clever_add_to_cart .clever-in-cart,
.et_pb_module.clever_add_to_cart .clever-in-cart p {
    margin: 0;
    padding: 0;
}

/* Allow the form and button to shrink to natural width so flexbox
   justify-content can position them within the wrapper. */
.et_pb_module.clever_add_to_cart .clever-add-to-cart form.cart,
.et_pb_module.clever_add_to_cart .clever-add-to-cart form.cart button,
.et_pb_module.clever_add_to_cart .clever-add-to-cart form.cart .single_add_to_cart_button {
    width: auto !important;
}

/* --- Divi: Gated content --- */
.clever-gated-content.clever-locked {
    background: #f8f8f8;
    border: 1px dashed #ccc;
    border-radius: 4px;
    padding: 20px;
    text-align: center;
}

.clever-locked-message {
    color: #666;
    font-style: italic;
}

/* --- Lock icon in title --- */
.clever-locked {
    font-size: 0.75em;
    opacity: 0.7;
}

/* --- Back to orders button on single order view --- */
.clever-back-to-orders {
    margin-top: 20px;
}

/* --- Clever Video List module --- */
.clever-video-player {
    display: flex;
    align-items: flex-start;
}

/* Left panel — playlist */
.clever-playlist {
    flex: 0 0 220px;
    width: 220px;
    min-width: 0;
    overflow-y: scroll;
    /* max-height set by JS to match video height */
}

/* Always-visible scrollbar styling */
.clever-playlist::-webkit-scrollbar {
    width: 6px;
}
.clever-playlist::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.08);
    border-radius: 3px;
}
.clever-playlist::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.3);
    border-radius: 3px;
}
.clever-playlist::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.5);
}

.clever-playlist-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.clever-playlist-item {
    padding: 10px 8px;
    padding-left: 6px !important; /* 2px gap after the left bar (bar itself is border-left) */
    margin: 0 6px 0 0 !important; /* 6px right margin keeps separator clear of the scrollbar */
    cursor: pointer;
    border-left: 3px solid transparent;
    border-bottom: 0px solid transparent; /* width/colour overridden by Divi on desktop */
    font-size: 0.95em;
    line-height: 1.4;
    transition: background 0.15s, border-color 0.15s;
}

.clever-playlist-item:hover {
    background: rgba(0,0,0,0.05);
}

.clever-playlist-item--active {
    border-left-color: #2ea3f2; /* fallback — overridden by Divi Design tab colour */
    font-weight: 600;
}

/* Right panel — video stage.
   Spacing between playlist and stage is controlled by the Divi "Video Spacing"
   attribute which sets gap on .clever-video-player. */
.clever-video-stage {
    flex: 1 1 0;
    min-width: 0;
    position: relative;
}

/* Next / Previous nav buttons.
   The nav is a sibling of .clever-video-player (outside it), so it sits
   full-width below. We push it right by the playlist width + gap so it
   lines up only under the video stage. */
.clever-video-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0 0;
    margin-left: 220px; /* playlist width; gap controlled by Divi Video Spacing attribute */
}

.clever-video-nav__btn {
    cursor: pointer;
    border: 1px solid #ccc;
    background: #f5f5f5;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    transition: background 0.15s;
}

.clever-video-nav__btn:hover:not(:disabled) {
    background: #e0e0e0;
}

.clever-video-nav__btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* 16:9 responsive iframe wrapper */
.clever-video-embed {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: calc(100vw * 0.45); /* cap height ~100px shorter than unconstrained 16/9 */
    overflow: hidden;
}

.clever-video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Suppress playlist separator on tablet and mobile */
@media ( max-width: 980px ) {
    .clever-playlist-item:not(:last-child) {
        border-bottom-width: 0 !important;
    }
}

/* Mobile: stack vertically */
@media ( max-width: 767px ) {
    .clever-video-player {
        flex-direction: column;
    }
    .clever-video-stage {
        order: 1;
        width: 100%;
    }
    .clever-playlist {
        order: 2;
        flex: none;
        width: 100%;
        max-height: 160px;
        overflow-y: auto;
    }
    .clever-below-player__spacer {
        width: 0 !important;
    }
    .clever-video-nav {
        margin-left: 0;
    }
    .clever-playlist-list {
        display: block;
    }
    .clever-playlist-item {
        display: block;
        width: 100%;
        border-left: 3px solid transparent;
        border-bottom: none;
        padding: 10px 12px;
        box-sizing: border-box;
    }
    .clever-playlist-item--active {
        border-left-color: currentColor;
    }
}

/* Have-access message shown below the Add to Cart button (Case 3: access via different plan) */
.clever-have-access-message {
    margin: 10px 0 0;
    font-size: 13px;
    line-height: 1.6;
    color: #555;
}

/* Complimentary access sub-label shown below product name for manually granted rows */
.clever-manual-grant-label {
    display: block;
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}

/* ==========================================================================
   Favourite heart button
   Used on Track List cards (image overlay), Course List cards (image overlay),
   and the Track Player bottom row.
   ========================================================================== */

/* Base button — sits in the image overlay, top-right corner */
.clever-fav-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    padding: 0;
    background: rgba(0, 0, 0, 0.35);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto; /* override any overlay pointer-events:none */
    transition: background 0.15s ease, transform 0.15s ease;
    z-index: 10;
    flex-shrink: 0;
}

.clever-fav-btn:hover {
    background: rgba(0, 0, 0, 0.55);
    transform: scale(1.1);
}

/* The SVG heart path */
.clever-fav-heart {
    width: 18px;
    height: 18px;
    display: block;
    fill: none;
    stroke: #fff;
    stroke-width: 2;
    transition: fill 0.15s ease, stroke 0.15s ease;
}

/* Filled (active) state */
.clever-fav-btn--active .clever-fav-heart {
    fill: #e03e52;
    stroke: #e03e52;
}

/* Track List card: the overlay already handles positioning context via
   .clever-tl-play-overlay (position:absolute;inset:0).
   The heart sits at top-right inside that overlay. */
.clever-tl-play-overlay .clever-fav-btn {
    position: absolute;
    top: 10px;
    right: 10px;
}

/* Course List card: .clever-cl-image-wrap is position:relative */
.clever-cl-image-wrap {
    position: relative;
}
.clever-cl-image-wrap .clever-fav-btn {
    position: absolute;
    top: 10px;
    right: 10px;
}

/* Track Player: heart overlays the video, absolutely positioned top-right
   inside .clever-tp-player-wrap (which is position:relative).
   The base .clever-fav-btn rules handle size, background and border.
   Only player-specific overrides needed here. */
.clever-tp-fav-btn {
    /* pointer-events already auto from base rule — no override needed */
}
.clever-tp-fav-btn:hover {
    transform: scale(1.1);
}

/* --- Mobile button layout: stacked, centred, 90% width, 10px gap --- */
@media (max-width: 767px) {
    .clever-cc-footer.is-two-btn,
    .clever-cl-footer.is-two-btn {
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 10px !important;
    }

    .clever-cc-btn-primary-wrap,
    .clever-cc-btn-secondary-wrap,
    .clever-cl-btn-primary-wrap,
    .clever-cl-btn-secondary-wrap {
        width: 90% !important;
        display: flex !important;
        justify-content: center !important;
    }

    body .clever-cc-btn-primary-wrap .et_pb_button,
    body .clever-cc-btn-secondary-wrap .et_pb_button,
    body .clever-cl-btn-primary-wrap .et_pb_button,
    body .clever-cl-btn-secondary-wrap .et_pb_button {
        width: 100% !important;
        text-align: center !important;
        box-sizing: border-box !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
}
