.zrafta-designer {
    max-width: 1100px;
    margin: 40px auto;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: #222;
}

/* ---- Controls ---- */
.zrafta-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 24px;
}

.zrafta-controls fieldset {
    border: 1px solid #e1e3e6;
    border-radius: 10px;
    padding: 14px 16px;
    min-width: 200px;
}

.zrafta-controls legend {
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #555;
    padding: 0 6px;
}

.zrafta-controls label {
    display: inline-flex;
    flex-direction: column;
    font-weight: 600;
    font-size: 13px;
    margin-right: 12px;
    gap: 4px;
}

.zrafta-controls input[type="number"] {
    width: 80px;
    padding: 7px 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
}

.zrafta-limit-note,
.zrafta-hint {
    flex-basis: 100%;
    font-size: 12px;
    color: #777;
    margin: 8px 0 0;
    font-weight: 400;
}

/* ---- Color swatches ---- */
.zrafta-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.zr-swatch {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #ddd;
    cursor: pointer;
    padding: 0;
    transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.zr-swatch:hover { transform: scale(1.08); }

.zr-swatch.active {
    border-color: #2d6cdf;
    box-shadow: 0 0 0 2px rgba(45, 108, 223, 0.35);
}

/* ---- Filling ---- */
.zrafta-filling-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.zr-filling-btn {
    padding: 7px 12px;
    border: 1px solid #ccc;
    border-radius: 999px;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
}

.zr-filling-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.zr-filling-btn.active {
    background: #2d6cdf;
    border-color: #2d6cdf;
    color: #fff;
}

.zrafta-selection-info {
    font-size: 13px;
    color: #444;
    margin: 10px 0 0;
}

/* ---- Designs / Style ---- */
.zrafta-design-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}

.zr-design-opt {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    margin: 0;
}

.zr-design-opt input[type="checkbox"],
.zr-design-opt input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: #2d6cdf;
    cursor: pointer;
}

/* ---- Add to cart ---- */
.zrafta-cart {
    margin-top: 16px;
}

.zrafta-add-cart {
    font-size: 16px;
    padding: 14px 28px;
    width: 100%;
    max-width: 360px;
    background: #1f9d55;
}

.zrafta-add-cart:hover { filter: brightness(0.96); }

/* ---- 2D section size labels ---- */
.zr-dim {
    font-size: 13px;
    font-weight: 600;
    fill: #555;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---- Price ---- */
.zrafta-price {
    margin-top: 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 12px;
    padding: 16px 18px;
    border: 1px solid #e1e3e6;
    border-radius: 10px;
    background: #fafbfc;
}

.zrafta-price-label {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #555;
}

.zrafta-price-value {
    font-size: 26px;
    font-weight: 700;
    color: #1f1f1f;
}

.zrafta-price-toggle {
    margin-left: auto;
    background: none;
    border: none;
    color: #2d6cdf;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

.zrafta-price-breakdown {
    flex-basis: 100%;
    list-style: none;
    margin: 8px 0 0;
    padding: 8px 0 0;
    border-top: 1px dashed #e1e3e6;
}

.zrafta-price-breakdown li {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #444;
    padding: 3px 0;
}

.zrafta-price-breakdown li span:last-child {
    font-variant-numeric: tabular-nums;
    color: #1f1f1f;
}

/* ---- Stage (2D + 3D) ---- */
.zrafta-stage {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 820px) {
    .zrafta-stage { grid-template-columns: 1fr; }
}

.zrafta-panel h4 {
    margin: 0 0 8px;
    font-size: 14px;
    color: #555;
}

#zr-2d {
    width: 100%;
    height: auto;
    border: 1px solid #e1e3e6;
    border-radius: 10px;
    background: #fff;
    touch-action: none;
}

#zr-3d {
    width: 100%;
    height: 360px;
    border: 1px solid #e1e3e6;
    border-radius: 10px;
    overflow: hidden;
    background: #f4f5f7;
}

.zr-3d-fallback {
    padding: 24px;
    color: #999;
    font-size: 14px;
}

/* ---- 2D interactive bits ---- */
.zr-cell { cursor: pointer; transition: fill-opacity 0.1s ease; }
.zr-cell:hover { fill-opacity: 0.32 !important; }
.zr-cell.selected {
    fill-opacity: 0.45 !important;
    stroke: #2d6cdf;
    stroke-width: 2.5;
}

.zr-divider-hit.zr-col { cursor: ew-resize; }
.zr-divider-hit.zr-row { cursor: ns-resize; }

/* ---- Export ---- */
.zrafta-export {
    margin-top: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
}

.zrafta-btn {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    background: #2d6cdf;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.zrafta-btn-secondary {
    background: #eef1f5;
    color: #333;
}

.zrafta-btn:hover { filter: brightness(0.96); }

#zr-export-output {
    flex-basis: 100%;
    min-height: 160px;
    margin-top: 6px;
    padding: 12px;
    border: 1px solid #e1e3e6;
    border-radius: 10px;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 12px;
    background: #fafbfc;
    resize: vertical;
}
