/**
 * SupportCandy integration styles.
 *
 * @since      1.0.0
 * @package    Cobs_Support_System
 */

/* General SupportCandy form styles */
.wpsc-shortcode-container select,
.wpsc-shortcode-container .select2-container--default .select2-selection--single {
    background-image: none;
    background: inherit;
    appearance: auto;
    -webkit-appearance: auto;
    -moz-appearance: auto;
    padding: 0;
}

.wpsc-shortcode-container .select2-container--default .select2-selection--single .select2-selection__arrow {
    background: none;
    border-radius: 0;
}

.wpsc-shortcode-container .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: unset;
}

.wpsc-shortcode-container .select2-container--default .select2-selection--single .select2-selection__rendered .select2-selection__clear {
    margin-right: 25px;
}

.wpsc-shortcode-container .select2-container--default .select2-selection--single .select2-selection__arrow {
    top: calc(50% - 13px);
}

.wpsc-shortcode-container h2 > small {
    font-size: 100%!important;
}

.cobs-support-ticket-page .wpsc-filter-container select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%231b1b1b' stroke-width='1.5'/%3E%3C/svg%3E");
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 10px 6px;
    padding: 5px 24px 5px 8px !important;
}

@media only screen and (min-width: 1360px) {
    .cobs-support-ticket-page .wpsc-filter {
        flex-wrap: nowrap;
        gap: 12px;
    }

    .cobs-support-ticket-page .wpsc-search {
        flex: 1 1 280px;
        min-width: 240px;
    }

    .cobs-support-ticket-page .wpsc-search .search-field {
        width: 100%;
    }

    .cobs-support-ticket-page .wpsc-filter-container {
        flex: 0 1 auto;
        flex-wrap: nowrap;
        min-width: 0;
    }

    .cobs-support-ticket-page .wpsc-filter-item {
        flex: 0 0 125px;
        min-width: 0;
        width: 125px;
    }

    .cobs-support-ticket-page .cobs-ticket-list-facet {
        flex-basis: 140px;
        width: 140px;
    }

    .cobs-support-ticket-page .wpsc-filter-item:has(.wpsc-input-filter),
    .cobs-support-ticket-page .wpsc-filter-item:has(.wpsc-input-sort-by),
    .cobs-support-ticket-page .cobs-ticket-list-facet[data-cobs-ticket-list-facet="assigned_agent"] {
        flex-basis: 150px;
        width: 150px;
    }

    .cobs-support-ticket-page .wpsc-filter-item:has(.wpsc-input-sort-order) {
        flex-basis: 85px;
        width: 85px;
    }
}

/* Ticket form adjustments */
body .wpsc-tff .name {
    font-size: 16px;
}

body .wpsc-tff .extra-info {
    font-size: 14px;
    line-height: 1.3;
}

body .wpsc-tff-label .optional-indicator {
    margin-left: 0.25em;
    font-weight: 400;
    font-style: normal;
    align-self: center;
}

body #wpsc-container .checkbox-container label, 
body .wpsc-modal .checkbox-container label {
    font-weight: normal;
    font-size: 16px!important;
}

body form label:not(.woocommerce-form__label-for-checkbox):not(.hs-form-checkbox-display):not(.hs-error-msg):not(.hs-form-booleancheckbox-display) {
    text-transform: none;
    letter-spacing: normal;
    color: inherit;
}

body .submit-container {
    margin-top: 10px;
}

body .wpsc-create-ticket + .wpsc-tff .wpsc-button {
    padding: 10px 16px!important;
}

body .wpsc-create-ticket + .wpsc-tff .wpsc-button.margin-right {
    margin-right: 10px;
}

body #wpsc-container .checkbox-container label:before, 
body .wpsc-modal .checkbox-container label:before {
    margin-right: 8px;
}

body #wpsc-container .wpsc-create-ticket .select2-container,
body #wpsc-container .wpsc-create-ticket + .wpsc-tff .select2-container,
body #wpsc-container div:has(+ .wpsc-create-ticket) .select2-container,
body #wpsc-container .wpsc-tff input {
    font-size: 16px !important
}

/* Fix editor styles */
@media only screen and (min-width: 1001px) {
    .mce-panel button:hover {
        background: none;
        border: none;
    }
}

/* Select2 overrides */
.cobs-support-ticket-page .select2-search__field,
.single-product .select2-search__field,
.cobs-support-ticket-page .select2-container--default .select2-search--dropdown,
.single-product .select2-container--default .select2-search--dropdown {
    padding: 4px!important;
}

.cobs-support-ticket-page .select2-container--default .select2-results__option,
.single-product .select2-container--default .select2-results__option {
    padding: 6px!important;
}

.cobs-support-ticket-page .select2-results__options li:focus,
.single-product .select2-results__options li:focus {
    border-radius: 0!important;
}

/* Custom class for HTML field in Support Candy */
.support-ticket-html {
    line-height: 1.4;
}

.support-ticket-html p {
    margin-bottom: 10px;
}

/* Product page */
#tab-product_help_tab {
    padding-left: 0;
    padding-right: 0;
}

/* Remove white background - parent class needed to be added to content */
.wpsc-nobg #wpsc-container .wpsc-shortcode-container {
    background-color: transparent!important;
}

.wpsc-nobg .wpsc-shortcode-container .wpsc-body {
    padding-top: 0;
}

.wpsc-nobg .wpsc-body {
    margin-left: -15px;
    margin-right: -15px;
    width: calc(100% + 30px);
}

.wpsc-nobg #wpsc-container div.mce-panel {
    border: 1px solid #c5c5c5;
    box-sizing: border-box;
}

.wpsc-nobg #wpsc-container select,
.wpsc-nobg #wpsc-container .select2-container .select2-selection {
    background-color: #fff;
}

body .wpsc-tag {
    font-size: 0.825rem;
    padding: 3px 6px;
}
