.cg-custom-length-wrapper {
    margin-top: 1.5em;
}

.cg-custom-length-tabs {
    display: flex;
    gap: 0.5rem;
    margin: 10px 0;
}

.cg-length-tab {
    padding: 0;
    font-weight: 700;
    border-top: 0;
    text-transform: uppercase;
    font-size: .8em;
    cursor: pointer;
    color: hsla(0, 0%, 40%, .85);
}

.cg-length-tab.is-active {
    border-top: 2px solid #37549c;
    color: #222;
}

.cg-length-tab[data-tab="custom"] {
    position: relative;
    display: inline-block;
    overflow: hidden;
}

.cg-length-tab[data-tab="custom"] .cg-tab-pill {
    position: relative;
    z-index: 2;
}

.cg-length-tab[data-tab="custom"]:not(.is-active, .active) .cg-tab-pill-wrap::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #ff9600;
    transform: translateX(-100%);
    animation: slideInBorder 3s 2s infinite;
    z-index: 1;
}

@keyframes slideInBorder {
    0% {
        transform: translateX(-100%);
    }

    40% {
        transform: translateX(100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.cg-tab-pill {
    color: #ff9600;
}

.cg-custom-length-panel {
    border: 1px solid #e5e5e5;
    padding: 1rem;
    background: #fff;
}

.cg-custom-length-control {
    margin-bottom: 1em;
}

#cg_custom_length_inputs label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25em;
}

#cg_custom_length_inputs .cg-field-hint {
    display: block;
    font-size: 0.85em;
    margin: 0 0 0.35em;
    color: #6c6c6c;
}

#cg_custom_length_inputs input[type="number"],
#cg_custom_length_inputs select {
    width: 100%;
    max-width: 100%;
}

.cg-custom-length-tolerance {
    font-size: 0.875em;
    color: #555;
    background: #f8f8f8;
    padding: 0.75em;
    border-left: 3px solid #0073aa;
    margin-top: 1em;
}

.cg-custom-length-message {
    margin-top: 1em;
    font-weight: 600;
}

.cg-custom-length-message strong {
    display: inline-block;
    font-size: 19px;
    font-weight: 700;
}

.cg-custom-length-message.cg-custom-length-error {
    color: #b32d2e;
    font-weight: 500;
}

.cg-custom-length-breakdown {
    margin-top: 0.75em;
    font-weight: normal;
    font-size: 0.875em;
    color: #444;
}

.cg-custom-length-breakdown ul {
    margin: 0.35em 0 0 1.2em;
    padding: 0;
    list-style: disc;
}

.cg-custom-meta-hidden .product-info .product-title .variation-title,
.cg-custom-meta-hidden .product-info .product_meta .woocommerce-variation-attributes,
.cg-custom-meta-hidden .product-info .product_meta .variation-attributes {
    display: none !important;
}

.cg-custom-length-wrapper.cg-is-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.cg-custom-length-wrapper.cg-is-loading:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    margin: -16px 0 0 -16px;
    border: 3px solid rgba(0, 0, 0, 0.2);
    border-top-color: #555;
    border-radius: 50%;
    animation: cg-spin 0.6s linear infinite;
    z-index: 2;
}

@keyframes cg-spin {
    to {
        transform: rotate(360deg);
    }
}

form.cg-custom-length-active .single_variation .price,
form.cg-custom-length-active .woocommerce-variation-price {
    display: none !important;
}

.product-gallery.cg-gallery-transition,
.product-info.cg-summary-transition {
    transition: all 0.3s ease;
}
