.bjd-app {
    --bjd-ink: #1f2328;
    --bjd-muted: #667085;
    --bjd-line: #d9dee7;
    --bjd-panel: #ffffff;
    --bjd-bg: #f6f8fb;
    --bjd-accent: #b45309;
    --bjd-accent-dark: #92400e;
    --bjd-radius: 8px;
    color: var(--bjd-ink);
    font-family: inherit;
    line-height: 1.45;
}

.bjd-woo {
    margin: 24px 0;
}

.bjd-app *,
.bjd-app *::before,
.bjd-app *::after {
    box-sizing: border-box;
}

.bjd-shell {
    display: grid;
    grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
    gap: 18px;
    width: 100%;
}

.bjd-panel {
    background: var(--bjd-panel);
    border: 1px solid var(--bjd-line);
    border-radius: var(--bjd-radius);
}

.bjd-controls {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    align-self: start;
}

.bjd-header h2 {
    margin: 0 0 6px;
    font-size: clamp(1.25rem, 2vw, 1.65rem);
    line-height: 1.15;
    letter-spacing: 0;
}

.bjd-header p,
.bjd-status {
    margin: 0;
    color: var(--bjd-muted);
    font-size: 0.95rem;
}

.bjd-controls label {
    display: grid;
    gap: 6px;
    font-weight: 600;
}

.bjd-controls label span {
    font-size: 0.9rem;
}

.bjd-controls input,
.bjd-controls select {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--bjd-line);
    border-radius: 6px;
    padding: 8px 10px;
    background: #fff;
    color: var(--bjd-ink);
}

.bjd-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.bjd-palette {
    display: grid;
    gap: 8px;
}

.bjd-color-row {
    display: grid;
    grid-template-columns: 42px 44px minmax(0, 1fr) 94px 36px;
    gap: 8px;
    align-items: center;
}

.bjd-color-row select {
    grid-column: 3 / 4;
}

.bjd-color-row .bjd-bead-price {
    display: grid;
    place-items: center start;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--bjd-muted);
}

.bjd-mini-preview {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(0, 0, 0, 0.22);
    border-radius: 50%;
    background-position: center;
    background-size: cover;
    box-shadow: inset 0 2px 5px rgba(255, 255, 255, 0.65), inset 0 -3px 8px rgba(0, 0, 0, 0.16);
}

.bjd-color-code {
    display: grid;
    place-items: center;
    min-height: 34px;
    border: 1px solid var(--bjd-line);
    border-radius: 6px;
    background: var(--bjd-bg);
    font-weight: 800;
}

.bjd-remove {
    min-width: 36px;
    min-height: 36px;
    border: 1px solid #dc2626;
    border-radius: 6px;
    background: #dc2626;
    color: #fff;
    cursor: pointer;
    font-weight: 800;
}

.bjd-primary,
.bjd-actions button,
.bjd-actions-inline button {
    min-height: 42px;
    border: 1px solid var(--bjd-line);
    border-radius: 6px;
    padding: 9px 12px;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.bjd-primary {
    border-color: var(--bjd-accent);
    background: var(--bjd-accent);
    color: #fff;
}

.bjd-primary:hover:not(:disabled) {
    background: var(--bjd-accent-dark);
}

.bjd-actions,
.bjd-actions-inline {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.bjd-actions-inline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bjd-actions button,
.bjd-actions-inline button {
    background: #fff;
    color: var(--bjd-ink);
}

.bjd-actions button:hover:not(:disabled),
.bjd-actions-inline button:hover:not(:disabled) {
    border-color: var(--bjd-accent);
    color: var(--bjd-accent-dark);
}

.bjd-remove:hover:not(:disabled) {
    border-color: #b91c1c;
    background: #b91c1c;
    color: #fff;
}

.bjd-actions button:disabled,
.bjd-remove:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.bjd-output {
    min-width: 0;
    overflow: hidden;
}

.bjd-preview-wrap {
    min-height: 540px;
    display: grid;
    place-items: center;
    overflow: auto;
    padding: 18px;
    background: #f4f6f8;
}

.bjd-preview-wrap canvas {
    display: block;
    max-width: 100%;
    height: auto;
    background: #fff;
    border: 1px solid var(--bjd-line);
}

.bjd-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding: 14px 18px;
    border-top: 1px solid var(--bjd-line);
    background: var(--bjd-bg);
}

.bjd-metric {
    display: grid;
    gap: 2px;
}

.bjd-metric strong {
    font-size: 1.05rem;
}

.bjd-metric span {
    color: var(--bjd-muted);
    font-size: 0.82rem;
}

.bjd-table-wrap {
    overflow-x: auto;
    border-top: 1px solid var(--bjd-line);
}

.bjd-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.bjd-table th,
.bjd-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--bjd-line);
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

.bjd-table th {
    background: #f9fafb;
    font-weight: 700;
}

.bjd-swatch {
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 8px;
    border: 1px solid rgba(0, 0, 0, 0.22);
    border-radius: 50%;
    vertical-align: -4px;
    background-position: center;
    background-size: cover;
}

.bjd-sheet {
    max-height: 340px;
    overflow: auto;
    padding: 16px 18px;
    border-top: 1px solid var(--bjd-line);
    background: #fff;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.85rem;
    white-space: pre-wrap;
}

.bjd-note,
.bjd-checkout-note {
    padding: 10px 12px;
    border: 1px solid var(--bjd-line);
    border-radius: 6px;
    background: #fbfbfc;
    color: var(--bjd-muted);
    font-size: 0.92rem;
}

.bjd-cart-thumb {
    display: inline-block;
    width: 42px;
    height: 42px;
    margin-right: 10px;
    border-radius: 8px;
    border: 1px solid var(--bjd-line);
    vertical-align: middle;
    background-size: cover;
    background-position: center;
}

body.single-product.bjd-product-enabled div.product div.images,
body.single-product.bjd-product-enabled div.product .woocommerce-product-gallery {
    display: none !important;
}

body.single-product.bjd-product-enabled div.product .summary {
    width: 100%;
    float: none;
}

.woocommerce div.product form.cart .bjd-app .single_add_to_cart_button,
.woocommerce div.product form.cart .bjd-app button.single_add_to_cart_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 920px) {
    .bjd-shell {
        grid-template-columns: 1fr;
    }

    .bjd-preview-wrap {
        min-height: 340px;
    }
}

@media (max-width: 560px) {
    .bjd-controls {
        padding: 14px;
    }

    .bjd-grid,
    .bjd-summary,
    .bjd-actions-inline {
        grid-template-columns: 1fr;
    }

    .bjd-color-row {
        grid-template-columns: 42px 44px minmax(0, 1fr) 84px 36px;
    }

    .bjd-preview-wrap {
        padding: 12px;
    }
}
