/**
 * Custom File Service - Public Styles
 */

/* ==========================================================================
   Rating Stars
   ========================================================================== */

.cfs-rating-container {
    margin: 20px 0;
}

.cfs-rating-stars {
    display: inline-flex;
    gap: 5px;
    cursor: pointer;
}

.cfs-rating-stars .star {
    font-size: 24px;
    color: #ddd;
    transition: color 0.2s;
    cursor: pointer;
}

.cfs-rating-stars .star.active,
.cfs-rating-stars .star.hover {
    color: #ffc107;
}

.cfs-rating-average {
    display: inline-block;
    margin-left: 10px;
    font-weight: bold;
    font-size: 18px;
}

.cfs-rating-count {
    display: inline-block;
    margin-left: 5px;
    color: #666;
    font-size: 14px;
}

/* ==========================================================================
   Comments
   ========================================================================== */

.cfs-comments-section {
    margin: 40px 0;
}

.cfs-comments-section h3 {
    margin-bottom: 20px;
    font-size: 24px;
}

.cfs-comment-form {
    margin-bottom: 30px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 4px;
}

.cfs-comment-form textarea {
    width: 100%;
    min-height: 100px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    resize: vertical;
}

.cfs-comment-form button {
    margin-top: 10px;
    padding: 10px 20px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.cfs-comment-form button:hover {
    background: #005a87;
}

.cfs-comments-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cfs-comment {
    padding: 15px;
    margin-bottom: 15px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
}

.cfs-comment .comment-meta {
    margin-bottom: 10px;
    font-size: 14px;
    color: #666;
}

.cfs-comment .comment-meta strong {
    color: #333;
    margin-right: 10px;
}

.cfs-comment .comment-content {
    margin-bottom: 10px;
    line-height: 1.6;
}

.cfs-comment .comment-actions {
    display: flex;
    gap: 15px;
    font-size: 13px;
}

.cfs-comment .comment-actions a {
    color: #0073aa;
    text-decoration: none;
}

.cfs-comment .comment-actions a:hover {
    text-decoration: underline;
}

.cfs-comment .comment-replies {
    margin-left: 30px;
    margin-top: 15px;
}

.cfs-reply-form {
    margin-top: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
    display: none;
}

/* ==========================================================================
   Author Profile
   ========================================================================== */

.cfs-author-card {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
    margin: 20px 0;
}

.cfs-author-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
}

.cfs-author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cfs-author-info {
    flex: 1;
}

.cfs-author-name {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 5px;
}

.cfs-author-bio {
    color: #666;
    line-height: 1.6;
    margin-bottom: 10px;
}

.cfs-author-likes {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.cfs-author-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 15px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s;
}

.cfs-author-like-btn:hover {
    background: #e5e5e5;
}

.cfs-author-like-btn.active {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

/* ==========================================================================
   File Grid
   ========================================================================== */

.cfs-file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.cfs-file-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 20px;
    transition: box-shadow 0.3s;
}

.cfs-file-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.cfs-file-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

.cfs-file-title a {
    color: #333;
    text-decoration: none;
}

.cfs-file-title a:hover {
    color: #0073aa;
}

.cfs-file-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #666;
}

.cfs-file-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.cfs-file-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.cfs-file-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 15px;
}

.cfs-file-tag {
    padding: 3px 10px;
    background: #f5f5f5;
    border-radius: 3px;
    font-size: 12px;
    color: #666;
}

.cfs-file-actions {
    display: flex;
    gap: 10px;
}

.cfs-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.2s;
}

.cfs-btn-primary {
    background: #0073aa;
    color: #fff;
}

.cfs-btn-primary:hover {
    background: #005a87;
}

.cfs-btn-secondary {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.cfs-btn-secondary:hover {
    background: #e5e5e5;
}

/* ==========================================================================
   Purchase/Price
   ========================================================================== */

.cfs-file-price {
    font-size: 20px;
    font-weight: bold;
    color: #0073aa;
    margin-bottom: 15px;
}

.cfs-file-price.free {
    color: #46b450;
}

/* ==========================================================================
   Modal
   ========================================================================== */

.cfs-modal {
    display: block;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.cfs-modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 30px;
    border-radius: 4px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.cfs-modal-close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.cfs-modal-close:hover {
    color: #000;
}

.cfs-modal h3 {
    margin-top: 0;
    margin-bottom: 20px;
}

.cfs-modal .form-group {
    margin-bottom: 15px;
}

.cfs-modal label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.cfs-modal input,
.cfs-modal select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.cfs-modal .form-row {
    display: flex;
    gap: 10px;
}

.cfs-modal .form-row .form-group {
    flex: 1;
}

/* ==========================================================================
   Messages/Notifications
   ========================================================================== */

.cfs-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10001;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s;
}

.cfs-message.show {
    opacity: 1;
    transform: translateX(0);
}

.cfs-message-success {
    border-left: 4px solid #46b450;
}

.cfs-message-error {
    border-left: 4px solid #dc3232;
}

.cfs-message-info {
    border-left: 4px solid #0073aa;
}

/* ==========================================================================
   Download History
   ========================================================================== */

.cfs-download-history {
    margin: 20px 0;
}

.cfs-download-history table {
    width: 100%;
    border-collapse: collapse;
}

.cfs-download-history th,
.cfs-download-history td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.cfs-download-history th {
    background: #f5f5f5;
    font-weight: 600;
}

.cfs-download-history tr:hover {
    background: #fafafa;
}

/* ==========================================================================
   Checkout
   ========================================================================== */

.cfs-checkout {
    max-width: 700px;
    margin: 0 auto;
}

.cfs-checkout-section {
    margin-bottom: 32px;
    padding: 24px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
}

.cfs-checkout-section h3 {
    margin: 0 0 20px;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 1px solid #eee;
    padding-bottom: 12px;
}

/* Order summary table */
.cfs-checkout-summary {
    width: 100%;
    border-collapse: collapse;
}

.cfs-checkout-summary th,
.cfs-checkout-summary td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.cfs-checkout-summary th {
    background: #f7f7f7;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #666;
}

.cfs-checkout-summary tfoot td {
    border-top: 2px solid #ddd;
    border-bottom: none;
    font-size: 15px;
}

.cfs-checkout-summary .cfs-col-price {
    text-align: right;
    white-space: nowrap;
    width: 100px;
}

/* Billing form */
.cfs-form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 0;
}

