/**
 * Theme Name:  Excelsior Product Manager
 * Theme URI:   https://excelsiorcomics.com.br
 * Description: Tema para o projeto base do Kablam
 * Version:     1.0.0
 * Author:      Alex Koti
 * Author URI:  https://alexkoti.com
 * License:     GNU General Public License
 */



/**
 * Normalize
 * 
 * @link https://necolas.github.io/normalize.css/
 * 
 */
html {line-height: 1.15;-webkit-text-size-adjust: 100%;}body {margin: 0;}main {display: block;}h1 {font-size: 2em;margin: 0.67em 0;}hr {box-sizing: content-box;height: 0;overflow: visible;}pre {font-family: monospace, monospace;font-size: 1em;}a {background-color: transparent;}abbr[title] {border-bottom: none;text-decoration: underline;text-decoration: underline dotted;}b, strong {font-weight: bolder;}code, kbd, samp {font-family: monospace, monospace;font-size: 1em;}small {font-size: 80%;}sub, sup {font-size: 75%;line-height: 0;position: relative;vertical-align: baseline;}sub {bottom: -0.25em;}sup {top: -0.5em;}img {border-style: none;}button, input, optgroup, select, textarea {font-family: inherit;font-size: 100%;line-height: 1.15;margin: 0;}button, input {overflow: visible;}button, select {text-transform: none;}button, [type="button"], [type="reset"], [type="submit"] {-webkit-appearance: button;}button::-moz-focus-inner, [type="button"]::-moz-focus-inner, [type="reset"]::-moz-focus-inner, [type="submit"]::-moz-focus-inner {border-style: none;padding: 0;}button:-moz-focusring, [type="button"]:-moz-focusring, [type="reset"]:-moz-focusring, [type="submit"]:-moz-focusring {outline: 1px dotted ButtonText;}fieldset {padding: 0.35em 0.75em 0.625em;}legend {box-sizing: border-box;color: inherit;display: table;max-width: 100%;padding: 0;white-space: normal;}progress {vertical-align: baseline;}textarea {overflow: auto;}[type="checkbox"], [type="radio"] {box-sizing: border-box;padding: 0;}[type="number"]::-webkit-inner-spin-button, [type="number"]::-webkit-outer-spin-button {height: auto;}[type="search"] {-webkit-appearance: textfield;outline-offset: -2px;}[type="search"]::-webkit-search-decoration {-webkit-appearance: none;}::-webkit-file-upload-button {-webkit-appearance: button;font: inherit;}details {display: block;}summary {display: list-item;}template {display: none;}[hidden] {display: none;}


body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

* {
    box-sizing: border-box;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
}

p:first-child {
    margin-top: 0;
}

p:last-child {
    margin-bottom: 0;
}

label {
    cursor: pointer;
}

/**
 * Auxiliar
 * 
 */
.container {
    margin: 0 auto;
    max-width: 1200px;
}

#site {
    outline: 1px dotted #333;
}

#site-header {
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    outline: 1px dotted #333;
}

#site-header #kablam-logo {
    font-size: 26px;
    font-weight: bold;
}

#site-header nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

#site-header nav a {
    padding: 10px;
    outline: 1px dotted #333;
}

#content {
    padding: 10px;
    outline: 1px dotted #333;
}

#content::before {
    clear: both;
    content: "";
    display: table;
}

.excs-form .boros_form_element {
    margin: 0 0 20px;
}

.excs-form .boros_form_element:not(.boros_element_checkbox) label {
    display: block;
}

.form_errors {
    color: red;
    margin: 0 0 20px;
}

.form_errors .alert-message {
    
}

.form_errors .alert-message p {
    margin: 0;
}

