/* Woaly Product Swatches - Frontend CSS */
/* Base styles (from plugin) + Woaly theme overrides merged */

.wpcvs-empty, .wpcvs-terms + select:not(.wpcvs-select), .wpcvs-term.wpcvs-disabled:after, .wpcvs-term.wpcvs-disabled:before, .wpcvs-term.wpcvs-out-of-stock:after, .wpcvs-term.wpcvs-out-of-stock:before {
    display: none !important;
}

.wpcvs-terms {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    margin-left: 0;
    margin-right: 0;
}

.wpcvs-terms .wpcvs-term {
    display: inline-block;
    cursor: pointer;
    text-align: center;
    margin: 3px 6px 3px 0;
    padding: 0 !important;
    border-radius: 12px !important;
    border: 1px solid #eeedec !important;
    background-color: #ffffff;
    position: relative;
    box-sizing: border-box;
    float: none;
    overflow: hidden !important;
}

.wpcvs-terms .wpcvs-term .wpcvs-term-inner {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center;
    align-content: center !important;
    justify-content: center !important;
    line-height: 34px;
    position: relative;
    background-color: #efefef;
}

.wpcvs-terms .wpcvs-term.wpcvs-selected {
    border: 2px solid #242638 !important;
}

.wpcvs-terms .wpcvs-term.wpcvs-selected .wpcvs-term-inner:before {
    display: none !important;
}

.wpcvs-terms .wpcvs-term.wpcvs-disabled,
.wpcvs-terms .wpcvs-term.wpcvs-out-of-stock {
    opacity: 0.4;
    cursor: default;
}

/* Image type */
.wpcvs-terms.wpcvs-type-image .wpcvs-term {
    height: 42px;
    width: 42px;
}

.wpcvs-terms.wpcvs-type-image .wpcvs-term .wpcvs-term-image {
    font-size: 0;
    border-radius: 2px;
    width: 34px;
    flex: 0 0 34px;
}

.wpcvs-terms.wpcvs-type-image .wpcvs-term .wpcvs-term-image img {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 2px;
}

/* Color type */
.wpcvs-terms.wpcvs-type-color.wpcvs-show-label-no.wpcvs-style-square {
    display: grid !important;
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    gap: 8px !important;
}

.wpcvs-terms.wpcvs-type-color .wpcvs-term {
    width: 100% !important;
    height: fit-content !important;
    aspect-ratio: 1 / 1 !important;
}

.wpcvs-terms.wpcvs-type-color .wpcvs-term .wpcvs-term-color {
    font-size: 0 !important;
    border-radius: 6px !important;
    width: 86% !important;
    height: 86% !important;
    flex: none !important;
}

/* Button type */
.wpcvs-terms.wpcvs-type-button.wpcvs-show-label-no.wpcvs-style-square {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
}

.wpcvs-terms.wpcvs-type-button .wpcvs-term {
    height: 3.5em !important;
    min-width: 3.5em !important;
    line-height: 40px;
    transition: all 300ms ease !important;
}

.wpcvs-terms.wpcvs-type-button .wpcvs-term .wpcvs-term-inner {
    height: 100% !important;
    background-color: white !important;
    border-radius: 2px;
}

.wpcvs-terms.wpcvs-type-button .wpcvs-term .wpcvs-term-inner .wpcvs-term-label {
    padding: 0 10px;
    width: 100%;
}

/* Radio type */
.wpcvs-terms.wpcvs-type-radio .wpcvs-term {
    display: block;
    width: calc(100% - 6px);
    text-align: start;
}

.wpcvs-terms.wpcvs-type-radio .wpcvs-term .wpcvs-term-inner {
    display: flex;
    align-items: center;
}

.wpcvs-terms.wpcvs-type-radio .wpcvs-term .wpcvs-term-radio {
    width: 34px;
    flex: 0 0 34px;
    text-align: center;
}

.wpcvs-terms.wpcvs-type-radio .wpcvs-term .wpcvs-term-label {
    padding: 0 10px;
}

.wpcvs-terms.wpcvs-type-radio .wpcvs-term input[type=radio] {
    outline: none;
    pointer-events: none;
}

/* Rounded style */
.wpcvs-terms.wpcvs-style-rounded .wpcvs-term {
    border-radius: 21px;
}

.wpcvs-terms.wpcvs-style-rounded .wpcvs-term .wpcvs-term-inner {
    border-radius: 17px;
}

.wpcvs-terms.wpcvs-style-rounded .wpcvs-term .wpcvs-term-image img {
    border-radius: 50%;
}

.wpcvs-terms.wpcvs-style-rounded .wpcvs-term .wpcvs-term-color {
    border-radius: 21px;
}

/* Show label */
.wpcvs-terms.wpcvs-show-label-yes .wpcvs-term {
    width: auto;
}

.wpcvs-terms.wpcvs-show-label-yes .wpcvs-term .wpcvs-term-label {
    padding-left: 10px;
    padding-right: 10px;
}

/* Group */
.wpcvs-group {
    flex-grow: 1;
    display: block;
    width: 100%;
}

.wpcvs-more {
    display: inline-block;
    margin: 6px 3px 0 3px;
    padding: 3px;
    height: 42px;
    line-height: 42px;
    position: relative;
    float: left;
}

/* Stacked layout */
.variations.wpcvs-attributes.wpcvs-attributes-stacked.wpcvs-initialized {
    display: flex;
    flex-direction: column;
    gap: 1.1em;
    margin-top: 0.6em;
}

.wpcvs-attributes-stacked .wpcvs-attribute-label label {
    font-weight: 700;
    color: #333333;
}

.wpcvs-attributes-stacked .wpcvs-attribute-label label:after {
    content: ":";
}

/* Single replacement: hide WC variation price/desc when theme handles it */
.wpcvs-single-replacement-enable:not(.woovr-active) .single_variation_wrap .woocommerce-variation-description,
.wpcvs-single-replacement-enable:not(.woovr-active) .single_variation_wrap .woocommerce-variation-price {
    display: none !important;
}

/* Table layout (default) */
table.variations.wpcvs-initialized tr {
    display: flex;
    align-items: center;
}

table.variations.wpcvs-initialized tr .label {
    width: 100px;
    flex: 0 0 100px;
}

table.variations.wpcvs-initialized tr .value {
    flex-grow: 1;
}

/* RTL */
body.rtl .wpcvs-term {
    float: right;
}

/* Tippy tooltip styles */
.wpcvs-tippy-inner {
    padding: 5px 1px;
    display: flex;
    flex-direction: column;
    text-align: center;
    align-items: center;
    justify-content: center;
}

.wpcvs-tippy-inner .wpcvs-tippy-title {
    font-weight: 700;
}

.wpcvs-tippy-inner > span {
    margin-bottom: 5px;
}

.wpcvs-tippy-inner > span:last-child {
    margin-bottom: 0;
}

.wpcvs-tippy-inner .wpcvs-tippy-swatches span {
    display: block;
    width: 100%;
    min-width: 150px;
    min-height: 150px;
    max-width: 600px;
    font-size: 0;
}

.wpcvs-tippy-swatches--color, .wpcvs-tippy-swatches--image img {
    width: 100%;
    height: auto;
    border-radius: 3px;
    margin: 0 !important;
    padding: 0 !important;
}