.cfs-form-row .cfs-form-group {
    flex: 1;
}

.cfs-form-group {
    margin-bottom: 14px;
}

.cfs-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 14px;
}

.cfs-form-group input[type="text"],
.cfs-form-group input[type="email"],
.cfs-form-group select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.cfs-form-group input:focus,
.cfs-form-group select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0,115,170,0.15);
}

.cfs-required {
    color: #c00;
}

/* Payment method tabs */
.cfs-payment-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 2px solid #e5e5e5;
}

.cfs-payment-tab {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.cfs-payment-tab:hover {
    color: #333;
}

.cfs-payment-tab.active {
    color: #0073aa;
    border-bottom-color: #0073aa;
}

/* Payment panels */
.cfs-payment-panel {
    padding-top: 8px;
}

.cfs-payment-panel[hidden] {
    display: none;
}

.cfs-payment-note {
    color: #555;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}

/* CC expiry row */
.cfs-expiry-row {
    display: flex;
    gap: 10px;
}

.cfs-expiry-row select {
    flex: 1;
}

.cfs-cvv-group {
    max-width: 130px;
}

/* PayPal branding */
.cfs-paypal-branding {
    margin: 16px 0;
}

.cfs-paypal-logo {
    display: inline-block;
    font-size: 24px;
    font-weight: 800;
    color: #003087;
    letter-spacing: -1px;
}

.cfs-paypal-logo span {
    color: #009cde;
}

/* Mail address */
.cfs-mail-address {
    font-style: normal;
    background: #f7f7f7;
    border-left: 3px solid #0073aa;
    padding: 12px 16px;
    border-radius: 0 4px 4px 0;
    margin: 0 0 16px;
    line-height: 1.8;
    font-size: 14px;
}

/* Error display */
.cfs-checkout-error {
    padding: 12px 16px;
    background: #fdf2f2;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #721c24;
    font-size: 14px;
    margin-bottom: 16px;
}

/* Submit row */
.cfs-checkout-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.cfs-btn-lg {
    padding: 12px 28px;
    font-size: 16px;
}

/* Thank-you screen */
.cfs-checkout-thankyou {
    max-width: 520px;
    margin: 40px auto;
    text-align: center;
    padding: 40px 32px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
}

.cfs-thankyou-icon {
    width: 64px;
    height: 64px;
    background: #46b450;
    color: #fff;
    border-radius: 50%;
    font-size: 32px;
    line-height: 64px;
    margin: 0 auto 24px;
}

.cfs-checkout-thankyou h2 {
    margin: 0 0 12px;
    font-size: 26px;
}

.cfs-checkout-thankyou p {
    color: #555;
    line-height: 1.7;
    margin-bottom: 12px;
}

.cfs-order-ref {
    font-weight: 600;
    color: #333 !important;
    margin-bottom: 28px !important;
}

/* Notices */
.cfs-checkout-notice,
.cfs-checkout-empty {
    padding: 32px;
    text-align: center;
}

/* Responsive */
@media (max-width: 600px) {
    .cfs-form-row {
        flex-direction: column;
        gap: 0;
    }

    .cfs-cvv-group {
        max-width: none;
    }

    .cfs-checkout-actions {
        flex-direction: column-reverse;
    }

    .cfs-checkout-actions .cfs-btn {
        width: 100%;
        text-align: center;
    }

    .cfs-payment-tab {
        padding: 10px 14px;
        font-size: 13px;
    }
}

/* ==========================================================================
   Cart Icon Badge
   ========================================================================== */

.cfs-cart-icon-wrap {
    position: relative;
    display: inline-block;
}

.cfs-cart-count {
    display: none;
    position: absolute;
    top: -6px;
    right: -8px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: #e00;
    color: #fff;
    border-radius: 9px;
    font-size: 11px;
    font-weight: bold;
    line-height: 18px;
    text-align: center;
    pointer-events: none;
}

.cfs-cart-count.has-items {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   Cart Toast
   ========================================================================== */

.cfs-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 18px;
    background: #333;
    color: #fff;
    border-radius: 6px;
    font-size: 14px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    z-index: 10002;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.3s, transform 0.3s;
    max-width: 320px;
}

.cfs-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.cfs-toast-success {
    border-left: 4px solid #46b450;
}

.cfs-toast-link {
    margin-left: 10px;
    color: #7ec8e3;
    text-decoration: underline;
    white-space: nowrap;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .cfs-file-grid {
        grid-template-columns: 1fr;
    }

    .cfs-author-card {
        flex-direction: column;
    }

    .cfs-modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }

    .cfs-file-meta {
        flex-direction: column;
        gap: 5px;
    }

    .cfs-membership-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ==========================================================================
   Home Shortcode — Tabbed front-page file listing
   ========================================================================== */

.cfs-home {
    --home-accent: #c0392b;
    font-size: 15px;
}

/* Tab bar */
.cfs-home-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
    margin-bottom: 16px;
    border-bottom: 2px solid #e8e8e8;
    padding-bottom: 10px;
}

.cfs-home-tab {
    background: #f4f4f4 !important;
    border: 1.5px solid #ddd !important;
    border-radius: 20px !important;
    padding: 6px 14px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    cursor: pointer;
    color: #444 !important;
    white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s;
    display: inline-flex !important;
    align-items: center;
    width: auto !important;
    min-width: 0 !important;
    box-shadow: none !important;
    line-height: 1.4 !important;
}

.cfs-home-tab:hover {
    border-color: #aaa !important;
    background: #ebebeb !important;
}

.cfs-home-tab.active {
    background: var(--home-accent) !important;
    border-color: var(--home-accent) !important;
    color: #fff !important;
}

/* Content area */
.cfs-home-content {
    position: relative;
    min-height: 80px;
    transition: opacity .2s;
}

.cfs-home-content.cfs-loading {
    opacity: 0.4;
    pointer-events: none;
}

.cfs-home-notice,
.cfs-home-empty {
    color: #888;
    font-size: 14px;
    padding: 24px 0;
    margin: 0;
}

.cfs-home-notice a {
    color: var(--home-accent);
}

/* ==========================================================================
   Browse Shortcode — Mobile-first file browser
   ========================================================================== */

.cfs-browse {
    --browse-accent: #c0392b;
    --browse-radius: 8px;
    font-size: 15px;
}

/* Search bar row */
.cfs-browse-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
    align-items: center;
}

