/* Hide default WooCommerce dropdown */
.variations select {
    display: none !important;
}

/* ===== RESPONSIVE GRID ===== */
.cart .variation-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(66px, 1fr));
    gap: 1rem; 
    width: 100%;
    margin-top: 10px;
    padding-right: 1rem;
}

/* ===== HARD RESET (OVERRIDES ELEMENTOR) ===== */
.cart button.variation-btn {
    all: unset;                     /* Kill Elementor button styles */
    box-sizing: border-box;
    margin: 0 !important;
    border: none !important;
    color: inherit !important;
    font-family: inherit !important;
    text-transform: none !important;
    line-height: normal !important;
    cursor: pointer;
}

.cart button.variation-btn.has-image {
    padding: 0 !important;
    background: none !important;
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 1 / 1;
    position: relative;
    text-align: center;
}

/* ===== BASE TILE ===== */
.cart button.variation-btn {
    display: grid;
    place-items: center;
    position: relative;
    text-align: center;
    width: 100%;
    aspect-ratio: 1 / 1;            /* Equal square tiles */
}

/* Text label inside text-only buttons */
.swatch-text {
    color: #938b8b;
    font-size: 12px;
    text-align: center;
    padding: 2px 4px;
}

/* ===== IMAGE SWATCH ===== */
.cart .variation-btn.has-image .swatch-image {
    width: 100%;
    height: 100%;
    border-radius: 2px;
    border: 1px solid #ccc;
    background-size: cover;
    background-position: center;
}

/* Label under image */
.cart .variation-btn.has-image .swatch-label {
    position: absolute;
    bottom: -0.8rem; /* space under tile */
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    white-space: nowrap;
    text-align: center;
}

/* Selected buttons (image or text) */
.cart .variation-btn.selected,
.cart .variation-btn.has-image.selected .swatch-image,
.cart .variation-btn.text-only.selected {
    border: 2px solid #dc7028 !important; /* Brand color */
}

/* ===== TEXT BUTTON ===== */
.cart .variation-btn.text-only {
    border: 1px solid #ccc;
    background: #fff;
    font-size: 14px;
    line-height: 1.2;
    display: grid;
    place-items: center;
}

/* Disabled buttons */
.cart .variation-btn.disabled,
.cart .variation-btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
    border-color: #ccc !important;
}

/* Optional: hover effect for both */
.cart .variation-btn:hover:not(.selected):not(.disabled) {
    border: 2px solid rgba(186,101,44,0.5);
}

/* Table header spacing */
form.variations_form.cart table.variations th.label {
    padding: 20px 15px 0 0 !important;
}

.cart button.variation-btn.variation-btn.text-only {
      aspect-ratio: auto !important;
}
.variations td.value {
    position: relative;
}

.variations .reset-top-right {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 12px;
    color: #ba652c;
    cursor: pointer;
    z-index: 5;
    text-decoration: underline;
}

.variations .reset-top-right:hover {
    opacity: 0.85;
}
.variations .reset-top-right {
    display: none;
}

.variations_form.has-selection .reset-top-right {
    display: block;
}
