/* Hide native WooCommerce rows only when AK Visual Variations replaces them. */
.variations_form .variations tr.ak-native-variation-row-hidden {
    display: none;
}

.ak-variation-select {
    width: 100%;
    max-width: 1500px;
    margin: 0 0 1.5rem;
}

.ak-variation-group {
    min-width: 0;
    margin: 0 0 1.5rem;
    padding: 0;
    border: 0;
}

/* Attribute heading, e.g. Size / Grind. */
.ak-variation-label {
    font-family: Cardo;
    display: block;
    width: 100%;
    margin: 0 0 .75rem;
    padding: 0;
    font-size: 1.2em;
    font-weight: 700;
    color: #000;
}

/* Three evenly distributed choices per row on tablet/desktop. */
.ak-variation-options {
    display: grid;
    grid-template-columns: repeat(var(--ak-columns-desktop, 3), minmax(0, 1fr));
    gap: var(--ak-gap, 1rem);
    width: 100%;
    align-items: start;
}

/* The whole item remains clickable, but only the image is visually boxed. */
.ak-variation-option,
.ak-variation-option:hover,
.ak-variation-option:focus,
.ak-variation-option:active,
.ak-variation-option.is-selected {
    appearance: none;
    -webkit-appearance: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    color: inherit;
    font: inherit;
    line-height: 1.3;
    text-align: center;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0;
    box-shadow: none !important;
    outline: 0;
    cursor: pointer;
}

/* Only the image box receives hover/selected borders.
 * It expands to fill its grid column while retaining internal padding. */
.ak-variation-image-wrap {
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: var(--ak-image-max-width, none);
    aspect-ratio: var(--ak-image-ratio, 1 / 1);
    margin: 0 auto .45rem;
    padding: 5px;
    overflow: hidden;
    transition: border-color .15s ease, opacity .15s ease, box-shadow .15s ease;
}

.ak-variation-option:hover:not(:disabled) .ak-variation-image-wrap,
.ak-variation-option:focus-visible .ak-variation-image-wrap {
    border: solid;
    border-color: #c9ab83;
        border-width: 1px;
}

.ak-variation-option:focus-visible .ak-variation-image-wrap {
    border: solid;
    border-color: #000 !important;
        border-width: 1px;
}

.ak-variation-option.is-selected .ak-variation-image-wrap {
    border: solid;
    border-color: #000 !important;
        border-width: 1px;
}

.ak-variation-option.is-unavailable,
.ak-variation-option:disabled {
    opacity: .35;
    cursor: not-allowed;
}

.ak-variation-image {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    object-fit: var(--ak-image-fit, cover);
}

/* Term name sits outside the bordered image box. */
.ak-variation-name,
.ak-variation-option.is-selected .ak-variation-name {
        color: #1f3b62;
        font-family: Cardo;
        font-size: 13px;
        opacity: 0.85;
    display: block;
    max-width: 100%;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    font-weight: 300;
    text-align: center;
}

.ak-variation-option.is-selected .ak-variation-name {
        opacity: 1;
}

/* Per-attribute responsive column counts. */
@media (max-width: 768px) {
    .ak-variation-options {
        grid-template-columns: repeat(var(--ak-columns-tablet, 3), minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .ak-variation-options {
        grid-template-columns: repeat(var(--ak-columns-mobile, 2), minmax(0, 1fr));
    }
}

/* Debug panel: enable with ?akvs_debug=1 on a product URL. */
.akvs-debug-panel {
    margin: 1rem 0 1.5rem;
    padding: .85rem;
    border: 1px solid #8c8f94;
    background: #fff;
    color: #1d2327;
    font-size: 12px;
    line-height: 1.45;
}

.akvs-debug-panel strong {
    display: block;
    margin-bottom: .5rem;
}

.akvs-debug-output {
    margin: 0;
    padding: .75rem;
    max-height: 360px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    font: 12px/1.45 monospace;
}

.akvs-debug-copy {
    margin-top: .65rem;
}