.cfs-browse-search-wrap {
    flex: 1;
    position: relative;
    display: flex !important;
    align-items: center;
    background: #fff;
    border: 1.5px solid #ddd;
    border-radius: 26px;
    transition: border-color .2s, box-shadow .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.cfs-browse-search-wrap:focus-within {
    border-color: var(--browse-accent);
    box-shadow: 0 0 0 3px rgba(192,57,43,.10);
}

.cfs-browse-q {
    flex: 1;
    min-width: 0;
    border: none !important;
    outline: none !important;
    padding: 10px 44px 10px 16px;
    font-size: 15px;
    background: transparent !important;
    box-shadow: none !important;
    margin: 0 !important;
    border-radius: 26px;
    color: #333;
}

.cfs-browse-search-btn {
    position: absolute !important;
    right: 10px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: none !important;
    border: none !important;
    padding: 4px !important;
    margin: 0 !important;
    cursor: pointer;
    font-size: 16px;
    color: #888;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: none !important;
}

.cfs-browse-search-btn:hover {
    color: var(--browse-accent);
}

.cfs-browse-filter-toggle {
    flex-shrink: 0;
    background: #fff !important;
    border: 1.5px solid #ddd !important;
    border-radius: 26px !important;
    padding: 10px 16px !important;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    color: #333 !important;
    transition: border-color .15s, background .15s, color .15s;
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
    width: auto !important;
    min-width: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    line-height: 1.4;
}

.cfs-browse-filter-toggle:hover {
    border-color: #aaa !important;
}

.cfs-browse-filter-toggle.cfs-has-filters {
    border-color: var(--browse-accent) !important;
    color: var(--browse-accent) !important;
    background: #fff9f9 !important;
}

.cfs-filter-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: var(--browse-accent);
    border-radius: 50%;
    vertical-align: middle;
    margin-left: 4px;
}

/* Category chips */
.cfs-browse-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
    margin-bottom: 12px;
}

.cfs-cat-chip {
    flex-shrink: 0;
    background: #f0f0f0;
    border: 1px solid transparent;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    color: #444;
    transition: background .15s, border-color .15s, color .15s;
}

.cfs-cat-chip:hover {
    background: #e5e5e5;
}

.cfs-cat-chip.active {
    background: var(--browse-accent);
    color: #fff;
    border-color: var(--browse-accent);
}

/* Filter drawer */
.cfs-browse-filters {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: var(--browse-radius);
    margin-bottom: 16px;
    overflow: hidden;
}

.cfs-browse-filters-inner {
    padding: 14px 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 20px;
}

/* Author + Special span full width; Clear button too */
.cfs-filter-group-full,
.cfs-filter-clear {
    grid-column: 1 / -1;
}

@media (max-width: 540px) {
    .cfs-browse-filters-inner {
        grid-template-columns: 1fr;
    }
}

.cfs-filter-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.cfs-filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.cfs-filter-pill {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 2px 9px;
    font-size: 11.5px;
    cursor: pointer;
    color: #444;
    transition: background .15s, border-color .15s, color .15s;
    line-height: 1.5;
}

.cfs-filter-pill:hover {
    border-color: #888;
    background: #f5f5f5;
}

.cfs-filter-pill.active {
    background: var(--browse-accent);
    border-color: var(--browse-accent);
    color: #fff;
}

.cfs-filter-clear {
    background: none;
    border: none;
    color: var(--browse-accent);
    cursor: pointer;
    font-size: 12px;
    padding: 0;
    text-decoration: underline;
    justify-self: start;
}

/* Language select */
.cfs-filter-select {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 5px 8px;
    font-size: 13px;
    background: #fff;
    color: #444;
    cursor: pointer;
    outline: none;
}

.cfs-filter-select:focus {
    border-color: #aaa;
}

.cfs-filter-login-note {
    font-size: 12px;
    color: #999;
    font-style: italic;
    align-self: center;
}

.cfs-filter-login-note a {
    color: var(--browse-accent);
}

/* Author autocomplete */
.cfs-author-ac-wrap {
    position: relative;
}

.cfs-browse-author {
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 5px 8px;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
}

.cfs-browse-author:focus {
    border-color: #888;
}

.cfs-author-ac-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 6px 6px;
    list-style: none;
    margin: 0;
    padding: 0;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
    max-height: 220px;
    overflow-y: auto;
}

.cfs-author-ac-list li {
    padding: 7px 10px;
    font-size: 13px;
    cursor: pointer;
    color: #333;
}

.cfs-author-ac-list li:hover,
.cfs-author-ac-list li.cfs-ac-focus {
    background: #f5f5f5;
    color: var(--browse-accent);
}

/* Tag chips (multi-select) */
.cfs-tag-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 6px;
    min-height: 0;
}

.cfs-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: var(--browse-accent);
    color: #fff;
    border-radius: 14px;
    padding: 2px 6px 2px 10px;
    font-size: 12px;
    line-height: 1.5;
}

.cfs-tag-chip-remove {
    background: none !important;
    border: none !important;
    color: #fff !important;
    cursor: pointer;
    padding: 0 2px !important;
    margin: 0 !important;
    font-size: 15px !important;
    font-weight: bold !important;
    line-height: 1 !important;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    display: inline !important;
    box-shadow: none !important;
    opacity: 0.75;
    vertical-align: middle;
}

.cfs-tag-chip-remove:hover {
    opacity: 1 !important;
}

/* Results area */
.cfs-browse-results {
    position: relative;
    min-height: 100px;
    transition: opacity .2s;
}

.cfs-browse-results.cfs-loading {
    opacity: 0.4;
    pointer-events: none;
}