/* ao enviar formulário, desativar elementos internos até o retorno da requisição */
.disabled .product,
.disabled .add-category-control-box > * {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

/**
 * Grid products
 * 
 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: 1fr;
    grid-column-gap: 1px;
    grid-row-gap: 1px;
}
.product-grid h2 {
    font-size: 0.9rem;
    font-weight: normal;
    margin: 0;
}
.product-grid .product {
    flex-basis: 20%;
    border: 1px dotted #ccc;
    position: relative;
}
.product.owned {
    border-color: green;
    background-color: rgba(4, 128, 0, 0.5);
}



/**
 * Product
 * 
 */
.product {
    
}
.single .product .product-desc {
    padding: 10px;
}
.single .product .product-desc h2 {
    margin: 0;
}


/**
 * CHECKBOX CONTROLS
 * 
 */
.product .product-check {
    display: none;
}
.circle {
    border: 1px solid #ccc;
    border-radius: 100%;
    width: 50px;
    height: 50px;
}
.product label {
    cursor: pointer;
}
.product .circle {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    border: 1px solid #666;
}
.product .circle:hover {
    background-color: rgba(4, 128, 0, 0.596);
}
.product .area {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 11;
    width: 100%;
    height: 100%;
    /* background-color: #75414149; */
}
.product label:hover .area {
    background-color: #7faabe6e;
}
.product input[type="checkbox"]:checked + label .circle {
    background-color: rgb(4, 128, 0);
}
.product .link {
    position: relative;
    z-index: 12;
}
.product .link a:hover {
    background-color: #a1b5f881;
}
.product-grid .product:has( input[type="checkbox"]:checked ) {
    transform: scale(95%);
}
.product-grid:has( input[type="checkbox"]:checked ) .product .link {
    z-index: 9;
}
.expm-add-category-to-product .add-category-control-box {
    display: none;
    /* display: flex; */
}

/* sempre mostrar controle na single */
body.single .expm-add-category-to-product .add-category-control-box {
    display: flex;
}

/* single de produto */
@media (min-width: 576px) {
    body.single .user-tags {
        padding: 10px 0;
    }
    body.single .expm-add-category-to-product {
        /* margin: 0 -10px -10px; */
    }
    body.single .expm-add-category-to-product .add-category-control-box {
        position: relative;
    }
}

/* compensar espaçamento quando a caixa de controles estiver visível */
body:has( input[type="checkbox"]:checked ) {
    padding-bottom: 200px;
}
@media (min-width: 576px) {
    body:has( input[type="checkbox"]:checked ) {
        padding-bottom: 70px;
    }
}

/* mostrar caixa com os controles ao acionar qualquer checkbox de produto */
.products:has( input[type="checkbox"]:checked ) .add-category-control-box {
    display: flex;
}
/* quando selecionar ao menos um check de produto não possuído, desativar botão de remover,
apenas quando todo os checks forem de produtos já possuídos, é que o botão ficará ativo */
.products:has( .product:not(.owned) input[type="checkbox"]:checked ) #remove-all {
    opacity: 0.5;
    pointer-events: none;
}
#add-all {
    opacity: 0.5;
    pointer-events: none;
}
/* ao habilitar o botão de adição, certificar que form não está no modo disabled */
.products:not(.disabled):has( .product:not(.owned) input[type="checkbox"]:checked ) #add-all {
    opacity: 1;
    pointer-events: all;
}
#remove-all {
    
}


/**
 * FIXED CONTROLS
 * 
 */
.add-category-control-box {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    background-color: #fff;
    z-index: 9999999;
    display: flex;
    gap: 20px;
    flex-direction: column;
    align-items: start;
}

/* permitir rolagem vertical quando tiver muitas categorias */
/* @todo revisar conforme a altura final disponível */
.user-product-categories-box {
    max-height: 280px;
    overflow: auto;
}

