/* Product Variations Styling */

.kalitho-variations-wrapper {
    margin-bottom: 1rem;
    /* Prevent layout shift on toggle */
}

.kalitho-attribute-row {
    margin-bottom: 1.5rem;
}

.kalitho-attribute-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #111;
}

.kalitho-attribute-selected-value {
    font-weight: 400;
    color: #666;
    text-transform: capitalize;
    margin-left: 0.5rem;
}

.kalitho-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Color Swatches */
.swatch-item {
    position: relative;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    border: 1px solid #e5e5e5;
    transition: all 0.1s ease;
}

.swatch-item:hover {
    transform: none;
}

.swatch-item.selected {
    border-color: transparent;
    /* Or keep border if needed, but outline is requested */
    outline: 1px solid #000;
    outline-offset: 4px;
    box-shadow: none;
}

.swatch-item.out-of-stock {
    opacity: 0.5;
    position: relative;
}

.swatch-item.out-of-stock::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 1px;
    background: #999;
    transform: translate(-50%, -50%) rotate(45deg);
}

/* Size/Material Buttons */
.button-item {
    padding: 4px 12px;
    border: none;
    background: #f2f2f2;
    cursor: pointer;
    font-size: 13px;
    color: #111;
    transition: all 0.2s ease;
    min-width: 3rem;
    text-align: center;
    border-radius: 30px;
    font-weight: 400;
    text-transform: uppercase;
}

.button-item:hover {
    background: #e6e6e6;
}

.button-item.selected {
    background: #ffffff;
    color: #000;
    border: 1.5px solid #000;
    box-shadow: none;
}

.button-item.out-of-stock {
    opacity: 0.5;
    background: #f9f9f9;
    color: #999;
    text-decoration: line-through;
    pointer-events: none;
    /* Optional: completely disable */
}

/* Size Guide Link */
.size-guide-link {
    font-size: 0.8rem;
    text-decoration: underline;
    color: #666;
    cursor: pointer;
}

.size-guide-link:hover {
    color: #000;
}

/* Model Stats */
.model-stats {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #666;
    background: #f9fafb;
    padding: 0.5rem 0.75rem;
    display: inline-block;
}

/* Stock Urgency */
.stock-urgency {
    color: #c2410c;
    /* Orange-700 */
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stock-urgency i {
    font-size: 1rem;
}

/* Hide default Selects (But keep them in DOM for form submission) */
.kalitho-hidden-selects,
.variations {
    opacity: 0;
    position: absolute;
    left: -9999px;
    visibility: hidden;
    height: 0;
}

/* Single Variation Price update */
.woocommerce-variation-price,
.variable-item-contents .price {
    display: none !important;
}

/* PDP Price Styling - BDI specific */
.pdp-price bdi,
.pdp-price .amount bdi {
    font-size: 16px !important;
    font-weight: 400 !important;
    color: #000 !important;
}

/* Quantity Input Restyling */
.quantity {
    display: inline-flex;
    align-items: center;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    width: fit-content;
    margin-right: 1rem;
    height: 44px;
    vertical-align: middle;
}

.quantity .qty {
    border: none !important;
    text-align: center;
    width: 3rem;
    padding: 0;
    margin: 0;
    height: 100%;
    -moz-appearance: textfield;
    appearance: textfield;
    background: transparent;
    font-weight: 500;
}

.quantity .qty::-webkit-outer-spin-button,
.quantity .qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qty-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0 0.8rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #111;
    font-size: 0.75rem;
    transition: background 0.2s;
}

.qty-btn:hover {
    background: #f9f9f9;
}

/* Shake Animation */
@keyframes shake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-5px);
    }

    100% {
        transform: translateX(0);
    }
}

.shake {
    animation: shake 0.4s ease-in-out;
}

/* Visually Disabled Add to Cart & Buy Now (Interactive for Shake) */
.single_add_to_cart_button.disabled-state,
.btn-buy-now.disabled-state {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #e5e5e5 !important;
    color: #999 !important;
    border-color: #e5e5e5 !important;
    /* Allow clicks to trigger shake feedback */
    pointer-events: auto !important;
}

/* Specific styling for disabled-state Buy Now button */
.btn-buy-now.disabled-state {
    background-color: #5a5a5a !important;
    color: #ffffff !important;
}

/* Add to Cart Button Success State */
.single_add_to_cart_button.success-state {
    /* Kept intentionally empty to override previous green styling */
    transition: all 0.3s ease;
}

.single_add_to_cart_button .fa-spinner {
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}