.cfs-browse-meta {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.cfs-browse-count {
    font-size: 13px;
    color: #888;
}

.cfs-browse-empty {
    text-align: center;
    padding: 40px 20px;
    color: #888;
}

/* File card grid */
.cfs-browse-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

@media (min-width: 540px) {
    .cfs-browse-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 900px) {
    .cfs-browse-grid { grid-template-columns: 1fr 1fr 1fr; }
}

/* File card */
.cfs-browse-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: var(--browse-radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow .2s;
}

.cfs-browse-card:hover {
    box-shadow: 0 3px 12px rgba(0,0,0,.1);
}

.cfs-browse-card-body {
    padding: 14px 14px 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cfs-browse-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    text-decoration: none;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cfs-browse-card-title:hover { color: var(--browse-accent); }

.cfs-browse-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 12px;
    color: #777;
    align-items: center;
}

.cfs-browse-card-author {
    color: #555;
    text-decoration: none;
    font-weight: 500;
}

.cfs-browse-card-author:hover { color: var(--browse-accent); text-decoration: underline; }

.cfs-browse-card-cat {
    background: #f0f0f0;
    border-radius: 10px;
    padding: 2px 8px;
}

.cfs-browse-card-voice {
    color: #999;
}

.cfs-browse-card-stats {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #999;
}

.cfs-browse-card-rating { color: #c8a000; }

.cfs-browse-card-footer {
    border-top: 1px solid #f0f0f0;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: #fafafa;
}

/* Price badge */
.cfs-price-badge {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 10px;
}

.cfs-price-free    { background: #e8f5e9; color: #2e7d32; }
.cfs-price-paid    { background: #fff3e0; color: #e65100; }
.cfs-price-owned   { background: #e3f2fd; color: #0d47a1; }
.cfs-price-premium { background: #f3e5f5; color: #6a1b9a; }

/* Small buttons */
.cfs-btn-sm {
    padding: 5px 12px;
    font-size: 12px;
    border-radius: 5px;
}

.cfs-btn-premium {
    background: #6a1b9a;
    color: #fff;
    border-color: #6a1b9a;
}

.cfs-btn-premium:hover { background: #7b1fa2; }

/* Pagination */
.cfs-browse-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px 0;
}

.cfs-browse-page-info {
    font-size: 14px;
    color: #666;
}

/* Membership Plans
   ========================================================================== */

.cfs-membership-wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 0;
}

.cfs-membership-active-banner {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    color: #2e7d32;
    padding: 12px 18px;
    border-radius: 6px;
    margin-bottom: 28px;
    font-weight: 500;
}

.cfs-membership-section {
    margin-bottom: 40px;
}

.cfs-membership-section-title {
    font-size: 1.4em;
    margin: 0 0 6px;
}

.cfs-membership-section-desc {
    color: #666;
    margin: 0 0 20px;
    font-size: 0.95em;
}

.cfs-membership-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.cfs-membership-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    transition: box-shadow .2s;
}

.cfs-membership-card:hover {
    box-shadow: 0 3px 12px rgba(0,0,0,.12);
}

.cfs-membership-duration {
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
}

.cfs-membership-price {
    font-size: 1.8em;
    font-weight: 700;
    color: #c0392b;
}

.cfs-membership-desc {
    font-size: 0.85em;
    color: #666;
    margin: 0;
}

.cfs-membership-card .cfs-btn {
    margin-top: auto;
    width: 100%;
}

.cfs-membership-unavailable {
    color: #888;
    font-style: italic;
}

.cfs-membership-feedback {
    margin-top: 16px;
    padding: 10px 14px;
    border-radius: 4px;
    background: #fef9f9;
}

/* ==========================================================================
   Audio Player Bar
   ========================================================================== */

.cfs-player-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: #1a0a0e;
    border-top: 2px solid #6f192a;
    color: #f0e0e4;
    font-size: 0.82rem;
    box-shadow: 0 -4px 20px rgba(0,0,0,.5);
}

.cfs-player-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    max-width: 1400px;
    margin: 0 auto;
    flex-wrap: nowrap;
}

/* Controls */
.cfs-player-controls {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.cfs-pbtn {
    background: none;
    border: none;
    color: #f0e0e4;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    line-height: 1;
    transition: background 0.15s;
}
.cfs-pbtn:hover { background: rgba(255,255,255,0.1); }
.cfs-pbtn-play { font-size: 1.2rem; padding: 0.3rem 0.6rem; }
.cfs-pbtn-close { margin-left: 0.5rem; opacity: 0.6; }
.cfs-pbtn-close:hover { opacity: 1; }

/* Track info */
.cfs-player-track {
    display: flex;
    flex-direction: column;
    min-width: 120px;
    max-width: 240px;
    flex-shrink: 0;
    overflow: hidden;
}
.cfs-player-title {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
    font-size: 0.85rem;
}
.cfs-player-author {
    font-size: 0.75rem;
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cfs-preview-badge {
    display: inline-block;
    background: #6f192a;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    margin-top: 2px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Timeline */
.cfs-player-timeline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}
.cfs-ptime {
    flex-shrink: 0;
    font-size: 0.75rem;
    opacity: 0.8;
    font-variant-numeric: tabular-nums;
    min-width: 2.5rem;
    text-align: center;
}
.cfs-scrubber {
    flex: 1;
    min-width: 0;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.2);
    cursor: pointer;
    accent-color: #c0392b;
}
.cfs-scrubber::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
}
.cfs-scrubber-disabled { opacity: 0.4; cursor: not-allowed; }

/* Volume */
.cfs-player-vol {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}
.cfs-vol-icon {
    cursor: pointer;
    font-size: 1rem;
    flex-shrink: 0;
}
.cfs-vol-slider {
    width: 70px;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.2);
    cursor: pointer;
    accent-color: #c0392b;
}

/* Play buttons on file cards */
.cfs-play-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #6f192a;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.25rem 0.55rem;
    font-size: 0.78rem;
    cursor: pointer;
    line-height: 1.4;
    vertical-align: middle;
    margin-right: 0.3rem;
    transition: background 0.15s;
}
.cfs-play-btn:hover { background: #9a2038; }
.cfs-play-preview {
    background: #444;
}
.cfs-play-preview:hover { background: #666; }

/* Shrink player on small screens */
@media (max-width: 600px) {
    .cfs-player-track { display: none; }
    .cfs-player-vol   { display: none; }
    .cfs-player-timeline { gap: 0.25rem; }
}

/* ============================================================
   Left sidebar navigation — menu-styled with icons (desktop).
   Targets the #secondary nav list (editable wp-block-list).
   ============================================================ */
#secondary .widget .wp-block-list,
#secondary .widget ul.wp-block-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
#secondary .widget .wp-block-list li {
    margin: 0 0 2px !important;
    padding: 0 !important;
    line-height: 1.2 !important;
}
#secondary .widget .wp-block-list li a {
    display: flex !important;
    align-items: center;
    gap: 11px;
    padding: 8px 12px !important;
    border-radius: 9px;
    font-size: 16px !important;
    font-weight: 600;
    line-height: 1.2 !important;
    color: #ffd0df !important;
    text-decoration: none !important;
    transition: background .15s ease, color .15s ease, transform .12s ease;
}
#secondary .widget .wp-block-list li a:hover,
#secondary .widget .wp-block-list li a:focus {
    background: rgba(138, 39, 69, .38);
    color: #fff !important;
    transform: translateX(2px);
}
/* Icon slot */
#secondary .widget .wp-block-list li a::before {
    content: "";
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: .92;
}
/* Per-item icons (Lucide-style line icons, stroke #ffd0df) matched by href */
#secondary .widget a[href*="/files"]::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffd0df' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6'/%3E%3C/svg%3E");
}
#secondary .widget a[href*="/playlists"]::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffd0df' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15V6'/%3E%3Cpath d='M18.5 18a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z'/%3E%3Cpath d='M12 12H3'/%3E%3Cpath d='M16 6H3'/%3E%3Cpath d='M12 18H3'/%3E%3C/svg%3E");
}
#secondary .widget a[href*="/fan-fiction"]::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffd0df' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19.5A2.5 2.5 0 0 1 6.5 17H20'/%3E%3Cpath d='M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2Z'/%3E%3C/svg%3E");
}
#secondary .widget a[href*="/links"]::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffd0df' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'/%3E%3C/svg%3E");
}
#secondary .widget a[href*="/my-account"]::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffd0df' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E");
}
#secondary .widget a[href*="/help"]::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffd0df' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E");
}
#secondary .widget a[href*="discord"]::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffd0df' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7.5 7.2A18 18 0 0 1 12 6.5a18 18 0 0 1 4.5.7'/%3E%3Cpath d='M16.5 16.8A18 18 0 0 1 12 17.5a18 18 0 0 1-4.5-.7'/%3E%3Cpath d='M8 9.5C6.5 11 6 13.5 6 16c1.5 1 3 1.5 3 1.5l1-2'/%3E%3Cpath d='M16 9.5c1.5 1.5 2 4 2 6.5-1.5 1-3 1.5-3 1.5l-1-2'/%3E%3Ccircle cx='9.5' cy='12.5' r='1'/%3E%3Ccircle cx='14.5' cy='12.5' r='1'/%3E%3C/svg%3E");
}