.user-product-categories {
    margin: 0;
    padding: 0;
    list-style: none;
    column-count: 2;
    column-gap: 10px;
}
.user-product-categories li {
    margin: 2px 0;
}
.user-product-categories label {
    word-break: break-all;
    display: block;
    padding: 4px 6px;
    border: 1px dotted #ccc;
    border-radius: 4px;
    display: flex;
    gap: 5px;
    align-items: center;
}
.user-product-categories label .text {
    display: -webkit-box; 
    -webkit-box-orient: vertical; 
    -webkit-line-clamp: 2; 
    overflow: hidden; 
    text-overflow: ellipsis;
    flex: 1;
}
.user-product-categories label:hover {
    border: 1px solid #666;
}
.user-product-categories label:before {
    content: '';
    width: 14px;
    height: 14px;
    display: block;
    border: 1px solid #ccc;
    background-color: #fff;
}
.user-product-categories input {
    display: none;
}
.user-product-categories input:checked + label {
    border: 1px solid #bbb;
    background-color: #ccc;
}
.user-product-categories input:checked + label:before {
    /* content: '✔'; */
    border-color: #333;
    background-color: #666;
}

.info-reset label {
    display: flex;
    gap: 10px;
    align-items: center;
    padding-right: 10px;
}
.info-reset label button {
    background-color: #f0f0f0;
    border: none;
    padding: 0;
    width: 50px;
    height: 50px;
    cursor: pointer;
    line-height: 0;
}
.info-reset label .total {
    display: flex;
    gap: 5px;
}
#add-remove-control {
    display: flex;
    gap: 10px;
}
#add-remove-control .input-control {
    position: relative;
}
#add-remove-control .input-control input {
    display: none;
}
#add-remove-control .input-control label {
    padding: 6px;
    border: 1px solid #ccc;
    display: flex;
    gap: 5px;
    align-items: center;
}
#add-remove-control .input-control.active{
    border-color: green;
    background-color: rgba(0, 255, 0, 0.5);
}
#add-remove-control .input-control input:checked + label {
    border-color: red;
    background-color: rgba(255, 0, 0, 0.363);
}

#add-categories-display {
    display: none;
}
[for="add-categories-display"] {
    background-color: #f0f0f0;
    border: none;
    padding: 10px;
    cursor: pointer;
    display: inline-block;
    user-select: none;
}
#category-control {
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-start;
    position: relative;
    width: 100%;
}
#category-control .fields {
    display: none;
    background-color: #fff;
    border-top: 1px solid #ccc;
    padding: 10px 0;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    /* display: flex; */
}
#category-control:has( #add-categories-display:checked ) .fields {
    display: flex;
}
#category-control-apply {
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    padding: 10px;
    cursor: pointer;
    display: block;
    user-select: none;
}
#category-control-apply:hover {
    background-color: #bbb;
}

@media (min-width: 576px) {
    .add-category-control-box {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    #category-control {
        align-items: flex-end;
        flex-direction: column;
        width: auto;
    }
    #category-control .fields {
        border: 1px solid #ccc;
        border-bottom: 0;
        position: absolute;
        right: -11px;
        bottom: calc(100% + 16px);
        min-width: 300px;
        padding: 10px 10px 0;
    }
    /* na individual a altura do controle é menor pois não possui o botão de remover seleção */
    body.single #category-control .fields {
        bottom: calc(100% + 10px);
    }
    .user-product-categories {
        column-count: 2;
    }
}


.product-grid .product .expm-ajax-actions {
    font-size: 14px;
    display: flex;
    flex-direction: column;
}
.product-grid .product .expm-ajax-actions > .message {
    padding: 0 10px;
}
.product-image {
    background-color: #919191;
    min-height: 200px;
    position: relative;
}
.product-image .issue-number {
    color: #fff;
    text-shadow: 1px 1px 1px #333;
    font-size: 2rem;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}
.product-desc {
    
}
.product-desc a {
    display: block;
    padding: 10px;
}
.product-desc a:hover {
    background-color: #5ca59f;
}
.user-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 5px;
}
.user-tags span {
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 2px 6px;
}
@media (min-width: 576px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (min-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}
@media (min-width: 992px) {
    .product-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}


.pagination {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    margin: 0;
    padding: 20px;
}
.pagination a,
.pagination span {
    border: 1px solid;
    display: block;
    padding: 10px 14px;
    text-decoration: none;
}



/**
 * Footer
 * 
 */
body > footer {
    outline: 1px dotted;
    padding: 1rem;
}


