/**
 * Variation Swatches - Frontend Styles
 *
 * @package HelloElementorChild
 */

:root {
    --hec-swatch-selected: #E89611;
    --hec-swatch-border: #D3D3D3;
    --hec-swatch-text: #232323;
    --hec-swatch-text-muted: #666769;
}

/* ========================================
   Variations Container
   ======================================== */

.hec-variations {
    display: flex;
    flex-direction: column;
    gap: 28px;
    width: 100%;
}

/* ========================================
   Variation Row (each attribute)
   ======================================== */

.hec-variation-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ========================================
   Label: "Select Color: White"
   ======================================== */

.hec-variation-label {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 18px;
}

.hec-variation-label-text {
    font-weight: 700;
    color: var(--hec-swatch-text);
}

.hec-variation-selected-value {
    font-weight: 400;
    color: var(--hec-swatch-text-muted);
}

/* ========================================
   Options Container
   ======================================== */

.hec-variation-options {
    display: flex;
    flex-direction: column;
}

/* Hide the WooCommerce select */
.hec-hidden-select {
    display: none !important;
}

/* ========================================
   Swatches Container
   ======================================== */

.hec-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* ========================================
   Base Swatch Button
   ======================================== */

.hec-swatch {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid var(--hec-swatch-border) !important;
    background: none;
    padding: 0;
    font-family: inherit;
    border-radius: 0 !important;
}

.hec-swatch:focus {
    outline: none;
}

.hec-swatch:focus-visible {
    box-shadow: 0 0 0 2px var(--hec-swatch-selected);
}

/* ========================================
   Color Swatch - Square
   ======================================== */

.hec-swatch-color[type=button] {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 0 !important;
    aspect-ratio: 1;
    flex-shrink: 0;
}

.hec-swatch-color:hover:not(.disabled) {
    border-color: var(--hec-swatch-selected) !important;
}

.hec-swatch-color.selected {
    border-color: var(--hec-swatch-selected) !important;
    border-width: 1px !important;
}

/* ========================================
   Label Swatch - Outlined Boxes
   ======================================== */

.hec-swatch-label {
    min-width: 48px;
    height: auto;
    padding: 15px 20px;
    border-radius: 0 !important;
    background: none !important;
    font-size: 14px;
    font-weight: 700;
    color: var(--hec-swatch-text-muted) !important;
}

.hec-swatch-label:hover:not(.disabled),
.hec-swatch-label:focus:not(.disabled) {
    border-color: var(--hec-swatch-selected) !important;
    color: var(--hec-swatch-text) !important;
}

.hec-swatch-label.selected,
.hec-swatch-label.selected:hover,
.hec-swatch-label.selected:focus {
    border-color: var(--hec-swatch-selected) !important;
    border-width: 2px;
    background: none !important;
    color: var(--hec-swatch-text) !important;
}

/* ========================================
   Disabled State
   ======================================== */

.hec-swatch.disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.hec-swatch-color.disabled {
    position: relative;
}

.hec-swatch-color.disabled::after {
    content: '';
    position: absolute;
    top: 50%;
    left: -1px;
    right: -1px;
    height: 1px;
    background: #999;
    transform: rotate(-45deg);
}

.hec-swatch-label.disabled {
    text-decoration: line-through;
}

/* ========================================
   Screen Reader Text
   ======================================== */

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ========================================
   Variation Price Styling
   ======================================== */

.woocommerce-variation-price .hec-price {
    font-size: 28px;
}