/* Give the 180px sidebar menu room so single words don't wrap mid-word */
.ast-separate-container.ast-two-container #secondary .widget,
#secondary .widget {
    padding: 14px 10px !important;
}
#secondary .widget .wp-block-list li a {
    word-break: keep-all;
    overflow-wrap: normal;
    white-space: normal;
}
#secondary .widget .wp-block-list li a::before { margin-left: 2px; }
/* Small top padding inside the first sidebar widget */
#secondary .widget:first-child { padding-top: 16px !important; }

/* ------------------------------------------------------------------
   Admin-bar offset (ADMIN ONLY). On this install <html> is missing the
   `wp-toolbar` class, so WordPress never applies its standard 32px top
   offset for the fixed admin bar — which let the sticky header overlap
   the page content. Push body content below the bar so the admin view
   matches what logged-out visitors already see. Logged-out users have
   no `.admin-bar`, so they're unaffected.
   ------------------------------------------------------------------ */
@media screen and (min-width: 922px) {
  body.admin-bar #content { margin-top: 32px; }
}

/* ------------------------------------------------------------------
   Card legibility on the pink theme: the action row and the author
   heart/block buttons inherited washed-out theme defaults and were hard
   to read on the rose card. Give them explicit brand-maroon contrast.
   Scoped to .cfs-files-wrapper so nothing else is affected.
   ------------------------------------------------------------------ */

/* The brand-maroon text below is designed to read on a light "rose card". But on
   the dark theme the Astra content box is dark maroon (--ast-global-color-4), so
   without a card the maroon text sits on a maroon panel and is unreadable. Give
   each file row its own rose card so it stays legible on any theme/background. */
.cfs-files-wrapper .file-listing {
    background: #ab7987;
    border: 1px solid #96606e;
    border-radius: 12px;
    padding: 8px 16px;
    margin-bottom: 10px;
}

/* Activate the two-column grid the grid-template-columns rules (inline <style> +
   Customizer CSS) already expect. Without display:grid those column widths are
   inert, so the card collapses to one block and the stats box renders 0-width.
   This rule was lost from public.css and only survived in browser cache until a
   CFS_VERSION bump forced a refetch. */
.cfs-files-wrapper .file-content {
    display: grid;
    align-items: start;
}

/* The right-hand stats box: a slightly deeper rose panel so it reads as its own
   box (matching the original design). */
.cfs-files-wrapper .file-actions-column {
    background: #ffc0cf;
    border-radius: 10px;
    padding: 8px 12px;
}

/* Smaller card title */
.cfs-files-wrapper .file-title,
.cfs-files-wrapper .file-title span,
.cfs-files-wrapper .file-title a {
    font-size: 1.3rem !important;
    line-height: 1.3;
}

/* On-sale pricing: sale price emphasised, original struck through. Used in the
   file card/detail title and in the cart/checkout summaries. */
