﻿/* Phase 16B.1 - Shared product variation editor */

.bsb-variation-editor {
    width: 100%;
    grid-column: 1 / -1;
    box-sizing: border-box;
    padding: 20px;
    margin: 16px 0;
    border: 1px solid #d9d3c8;
    border-radius: 12px;
    background: #faf8f4;
    color: #292b25;
}

.bsb-variation-editor h3 {
    margin: 0 0 16px;
    font-size: 20px;
}

.bsb-variation-editor label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
}

.bsb-variation-editor input,
.bsb-variation-editor select {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #d9d3c8;
    border-radius: 6px;
    background: #ffffff;
    color: #292b25;
    font-size: 14px;
}

.bsb-variation-editor input:focus,
.bsb-variation-editor select:focus {
    outline: 2px solid #536b3d;
    outline-offset: 2px;
}

.bsb-variation-editor .bsb-variation-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
    gap: 14px;
    padding: 16px;
    margin: 14px 0;
    background: #ffffff;
    border: 1px solid #e2ddd4;
    border-radius: 8px;
}

.bsb-variation-row > strong {
    grid-column: 1 / -1;
    font-size: 14px;
    color: #536b3d;
}

.bsb-variation-editor input[type="color"] {
    height: 42px;
    padding: 4px;
    cursor: pointer;
}

.bsb-variation-editor button {
    width: auto;
    min-height: 40px;
    padding: 9px 14px;
    border-radius: 6px;
    cursor: pointer;
    white-space: normal;
}

.bsb-variation-row > button {
    grid-column: 1 / -1;
    justify-self: end;
    color: #914545;
    border: 1px solid #d8baba;
    background: #fff;
}

.bsb-variation-editor > button {
    background: #536b3d;
    color: #ffffff;
    border: 1px solid #536b3d;
}

.bsb-variation-editor [data-variation-total] {
    margin: 18px 0 0;
    padding: 14px;
    border-top: 1px solid #d9d3c8;
    font-weight: 700;
    color: #405532;
}

@media (max-width: 768px) {
    .bsb-variation-editor .bsb-variation-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .bsb-variation-editor {
        padding: 12px;
    }

    .bsb-variation-editor .bsb-variation-row {
        grid-template-columns: minmax(0, 1fr);
        padding: 12px;
    }

    .bsb-variation-editor button {
        width: 100%;
    }
}

/* Variation photo controls */

.bsb-variation-editor .bsb-variation-photo {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
    background: #faf8f4;
    border: 1px dashed #d9d3c8;
    border-radius: 8px;
}

.bsb-variation-photo img {
    width: 160px;
    height: 160px;
    max-width: 100%;
    object-fit: contain;
    background: #ffffff;
    border: 1px solid #e2ddd4;
    border-radius: 6px;
}

.bsb-variation-photo img[hidden] {
    display: none;
}

.bsb-variation-photo label {
    width: 100%;
}

.bsb-variation-photo input[type="file"] {
    width: 100%;
    font-size: 13px;
    background: #ffffff;
}

.bsb-variation-photo p {
    margin: 0;
    font-size: 12px;
    color: #66685f;
    overflow-wrap: anywhere;
}

.bsb-variation-photo button {
    color: #914545;
    background: #ffffff;
    border: 1px solid #d8baba;
}

@media (max-width: 480px) {
    .bsb-variation-photo img {
        align-self: center;
    }

    .bsb-variation-photo button {
        width: 100%;
    }
}
