/* coursefields — modal styles */
.cf-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.cf-modal-overlay[hidden] { display: none; }
body.cf-open { overflow: hidden; }

.cf-modal-dialog {
    background: #fff;
    border-radius: 6px;
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0,0,0,.25);
}

.cf-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .85rem 1.25rem;
    border-bottom: 1px solid #e5e5e5;
    flex-shrink: 0;
}
.cf-modal-header h4 { margin: 0; font-size: 1.05rem; font-weight: 600; }

.cf-close {
    background: none; border: none; font-size: 1.5rem;
    line-height: 1; cursor: pointer; color: #666; padding: 0 .25rem;
    outline: none !important; box-shadow: none !important;
}
.cf-close:hover, .cf-close:focus { color: #000; outline: none !important; box-shadow: none !important; }

.cf-modal-body {
    padding: 1rem 1.25rem;
    overflow-y: auto;
    flex: 1;
}

.cf-modal-footer {
    padding: .75rem 1.25rem;
    border-top: 1px solid #e5e5e5;
    display: none; /* User doesn't want footer close button */
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* Force show footer on product page if it has the add-to-cart button */
.cf-modal-overlay[data-context="product"] .cf-modal-footer {
    display: flex;
}

/* Tabs */
.cf-tabs {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    border-bottom: 2px solid #e5e5e5;
}
.cf-tab-btn {
    background: none;
    border: 1px solid #ddd;
    border-bottom: 2px solid transparent;
    border-radius: 4px 4px 0 0;
    padding: .35rem .8rem;
    cursor: pointer;
    font-size: .875rem;
    color: #555;
    margin-bottom: -2px;
}
.cf-tab-btn:hover { background: #f5f5f5; }
.cf-tab-btn.active { background: #fff; border-color: #ddd #ddd #fff; font-weight: 600; color: #222; }
.cf-tab-btn.cf-filled { color: #2e7d32; }
.cf-tick { margin-left: .3rem; color: #2e7d32; }

/* Panes */
.cf-pane { display: none; }
.cf-pane.active { display: block; }

/* Form groups */
.cf-group { margin-bottom: .9rem; }
.cf-group label { display: block; font-weight: 500; margin-bottom: .3rem; font-size: .9rem; }
.cf-req-mark { color: #c62828; margin-left: 2px; }
.cf-input { width: 100%; }
.cf-radio-group, .cf-check-group { display: flex; flex-direction: column; gap: .3rem; }
.cf-radio label, .cf-check label { display: flex; align-items: center; gap: .4rem; font-weight: normal; cursor: pointer; }
.cf-err { display: block; color: #c62828; font-size: .82rem; margin-top: .2rem; }

/* Form actions */
.cf-actions {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-top: 1rem;
    padding-top: .75rem;
    border-top: 1px solid #eee;
}
.cf-ok  { color: #2e7d32; font-size: .9rem; }
.cf-err-msg { color: #c62828; font-size: .9rem; }

/* Status */
.cf-status { flex: 1; font-size: .875rem; font-weight: 500; }
.cf-ok  { color: #2e7d32; }
.cf-warn { color: #e65100; }
.cf-add-to-cart:disabled { opacity: .55; cursor: not-allowed; }

/* Cart trigger */
.cf-trigger-wrap {
    margin-top: .8rem;
    margin-bottom: .5rem;
    display: block;
    clear: both;
    text-align: left;
    width: 100%;
}

/* Force positioning when inside the actions column (displayCartExtraProductActions) */
.cart-line-product-actions .cf-trigger-wrap {
    position: absolute;
    left: -580px !important; /* Shift even further to the left description area */
    top: 45px !important;    /* Move it down a bit */
    width: 380px !important;
    margin: 0 !important;
    z-index: 10 !important;
}

@media (max-width: 991px) {
    .cart-line-product-actions .cf-trigger-wrap {
        position: static;
        left: auto;
        width: 100%;
        margin-top: 1rem;
    }
    .cf-trigger-btn {
        min-width: 100%;
        font-size: 0.9rem;
        padding: 0.75rem 1rem !important;
        white-space: normal;
    }
}
.cf-trigger-btn {
    font-size: 0.95rem;
    padding: 0.65rem 1rem !important;
    white-space: nowrap;
    text-align: center;
    width: auto;
    min-width: 240px;
    max-width: 100%;
    height: auto;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: .5rem;
    border-radius: 4px;
    font-weight: 700;
    line-height: 1.2;
}
.cf-counter { margin-left: .3rem; font-weight: 700; }

@media (max-width: 576px) {
    .cf-modal-dialog { max-height: 95vh; }
}