.cfs-price-sale { font-weight: 700; }
.cfs-price-orig {
    margin-left: 6px;
    font-weight: 400;
    font-size: 0.92em;
    text-decoration: line-through;
    opacity: 0.6;
}
.cfs-files-wrapper .file-title .cfs-price-sale { color: #d5f5e3; }

/* Checkout coupon */
.cfs-coupon { margin-top: 14px; }
.cfs-coupon > label { display: block; margin-bottom: 6px; font-weight: 600; }
.cfs-coupon-row { display: flex; gap: 8px; align-items: stretch; }
.cfs-coupon-input { flex: 1 1 auto; min-width: 0; }
.cfs-coupon-msg { margin-top: 6px; font-size: 0.9rem; min-height: 1.1em; }
.cfs-coupon-ok { color: #1e7d45; }
.cfs-coupon-err { color: #b3261e; }
.cfs-sum-discount td { color: #1e7d45; }

/* Title + audience/gender symbols on ONE line (title left, symbols right) */
.cfs-files-wrapper .file-title-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
}
.cfs-files-wrapper .file-title-row .file-title { margin: 0; }
.cfs-files-wrapper .file-title-row .file-format {
    margin-left: auto;
    flex: 0 0 auto;
    white-space: nowrap;
}

/* Bold the File Info / Favorite / Report / Comments action line */
.cfs-files-wrapper .file-actions,
.cfs-files-wrapper .file-actions a {
    font-weight: 700;
}

.cfs-files-wrapper .file-actions { color: #9a5563; }            /* the '|' separators */
.cfs-files-wrapper .file-actions a,
.cfs-files-wrapper .file-actions .cfs-fav-file-disabled {
    color: #6b182b;
    font-weight: 700;
    text-decoration: none;
}
.cfs-files-wrapper .file-actions a:hover { color: #a01f3c; text-decoration: underline; }

/* Description + read-more text — light pink, readable on the mauve card */
.cfs-files-wrapper .file-description,
.cfs-files-wrapper .file-description p,
.cfs-files-wrapper .cfs-short-desc,
.cfs-files-wrapper .cfs-long-desc,
.cfs-files-wrapper .cfs-short-text,
.cfs-files-wrapper .cfs-read-more {
    color: #f3dde6;
}

/* "♥ Favorited" active state — distinct accent */
.cfs-files-wrapper .file-actions a.cfs-fav-file.active { color: #d5f5e3; }

/* Comments link carried opacity:0.75 (looked dimmer than its siblings) — match it */
.cfs-files-wrapper .cfs-comments-toggle { opacity: 1; }

/* Short action labels exist in markup but are hidden on desktop (full labels show). */
.cfs-files-wrapper .file-actions .cfs-act-short { display: none; }

/* ---- Mobile only: compact + reordered (desktop is untouched) ---- */
@media (max-width: 640px) {
    .cfs-files-wrapper .file-listing { padding: 8px 12px; margin-bottom: 8px; }

    /* File-info action line: short labels + smaller font so it fits on one line */
    .cfs-files-wrapper .file-actions { font-size: 0.8rem !important; white-space: nowrap; }
    .cfs-files-wrapper .file-actions .cfs-act-full  { display: none; }
    .cfs-files-wrapper .file-actions .cfs-act-short { display: inline; }

    /* Reorder so the stats box sits ABOVE the File Info line. display:contents
       promotes the left column's children into .file-content so they can be
       interleaved with the stats box via `order` — desktop markup/layout is
       unchanged. */
    .cfs-files-wrapper .file-content { display: flex !important; flex-direction: column; }
    .cfs-files-wrapper.cfs-layout-list .file-info-column { display: contents !important; }
    .cfs-files-wrapper .file-title-row     { order: 1; }
    .cfs-files-wrapper .cfs-file-links     { order: 2; }
    .cfs-files-wrapper .file-description   { order: 3; }
    .cfs-files-wrapper .file-tags          { order: 4; }
    .cfs-files-wrapper .file-actions-column { order: 5; }   /* stats box */
    .cfs-files-wrapper .file-actions       { order: 6; }    /* File Info line, last */

    /* Hide downloads / date / effect(type) tags on mobile only (kept on desktop) */
    .cfs-files-wrapper .cfs-stat-downloads,
    .cfs-files-wrapper .cfs-stat-date,
    .cfs-files-wrapper .cfs-effects-list { display: none !important; }

    /* Title a touch smaller; description clamped to 2 lines */
    .cfs-files-wrapper .file-title,
    .cfs-files-wrapper .file-title span,
    .cfs-files-wrapper .file-title a { font-size: 1.1rem !important; }
    .cfs-files-wrapper .cfs-short-text { -webkit-line-clamp: 2 !important; }

    /* Stats: compact 2-column grid */
    .cfs-files-wrapper .file-actions-column { margin-top: 8px; padding: 8px 10px; }
    .cfs-files-wrapper .file-actions-column .file-stats {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 1px 12px !important;
        font-size: 0.78rem !important;
        line-height: 1.3 !important;
    }
    .cfs-files-wrapper .file-actions-column .file-stats > .cfs-author-row {
        grid-column: 1 / -1;
        margin-bottom: 2px;
    }
    .cfs-files-wrapper .cfs-author-row {
        display: flex !important; align-items: center; gap: 10px; flex-wrap: wrap;
    }
}

/* Author heart / block buttons in the rose stats box */
.cfs-files-wrapper .cfs-btn-fav,
.cfs-files-wrapper .cfs-btn-block { color: #6b182b; opacity: 1; }
.cfs-files-wrapper .cfs-btn-fav.active   { color: #d6336c; }    /* favorited = crimson */
.cfs-files-wrapper .cfs-btn-block.active { color: #c1121f; }    /* blocked = red */
.cfs-files-wrapper .cfs-btn-fav:hover,
.cfs-files-wrapper .cfs-btn-block:hover  { color: #d6336c; }

/* 'Mark Favorite' carried a 0.6 opacity fade that made it lighter than the
   sibling links (File Info / Report File / Comments). Match it to the rest of
   the row; the favorited '♥ Favorited' state keeps its crimson as a state cue. */
.cfs-files-wrapper .file-actions a.cfs-fav-file { opacity: 1; }

/* File name / title — inherited the theme's default heading grey; bring it
   into the brand maroon so it matches the rest of the card. */
.cfs-files-wrapper .file-title,
.cfs-files-wrapper .file-title span,
.cfs-files-wrapper .file-title a { color: #6b182b; }

/* ------------------------------------------------------------------
   Header (desktop right section): the search magnifier and cart basket
   were near-black icons on the grey header bar — hard to see — and the
   cart sat left of search. Swap search before the cart and give both the
   same visible round-button treatment as the account icon.
   Scoped to .site-header-primary-section-right so mobile is untouched.
   ------------------------------------------------------------------ */
.site-header-primary-section-right .ast-header-search { order: -1; }

.site-header-primary-section-right .ast-header-search .astra-search-icon,
.site-header-primary-section-right .cfs-cart-icon-wrap {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px;
    border-radius: 50%;
    border: 1.5px solid #b04a68;
    background: rgba(138, 39, 69, .45);
    position: relative;
    transition: all .15s ease;
}
.site-header-primary-section-right .ast-header-search .astra-search-icon:hover,
.site-header-primary-section-right .cfs-cart-icon-wrap:hover {
    background: rgba(138, 39, 69, .8);
    border-color: #ffd0df;
}
/* Brighten the search glyph (was black). */
.site-header-primary-section-right .ast-header-search .ast-search-icon,
.site-header-primary-section-right .ast-header-search .astra-search-icon,
.site-header-primary-section-right .ast-header-search svg {
    color: #ffd0df !important;
    fill: #ffd0df !important;
}
/* Cart icon is a dark PNG — render it light so it reads on the maroon button. */
.site-header-primary-section-right .cfs-cart-icon-wrap img {
    width: 22px !important; height: 22px !important;
    filter: brightness(0) invert(1);
}

/* Left sidebar icon for the Visuals tool (concentric rings — hypnotic spiral). */
#secondary .widget a[href*="/visuals"]::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffd0df' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Ccircle cx='12' cy='12' r='5'/%3E%3Ccircle cx='12' cy='12' r='1.5'/%3E%3C/svg%3E");
}

/* ------------------------------------------------------------------
   Browse pagination — First/Prev, windowed page numbers, Next/Last,
   and a jump-to-page box. Themed to match the maroon UI.
   ------------------------------------------------------------------ */
.cfs-browse-pagination { flex-wrap: wrap; gap: 6px; }
.cfs-browse-pagination .cfs-browse-page-btn {
    padding: 6px 11px; min-width: 34px; border: 1px solid #5a2535; border-radius: 6px;
    background: #2a0f18; color: #ffd0df; cursor: pointer; font-size: 14px; line-height: 1.2;
    transition: background .15s ease, border-color .15s ease;
}
.cfs-browse-pagination .cfs-browse-page-btn:hover:not(:disabled) { background: #6c1f35; border-color: #8a2745; }
.cfs-browse-pagination .cfs-browse-page-btn:disabled { opacity: .4; cursor: default; }
.cfs-browse-pagination .cfs-page-current {
    background: #8a2745; border-color: #b04a68; color: #fff; font-weight: 700; cursor: default;
}
.cfs-browse-pagination .cfs-page-ellipsis { color: #b07a8a; padding: 0 2px; align-self: center; }
.cfs-browse-page-jump { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; }
.cfs-browse-page-jump .cfs-browse-page-info { font-size: 13px; color: #c0a0ac; white-space: nowrap; }
.cfs-browse-page-input {
    width: 62px; padding: 6px 8px; background: #1a0a10; border: 1px solid #4a1525;
    border-radius: 6px; color: #f0d0d8; font-size: 14px; box-sizing: border-box;
}
.cfs-browse-page-go {
    padding: 6px 12px; border: 1px solid #5a2535; border-radius: 6px;
    background: #6c1f35; color: #ffd0df; cursor: pointer; font-size: 14px;
}
.cfs-browse-page-go:hover { background: #8a2745; border-color: #b04a68; }

/* ------------------------------------------------------------------
   Admin-bar offset for tablet/mobile (<922px). <html> lacks the
    class on this install, so WordPress's standard top offset
   never applies and the fixed/absolute admin bar overlaps (hides) the
   whole site header for logged-in admins. Push the page down by the bar
   height so the mobile header (logo + compact menu) is visible. The ≥922px
   case is handled separately (sticky header top:32 + #content margin).
   ------------------------------------------------------------------ */
@media screen and (max-width: 921px) {
  body.admin-bar #masthead,
  body.admin-bar .ast-mobile-header-wrap,
  body.admin-bar .ast-main-header-wrap {
    display: block !important; visibility: visible !important; margin-top: 46px !important;
  }
}

/* Mobile: the compact (hamburger) menu sits at the far left, before the logo. */
.ast-mobile-header-wrap .site-header-primary-section-left { align-items: center; }
.ast-mobile-header-wrap .site-header-primary-section-left .ast-builder-menu-1 { order: -1; margin-right: 6px; }

/* Mobile/tablet: keep the header bar fixed at the top while scrolling, like
   desktop. On phones (<=600px) WP's admin bar scrolls away so the header sticks
   to the very top; where the admin bar is fixed (601-921px) it sticks below it. */
@media screen and (max-width: 921px) {
  #masthead {
    position: sticky !important; top: 0; z-index: 9990;
    box-shadow: 0 2px 14px rgba(0,0,0,.35);
  }
}
@media screen and (min-width: 601px) and (max-width: 782px) {
  body.admin-bar #masthead { top: 46px; }
}
@media screen and (min-width: 783px) and (max-width: 921px) {
  body.admin-bar #masthead { top: 32px; }
}

/* ------------------------------------------------------------------
   Mobile flyout (Max Mega Menu): same per-item icons as the desktop
   left sidebar, matched by href. Higher specificity + !important to win
   over Max Mega Menu's own mobile stylesheet.
   ------------------------------------------------------------------ */
@media screen and (max-width: 921px) {
  #mega-menu-wrap-primary #mega-menu-primary li.mega-menu-item > a.mega-menu-link[href*="/files"]::before,
  #mega-menu-wrap-primary #mega-menu-primary li.mega-menu-item > a.mega-menu-link[href*="/playlists"]::before,
  #mega-menu-wrap-primary #mega-menu-primary li.mega-menu-item > a.mega-menu-link[href*="/visuals"]::before,
  #mega-menu-wrap-primary #mega-menu-primary li.mega-menu-item > a.mega-menu-link[href*="/fan-fiction"]::before,
  #mega-menu-wrap-primary #mega-menu-primary li.mega-menu-item > a.mega-menu-link[href*="/links"]::before,
  #mega-menu-wrap-primary #mega-menu-primary li.mega-menu-item > a.mega-menu-link[href*="/my-account"]::before,
  #mega-menu-wrap-primary #mega-menu-primary li.mega-menu-item > a.mega-menu-link[href*="/help"]::before {
    content: "" !important; display: inline-block !important; vertical-align: middle;
    width: 18px !important; height: 18px !important; margin-right: 10px !important;
    background-size: contain !important; background-repeat: no-repeat !important;
    background-position: center !important; opacity: .92; border: 0 !important;
  }
  #mega-menu-wrap-primary #mega-menu-primary li.mega-menu-item > a.mega-menu-link[href*="/files"]::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffd0df' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6'/%3E%3C/svg%3E") !important;
  }
  #mega-menu-wrap-primary #mega-menu-primary li.mega-menu-item > a.mega-menu-link[href*="/playlists"]::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffd0df' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15V6'/%3E%3Cpath d='M18.5 18a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z'/%3E%3Cpath d='M12 12H3'/%3E%3Cpath d='M16 6H3'/%3E%3Cpath d='M12 18H3'/%3E%3C/svg%3E") !important;
  }
  #mega-menu-wrap-primary #mega-menu-primary li.mega-menu-item > a.mega-menu-link[href*="/visuals"]::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffd0df' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Ccircle cx='12' cy='12' r='5'/%3E%3Ccircle cx='12' cy='12' r='1.5'/%3E%3C/svg%3E") !important;
  }
  #mega-menu-wrap-primary #mega-menu-primary li.mega-menu-item > a.mega-menu-link[href*="/fan-fiction"]::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffd0df' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19.5A2.5 2.5 0 0 1 6.5 17H20'/%3E%3Cpath d='M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2Z'/%3E%3C/svg%3E") !important;
  }
  #mega-menu-wrap-primary #mega-menu-primary li.mega-menu-item > a.mega-menu-link[href*="/links"]::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffd0df' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'/%3E%3C/svg%3E") !important;
  }
  #mega-menu-wrap-primary #mega-menu-primary li.mega-menu-item > a.mega-menu-link[href*="/my-account"]::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffd0df' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E") !important;
  }
  #mega-menu-wrap-primary #mega-menu-primary li.mega-menu-item > a.mega-menu-link[href*="/help"]::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffd0df' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E") !important;
  }
}

/* ------------------------------------------------------------------
   File Info (detail) on mobile: merge the stats into a compact meta
   block under the title (replaces the desktop side stats box). A subtle
   dark panel + bright text keeps it readable on the maroon card.
   ------------------------------------------------------------------ */
.cfs-detail-meta-mobile { display: none; }
@media screen and (max-width: 921px) {
  .cfs-detail-view .file-content { display: block !important; }
  .cfs-detail-view .file-actions-column { display: none !important; }

  .cfs-detail-meta-mobile {
    display: block; margin: 4px 0 14px; padding: 9px 12px;
    background: rgba(0, 0, 0, .42); border-radius: 8px;
    font-size: 0.9rem; line-height: 1.55; color: #ffdbe4;
  }
  .cfs-detail-meta-mobile .cfs-dm-row { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 8px; }
  .cfs-detail-meta-mobile .cfs-dm-row2 { color: #f3c3cf; margin-top: 4px; }
  .cfs-detail-meta-mobile .cfs-dm-sep { color: #c98ba0; }
  .cfs-detail-meta-mobile .cfs-dm-author { color: #ffa7b8; font-weight: 700; text-decoration: none; }
  .cfs-detail-meta-mobile .cfs-dm-author:hover { text-decoration: underline; }
  .cfs-detail-meta-mobile .cfs-dm-stars { color: #ffd166; letter-spacing: 1px; }
  .cfs-detail-meta-mobile .cfs-dm-effect { color: #ffc187; font-weight: 500; }
}

/* ============================================================
   Wide-screen multi-column file grid
   Reclaims wasted horizontal space on large monitors:
     - laptops / tablets (<1500px content): 1 column (stacked, unchanged)
     - full-HD widths:                       2 columns side-by-side
     - ultra-wide:                           3 columns
   Each card keeps its own content + stats sub-layout. Below 922px
   the layout stays single-column (mobile rules untouched).
   Applies to both [cfs_home] and the browse/files listing, since both
   render into .cfs-files-wrapper.cfs-layout-list.
   ============================================================ */
@media (min-width: 922px) {
  .cfs-files-wrapper.cfs-layout-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(700px, 1fr));
    gap: 1rem;
    align-items: start;
  }
  .cfs-files-wrapper.cfs-layout-list > .file-listing {
    margin: 0 !important;   /* grid gap handles spacing now */
    min-width: 0;           /* let cards shrink instead of overflowing */
    height: 100%;           /* equal-height cards across a row */
  }
}

/* ============================================================
   Mobile ad banner placement (<=921px)
   - Top (horizontal) ad  -> fixed bottom strip that does NOT scroll.
                             Rests just above the audio player bar when
                             that bar is visible (body.cfs-player-on).
   - Side (vertical) ad   -> hidden on mobile entirely.
   When no horizontal ad is active the shortcode renders no
   .horizontal-ads element, so nothing is fixed and no space is
   reserved (the :has() rules below simply don't match).
   ============================================================ */
@media (max-width: 921px) {

  /* Side banner: gone on mobile */
  .ad-creator-ads.vertical-ads { display: none !important; }

  /* Top banner: fixed to the bottom of the viewport */
  .ad-creator-ads.horizontal-ads {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9990;                       /* under the audio player bar (99999) */
    margin: 0 !important;
    padding: 4px 6px;
    background: rgba(20, 6, 10, 0.94);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.45);
    text-align: center;
    line-height: 0;
    transition: bottom .2s ease;
  }
  .ad-creator-ads.horizontal-ads .ad-item { margin: 0 !important; }
  .ad-creator-ads.horizontal-ads img {
    max-width: 100%;
    max-height: 70px;
    width: auto;
    height: auto;
    display: inline-block;
    vertical-align: middle;
  }

  /* While the player bar is showing, sit directly above it instead of under it */
  body.cfs-player-on .ad-creator-ads.horizontal-ads {
    bottom: var(--cfs-player-h, 58px);
  }

  /* Reserve bottom space so the fixed strip never hides page-bottom content,
     but only when a horizontal ad is actually on the page */
  body:has(.ad-creator-ads.horizontal-ads) { padding-bottom: 100px; }
  body.cfs-player-on:has(.ad-creator-ads.horizontal-ads) {
    padding-bottom: calc(100px + var(--cfs-player-h, 58px));
  }
}

/* ============================================================
   Banner display scaling (variable aspect ratios)
   - Horizontal: scale to a fixed HEIGHT, width follows the image.
   - Vertical:   scale to a fixed WIDTH, height follows the image.
   Mobile horizontal uses the max-height:70px rule in the <=921 block
   above; this desktop rule is scoped to >=922 so it doesn't clash.
   Vertical is hidden on mobile, so its rule is desktop-only in effect.
   ============================================================ */
@media (min-width: 922px) {
  .ad-creator-ads.horizontal-ads img { height: 100px; width: auto; max-width: 100%; }
}
.ad-creator-ads.vertical-ads img { width: 125px; height: auto; max-width: 100%; }
